/* ============================================================
   DEADLANE — legal pages (terms.html, privacy.html, delete-account.html)
   Long-form reading layout on top of styles.css tokens: one readable
   column, a sticky contents list on wide screens, no decoration in the
   text itself.
   ============================================================ */

.legal-head {
  border-bottom: 1px solid var(--line);
  padding: clamp(2.5rem, 7vw, 4.5rem) clamp(1rem, 5vw, 2rem) clamp(2rem, 5vw, 3rem);
}
.legal-head__inner { max-width: 1080px; margin: 0 auto; }
.legal-head h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); margin: .3rem 0 .8rem; }
.legal-meta { color: var(--ink-soft); font-size: .95rem; }
.legal-meta b { color: var(--ink); font-weight: 600; }
.legal-draft {
  margin-top: 1.2rem; padding: .8rem 1rem;
  border: 1px solid var(--red); border-left-width: 4px; border-radius: var(--radius);
  background: rgba(216,69,47,.08); color: #f0b0a4; font-size: .92rem;
}
.legal-draft b { color: #fff; }

.legal {
  max-width: 1080px; margin: 0 auto;
  padding: clamp(2rem, 5vw, 3rem) clamp(1rem, 5vw, 2rem) clamp(3rem, 8vw, 5rem);
  display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
.legal-toc { position: sticky; top: 84px; font-size: .88rem; }
.legal-toc p {
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: .16em;
  font-size: .7rem; color: var(--ink-faint); margin-bottom: .6rem;
}
.legal-toc ol { list-style: none; display: grid; gap: .35rem; border-left: 1px solid var(--line); }
.legal-toc a { display: block; padding: .15rem 0 .15rem .9rem; color: var(--ink-soft); line-height: 1.4; }
.legal-toc a:hover { color: var(--amber); }

.legal-body { max-width: 72ch; color: var(--ink-soft); font-size: 1.02rem; line-height: 1.75; }
.legal-body > section { scroll-margin-top: 84px; }
.legal-body > section + section { margin-top: 2.6rem; }
.legal-body h2 {
  font-size: 1.45rem; color: var(--ink); letter-spacing: .02em; margin-bottom: .8rem;
  padding-top: .2rem;
}
.legal-body h3 { font-family: var(--font-body); text-transform: none; font-size: 1.04rem; font-weight: 600; color: var(--ink); margin: 1.4rem 0 .4rem; letter-spacing: 0; line-height: 1.4; }
.legal-body p + p, .legal-body p + ul, .legal-body ul + p, .legal-body table + p { margin-top: .9rem; }
.legal-body ul { margin: .7rem 0 0 1.2rem; display: grid; gap: .4rem; }
.legal-body li::marker { color: var(--amber); }
.legal-body strong { color: var(--ink); font-weight: 600; }
.legal-body a { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }
.legal-body .caps { text-transform: uppercase; font-size: .94rem; letter-spacing: .01em; }
.legal-body .ph { background: rgba(224,168,58,.16); color: var(--amber-2); padding: 0 .3rem; border-radius: 2px; font-weight: 600; }

.legal-summary {
  border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: var(--radius);
  background: var(--panel); padding: 1.2rem 1.4rem; margin-bottom: 2.4rem;
}
.legal-summary h2 { font-size: 1.1rem; margin-bottom: .6rem; }
.legal-summary ul { margin-top: .4rem; }

.legal-table-wrap { overflow-x: auto; margin-top: 1rem; border: 1px solid var(--line); border-radius: var(--radius); }
.legal-body table { width: 100%; border-collapse: collapse; font-size: .92rem; line-height: 1.55; }
.legal-body th, .legal-body td { text-align: left; vertical-align: top; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
.legal-body th { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .08em; font-size: .74rem; color: var(--ink-faint); font-weight: 500; background: var(--bg-alt); }
.legal-body tr:last-child td { border-bottom: 0; }
.legal-body td:first-child { color: var(--ink); font-weight: 600; min-width: 150px; }

.legal-steps { counter-reset: s; list-style: none; margin: 1rem 0 0 !important; display: grid; gap: .8rem !important; }
.legal-steps > li {
  counter-increment: s; position: relative; padding: 1rem 1.2rem 1rem 3.6rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.legal-steps > li::before {
  content: counter(s); position: absolute; left: 1.1rem; top: 1rem;
  width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%;
  background: var(--amber); color: var(--bg); font-family: var(--font-head); font-weight: 700; font-size: .9rem;
}
.legal-steps > li::marker { content: none; }

.footer__links { display: flex; justify-content: center; flex-wrap: wrap; gap: .4rem 1.4rem; margin: -.4rem 0 1.2rem; font-size: .82rem; }
.footer__links a { color: var(--ink-soft); }
.footer__links a:hover, .footer__links a[aria-current="page"] { color: var(--amber); }

/* ---------- Account deletion tool (delete-account.html) ---------- */
.dl-app {
  margin-top: 1rem; padding: clamp(1.1rem, 3vw, 1.6rem);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.dl-view[hidden] { display: none; }
.dl-lead { color: var(--ink); margin-bottom: 1rem; }
.dl-muted { color: var(--ink-faint); font-size: .92rem; }
.dl-providers { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.dl-oauth-note { margin-top: .7rem; }
.dl-or { display: flex; align-items: center; gap: .8rem; margin: 1.2rem 0 .9rem; color: var(--ink-faint); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; }
.dl-or::before, .dl-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.dl-form { display: grid; gap: .8rem; }
.dl-field { display: grid; gap: .35rem; }
.dl-field > span { color: var(--ink); font-size: .92rem; font-weight: 600; }
.dl-field input {
  width: 100%; min-height: 46px; padding: 0 .9rem;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; font-size: 1rem;
}
.dl-field input:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; border-color: var(--amber); }
.dl-btn {
  min-height: 46px; padding: 0 1.1rem; cursor: pointer;
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: .08em; font-size: .9rem; font-weight: 600;
  color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
}
.dl-btn:hover:not(:disabled) { border-color: var(--ink-soft); }
.dl-btn:focus-visible, .dl-link:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.dl-btn:disabled { opacity: .45; cursor: not-allowed; }
.dl-btn--primary { background: var(--amber); border-color: var(--amber); color: #191400; }
.dl-btn--provider { background: var(--panel-2); }
.dl-btn--danger { background: #3a1410; border-color: var(--red); color: #ffd9d2; }
.dl-btn--danger:hover:not(:disabled) { background: #551c15; border-color: #ff6a50; }
.dl-link { justify-self: start; background: none; border: 0; padding: 0; color: var(--amber); font: inherit; font-size: .92rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.dl-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.dl-msg { min-height: 1.2em; margin-top: .8rem; font-size: .94rem; }
.dl-msg:empty { display: none; }
.dl-msg--err { color: #ff9a86; }
.dl-msg--ok { color: var(--green); }
.dl-danger { border-left: 3px solid var(--red); padding-left: 1rem; }
.legal-body .dl-danger__title { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .06em; font-size: 1.35rem; color: #ff9a86; margin: 0 0 .8rem; }
.dl-identity { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 1.1rem 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.dl-identity > div { background: var(--bg); padding: .7rem .9rem; }
.dl-identity dt { font-family: var(--font-head); text-transform: uppercase; letter-spacing: .12em; font-size: .7rem; color: var(--ink-faint); }
.dl-identity dd { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.05rem; color: var(--ink); overflow-wrap: anywhere; white-space: pre-wrap; }
.dl-notice { margin-top: .7rem; font-size: .9rem; color: var(--ink-soft); }
.dl-countdown { margin-top: .5rem; font-family: var(--font-head); letter-spacing: .06em; font-size: .95rem; min-height: 1.3em; }
.dl-countdown--wait { color: var(--amber); }
.dl-countdown--ready { color: #ff9a86; }
.dl-success { font-size: 1.1rem; font-weight: 600; color: var(--ink); padding: .9rem 1rem; border: 1px solid var(--green-dim); border-radius: var(--radius); background: rgba(111,227,107,.06); }
@media (max-width: 560px) {
  .dl-providers, .dl-identity { grid-template-columns: 1fr; }
  .dl-actions .dl-btn { width: 100%; }
}

@media (max-width: 860px) {
  .legal { grid-template-columns: 1fr; }
  .legal-toc { position: static; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; background: var(--panel); }
}

/* ---------- Print / PDF: black on white, single column, no site chrome ---------- */
@media print {
  @page { size: Letter; margin: 0.75in 0.8in 0.85in; }
  html, body { background: #fff !important; color: #111 !important; }
  body { font-size: 10.5pt; }
  .nav, .legal-toc, .footer__links, .footer__tag, .footer__brand { display: none !important; }
  .legal-head { border-bottom: 1px solid #999; padding: 0 0 14pt; }
  .legal-head__inner, .legal { max-width: none; }
  .legal-head h1 { color: #000; font-size: 22pt; margin: 2pt 0 6pt; }
  .eyebrow { color: #555 !important; }
  .legal-meta, .legal-meta b { color: #222 !important; }
  .legal-draft { background: #fff3f0 !important; color: #8a1c0c !important; border-color: #c0392b !important; }
  .legal-draft b { color: #8a1c0c !important; }
  .legal { display: block; padding: 14pt 0 0; }
  .legal-body { max-width: none; color: #111 !important; font-size: 10.5pt; line-height: 1.5; }
  .legal-body > section + section { margin-top: 16pt; }
  .legal-body h2 { color: #000; font-size: 13pt; break-after: avoid; page-break-after: avoid; }
  .legal-body h3 { color: #000; break-after: avoid; page-break-after: avoid; }
  .legal-body strong { color: #000; }
  .legal-body a { color: #0b4ea2; }
  .legal-body li::marker { color: #333; }
  .legal-body .ph { background: #fff59d !important; color: #000 !important; outline: 1px solid #e0c200; }
  .legal-summary { background: #f6f6f4 !important; border-color: #bbb; border-left-color: #333; break-inside: avoid; }
  .legal-summary h2 { color: #000; }
  .legal-table-wrap { border-color: #bbb; overflow: visible; }
  .legal-body th { background: #eee !important; color: #333; }
  .legal-body th, .legal-body td { border-bottom-color: #ccc; }
  .legal-body td:first-child { color: #000; }
  .legal-steps > li { background: #fff !important; border-color: #bbb; break-inside: avoid; }
  .legal-steps > li::before { background: #333 !important; color: #fff; }
  .footer { background: #fff !important; border-top: 1px solid #999; padding: 10pt 0 0; }
  .footer__legal { color: #444 !important; }
  .flame { display: none; }
}
