/* Estilo das páginas estáticas (termos e privacidade). Mesmos tokens, fontes e rodapé de index.html; tudo local. */
  @font-face { font-family: "Plus Jakarta Sans"; src: url(/fonts/plus-jakarta-sans-latin-wght-normal.woff2) format("woff2");
               font-weight: 200 800; font-style: normal; font-display: swap; }
  @font-face { font-family: "JetBrains Mono"; src: url(/fonts/jetbrains-mono-latin-wght-normal.woff2) format("woff2");
               font-weight: 100 800; font-style: normal; font-display: swap; }

  /* Tema claro (padrão, neutros quentes: creme e bege) e escuro (slate). Laranja só em ações, verde só para "ao vivo", âmbar para avisos. */
  :root {
    color-scheme: light;
    --bg: #FAF7F2; --panel: #FFFDF9; --panel-2: #F3EDE2; --code-bg: #F6F1E8;
    --line: #E8E0D2; --line-strong: #D6CBB8; --input-line: #8F816D; --scroll: #BFB29B;
    --art-bg: #FBEBD3; --art-glow: radial-gradient(60% 55% at 50% 56%, rgba(249,115,22,.18), transparent 72%);
    --text: #261E15; --muted: #6B5E50;
    --accent: #F97316; --accent-hover: #EA580C; --on-accent: #1A0A00; --accent-text: #C2410C; --focus: #EA580C;
    --ok: #10B981; --ok-text: #047857; --ok-soft: rgba(16,185,129,.14);
    --warn: #F59E0B; --warn-text: #A15207; --warn-soft: rgba(245,158,11,.14);
    --danger: #EF4444; --danger-text: #B91C1C; --danger-soft: rgba(239,68,68,.10);
    --backdrop: rgba(38,30,21,.55);
    --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --r: 4px;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      color-scheme: dark;
      --bg: #0B0F19; --panel: #0F172A; --panel-2: #1E293B; --code-bg: #090D16;
      --line: #334155; --line-strong: #475569; --input-line: #64748B; --scroll: #475569;
      --art-bg: #111A2E; --art-glow: radial-gradient(60% 55% at 50% 56%, rgba(249,115,22,.12), transparent 72%);
      --text: #E2E8F0; --muted: #94A3B8;
      --accent-hover: #FB923C; --accent-text: #FB923C; --focus: #F97316;
      --ok-text: #34D399; --warn-text: #FBBF24; --danger-text: #F87171; --danger-soft: rgba(239,68,68,.14);
      --backdrop: rgba(11,15,25,.8);
    }
  }
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0B0F19; --panel: #0F172A; --panel-2: #1E293B; --code-bg: #090D16;
    --line: #334155; --line-strong: #475569; --input-line: #64748B; --scroll: #475569;
    --art-bg: #111A2E; --art-glow: radial-gradient(60% 55% at 50% 56%, rgba(249,115,22,.12), transparent 72%);
    --text: #E2E8F0; --muted: #94A3B8;
    --accent-hover: #FB923C; --accent-text: #FB923C; --focus: #F97316;
    --ok-text: #34D399; --warn-text: #FBBF24; --danger-text: #F87171; --danger-soft: rgba(239,68,68,.14);
    --backdrop: rgba(11,15,25,.8);
  }
  * { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
  [hidden] { display: none !important; } /* "hidden" vence os display: flex/grid e esconde também <svg> */
  body { margin: 0; background: var(--bg); color: var(--text); font: 400 14px/1.5 var(--sans); }
  a { color: var(--accent-text); }
  svg.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

  /* estrutura: barra fina, área principal em tela cheia e rodapé fino */
  .app { min-height: 100dvh; display: flex; flex-direction: column; }
  body[data-view="inbox"] .app { height: 100dvh; }
  .home, .inbox { flex: 1 1 auto; min-height: 0; }

  .topbar { flex: none; height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
            padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
  .brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 0; border-radius: var(--r); }
  .brand img { width: 34px; height: auto; display: block; flex: none; }
  .brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; }
  .brand-name span { font-weight: 400; color: var(--muted); }
  .live { display: inline-flex; align-items: center; gap: 7px; padding: 3px 8px; border: 1px solid var(--line-strong); border-radius: var(--r);
          font: 500 10px/14px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
  .live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
  .live[data-state="live"] { color: var(--ok-text); background: var(--ok-soft); border-color: transparent; }
  .live[data-state="live"] .dot { background: var(--ok); animation: pulse 2s ease-out infinite; }
  .live[data-state="retry"] { color: var(--warn-text); background: var(--warn-soft); border-color: transparent; }
  .live[data-state="retry"] .dot { background: var(--warn); }
  @keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16,185,129,.55); } 70%, 100% { box-shadow: 0 0 0 6px rgba(16,185,129,0); } }
  body[data-view="home"] .live { display: none; }

  .foot { flex: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "nav credit theme"; align-items: center; column-gap: 16px;
          padding: 2px 16px; background: var(--panel); border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
  .foot nav { grid-area: nav; display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; }
  .foot nav > * + *::before { content: "·"; margin: 0 8px 0 4px; color: var(--line-strong); }
  .foot-link { display: inline-flex; align-items: center; background: none; border: 0; padding: 6px 2px; color: var(--muted); font: inherit;
               text-decoration: none; cursor: pointer; border-radius: 2px; }
  .foot-link:hover { color: var(--text); text-decoration: underline; background: none; }
  .credit { grid-area: credit; justify-self: end; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0 14px; margin: 0; }
  .credit > * + *::before { content: "·"; margin-right: 14px; color: var(--line-strong); }
  .credit a { color: var(--text); font-weight: 600; text-decoration: none; border-radius: 2px; padding: 6px 0; }
  .credit a:hover { text-decoration: underline; text-underline-offset: 2px; }
  #theme { grid-area: theme; width: 30px; height: 30px; padding: 0; display: grid; place-items: center; }
  #theme .i-sun { display: none; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) #theme .i-sun { display: block; }
    :root:not([data-theme="light"]) #theme .i-moon { display: none; }
  }
  :root[data-theme="dark"] #theme .i-sun { display: block; }
  :root[data-theme="dark"] #theme .i-moon { display: none; }

  /* botões e campos: 4px de raio, sem sombra */
  button { font: inherit; cursor: pointer; border-radius: var(--r); border: 1px solid var(--line-strong); background: transparent; color: var(--text);
           padding: 0 14px; min-height: 36px; transition: background .12s, border-color .12s, color .12s; }
  button:hover { background: var(--panel-2); }
  button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
  button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
  button.danger { color: var(--danger-text); border-color: var(--line-strong); }
  button.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
  button.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 600; }
  button.danger-solid:hover { background: var(--danger); filter: brightness(.92); }
  button:focus-visible, textarea:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
  .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
  .icon-btn { width: 36px; padding: 0; }

  @media (max-width: 640px) {
    .foot { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "nav theme" "credit credit"; column-gap: 8px; row-gap: 0; padding: 2px 8px 8px; }
    .foot nav > * + *::before, .credit > * + *::before { display: none; }
    .foot nav { gap: 0; }
    .foot-link { min-height: 44px; padding: 0 6px; }
    #theme { width: 44px; height: 44px; }
    .credit { justify-self: start; justify-content: flex-start; align-items: center; gap: 0 14px; padding: 0 6px; }
    .credit a { display: inline-flex; align-items: center; min-height: 44px; padding: 0; }
    .credit > span:last-child { flex-basis: 100%; }
  }

  /* ---- páginas de texto (termos e privacidade) ---- */
  .app > main.doc { flex: 1 0 auto; width: 100%; max-width: 760px; margin: 0 auto; padding: 28px 20px 56px; }
  .back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r);
               color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
  .back-link:hover { background: var(--panel-2); }
  .doc-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 0 20px; }
  .doc-head-text { flex: 1; min-width: 0; }
  .doc-head img { flex: none; display: block; width: min(330px, 46%); height: auto; }
  .doc h1 { margin: 0 0 6px; font-size: clamp(26px, 4vw, 34px); line-height: 1.15; font-weight: 700; letter-spacing: -.02em; text-wrap: balance; }
  .doc .updated { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
  .doc .summary { margin: 0 0 8px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r); }
  .doc .summary p { margin: 0; }
  .doc h2 { margin: 28px 0 8px; font-size: 18px; line-height: 1.3; font-weight: 700; text-wrap: balance; }
  .doc p, .doc li { font-size: 15.5px; line-height: 1.7; }
  .doc p { margin: 0 0 12px; max-width: 68ch; }
  .doc ul { margin: 0 0 12px; padding-left: 20px; max-width: 68ch; }
  .doc li { margin-bottom: 6px; }
  .doc a { color: var(--accent-text); text-underline-offset: 2px; }
  .doc strong { font-weight: 600; }
  .foot-link[aria-current="page"] { color: var(--text); font-weight: 600; }
  @media (max-width: 640px) { .app > main.doc { padding: 20px 16px 40px; } .brand-name span { display: none; } .back-link { min-height: 44px; }
    .doc-head { flex-direction: column-reverse; align-items: flex-start; gap: 8px; }
    .doc-head img { width: min(280px, 82%); align-self: center; } }

  @media (prefers-reduced-motion: reduce) {
    button, a { transition: none; }
  }
