/* tipdash Terms gate + legal pages + cookie banner. Plain on purpose.
   Drop-in for assets/terms-gate.css on branch terms-gate (PR #162). Styles the existing
   markup only (tg-*, legal-*, cc-*, .terms-ver). Theme variables with navy fallbacks;
   system font stack; no animation. */

/* ---------- Gate ---------- */
html.tg-locked,html.tg-locked body{overflow:hidden}
.tg-overlay{position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(0,0,0,.72)}
.tg-overlay[hidden]{display:none}
.tg-card{box-sizing:border-box;width:100%;max-width:560px;max-height:calc(100dvh - 32px);display:flex;flex-direction:column;
  background:var(--card,#151b2b);color:var(--txt,#eef2fa);border:1px solid var(--line,#26304a);border-radius:12px;padding:22px 22px 12px;
  font:400 1rem/1.55 system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}
.tg-title{margin:0 0 12px;font-size:1.3125rem;line-height:1.3;font-weight:700}
.tg-body{overflow:auto;flex:1 1 auto;min-height:0;padding:12px 14px;border:1px solid var(--line,#26304a);border-radius:8px;
  background:var(--bg2,#0f1420);font-size:.9375rem;line-height:1.55}
.tg-body > :first-child{margin-top:0}.tg-body > :last-child{margin-bottom:0}
.tg-body p{margin:0 0 .8em}
.tg-body h2,.tg-body h3,.tg-body h4{margin:1.3em 0 .4em;font-size:1rem;line-height:1.35;font-weight:700}
.tg-body ul,.tg-body ol{margin:0 0 .8em;padding-left:1.3em}.tg-body li{margin:0 0 .35em}
.tg-body blockquote{margin:0 0 .8em;padding:8px 12px;border:1px solid var(--line,#26304a);border-radius:6px;color:var(--muted,#8a95ad)}
.tg-body blockquote p{margin:0}
.tg-body small{color:var(--muted,#8a95ad)}
.tg-body hr{border:0;border-top:1px solid var(--line,#26304a);margin:1em 0}
.tg-msg{min-height:1.3em;margin:8px 0 0;font-size:.875rem;color:var(--muted,#8a95ad)}
.tg-age{display:flex;gap:12px;align-items:flex-start;margin-top:4px;padding:12px 14px;border:1px solid var(--line,#26304a);border-radius:8px;font-weight:600;line-height:1.45;cursor:pointer}
.tg-age input{flex:none;width:22px;height:22px;margin:0;accent-color:var(--accent,#5b8cff);cursor:pointer}
.tg-age:focus-within{outline:2px solid var(--accent,#5b8cff);outline-offset:2px}
.tg-links{margin:10px 0 0;font-size:.875rem;color:var(--muted,#8a95ad)}
.tg-links a,.tg-body a{color:var(--accent,#5b8cff);text-decoration:underline;text-underline-offset:2px}
.tg-actions{display:flex;margin-top:14px}
.tg-accept{flex:1;min-height:48px;padding:0 22px;border-radius:8px;border:1px solid transparent;background:var(--accent,#5b8cff);
  color:var(--on-accent,#0b0f1a);font:inherit;font-weight:700;cursor:pointer}
.tg-accept[disabled]{background:transparent;border-color:var(--line,#26304a);color:var(--muted,#8a95ad);cursor:not-allowed;opacity:1}
.tg-accept:focus-visible,.tg-body:focus-visible,.tg-card a:focus-visible{outline:2px solid var(--accent,#5b8cff);outline-offset:2px}
.tg-hint{margin:8px 0 0;font-size:.8125rem;color:var(--muted,#8a95ad);text-align:center}
.tg-hint[hidden]{display:none}
/* Version tag: team metadata. Tiny + low contrast, legible up close. (In #162 .tg-ver sits under the title.) */
.tg-ver,.legal-ver,.terms-ver{font:500 10px/1.3 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;letter-spacing:.02em;color:var(--faint,#5c6785);opacity:.75}
.tg-ver{order:99;margin:10px 0 0;text-align:center}  /* flex order moves it to the card bottom without markup change */
@media (max-width:480px){
  .tg-overlay{padding:0;align-items:stretch}
  .tg-card{max-width:none;max-height:none;height:100dvh;border:0;border-radius:0;
    padding:calc(18px + env(safe-area-inset-top,0px)) 16px calc(8px + env(safe-area-inset-bottom,0px))}
}

/* ---------- Legal pages ---------- */
.legal-main{box-sizing:border-box;max-width:calc(68ch + 40px);margin:0 auto;padding:32px 20px 32px;color:var(--txt,#eef2fa);
  font:400 1rem/1.6 system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}
.legal-main > h1{margin:0 0 6px;font-size:1.75rem;line-height:1.25;font-weight:700;letter-spacing:-.01em}
.legal-main > .legal-ver{display:block;margin:0 0 20px}
.legal-body p{margin:0 0 1em}
.legal-body > blockquote:first-child{margin:0 0 20px;padding:10px 14px;border:1px solid var(--line,#26304a);border-radius:8px;background:var(--card,#151b2b);font-size:.875rem;color:var(--muted,#8a95ad)}
.legal-body > blockquote:first-child p{margin:0}
.legal-body > blockquote:first-child strong{color:var(--txt,#eef2fa)}
.legal-body blockquote{margin:0 0 1em;padding:8px 14px;border-left:3px solid var(--line,#26304a);color:var(--muted,#8a95ad)}
/* The renderer turns the draft's "# Title" into an h2 that repeats the h1: show it as a quiet subtitle. */
.legal-body > h2{margin:0 0 2px;font-size:.9375rem;font-weight:500;color:var(--muted,#8a95ad)}
.legal-body > h2 + p > small:only-child{display:block;font-size:.875rem;color:var(--muted,#8a95ad)}
/* "## 1. Section" renders as h3: these are the numbered section heads. */
.legal-body h3{margin:2em 0 .6em;padding-top:.9em;border-top:1px solid var(--line,#26304a);font-size:1.25rem;line-height:1.3;font-weight:700}
.legal-body h4{margin:1.6em 0 .4em;font-size:1.0625rem;line-height:1.35;font-weight:700}
.legal-body ul,.legal-body ol{margin:0 0 1em;padding-left:1.4em}
.legal-body li{margin:0 0 .4em;padding-left:.2em}
.legal-body li::marker{color:var(--muted,#8a95ad)}
.legal-body strong{font-weight:650}
.legal-body small{color:var(--muted,#8a95ad)}
.legal-body hr{border:0;border-top:1px solid var(--line,#26304a);margin:2em 0 0}
.legal-body hr + h3{border-top:0;margin-top:1.2em}
.legal-body table{width:100%;border-collapse:collapse;margin:0 0 1.2em;font-size:.9375rem;line-height:1.45}
.legal-body th,.legal-body td{padding:9px 12px;text-align:left;vertical-align:top;border:1px solid var(--line,#26304a)}
.legal-body th{background:var(--card,#151b2b);font-weight:650}
.legal-body a,.legal-foot a{color:var(--accent,#5b8cff);text-decoration:underline;text-underline-offset:2px}
.legal-body a:focus-visible,.legal-foot a:focus-visible{outline:2px solid var(--accent,#5b8cff);outline-offset:2px}
.legal-err{color:var(--muted,#8a95ad)}
.legal-foot{max-width:calc(68ch + 40px);margin:0 auto;padding:18px 20px calc(12px + env(safe-area-inset-bottom,0px));border-top:1px solid var(--line,#26304a);
  text-align:center;font-size:.8125rem;color:var(--muted,#8a95ad)}
.legal-links{line-height:2}
.terms-ver{text-align:center;padding:14px 0 calc(10px + env(safe-area-inset-bottom,0px))}

/* ---------- Cookie banner (built, off) ---------- */
.cc-banner{position:fixed;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom,0px));z-index:2147482000;max-width:640px;margin:0 auto;
  display:flex;flex-wrap:wrap;gap:10px 16px;align-items:center;justify-content:space-between;padding:12px 14px;border-radius:8px;
  background:var(--card,#151b2b);color:var(--txt,#eef2fa);border:1px solid var(--line,#26304a);
  font:400 .875rem/1.45 system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}
.cc-text{margin:0;flex:1 1 240px}
.cc-text a{color:var(--accent,#5b8cff);text-decoration:underline}
.cc-actions{display:flex;gap:8px;flex:0 0 auto}
.cc-btn{min-height:44px;padding:0 14px;border-radius:8px;border:1px solid var(--line,#26304a);background:transparent;color:inherit;font:inherit;font-weight:600;cursor:pointer}
.cc-primary{background:var(--accent,#5b8cff);border-color:transparent;color:var(--on-accent,#0b0f1a)}
.cc-btn:focus-visible,.cc-text a:focus-visible{outline:2px solid var(--accent,#5b8cff);outline-offset:2px}

/* Contents list (from Cinna's legal.css, cc-toc rules only) */
.cc-toc{font-size:.9375rem;line-height:1.4;padding:14px 16px;border:1px solid var(--line,#26304a);border-radius:8px;background:var(--card,#151b2b)}
.cc-toc-title{margin:0 0 8px;font-size:.8125rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--muted,#8a95ad)}
.cc-list{list-style:none;margin:0;padding:0}
.cc-list li{margin:0}
.cc-list a{display:flex;gap:.5em;padding:5px 0;text-decoration:none;color:var(--txt,#eef2fa)}
.cc-list a:hover{text-decoration:underline}
.cc-list .cc-n{flex:none;min-width:1.6em;color:var(--muted,#8a95ad);font-variant-numeric:tabular-nums}
.cc-toc{max-width:760px;margin:0 auto 16px}.cc-toc[hidden]{display:none}.cc-toc a{color:var(--accent,#5b8cff)}
.legal-body h2,.legal-body h3{scroll-margin-top:16px}
