/* Tokens: asset-tag yellow on a cool steel-paper ground, navy ink. */
:root {
  --paper: #edf1f4;
  --card: #ffffff;
  --ink: #12233a;
  --steel: #56677b;
  --rule: #c6d0d9;
  --tag: #f4c430;
  --tag-ink: #2a2100;
  --ok: #1e7457;
  --err: #a3261b;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Public Sans", system-ui, sans-serif;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.2rem;
  --step-4: clamp(2.6rem, 6vw, 4.4rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--step-0)/1.6 var(--body); }
img { max-width: 100%; }
a { color: var(--ink); text-decoration-color: var(--steel); text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--ink); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 2px; }
.tag :focus-visible { outline-color: var(--ink); }
.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--tag); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--steel); }

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; letter-spacing: 0; margin: 0 0 .5em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); margin-top: 1.6em; }
h3 { font-size: var(--step-2); font-weight: 600; margin-top: 1.2em; }
p, ul, ol { margin: 0 0 1em; }
.lede { font-size: var(--step-1); line-height: 1.5; max-width: 62ch; }

/* Header */
.masthead { background: var(--ink); color: #fff; }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .9rem 0; }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.6rem; color: inherit; text-decoration: none; }
.masthead ul { list-style: none; display: flex; gap: 1.25rem; align-items: center; margin: 0; padding: 0; flex-wrap: wrap; }
.masthead a { color: #fff; text-decoration-color: rgba(255,255,255,.4); }
.masthead :focus-visible { outline-color: var(--tag); }

.btn { display: inline-block; background: var(--ink); color: #fff; font: 600 1rem/1 var(--body); padding: .9rem 1.3rem; border: 2px solid var(--ink); border-radius: 4px; text-decoration: none; cursor: pointer; }
.btn:hover { background: #fff; color: var(--ink); }
.btn[disabled] { opacity: .6; cursor: wait; }
.masthead .btn { background: var(--tag); color: var(--tag-ink); border-color: var(--tag); }
.masthead .btn:hover { background: transparent; color: #fff; }
.btn-small { padding: .55rem .9rem; font-size: .95rem; }
.link-quiet { margin-left: 1rem; }

.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 1rem 0 0; margin: 0; font-size: .9rem; color: var(--steel); }
.crumbs li + li::before { content: "/"; margin-right: .4rem; color: var(--rule); }

/* The asset tag: the one loud element */
.tag { position: relative; background: var(--tag); color: var(--tag-ink); border-radius: 10px; padding: 2.2rem 1.6rem 1.4rem; box-shadow: 0 1px 0 #c79c12, 0 14px 30px -18px rgba(18,35,58,.55); }
.tag-hole { position: absolute; top: .9rem; left: 50%; width: 1.1rem; height: 1.1rem; margin-left: -.55rem; border-radius: 50%; background: var(--paper); box-shadow: inset 0 1px 2px rgba(0,0,0,.25); }
.tag-heading { font-family: var(--display); font-weight: 700; font-size: 1.7rem; line-height: 1.05; margin-bottom: .5rem; }
.tag p { margin-bottom: .9rem; }
.tag .btn { background: var(--ink); border-color: var(--ink); color: #fff; }
.tag .btn:hover { background: transparent; color: var(--ink); }
.barcode { height: 2.6rem; margin-top: 1.2rem; background: repeating-linear-gradient(90deg, var(--tag-ink) 0 2px, transparent 2px 4px, var(--tag-ink) 4px 5px, transparent 5px 8px, var(--tag-ink) 8px 11px, transparent 11px 13px, var(--tag-ink) 13px 14px, transparent 14px 17px); opacity: .85; }
.tag-serial { font-weight: 600; font-size: .9rem; margin: .4rem 0 0; }
.tag-steps { padding-left: 1.3rem; margin-bottom: 0; }
.tag-steps li { margin-bottom: .7rem; }

/* Home */
.hero { padding: clamp(2.5rem, 7vw, 5rem) 0 2rem; }
.hero-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 { max-width: 14ch; }
.tag-hero { transform: rotate(1.2deg); }
@media (prefers-reduced-motion: no-preference) {
  .tag-hero { animation: hang .9s cubic-bezier(.2,.7,.3,1.2) both .15s; transform-origin: 50% 0; }
  @keyframes hang { from { transform: rotate(-5deg); opacity: 0; } to { transform: rotate(1.2deg); opacity: 1; } }
}
.band { padding: 1rem 0 2.5rem; }
.band > h2 { margin-top: .5em; }
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 3px solid var(--ink); }
.service { display: block; padding: 1.4rem 1.4rem 1.6rem 0; text-decoration: none; border-bottom: 1px solid var(--rule); }
.service + .service { padding-left: 1.4rem; border-left: 1px solid var(--rule); }
.service h3 { margin-top: 0; text-decoration: underline; text-decoration-color: var(--tag); text-decoration-thickness: 4px; text-underline-offset: .15em; }
.service p { color: var(--steel); margin: 0; }
.service:hover h3 { text-decoration-color: var(--ink); }

.matrix { width: 100%; border-collapse: collapse; background: var(--card); font-size: .98rem; }
.matrix th, .matrix td { text-align: left; padding: .85rem 1rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.matrix thead th { font-family: var(--display); font-size: 1.2rem; border-bottom: 3px solid var(--ink); }
.matrix tbody th { font-weight: 700; white-space: nowrap; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.plain-list { list-style: none; padding: 0; }
.plain-list li { padding: .8rem 0; border-bottom: 1px solid var(--rule); }
.plain-list a { font-weight: 600; }
.checks { list-style: none; padding: 0; }
.checks li { position: relative; padding-left: 1.8rem; margin-bottom: .6rem; }
.checks li::before { content: ""; position: absolute; left: .15rem; top: .45em; width: .9rem; height: .5rem; border-left: 3px solid var(--ok); border-bottom: 3px solid var(--ok); transform: rotate(-45deg); }

/* Articles */
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(2rem, 5vw, 4rem); padding: 1.5rem 0 4rem; }
.prose { max-width: 68ch; }
.prose h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); margin-top: .6rem; }
.prose section { scroll-margin-top: 1rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: .45rem; }
.toc { background: var(--card); border-left: 4px solid var(--tag); padding: 1rem 1.2rem; margin: 1.5rem 0; }
.toc-head { font-weight: 700; margin-bottom: .4rem; }
.toc ul, .related ul { list-style: none; padding: 0; margin: 0; }
.toc li, .related li { margin: .3rem 0; }
.steps { counter-reset: none; }
.steps li::marker { font-family: var(--display); font-weight: 700; }
.regions { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.region { background: var(--card); padding: 1rem 1.2rem; border-top: 3px solid var(--ink); }
.region h3 { margin-top: 0; font-size: 1.35rem; }
.region p { margin: 0; font-size: .97rem; color: var(--steel); }
.aside-col .sticky { position: sticky; top: 1.5rem; display: grid; gap: 1.5rem; }
.related { padding: 0 .2rem; }
.faq details { border-bottom: 1px solid var(--rule); padding: .9rem 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: .6rem 0 0; }
.sources { margin-top: 2.5rem; font-size: .95rem; }
.sources h2 { font-size: 1.6rem; }
.reviewed { color: var(--steel); }

/* Quote form, styled as a custody manifest */
.quote-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(2rem, 5vw, 4rem); padding: 1.5rem 0 4rem; align-items: start; }
.manifest { background: var(--card); border-top: 6px solid var(--tag); padding: 1.6rem; box-shadow: 0 14px 30px -22px rgba(18,35,58,.6); }
fieldset { border: 0; padding: 0; margin: 0 0 1.4rem; }
legend { font-family: var(--display); font-weight: 700; font-size: 1.5rem; margin-bottom: .6rem; padding: 0; }
.field { margin-bottom: 1rem; display: grid; gap: .3rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label, .label { font-weight: 600; font-size: .95rem; }
.opt { font-weight: 400; color: var(--steel); }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--steel); border-radius: 4px; padding: .65rem .75rem; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--tag); outline-offset: 0; border-color: var(--ink); }
.choices { display: grid; gap: .4rem; }
.choice { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; }
.choice input { width: 1.15rem; height: 1.15rem; margin-top: .25rem; flex: none; accent-color: var(--ink); }
.hp { position: absolute; left: -9999px; }
.form-status { min-height: 1.4em; font-weight: 600; }
.form-status.is-error { color: var(--err); }

/* Footer */
.footer { background: var(--ink); color: #d8e0e8; padding: 3rem 0 1.5rem; font-size: .95rem; }
.footer a { color: #fff; text-decoration-color: rgba(255,255,255,.35); }
.footer :focus-visible { outline-color: var(--tag); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
.footer-grid ul { list-style: none; padding: 0; }
.footer-grid li { margin-bottom: .4rem; }
.footer-head { font-weight: 700; color: #fff; }
.footer-fine { border-top: 1px solid rgba(255,255,255,.15); margin-top: 1.5rem; padding-top: 1rem; color: #a9b6c3; }

@media (max-width: 900px) {
  .hero-grid, .two-col, .article-grid, .quote-grid { grid-template-columns: 1fr; }
  .tag-hero { transform: none; max-width: 460px; }
  .service-grid { grid-template-columns: 1fr; }
  .service + .service { padding-left: 0; border-left: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .aside-col .sticky { position: static; }
}
@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
  .matrix thead { display: none; }
  .matrix, .matrix tbody, .matrix tr, .matrix th, .matrix td { display: block; width: 100%; }
  .matrix tr { border-bottom: 3px solid var(--ink); }
  .matrix td { border-bottom: 0; padding-top: .3rem; padding-bottom: .3rem; }
  .masthead ul { gap: .8rem; font-size: .95rem; }
  .link-quiet { display: inline-block; margin: 1rem 0 0; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Wide pages: tables, directory, tools */
.wide { padding: 1.5rem 0 4rem; }
.scroll { overflow-x: auto; }
.table-tools { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; margin: 1.5rem 0 1rem; }
.table-tools input[type=search] { width: min(320px, 100%); }
.law-table { width: 100%; border-collapse: collapse; background: var(--card); font-size: .95rem; }
.law-table th, .law-table td { text-align: left; vertical-align: top; padding: .75rem .9rem; border-bottom: 1px solid var(--rule); }
.law-table thead th { font-family: var(--display); font-size: 1.15rem; border-bottom: 3px solid var(--ink); position: sticky; top: 0; background: var(--card); }
.law-table tbody th { white-space: nowrap; }
.law-table td:nth-child(2) { min-width: 14rem; }
.law-table td:nth-child(3) { min-width: 16rem; }
.src { display: inline-block; margin-left: .3rem; font-size: .85rem; color: var(--steel); }
.inline-list { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.dir-state { margin-top: 2rem; }
.dir-state h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; }
.count { font-family: var(--body); font-size: 1rem; font-weight: 400; color: var(--steel); }
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.dir-card { background: var(--card); padding: 1rem 1.2rem; border-top: 3px solid var(--ink); }
.dir-card h3 { margin-top: 0; font-size: 1.35rem; }
.dir-card p { margin: 0 0 .5rem; font-size: .95rem; }
.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 1.5rem; border-top: 3px solid var(--ink); }
.state-grid a { display: block; padding: .8rem 0; border-bottom: 1px solid var(--rule); text-decoration: none; }
.state-grid a strong { display: block; font-family: var(--display); font-size: 1.35rem; text-decoration: underline; text-decoration-color: var(--tag); text-decoration-thickness: 3px; }
.state-grid a span { color: var(--steel); font-size: .92rem; }
.state-grid a:hover strong { text-decoration-color: var(--ink); }
.timeline li { margin-bottom: .7rem; }
.timeline li::marker { font-family: var(--display); font-weight: 700; }
.byline { color: var(--steel); font-size: .95rem; margin-top: -.4rem; }

/* Tools */
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.result { align-self: start; }
.result ul { padding-left: 1.2rem; }
.quote-grid:has(.result) { grid-template-columns: 1fr 1.2fr 1fr; }
.rfp-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem; align-items: start; margin-top: 1.5rem; }
.inv-row { display: grid; grid-template-columns: 1.3fr .6fr 1.4fr auto; gap: .6rem; align-items: end; margin-bottom: .4rem; }
.inv-row .field { margin-bottom: .4rem; }
.remove { font: inherit; font-size: .9rem; background: none; border: 0; color: var(--err); text-decoration: underline; cursor: pointer; padding: .7rem .2rem; min-height: 44px; }
.rfp-out { position: sticky; top: 1.5rem; }
.rfp-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.rfp-doc { background: var(--card); border-top: 6px solid var(--tag); padding: 1.2rem; white-space: pre-wrap; font: .9rem/1.55 var(--body); max-height: 70vh; overflow: auto; margin: 0; }
@media (max-width: 1100px) { .quote-grid:has(.result) { grid-template-columns: 1fr 1fr; } .quote-grid:has(.result) .prose { grid-column: 1 / -1; } }
@media (max-width: 900px) {
  .quote-grid:has(.result), .rfp-grid { grid-template-columns: 1fr; }
  .rfp-out { position: static; }
}
@media (max-width: 640px) {
  .inv-row { grid-template-columns: 1fr 1fr; }
  .inv-row .field:nth-child(3) { grid-column: 1 / -1; }
  .law-table thead { display: none; }
  .law-table, .law-table tbody, .law-table tr, .law-table th, .law-table td { display: block; width: 100%; min-width: 0 !important; }
  .law-table tr { border-bottom: 3px solid var(--ink); padding: .4rem 0; }
  .law-table td { border: 0; padding: .2rem .9rem; }
  .law-table td::before { content: attr(data-l); display: block; font-weight: 700; font-size: .85rem; color: var(--steel); }
}

/* Comparison pages */
.cmp-table td, .cmp-table th { font-size: .93rem; }
.cmp-table tbody th { white-space: normal; min-width: 11rem; }
.cert { display: block; margin-bottom: .4rem; }
.grade { display: inline-block; margin-left: .35rem; padding: 0 .35rem; border: 1px solid var(--steel); border-radius: 3px; font-size: .75rem; font-weight: 700; color: var(--steel); line-height: 1.4; }
.lapsed { color: var(--err); }
.article-grid.flush { padding-top: 0; }
.stat-bars { display: grid; gap: .35rem; margin: 1rem 0 1.5rem; }
.stat-bar { display: grid; grid-template-columns: 9rem 1fr 2.5rem; gap: .6rem; align-items: center; font-size: .95rem; }
.stat-bar .bar { height: 1.1rem; background: var(--tag); border: 1px solid #c79c12; min-width: 2px; }
.stat-bar .n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .stat-bar { grid-template-columns: 6.5rem 1fr 2rem; } }

.form-note { background: #fff6d6; border-left: 4px solid var(--tag); padding: .7rem .9rem; margin: 0 0 1rem; font-size: .95rem; }
.scroll + p { margin-top: 1rem; }

.brand-tag { display: block; font-family: var(--body); font-weight: 400; font-size: .78rem; line-height: 1.2; color: #c9d4df; margin-top: .1rem; }
.footer .brand-tag { color: #a9b6c3; }
@media (max-width: 640px) { .masthead .brand-tag { display: none; } }

.mail-fallback { grid-column: 1 / -1; background: var(--card); border-top: 6px solid var(--tag); padding: 1.4rem 1.6rem; }
.mail-fallback .rfp-doc { border-top: 0; padding: 0; max-height: none; background: none; }
