/* ============================================================
   myFLIGHTDATA - Legal page (views/NewSite/legal_docs.php, route /legal)

   Served by Newsite::css('legal'), linked through $meta['stylesheet'].
   Layout follows part135sms.com/legal (tabs, sticky "Sections" list,
   numbered sections, revision line), recoloured to this site's slate /
   sky palette. Everything is scoped to .legal-page so it cannot touch
   the header or footer. Tailwind's reset is on, so lists, headings and
   paragraph spacing are set here explicitly.
   ============================================================ */
.legal-page{
  --lg-bg:#f8fafc; --lg-surface:#ffffff; --lg-line:#e2e8f0; --lg-ink:#0f172a; --lg-text:#334155;
  --lg-muted:#64748b; --lg-accent:#0284c7; --lg-accent-strong:#0369a1;
  --lg-warn-bg:#fffbeb; --lg-warn-line:#f59e0b;
  --lg-mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  display:block; background:var(--lg-bg); color:var(--lg-text);
}
:root.dark .legal-page{
  --lg-bg:#0f172a; --lg-surface:#1e293b; --lg-line:#1e293b; --lg-ink:#f1f5f9; --lg-text:#cbd5e1;
  --lg-muted:#94a3b8; --lg-accent:#38bdf8; --lg-accent-strong:#7dd3fc;
  --lg-warn-bg:rgba(245,158,11,.10); --lg-warn-line:#f59e0b;
}
.legal-wrap{max-width:80rem;margin:0 auto;padding:0 1rem}
@media (min-width:640px){.legal-wrap{padding:0 1.5rem}}
@media (min-width:1024px){.legal-wrap{padding:0 2rem}}

/* ---- hero band ---- */
.legal-hero{
  position:relative;overflow:hidden;padding:64px 0 56px;color:#e2e8f0;
  background:radial-gradient(80% 120% at 85% 0%,rgba(14,165,233,.22) 0%,rgba(14,165,233,0) 60%),#0f172a;
  border-bottom:1px solid #1e293b;
}
.legal-crumbs{font-size:.85rem;color:#94a3b8;margin:0 0 14px}
.legal-crumbs a{color:#7dd3fc}
.legal-crumbs a:hover{color:#bae6fd;text-decoration:underline}
.legal-hero h1{font-size:clamp(2.2rem,4.5vw,3rem);font-weight:800;letter-spacing:-.025em;line-height:1.05;color:#ffffff;margin:0 0 14px}
.legal-lead{font-size:1.0625rem;line-height:1.6;color:#cbd5e1;max-width:62ch;margin:0}

/* ---- tabs ---- */
.legal-section{padding:40px 0 96px}
.legal-tabs{display:none;flex-wrap:wrap;gap:4px;border-bottom:2px solid var(--lg-line);margin-bottom:32px}
.is-tabbed .legal-tabs{display:flex}
.legal-tab{
  font:inherit;font-weight:700;font-size:1.02rem;color:var(--lg-muted);background:none;border:0;
  padding:12px 16px;margin-bottom:-2px;border-bottom:3px solid transparent;cursor:pointer;white-space:nowrap;
  transition:color .15s,border-color .15s;
}
.legal-tab:hover{color:var(--lg-ink)}
.legal-tab[aria-selected="true"]{color:var(--lg-ink);border-bottom-color:var(--lg-accent)}
.legal-tab:focus-visible{outline:2px solid #0ea5e9;outline-offset:-3px;border-radius:4px}
.legal-tab .tab-short{display:none}

/* ---- panels: without JavaScript all three show, separated ---- */
.legal-panel + .legal-panel{margin-top:56px;padding-top:40px;border-top:1px solid var(--lg-line)}
.is-tabbed .legal-panel + .legal-panel{margin-top:0;padding-top:0;border-top:0}
.legal-panel:focus{outline:none}
.legal-layout{display:grid;grid-template-columns:250px minmax(0,1fr);gap:48px;align-items:start}

/* ---- Sections list ---- */
.legal-toc{position:sticky;top:88px;font-size:.9rem}
.legal-toc summary{font-family:var(--lg-mono);font-size:.74rem;letter-spacing:.12em;text-transform:uppercase;color:var(--lg-muted);cursor:pointer;margin-bottom:10px;list-style:none}
.legal-toc summary::-webkit-details-marker{display:none}
.legal-toc ol{list-style:none;margin:0;padding:0;display:grid;gap:2px;border-left:2px solid var(--lg-line)}
.legal-toc a{display:block;padding:5px 0 5px 14px;margin-left:-2px;border-left:2px solid transparent;color:var(--lg-muted);line-height:1.35;transition:color .15s,border-color .15s}
.legal-toc a:hover{color:var(--lg-ink);border-left-color:var(--lg-accent)}
.legal-toc a:focus-visible{outline:2px solid #0ea5e9;outline-offset:2px;border-radius:2px}

/* ---- document ---- */
.legal-doc{max-width:74ch;display:grid;gap:14px;font-size:1rem;line-height:1.7}
.legal-head{display:grid;gap:8px;padding-bottom:18px;border-bottom:1px solid var(--lg-line);margin-bottom:6px}
.legal-head h2{font-size:1.75rem;font-weight:800;letter-spacing:-.02em;line-height:1.2;color:var(--lg-ink);margin:0}
.legal-meta{font-family:var(--lg-mono);font-size:.82rem;color:var(--lg-muted);margin:0}
.legal-doc h3{font-size:1.2rem;font-weight:700;letter-spacing:-.01em;line-height:1.3;color:var(--lg-ink);margin:18px 0 0}
.legal-doc p{margin:0}
.legal-doc ul{list-style:disc;margin:0;padding-left:1.25em;display:grid;gap:10px}
.legal-doc li::marker{color:var(--lg-muted)}
.legal-doc p,.legal-doc li{overflow-wrap:anywhere}
.legal-doc a{color:var(--lg-accent);text-decoration:underline;text-underline-offset:2px}
.legal-doc a:hover{color:var(--lg-accent-strong)}
.legal-doc strong,.legal-doc b{color:var(--lg-ink);font-weight:700}
.legal-important{background:var(--lg-warn-bg);border-left:4px solid var(--lg-warn-line);padding:12px 16px;border-radius:0 8px 8px 0;color:var(--lg-ink)}
.legal-address{font-style:normal;display:grid;gap:2px}

@media (max-width:900px){
  .legal-layout{grid-template-columns:1fr;gap:20px}
  .legal-toc{position:static;background:var(--lg-surface);border:1px solid var(--lg-line);border-radius:12px;padding:12px 16px}
  :root.dark .legal-toc{border-color:#334155}
  .legal-toc summary{margin-bottom:0;display:flex;justify-content:space-between;align-items:center}
  .legal-toc details[open] summary{margin-bottom:10px}
  .legal-toc summary::after{content:"+";font-size:1.2rem;color:var(--lg-accent);line-height:1}
  .legal-toc details[open] summary::after{content:"\2013"}
}
@media (max-width:600px){
  .legal-hero{padding:44px 0 40px}
  .legal-section{padding:28px 0 64px}
  .legal-tab{flex:1;padding-inline:8px}
  .legal-tab .tab-long{display:none}
  .legal-tab .tab-short{display:inline}
}

/* ---- print: just the document being read ---- */
@media print{
  body > nav, .subnav, .mega-scrim, footer, #toast-container, .legal-hero, .legal-tabs, .legal-toc{display:none !important}
  .legal-page{background:#fff;color:#000}
  .legal-layout{display:block}
  .legal-section{padding:0}
}
