/* One theme only: an old-library look, with deep green leather and gold leaf. */
:root {
  color-scheme: dark;
  --bg: #111815;
  --surface: #18211d;
  --surface-2: #1f2a25;
  --text: #ede6d6;
  --muted: #a39d8c;
  --border: #2c3833;
  --accent: #d4af6a;
  --accent-ink: #1b1508;
  --accent-soft: rgba(212, 175, 106, .12);
  --green: #7fb8a4;
  --green-soft: rgba(127, 184, 164, .14);
  --link: #9fd0bd;
  --beginner: #8fd1a4;
  --intermediate: #e6b465;
  --advanced: #e79bbb;
  --map-fill: #24302b;
  --foil: linear-gradient(100deg, #f5e6bd 0%, #d4af6a 38%, #a7803e 58%, #f0d79c 100%);
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .28);
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--sans); }
/* faint paper grain over everything */
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin: .2em 0 .3em; }
h2 { font-size: 1.5rem; margin: 1.6em 0 .5em; }
h3 { font-size: 1.15rem; margin: 0 0 .4em; }
a { color: var(--link); text-underline-offset: 2px; }
img { max-width: 100%; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px; z-index: 10; }

/* Header */
.site-header { background: rgba(17, 24, 21, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, rgba(212, 175, 106, .55), transparent); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.logo { font-family: var(--serif); font-weight: 700; font-size: 1.35rem; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo-mark { color: var(--accent); flex: none; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: .95rem; }
.site-nav a:hover { background: var(--surface-2); }
.site-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 6px 12px; font: inherit; }
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--surface); flex-direction: column; padding: 8px 16px 16px; border-bottom: 1px solid var(--border); }
  .site-nav.open { display: flex; }
}

/* Hero */
.hero { padding: 56px 0 48px; border-bottom: 1px solid var(--border);
  background: radial-gradient(ellipse 55% 75% at 76% 50%, rgba(212, 175, 106, .12), transparent 70%),
              radial-gradient(ellipse 50% 60% at 5% 0%, rgba(127, 184, 164, .10), transparent 70%), var(--bg); }
.hero h1 { font-size: clamp(2.4rem, 6.5vw, 3.8rem); max-width: 13ch; background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { font: 600 .78rem var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin: 0; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }
.state-jump { margin-top: 24px; max-width: 520px; }
.state-jump label { font-weight: 600; display: block; margin-bottom: 8px; }
.jump-row { display: flex; gap: 8px; }
select, .search { font: inherit; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); width: 100%; }
.search { max-width: 520px; margin-top: 8px; }
.stats { color: var(--muted); margin-top: 20px; font-size: .95rem; }
.stats strong { color: var(--text); }

.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: var(--radius); padding: 10px 20px; font: 600 1rem var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }

/* Layout */
.page-head { padding-top: 32px; padding-bottom: 8px; }
.section { margin: 40px 0; }
.grid { display: grid; gap: 16px; }
.grid.three { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; padding-bottom: 48px; }
@media (max-width: 900px) { .with-sidebar { grid-template-columns: 1fr; } }
.sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 80px; }
@media (max-width: 900px) { .sidebar { position: static; } }

.card, .panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.panel { margin-bottom: 20px; }
.panel h2 { margin-top: 0; }
.panel.tip { background: var(--accent-soft); border-color: transparent; }
.card p { margin: .3em 0 .6em; color: var(--muted); }
.level-card, .article-card { text-decoration: none; color: var(--text); display: block; transition: transform .2s, border-color .2s, box-shadow .2s; }
.level-card:hover, .article-card:hover { transform: translateY(-3px); border-color: rgba(212, 175, 106, .5); box-shadow: var(--shadow), 0 0 0 1px rgba(212, 175, 106, .15), 0 0 28px rgba(212, 175, 106, .08); }
.section > h2::after { content: ""; display: block; width: 56px; height: 2px; margin-top: 10px; background: linear-gradient(90deg, var(--accent), transparent); }
.arrow { font-weight: 600; color: var(--accent); }
.article-card h3 a { color: var(--text); text-decoration: none; }
.article-card h3 a:hover { color: var(--link); }
.meta { color: var(--muted); font-size: .88rem; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }

.level { display: inline-block; font: 600 .75rem var(--sans); letter-spacing: .04em; text-transform: uppercase; padding: 3px 10px; border-radius: 99px; margin-bottom: 8px; }
.level-beginner { color: var(--beginner); background: color-mix(in srgb, var(--beginner) 14%, transparent); }
.level-intermediate { color: var(--intermediate); background: color-mix(in srgb, var(--intermediate) 14%, transparent); }
.level-advanced { color: var(--advanced); background: color-mix(in srgb, var(--advanced) 14%, transparent); }
h2 .level { font-size: .9rem; }

/* Links */
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list .link-item { padding: 12px 0; border-top: 1px solid var(--border); }
.link-list .link-item:first-child { border-top: 0; }
.grid.two .link-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); }
.link-item a { font-weight: 600; }
.link-item p { margin: 2px 0 0; color: var(--muted); font-size: .95rem; }
.badge { font: 600 .7rem var(--sans); text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px; margin-left: 8px; vertical-align: 2px; }
.badge-free { background: var(--green-soft); color: var(--green); }
.badge-paid { background: var(--surface-2); color: var(--muted); }
.badge-fee { background: color-mix(in srgb, var(--intermediate) 14%, transparent); color: var(--intermediate); }
.plain { padding-left: 1.1em; margin: 0; }
.plain li { margin: 6px 0; }
.toc a { display: block; padding: 4px 0; font-size: .95rem; }

/* States */
.facts { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0 0; }
.facts div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 16px; }
.facts dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 16px 0 32px; }
.state-tile { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); font-weight: 500; }
.state-tile:hover { border-color: var(--accent); }
.abbr { font: 700 .8rem var(--sans); background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 4px 6px; min-width: 34px; text-align: center; }

/* Articles */
.prose { font-size: 1.06rem; }
.prose p, .prose li { max-width: 68ch; }
.prose table { border-collapse: collapse; width: 100%; font-size: .95rem; margin: 1em 0; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { background: var(--surface-2); }
.callout { background: var(--accent-soft); border-left: 4px solid var(--accent); padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.5em 0; max-width: 68ch; }
.prose .meta + p::first-letter { float: left; font: 700 3.6em/.82 var(--serif); margin: .08em .12em 0 0; background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
.note { background: var(--surface-2); padding: 10px 14px; border-radius: var(--radius); font-size: .95rem; }
.next { display: inline-block; margin-top: 24px; font-weight: 600; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chip { font: 500 .95rem var(--sans); padding: 6px 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Ads */
.ad { margin: 24px 0; }
.ad-placeholder { border: 2px dashed var(--border); border-radius: var(--radius); color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; display: flex; align-items: center; justify-content: center; }
.ad-leaderboard.ad-placeholder { min-height: 90px; }
.ad-in-content.ad-placeholder, .ad-in-article.ad-placeholder { min-height: 250px; }
.ad-sidebar.ad-placeholder { min-height: 250px; margin: 0; }

/* Footer */
.site-footer { background: #0c110f; border-top: 1px solid var(--border); padding: 32px 0; margin-top: 48px; font-size: .95rem; }
.footer-inner { display: grid; gap: 12px; }
.footer-inner nav { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-inner p { margin: 4px 0; color: var(--muted); }
.fineprint { font-size: .85rem; }

/* Graphics */
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 32px; align-items: center; }
.hero-art { margin: 0; text-align: center; }
.hero-art figcaption { color: var(--muted); font-size: .9rem; margin-top: 8px; }
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { max-width: 420px; margin: 0 auto; }
}
/* Growing family tree: branches draw in, ancestors light up generation by generation */
.tree { width: 100%; height: auto; overflow: visible; }
.tree .branch, .tree .root { fill: none; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s ease-out forwards; animation-delay: var(--d); }
.tree .branch { stroke: url(#bark); }
.tree .root { stroke: var(--muted); opacity: .35; }
.tree .leaf { fill: var(--green); opacity: 0; animation: fade-leaf .8s ease-out forwards; animation-delay: var(--d); }
.tree .node { fill: #e9cf94; opacity: 0; transform-box: fill-box; transform-origin: center; filter: drop-shadow(0 0 5px rgba(232, 200, 130, .7));
  animation: pop .5s cubic-bezier(.3, 1.6, .5, 1) forwards, twinkle 4.5s ease-in-out infinite; animation-delay: var(--d), calc(var(--d) + 1s + var(--t)); }
.tree .node.unknown { fill: var(--bg); stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 2 2; filter: none; animation: pop .5s ease-out forwards; animation-delay: var(--d); }
.tree .node.you { fill: var(--text); filter: drop-shadow(0 0 10px rgba(237, 230, 214, .5)); animation: pop .6s ease-out forwards; animation-delay: var(--d); }
.tree .gen { fill: var(--muted); font: 600 9.5px var(--sans); letter-spacing: .14em; text-transform: uppercase; opacity: 0; animation: fade .8s ease-out forwards; animation-delay: var(--d); }
.tree .you-label { fill: var(--text); font: 600 13px var(--sans); opacity: 0; animation: fade .8s ease-out forwards; animation-delay: var(--d); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
@keyframes fade { to { opacity: 1; } }
@keyframes fade-leaf { to { opacity: .5; } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) {
  .tree * { animation: none !important; opacity: 1 !important; stroke-dashoffset: 0 !important; }
  .tree .root { opacity: .35 !important; } .tree .leaf { opacity: .5 !important; }
}

/* Big-number fact band */
.fact-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; margin: 48px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.fact { padding: 28px 24px; border-left: 1px solid var(--border); }
.fact:first-child { border-left: 0; }
.fact b { display: block; font: 700 3rem/1 var(--serif); background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 10px; }
.fact span { color: var(--muted); font-size: .95rem; }
@media (max-width: 600px) { .fact { border-left: 0; border-top: 1px solid var(--border); } .fact:first-child { border-top: 0; } }

.level-icon { display: block; margin-bottom: 10px; }
.level-head { display: flex; align-items: center; gap: 10px; }
.level-head .level-icon { margin: 0; }
.section > h2.level-head { flex-wrap: wrap; }
.section > h2.level-head::after { flex-basis: 100%; margin-top: 4px; background: linear-gradient(90deg, var(--accent), transparent) no-repeat 0 0 / 56px 2px; }
.level-icon-beginner { color: var(--beginner); }
.level-icon-intermediate { color: var(--intermediate); }
.level-icon-advanced { color: var(--advanced); }

.cat-head { display: flex; align-items: center; gap: 12px; }
.cat-icon { color: var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 6px; width: 42px; height: 42px; flex: none; }
.toc a { display: flex; align-items: center; gap: 8px; }
.toc-icon { color: var(--accent); flex: none; }

.map-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-top: 16px; }
.us-map { width: 100%; height: auto; display: block; }
.us-map path { fill: var(--map-fill); stroke: var(--bg); stroke-width: 1.2; transition: fill .15s, filter .15s; }
.us-map a:hover path, .us-map a:focus path { fill: var(--accent); filter: drop-shadow(0 0 8px rgba(212, 175, 106, .55)); }
.us-map a:focus { outline: none; }
.map-hint { color: var(--muted); font-size: .9rem; text-align: center; margin: 8px 0 0; }

.state-head { position: relative; }
.state-shape { position: absolute; right: 16px; top: 40px; width: 200px; height: 170px; }
.state-shape path { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.state-head h1, .state-head .lede { padding-right: 230px; }
@media (max-width: 760px) {
  .state-shape { position: static; display: block; width: 120px; height: 100px; margin: 8px 0; }
  .state-head h1, .state-head .lede { padding-right: 0; }
}

[hidden] { display: none !important; }

/* Search + topics */
.nav-search { display: inline-flex; align-items: center; gap: 6px; }
.search-form { display: flex; gap: 8px; max-width: 560px; margin-top: 14px; }
.search-form .search { margin: 0; flex: 1; min-width: 0; }
.hero .search-form { margin-top: 12px; }
.topic-cloud, .tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags { align-items: center; margin: 32px 0 8px; padding-top: 18px; border-top: 1px solid var(--border); }
.tags > span { color: var(--muted); font-size: .9rem; margin-right: 4px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font: 500 .9rem var(--sans); }
.tag:hover { border-color: var(--accent); color: var(--accent); }
.tag b { font-weight: 600; color: var(--muted); font-size: .8rem; }
.topic-card { text-decoration: none; color: var(--text); }
.topic-card h3 { color: var(--accent); }
.chip span:empty { display: none; }
.chip span { opacity: .7; font-size: .85em; }
.search-status { color: var(--muted); margin: 8px 0 4px; }
.results { list-style: none; padding: 0; margin: 0 0 32px; }
.result { padding: 16px 0; border-bottom: 1px solid var(--border); }
.result > a { font: 600 1.15rem var(--serif); color: var(--link); text-decoration: none; }
.result > a:hover { text-decoration: underline; }
.result p { margin: 4px 0 0; color: var(--muted); }
.result-type { display: block; font: 600 .72rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.result-type.result-resource { color: var(--green); }
.result mark, .result-type mark { background: var(--accent-soft); color: var(--text); border-radius: 3px; padding: 0 2px; }

/* Printable forms: a white letter-size sheet on screen, the only thing that prints */
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.form-actions .hint { color: var(--muted); font-size: .9rem; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.sheet-scroll { overflow-x: auto; padding-bottom: 12px; }
.sheet { background: #fff; color: #1a1a1a; margin: 8px auto 24px; padding: .4in; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); border-radius: 2px;
  font: 11px/1.35 Georgia, "Times New Roman", serif; box-sizing: border-box; }
.sheet-portrait { width: 8.5in; min-height: 11in; }
.sheet-landscape { width: 11in; min-height: 8.5in; }
.sheet h2 { font: 700 22px Georgia, serif; margin: 0; color: #1a1a1a; }
.sheet h2::after { display: none; }
.sheet h3 { font: 700 13px Georgia, serif; margin: 14px 0 6px; color: #1a1a1a; text-transform: uppercase; letter-spacing: .06em; }
.sheet h3 small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.sheet-head { display: flex; gap: 24px; align-items: flex-end; border-bottom: 2px solid #1a1a1a; padding-bottom: 8px; margin-bottom: 12px; }
.sheet-head h2 { flex: 0 0 auto; }
.sheet-meta { flex: 1; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.sheet-meta .line { flex: 1 1 30%; }
.line { display: flex; align-items: flex-end; gap: 5px; min-height: 18px; }
.line-label { white-space: nowrap; color: #444; font-size: 10px; }
.line.full { width: 100%; }
.fill { flex: 1; min-width: 30px; border-bottom: 1px solid #888; min-height: 15px; outline: none; color: #0b3d91; font-family: "Segoe Print", "Bradley Hand", cursive, Georgia; }
.fill:focus, .form-table .cell:focus, .notes:focus { background: #fff8e1; }
.form-table .cell { min-height: 16px; height: 100%; outline: none; overflow: hidden; }
.form-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.form-table th { border: 1px solid #444; background: #f1ede4; font: 600 9px/1.15 Georgia, serif; padding: 3px; color: #1a1a1a; vertical-align: bottom; }
.form-table td { border: 1px solid #777; height: 24px; padding: 2px 4px; font-size: 10px; color: #0b3d91; outline: none; overflow: hidden; }
.form-table.vertical th:not(.wide) { height: 1.45in; }
.form-table.vertical th span { writing-mode: vertical-rl; transform: rotate(180deg); display: inline-block; text-align: left; max-height: 1.4in; }
.form-table.vertical td { height: 21px; }
.legend { font-size: 10px; color: #444; margin: 8px 0 0; }
.sheet-foot { font-size: 9px; color: #888; text-align: right; margin: 6px 0 0; }
.notes { border: 1px solid #777; min-height: 1.1in; padding: 4px; outline: none; color: #0b3d91; }
.fg-person { border: 1px solid #999; padding: 6px 10px 8px; margin-bottom: 8px; }
.fg-person h3 { margin-top: 0; }
.event { display: grid; grid-template-columns: 1fr 1.4fr; gap: 0 16px; }
.event.marriage { margin: 4px 0 2px; }

/* pedigree: four columns plus continuation numbers, connected with bracket lines */
.pedigree { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr .45fr; column-gap: 26px; height: 6.55in; }
.pcol { display: flex; flex-direction: column; }
.pgroup { flex: 1; display: flex; flex-direction: column; position: relative; }
.pgroup:not(.single)::before { content: ""; position: absolute; left: -13px; top: 25%; bottom: 25%; border-left: 1.2px solid #444; }
.slot, .pgroup.single { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.person { border: 1px solid #555; border-radius: 3px; padding: 3px 6px 4px; position: relative; background: #fff; }
.person.small { padding: 2px 5px 3px; }
.person .line { min-height: 15px; }
.person .fill { min-height: 13px; }
.pcol:not(:first-child) .person::before { content: ""; position: absolute; left: -14px; top: 50%; width: 13px; border-top: 1.2px solid #444; }
.pcol:not(:nth-last-child(-n+2)) .person::after { content: ""; position: absolute; right: -14px; top: 50%; width: 13px; border-top: 1.2px solid #444; }
.pname { display: flex; gap: 5px; align-items: flex-end; font-weight: 700; }
.pname b { font-size: 10px; color: #555; }
.pname .fill { font-weight: 400; }
.conts { justify-content: space-around; }
.cont { display: flex; align-items: flex-end; gap: 4px; font-size: 9.5px; color: #444; white-space: nowrap; }
.cont .line { flex: 1; min-height: 14px; }

@media print {
  body { background: #fff !important; }
  body::before, .site-header, .site-footer, .no-print, .ad, .skip { display: none !important; }
  .sheet-scroll { overflow: visible; padding: 0; max-width: none; }
  .sheet { box-shadow: none; margin: 0; padding: 0; width: auto; min-height: 0; border-radius: 0; }
  .fill, .form-table td, .notes { color: #0b3d91; }
  .fill:focus, .form-table .cell:focus { background: none; }
}

.record-dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 0 0 12px; }
.record-dates div { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; }
.record-dates dt { color: var(--muted); font-size: .85rem; }
.record-dates dd { margin: 2px 0 0; font: 700 1.35rem var(--serif); color: var(--accent); }
.prose blockquote { margin: 16px 0; padding: 14px 18px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 var(--radius) var(--radius) 0; font-family: var(--serif); font-style: italic; }
.search-more { margin: 0 0 32px; }

/* Reference Shelf */
.ref-table { width: 100%; border-collapse: collapse; margin: 14px 0 24px; font-size: .97rem; }
.ref-table th, .ref-table td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.ref-table thead th { color: var(--muted); font: 600 .8rem var(--sans); text-transform: uppercase; letter-spacing: .06em; border-bottom: 2px solid var(--border); }
.ref-table tbody th { color: var(--accent); font-family: var(--serif); font-weight: 600; width: 32%; }
.ref-table tr[hidden] { display: none; }
.reference .search { margin-bottom: 4px; }
.calc { margin: 8px 0 20px; }
.calc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 10px 0; }
.calc-row label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
.calc-half { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .95rem; }
.calc-result { font: 700 1.5rem/1.3 var(--serif); color: var(--accent); margin: 16px 0 4px; }
.calc-cm { color: var(--muted); margin: 0; }
@media (max-width: 600px) { .calc-row { grid-template-columns: 1fr; } .ref-table tbody th { width: 40%; } }
