/* Shared styles for Tracan's legal pages (public/legal/*.html). No external assets. */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --text: #1c1c1e;
  --muted: #5f6368;
  --line: #e3e3e8;
  --panel: #f5f5f7;
  --link: #0a58ca;
  --accent: #c2410c;
  --mark-bg: #fff1a8;
  --mark-text: #3d2f00;
  --draft-bg: #fff4e5;
  --draft-line: #f0b25a;
  --draft-text: #7a3e00;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113;
    --text: #ececf0;
    --muted: #a1a1aa;
    --line: #2c2c31;
    --panel: #1b1b1f;
    --link: #7ab0ff;
    --accent: #ff9f5a;
    --mark-bg: #5c4a00;
    --mark-text: #fff3c4;
    --draft-bg: #2b1d0c;
    --draft-line: #8a5a1c;
    --draft-text: #ffd59a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

/* Header */
header.site { border-bottom: 1px solid var(--line); }
header.site .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 20px; padding-top: 14px; padding-bottom: 14px;
}
.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
header.site nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.95rem; }
header.site nav a { color: var(--muted); text-decoration: none; }
header.site nav a:hover { color: var(--text); text-decoration: underline; }
header.site nav a[aria-current="page"] { color: var(--text); font-weight: 600; }

/* Draft banner */
.draft {
  background: var(--draft-bg); color: var(--draft-text);
  border-bottom: 1px solid var(--draft-line);
  font-weight: 600; font-size: 0.95rem;
}
.draft .wrap { padding-top: 10px; padding-bottom: 10px; }

/* Body copy */
main.wrap { padding-top: 28px; padding-bottom: 40px; }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 1.25rem; line-height: 1.3; margin: 36px 0 8px; padding-top: 4px; }
h3 { font-size: 1.05rem; margin: 24px 0 6px; }
p, ul, ol { margin: 0 0 12px; }
ul, ol { padding-left: 1.4em; }
li { margin: 4px 0; }
.lead { color: var(--muted); font-size: 1.05rem; }
.meta { color: var(--muted); font-size: 0.9rem; }
.toc { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 20px 0 8px; }
.toc ol { margin: 0; }
.toc li { margin: 2px 0; }

/* Placeholders and open decisions */
mark { background: var(--mark-bg); color: var(--mark-text); padding: 0 3px; border-radius: 3px; }
.decision {
  border: 1px dashed var(--accent); border-radius: 10px;
  padding: 10px 14px; margin: 8px 0 16px; font-size: 0.95rem;
}
.decision strong:first-child { color: var(--accent); }

/* Tables */
.table { overflow-x: auto; margin: 8px 0 18px; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
th { background: var(--panel); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; white-space: nowrap; }

/* Footer */
footer.site { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
footer.site .wrap { padding-top: 18px; padding-bottom: 28px; }
footer.site p { margin: 0 0 6px; }

@media (max-width: 480px) {
  h1 { font-size: 1.6rem; }
  td:first-child { white-space: normal; }
}
/* On phones, tables with labelled cells become one card per row. */
@media (max-width: 600px) {
  .table.stack { overflow: visible; }
  .table.stack table, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table.stack tr { border-bottom: 1px solid var(--line); padding: 6px 0; }
  .table.stack tr:last-child { border-bottom: 0; }
  .table.stack td { border-bottom: 0; padding: 4px 12px; white-space: normal; }
  .table.stack td:first-child { font-size: 1rem; padding-top: 8px; }
  .table.stack td:not(:first-child)::before {
    content: attr(data-label); display: block;
    color: var(--muted); font-size: 0.8rem; font-weight: 600;
  }
}
@media print {
  .draft { border: 1px solid #000; }
  header.site nav { display: none; }
  a { color: inherit; }
}
