/* Base styles shared by every site. Sites set colour tokens via :root in the layout. */
:root {
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 10px;
  --gap: 16px;
  --maxw: 1080px;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 18px/1.6 var(--sans); color: var(--ink); background: var(--bg); }
img, svg, canvas { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 1.2em 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-top: .4em; }
h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); }
h3 { font-size: 1.15rem; }
p, ul, ol { margin: 0 0 1em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: 16px; }
.small, .note { font-size: .88rem; color: var(--muted); }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 68ch; }
.prose { max-width: 72ch; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px; z-index: 10; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--rule); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 10px; }
.brand { font: 700 1.2rem var(--display); color: var(--ink); text-decoration: none; }
.site-header nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; }
.site-header nav a { color: var(--ink); text-decoration: none; font-weight: 500; padding: 6px 0; display: inline-block; }
.site-header nav a[aria-current] { color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }
.crumbs { font-size: .85rem; color: var(--muted); margin-top: 14px; }
.crumbs a { color: var(--muted); }

.site-footer { margin-top: 56px; border-top: 1px solid var(--rule); background: var(--surface); padding-block: 20px; font-size: .95rem; }
.site-footer a { color: var(--ink); }

.cards { list-style: none; padding: 0; margin: 0 0 1.5em; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-icon { font-size: 1.8rem; line-height: 1; }
.card-title { font: 600 1.08rem var(--display); color: var(--accent); }
.card-text { font-size: .9rem; color: var(--muted); line-height: 1.45; }

.btn { font: 600 1rem var(--sans); padding: 10px 18px; border-radius: 8px; border: 2px solid var(--accent); background: var(--accent); color: var(--accent-ink); cursor: pointer; min-height: 44px; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.secondary { background: transparent; color: var(--accent); }
.btn.small { padding: 6px 12px; min-height: 36px; font-size: .9rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }

.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px; margin: 0 0 20px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 18px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .95rem; }
label.field small { font-weight: 400; color: var(--muted); }
input, select, textarea { font: 1rem var(--sans); padding: 9px 10px; border: 1px solid var(--rule); border-radius: 8px; background: #fff; color: var(--ink); min-height: 44px; width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--accent); }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.result { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border: 2px solid var(--accent); border-radius: var(--radius); padding: 16px 18px; margin: 16px 0; }
.result .big { font: 700 1.8rem var(--display); display: block; }
.warn { background: #fff4e0; border-left: 4px solid #d98b00; padding: 10px 14px; border-radius: 6px; }

table.data { border-collapse: collapse; width: 100%; font-size: .95rem; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
table.data th { background: var(--surface); }
.table-scroll { overflow-x: auto; }

.faq details { border-bottom: 1px solid var(--rule); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 8px 0 0; }
.related { margin-top: 40px; }

.ad { margin: 24px 0; min-height: 90px; }
.ad-preview { display: grid; place-items: center; border: 2px dashed var(--rule); color: var(--muted); font-size: .85rem; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 50; font-weight: 600; }

@media print {
  .site-header, .site-footer, .crumbs, .ad, .related, .faq, .no-print, .lede { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .wrap { max-width: none; padding: 0; }
  h1 { margin: 0 0 8pt; }
}

.legal-table { border-collapse: collapse; margin: 1rem 0; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: .4rem .8rem .4rem 0; border-bottom: 1px solid var(--rule, #ddd); }
.legal-table th { font-weight: 600; white-space: nowrap; }
@media (max-width: 480px) { .legal-table th { white-space: normal; } }
