/* Tema "Moderno" — painel de investimentos: Inter, cinzas azulados, destaque índigo.
   Carregue DEPOIS de calculadora.css. Para voltar ao visual original, remova a linha
   <link ... moderno.css> do index.html (o resto do site não depende deste arquivo).
   Fica em @media screen: a impressão continua limpa. */
@media screen {
  :root {
    color-scheme: light;
    --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --display: var(--body);
    --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    --bg: #f3f5fa;
    --surface: #ffffff;
    --surface2: #f6f8fc;
    --ink: #0f172a;
    --muted: #475569;
    --faint: #5b6a80;
    --line: #e1e7f0;
    --strong: #8896ab;
    --accent: #4338ca;
    --accentbg: #eceefe;
    --on-accent: #ffffff;
    --series2: #047857;
    --positive: #047857;
    --positivebg: #e6f6ee;
    --negative: #be123c;
    --negativebg: #fdecf0;
    --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px -12px rgba(15, 23, 42, .12);
    --radius: 16px;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme=light]) {
      color-scheme: dark;
      --bg: #0a0f1d; --surface: #111a2e; --surface2: #162239; --ink: #e8edf8;
      --muted: #a9b6cf; --faint: #98a7c2; --line: #223050; --strong: #5d6e91;
      --accent: #a5b4fc; --accentbg: #1c2650; --on-accent: #0a0f1d; --series2: #34d399;
      --positive: #6ee7b7; --positivebg: #0f2a21; --negative: #fda4af; --negativebg: #371820;
      --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 28px -16px rgba(0, 0, 0, .6);
    }
  }
  :root[data-theme=dark] {
    color-scheme: dark;
    --bg: #0a0f1d; --surface: #111a2e; --surface2: #162239; --ink: #e8edf8;
    --muted: #a9b6cf; --faint: #98a7c2; --line: #223050; --strong: #5d6e91;
    --accent: #a5b4fc; --accentbg: #1c2650; --on-accent: #0a0f1d; --series2: #34d399;
    --positive: #6ee7b7; --positivebg: #0f2a21; --negative: #fda4af; --negativebg: #371820;
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 28px -16px rgba(0, 0, 0, .6);
  }

  body {
    background-color: var(--bg);
    background-image: radial-gradient(900px 340px at 50% -140px, color-mix(in srgb, var(--accent) 14%, transparent), transparent);
    background-repeat: no-repeat;
    font-feature-settings: 'cv11', 'ss01';
  }
  :focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

  /* ---------- Cabeçalho ---------- */
  h1 { font: 800 clamp(1.8rem, 3.6vw, 2.5rem)/1.1 var(--body); letter-spacing: -.035em; }
  .eyebrow { display: inline-block; font: 600 .72rem/1 var(--body); letter-spacing: .1em; text-transform: uppercase;
    color: var(--accent); background: var(--accentbg); padding: 6px 10px; border-radius: 999px; margin-bottom: 12px; }
  .intro { font-size: 1rem; color: var(--muted); }

  /* ---------- Superfícies ---------- */
  main, .market-bar, .projections { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
  .market-bar { padding: 22px; }
  .market-title { font-size: 1rem; font-weight: 700; letter-spacing: -.01em; }
  .market-item { background: var(--surface2); border: 1px solid var(--line); border-radius: 14px; padding: 18px 16px; transition: border-color .15s, transform .15s; }
  .market-item:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
  .market-item strong { font: 700 clamp(1.45rem, 2.2vw, 1.85rem)/1.1 var(--body); letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
  .market-item>span, .market-heading { font-weight: 600; }
  .inflation-card, .growth-target { border-top: 3px solid var(--accent); }
  .market-help-button { background: var(--surface); border-color: var(--line); }
  .icon-btn { border-radius: 10px; }
  .growth-panel { border-top-color: var(--line); }

  /* ---------- Navegação ---------- */
  .calculator-navigation { background: var(--surface2); border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; padding: 16px 16px 0; }
  .calculator-areas { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
  .area-button { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; min-height: 68px; padding: 12px 16px; color: var(--muted); transition: border-color .15s, background .15s, color .15s; }
  .area-button:hover { background: var(--surface); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
  .area-button[aria-pressed=true] { background: var(--accentbg); border-color: var(--accent); color: var(--accent); box-shadow: none; }
  .area-icon { font: 700 1.3rem/1 var(--body); }
  .area-title { font-size: .95rem; font-weight: 700; letter-spacing: -.01em; }
  .area-button[aria-pressed=true] .area-detail { color: color-mix(in srgb, var(--accent) 80%, var(--muted)); }
  .tabs { gap: 4px; }
  .tabs button { border-radius: 10px 10px 0 0; font-weight: 600; color: var(--muted); }
  .tabs button:hover { background: var(--surface); }
  .tabs button[aria-selected=true] { background: var(--surface); color: var(--accent); border-bottom-color: var(--accent); }
  main[data-area=personal] .tabs button { flex: 0 1 auto; }

  /* ---------- Painéis, campos e botões ---------- */
  .panel-head h2 { font: 800 1.45rem/1.2 var(--body); letter-spacing: -.025em; }
  .panel-head p { color: var(--muted); }
  input, select { background: var(--surface); border: 1px solid var(--strong); border-radius: 10px; font-family: var(--body); font-variant-numeric: tabular-nums; }
  input:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 0; border-color: var(--accent); }
  input[readonly] { background: var(--surface2); border-style: solid; color: var(--ink); }
  button { border-radius: 10px; border-color: var(--line); font-weight: 600; transition: background .15s, border-color .15s; }
  button:hover:not(:disabled) { border-color: var(--accent); background: var(--accentbg); }
  .primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
  .primary:hover:not(:disabled) { background: var(--accent); filter: brightness(1.1); }
  .field label { font-weight: 600; }
  .result-box { background: linear-gradient(180deg, var(--accentbg), var(--surface) 170px); border: 1px solid var(--line); border-top: 1px solid var(--line); border-radius: 14px; }
  .result-caption { text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; }
  .result-value { font: 800 clamp(2rem, 3.4vw, 2.8rem)/1.15 var(--body); letter-spacing: -.035em; font-variant-numeric: tabular-nums; color: var(--accent); }
  .metric strong { font-family: var(--body); font-weight: 700; font-variant-numeric: tabular-nums; }
  .formula { font-family: var(--mono); font-size: .76rem; }
  .comparison th { background: var(--surface2); text-transform: none; }
  .comparison td, .comparison tbody th { font-family: var(--body); font-variant-numeric: tabular-nums; }
  .table-wrap { border-radius: 14px; }
  .toast { border-radius: 12px; box-shadow: var(--shadow); }
  ::selection { background: var(--accentbg); color: var(--ink); }

  /* ---------- Calculadoras pessoais (reserva e aposentadoria) ---------- */
  .pk-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .pk-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .pk-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  .pk-field label { font-size: .875rem; font-weight: 600; }
  .pk-input { display: flex; align-items: stretch; border: 1px solid var(--strong); border-radius: 10px; background: var(--surface); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
  .pk-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent); }
  .pk-input:has(input[aria-invalid=true]) { border-color: var(--negative); box-shadow: 0 0 0 3px color-mix(in srgb, var(--negative) 22%, transparent); }
  .pk-input input { flex: 1; min-width: 0; border: 0; border-radius: 0; background: transparent; outline: none; min-height: 46px; padding: 0 12px; font-size: 1rem; font-weight: 500; }
  .pk-input input:focus-visible { outline: none; box-shadow: none; }
  .pk-affix { display: grid; place-items: center; padding: 0 12px; background: var(--surface2); color: var(--muted); font-size: .8rem; font-weight: 600; white-space: nowrap; }
  .pk-input .pk-affix:first-child { border-right: 1px solid var(--line); }
  .pk-input .pk-affix:last-child:not(:first-child) { border-left: 1px solid var(--line); }
  .pk-hint { font-size: .8rem; color: var(--muted); line-height: 1.45; }
  .pk-error { font-size: .8rem; color: var(--negative); font-weight: 600; }
  .pk-note { font-size: .82rem; color: var(--muted); line-height: 1.6; }
  .pk-muted { color: var(--muted); font-size: .92rem; line-height: 1.55; }
  .pk-link { align-self: flex-start; min-height: 32px; padding: 0; border: 0; background: none; color: var(--accent); font-size: .82rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-align: left; }
  .pk-link:hover:not(:disabled) { background: none; filter: brightness(1.2); }

  .pk-choices { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 8px; }
  .pk-choices legend { padding: 0; margin-bottom: 8px; font-size: .875rem; font-weight: 600; }
  .pk-choice { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
  .pk-choice:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
  .pk-choice:has(input:checked) { border-color: var(--accent); background: var(--accentbg); }
  .pk-choice:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
  .pk-choice input { width: 18px; height: 18px; min-height: 18px; accent-color: var(--accent); margin: 0; }
  .pk-choice-text { display: grid; gap: 1px; min-width: 0; }
  .pk-choice-text b { font-size: .92rem; font-weight: 600; }
  .pk-choice-text small { color: var(--muted); font-size: .76rem; }
  .pk-choice strong { font-size: .92rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); white-space: nowrap; }

  .pk-adv { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 0 14px; }
  .pk-adv summary { cursor: pointer; padding: 12px 0; font-size: .875rem; font-weight: 600; list-style-position: inside; }
  .pk-adv[open] { padding-bottom: 14px; }
  .pk-adv[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 14px; }
  .pk-adv .pk-table-wrap { margin-bottom: 14px; }

  .pk-live { min-width: 0; }
  .pk-eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .pk-big { font: 800 clamp(1.8rem, 3.2vw, 2.5rem)/1.15 var(--body); letter-spacing: -.035em; color: var(--accent); margin: 6px 0 8px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  .pk-big.pos { color: var(--positive); }
  .pk-big.neg { color: var(--negative); }
  .pk-alert { padding: 14px 16px; border-radius: 12px; background: var(--negativebg); color: var(--negative); border: 1px solid color-mix(in srgb, var(--negative) 45%, transparent); font-weight: 600; font-size: .92rem; }

  .pk-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
  .pk-kpi { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-width: 0; }
  .pk-kpi-label { font-size: .72rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
  .pk-kpi strong { font-size: 1.08rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  .pk-kpi small { font-size: .74rem; color: var(--muted); }

  .pk-meter { margin-top: 16px; }
  .pk-meter-top { display: flex; justify-content: space-between; gap: 8px; font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
  .pk-meter-top b { color: var(--ink); }
  .pk-bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
  .pk-bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .3s; }

  .pk-wide { margin-top: 32px; padding-top: 8px; border-top: 1px solid var(--line); }
  .pk-h3 { font-size: 1.02rem; font-weight: 700; letter-spacing: -.015em; margin: 24px 0 12px; }
  .pk-row-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 24px 0 12px; }
  .pk-row-head .pk-h3 { margin: 0; }
  .pk-wide>.pk-note { margin-top: 18px; max-width: 80ch; }
  .pk-monthly { margin-top: 18px; }

  .pk-segment { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface2); }
  .pk-segment button { min-height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-size: .82rem; }
  .pk-segment button[aria-pressed=true] { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgba(15, 23, 42, .14); }
  .pk-segment button:hover:not(:disabled):not([aria-pressed=true]) { background: none; color: var(--ink); }
  .pk-field .pk-segment { align-self: flex-start; }

  .pk-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); max-height: 520px; scrollbar-width: thin; }
  .pk-table { width: 100%; min-width: 620px; border-collapse: separate; border-spacing: 0; font-size: .82rem; font-variant-numeric: tabular-nums; }
  .pk-table th, .pk-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left; }
  .pk-table .num { text-align: right; }
  .pk-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface2); color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .03em; }
  .pk-table tbody th { font-weight: 600; color: var(--ink); }
  .pk-table tbody tr:last-child th, .pk-table tbody tr:last-child td { border-bottom: 0; }
  .pk-table tbody tr:hover { background: var(--surface2); }
  .pk-table .sel { background: var(--accentbg); font-weight: 700; }
  .pk-table .pos { color: var(--positive); font-weight: 700; }
  .pk-table .neg { color: var(--muted); }

  .pk-chart { width: 100%; }
  .pk-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 8px; padding: 0; list-style: none; font-size: .8rem; color: var(--muted); }
  .pk-legend li { display: flex; align-items: center; gap: 7px; }
  .pk-swatch { display: inline-block; width: 14px; height: 4px; border-radius: 2px; background: var(--accent); }
  .pk-swatch.s2 { background: repeating-linear-gradient(90deg, var(--series2) 0 5px, transparent 5px 8px); height: 3px; }
  .pk-chart-stage { position: relative; }
  .pk-chart svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
  .pk-grid { stroke: var(--line); stroke-width: 1; }
  .pk-axis { fill: var(--muted); font: 500 11px var(--body); font-variant-numeric: tabular-nums; }
  .pk-line { stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
  .pk-line.s1 { stroke: var(--accent); }
  .pk-line.s2 { stroke: var(--series2); stroke-width: 2; stroke-dasharray: 6 5; }
  .pk-area.s1 { fill: color-mix(in srgb, var(--accent) 16%, transparent); stroke: none; }
  .pk-marker { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 4; }
  .pk-marker-text { fill: var(--ink); font: 600 11px var(--body); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }
  .pk-cursor { stroke: var(--strong); stroke-width: 1; }
  .pk-dot { stroke: var(--surface); stroke-width: 2; }
  .pk-dot.s1 { fill: var(--accent); }
  .pk-dot.s2 { fill: var(--series2); }
  .pk-tip { position: absolute; z-index: 3; pointer-events: none; padding: 8px 10px; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: .74rem; line-height: 1.5; white-space: nowrap; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
  .pk-tip div:first-child { font-weight: 700; }


  .pk-choice-list { display: grid; gap: 8px; }
  .pk-reco { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  .pk-reco:empty { display: none; }
  .pk-reco-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); margin-top: 8px; font-size: .85rem; }
  .pk-reco-line span { color: var(--muted); }
  .pk-reco-line b { text-align: right; font-weight: 700; }
  .pk-reco .pk-note { margin-top: 8px; }
  .pk-td-host .pk-note { margin: 10px 0 4px; max-width: 80ch; }
  .pk-verdict { margin-top: 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: .9rem; line-height: 1.55; }
  .pk-verdict b { font-weight: 700; }
  .pk-verdict.ok { background: var(--positivebg); border-color: color-mix(in srgb, var(--positive) 45%, transparent); }
  .pk-verdict.warn { background: var(--negativebg); border-color: color-mix(in srgb, var(--negative) 45%, transparent); }

  /* ---------- Praia animada ---------- */
  .pk-beach {
    --b-sky1: #5fbdf2; --b-sky2: #e2f4fd; --b-sea1: #52c6f2; --b-sea2: #1fa3e2; --b-sea3: #0e82c3; --b-foam: rgba(255, 255, 255, .6);
    --b-sand: #f6d98a; --b-trunk: #8b5a2b; --b-leaf: #2f9e5b; --b-sun: #fbbf24; --b-cloud: #ffffff; --b-ink: #334155;
    position: relative; height: 168px; margin: 0 0 22px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--b-sky2);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme=light]) .pk-beach { --b-sky1: #0a1633; --b-sky2: #1f3a66; --b-sea1: #1d4f91; --b-sea2: #153c73; --b-sea3: #0f2c57; --b-foam: rgba(190, 215, 255, .22); --b-sand: #7a6a4a; --b-trunk: #5b3a1e; --b-leaf: #1f7a45; --b-cloud: #8ea3c4; --b-ink: #cbd5e1; }
    :root:not([data-theme=light]) .pk-stars { display: block; }
    :root:not([data-theme=light]) .pk-moon { display: block; }
    :root:not([data-theme=light]) .pk-sun { display: none; }
  }
  :root[data-theme=dark] .pk-beach { --b-sky1: #0a1633; --b-sky2: #1f3a66; --b-sea1: #1d4f91; --b-sea2: #153c73; --b-sea3: #0f2c57; --b-foam: rgba(190, 215, 255, .22); --b-sand: #7a6a4a; --b-trunk: #5b3a1e; --b-leaf: #1f7a45; --b-cloud: #8ea3c4; --b-ink: #cbd5e1; }
  :root[data-theme=dark] .pk-stars { display: block; }
  :root[data-theme=dark] .pk-moon { display: block; }
  :root[data-theme=dark] .pk-sun { display: none; }
  .pk-beach svg { display: block; width: 100%; height: 100%; }
  .b-sky1 { stop-color: var(--b-sky1); }
  .b-sky2 { stop-color: var(--b-sky2); }
  .pk-stars { display: none; }
  .pk-stars circle { fill: #fff; animation: pk-twinkle 3.2s ease-in-out infinite alternate; }
  .pk-moon { display: none; fill: #e8edf6; }
  .pk-sun-disc { fill: var(--b-sun); transform-box: fill-box; transform-origin: center; animation: pk-pulse 4.5s ease-in-out infinite; }
  .pk-rays { transform-box: fill-box; transform-origin: center; animation: pk-spin 48s linear infinite; }
  .pk-rays line { stroke: var(--b-sun); stroke-width: 3; stroke-linecap: round; opacity: .85; }
  .pk-cloud { fill: var(--b-cloud); opacity: .92; }
  .pk-cloud.c1 > g { animation: pk-drift 46s ease-in-out infinite alternate; }
  .pk-cloud.c2 > g { animation: pk-drift 62s ease-in-out infinite alternate-reverse; }
  .pk-gull path { stroke: var(--b-ink); stroke-width: 1.8; stroke-linecap: round; animation: pk-fly 16s ease-in-out infinite alternate; }
  .pk-gull.g2 path { animation-duration: 21s; animation-delay: -6s; }
  .pk-wave.w1 { fill: var(--b-sea1); animation: pk-wave1 15s linear infinite; }
  .pk-wave.w2 { fill: var(--b-sea2); animation: pk-wave2 11s linear infinite; }
  .pk-wave.w3 { fill: var(--b-sea3); animation: pk-wave3 8s linear infinite; }
  .pk-wave.w4 { fill: var(--b-foam); animation: pk-wave4 6s linear infinite; }
  .pk-boat { transform-box: fill-box; transform-origin: 50% 100%; animation: pk-bob 3.6s ease-in-out infinite alternate; }
  .pk-hull { fill: #b45309; } .pk-mast { stroke: var(--b-ink); stroke-width: 1.6; } .pk-sail { fill: #ffffff; } .pk-sail2 { fill: #fde68a; }
  .pk-sand { fill: var(--b-sand); }
  .pk-trunk { stroke: var(--b-trunk); stroke-width: 7; stroke-linecap: round; }
  .pk-fronds { fill: var(--b-leaf); transform-origin: 0 0; animation: pk-sway 5s ease-in-out infinite alternate; }
  .pk-coco { fill: #6b3f1d; }
  .pk-pole { stroke: #64748b; stroke-width: 2.2; stroke-linecap: round; }
  .pk-umb1 { fill: #ef4444; } .pk-umb2 { fill: #ffffff; } .pk-towel { fill: #fb923c; }
  .pk-beach-caption { position: absolute; left: 14px; top: 12px; margin: 0; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 90%, transparent); color: var(--ink); font-size: .82rem; font-weight: 700; box-shadow: 0 1px 4px rgba(0, 0, 0, .14); max-width: calc(100% - 28px); }
  @keyframes pk-wave1 { to { transform: translateX(-160px); } }
  @keyframes pk-wave2 { to { transform: translateX(-200px); } }
  @keyframes pk-wave3 { to { transform: translateX(-240px); } }
  @keyframes pk-wave4 { to { transform: translateX(-180px); } }
  @keyframes pk-spin { to { transform: rotate(360deg); } }
  @keyframes pk-pulse { 50% { transform: scale(1.07); } }
  @keyframes pk-drift { to { transform: translateX(70px); } }
  @keyframes pk-fly { from { transform: translate(0, 0); } to { transform: translate(90px, -10px); } }
  @keyframes pk-bob { from { transform: rotate(-3deg) translateY(0); } to { transform: rotate(3deg) translateY(2px); } }
  @keyframes pk-sway { from { transform: rotate(-2.2deg); } to { transform: rotate(2.6deg); } }
  @keyframes pk-twinkle { from { opacity: .25; } to { opacity: 1; } }
  @media (prefers-reduced-motion: reduce) { .pk-beach * { animation: none !important; } }

  /* ---------- Celular ---------- */
  @media (max-width: 900px) {
    .calculator-areas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-width: 700px) {
    .area-button { flex-direction: row; align-items: center; min-height: 64px; padding: 10px 12px; gap: 10px; }
    .area-title { font-size: .88rem; }
    main[data-area=personal] .tabs { grid-template-columns: 1fr; }
    .pk-grid2 { grid-template-columns: minmax(0, 1fr); }
    .pk-wide { margin-top: 24px; }
    .pk-beach { height: 132px; }
    .pk-beach-caption { font-size: .76rem; padding: 5px 10px; }
    .metric { flex-wrap: wrap; row-gap: 2px; }
    .metric strong { margin-left: auto; }
    .panel { padding: 20px 16px; }
    .tabs button { border: 1px solid var(--line); background: var(--surface); }
    .tabs button[aria-selected=true] { border-color: var(--accent); background: var(--accentbg); }
    .pk-row-head .pk-segment { width: 100%; }
    .pk-row-head .pk-segment button { flex: 1; padding: 0 6px; font-size: .78rem; line-height: 1.2; }
  }
  @media (max-width: 420px) {
    .pk-kpis { grid-template-columns: 1fr; }
    .pk-segment button { padding: 0 10px; }
  }
  @media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

  /* Evolução do aporte (aposentadoria) */
  .pk-ramp { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface2); }
  .pk-ramp:empty { display: none; }
  .pk-ramp .pk-h3 { margin: 0 0 4px; font-size: .95rem; }
  .pk-ramp > .pk-muted { margin: 0 0 10px; font-size: .82rem; }
  .pk-ramp-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }
  .pk-ramp-row { display: grid; grid-template-columns: 116px minmax(30px, 1fr) 124px 92px; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: .8rem; font-variant-numeric: tabular-nums; }
  .pk-ramp-row:first-child { border-top: 0; }
  .pk-ramp-year { color: var(--muted); white-space: nowrap; }
  .pk-ramp-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
  .pk-ramp-bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
  .pk-ramp-val { text-align: right; white-space: nowrap; }
  .pk-ramp-diff { text-align: right; color: var(--positive); font-size: .75rem; white-space: nowrap; }
  .pk-ramp-row.last .pk-ramp-year, .pk-ramp-row.last .pk-ramp-val { font-weight: 700; color: var(--ink); }
  .pk-ramp-row.last .pk-ramp-bar i { background: var(--series2); }
  @media (max-width: 520px) {
    .pk-ramp-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
    .pk-ramp-year { order: 1; } .pk-ramp-val { order: 2; } .pk-ramp-bar { order: 3; } .pk-ramp-diff { order: 4; }
  }

  /* Seletor de título e modal "fim da vida e sucessão" */
  .pk-select { width: 100%; min-height: 42px; margin-top: 6px; padding: 0 10px; border: 1px solid var(--strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: .9rem; font-weight: 500; }
  .pk-choice-text .pk-select { margin: 6px 0 4px; }
  .pk-field .pk-select { margin-top: 0; }
  .pk-label { font-size: .875rem; font-weight: 600; }
  .pk-legacy { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; margin-top: 16px; }
  .pk-cta { min-height: 46px; padding: 0 20px; border: 0; border-radius: 12px; background: var(--accent); color: var(--on-accent, #fff); font-size: .95rem; font-weight: 700; cursor: pointer; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
  .pk-cta:hover { filter: brightness(1.08); }
  dialog.pk-modal { width: min(920px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 90px rgba(5, 10, 25, .45); overflow: hidden; }
  dialog.pk-modal[open] { display: flex; flex-direction: column; }
  dialog.pk-modal::backdrop { background: rgba(8, 12, 24, .62); backdrop-filter: blur(2px); }
  .pk-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
  .pk-modal-head h2 { margin: 0; font-size: 1.15rem; }
  .pk-modal-close { width: 38px; min-height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface2); color: var(--ink); font-size: 1.4rem; line-height: 1; cursor: pointer; }
  .pk-modal-body { overflow-y: auto; padding: 16px 20px 24px; display: grid; gap: 14px; }
  .pk-modal-tabs .pk-segment { display: flex; }
  .pk-modal-tabs .pk-segment button { flex: 1; }
  .pk-modal-sec { display: grid; gap: 14px; min-width: 0; }
  .pk-modal-sec[hidden] { display: none; }
  .pk-modal-out { display: grid; gap: 14px; min-width: 0; }
  .pk-modal-controls { display: flex; flex-wrap: wrap; gap: 14px 24px; }
  .pk-modal-controls .pk-segment { flex-wrap: wrap; }
  .pk-chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .pk-chip { min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface2); color: var(--ink); font-size: .85rem; font-weight: 600; cursor: pointer; }
  .pk-chip:hover { border-color: var(--accent); color: var(--accent); }
  .pk-stack { display: flex; height: 22px; border-radius: 999px; overflow: hidden; background: var(--line); }
  .pk-seg { display: block; height: 100%; }
  .pk-seg-meacao { background: #38bdf8; } .pk-seg-herdeiros { background: var(--accent); } .pk-seg-testamento { background: #a78bfa; }
  .pk-seg-itcmd { background: #f59e0b; } .pk-seg-custos { background: #ef4444; }
  .pk-stack-legend { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: .82rem; color: var(--muted); }
  .pk-stack-legend .pk-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; }
  .pk-notes { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: .82rem; color: var(--muted); line-height: 1.5; }
  .pk-table .strong { font-weight: 700; }
  @media (max-width: 700px) {
    dialog.pk-modal { width: calc(100vw - 12px); max-height: calc(100vh - 12px); border-radius: 14px; }
    .pk-modal-head, .pk-modal-body { padding-left: 14px; padding-right: 14px; }
    .pk-modal-tabs .pk-segment button { padding: 0 6px; font-size: .78rem; }
  }

  .pk-pct { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-size: .82rem; color: var(--muted); }
  .pk-pct input { width: 76px; min-height: 38px; padding: 0 10px; border: 1px solid var(--strong); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: .95rem; font-weight: 600; text-align: right; }
  .pk-pct input:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; }

  .pk-rate { display: grid; justify-items: end; gap: 2px; text-align: right; }
  .pk-rate small { color: var(--muted); font-size: .72rem; white-space: nowrap; }

  .pk-explain { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface2); }
  .pk-explain:empty { display: none; }
  .pk-explain summary { cursor: pointer; font-weight: 700; font-size: .92rem; }
  .pk-explain-example { margin: 12px 0 4px; padding: 10px 12px; border-radius: 10px; background: var(--accentbg); font-size: .88rem; line-height: 1.5; }
  .pk-explain-steps { list-style: none; counter-reset: ex; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
  .pk-explain-steps li { counter-increment: ex; display: grid; grid-template-columns: 26px 1fr; column-gap: 10px; row-gap: 2px; font-size: .84rem; line-height: 1.5; color: var(--muted); }
  .pk-explain-steps li::before { content: counter(ex); grid-row: 1 / span 2; width: 26px; height: 26px; border-radius: 50%; background: var(--accentbg); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: .78rem; }
  .pk-explain-steps li b { color: var(--ink); font-size: .88rem; }

  /* ---------- FII de papel ---------- */
  .pk-fii { --amber: #b45309; --amberbg: #fef3c7; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .pk-fii, :root:not([data-theme=light]) .pk-fii-scope { --amber: #fcd34d; --amberbg: #3a2a0b; } }
  :root[data-theme=dark] .pk-fii, :root[data-theme=dark] .pk-fii-scope { --amber: #fcd34d; --amberbg: #3a2a0b; }
  #tab-fiipapel { --amber: #b45309; --amberbg: #fef3c7; --seg-amber: #d97706; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme=light]) #tab-fiipapel { --amber: #fcd34d; --amberbg: #3a2a0b; --seg-amber: #f59e0b; } }
  :root[data-theme=dark] #tab-fiipapel { --amber: #fcd34d; --amberbg: #3a2a0b; --seg-amber: #f59e0b; }
  .pk-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .pk-sub { margin: 6px 0 0; font-size: .95rem; }
  .pk-form > .pk-hint { margin-top: -6px; }
  .pk-bench-box { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface2); }
  .pk-bench-box .pk-sub { margin: 0; }
  .pk-bench { display: grid; gap: 8px; align-content: start; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
  .pk-bench > b { font-size: .85rem; }
  .pk-bench .pk-select { width: 100%; min-width: 0; }
  .pk-fund-chips .pk-chip[aria-pressed=true] { border-color: var(--accent); background: var(--accentbg); color: var(--accent); }
  .pk-chip:disabled { opacity: .45; cursor: not-allowed; }
  .pk-chip-add, .pk-chip-remove { border-style: dashed; background: transparent; }
  .pk-fund-tools { display: flex; gap: 12px; flex-wrap: wrap; }
  .pk-big.amber { color: var(--amber); }
  .pk-seg-hg { background: var(--positive); }
  .pk-seg-my { background: var(--seg-amber, #d97706); }
  .pk-seg-hy { background: var(--negative); }
  .pk-seg-oth { background: var(--strong); }
  .pk-stack-host { margin-top: 20px; }
  .pk-stack-legend li { display: flex; align-items: center; }
  .pk-table td.cls-hg { color: var(--positive); }
  .pk-table td.cls-my { color: var(--amber); }
  .pk-table td.cls-hy { color: var(--negative); }
  .pk-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
  .pk-check { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: .85rem; line-height: 1.5; }
  .pk-check > div { display: grid; gap: 2px; min-width: 0; }
  .pk-check b { font-size: .85rem; }
  .pk-check span:not(.pk-check-icon):not(.sr-only) { color: var(--muted); }
  .pk-check-icon { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: var(--surface2); color: var(--muted); }
  .ck-ok .pk-check-icon { background: var(--positivebg); color: var(--positive); }
  .ck-warn .pk-check-icon { background: var(--amberbg); color: var(--amber); }
  .ck-bad .pk-check-icon { background: var(--negativebg); color: var(--negative); }
  .ck-bad { border-color: color-mix(in srgb, var(--negative) 45%, transparent); }
  .ck-warn { border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
  @media (max-width: 900px) { .pk-grid3 { grid-template-columns: minmax(0, 1fr); } }
  .pk-bench-box .pk-grid3 { grid-template-columns: minmax(0, 1fr); }
  .pk-compact th, .pk-compact td { padding: 9px 8px; font-size: .8rem; }
  .pk-compact .pk-table { min-width: 0; }
  .pk-compact th, .pk-compact td { white-space: normal; }
  .pk-verdict.amber { background: var(--amberbg); border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
  @media (max-width: 700px) { .pk-compact th, .pk-compact td { padding: 8px 5px; font-size: .74rem; } }
}
