/* Family Records Binder: a paper binder with tab dividers. Light and dark follow the device; the printout is plain. */
:root {
  --bg: #f5f1e8; --paper: #fffdf8; --ink: #1d262b; --muted: #5d666a; --line: #e2dacb; --soft: #efe8da;
  --accent: #1f4652; --accent-ink: #ffffff; --accent-soft: #e3eef0;
  --brass: #8a5f17; --brass-bg: #f5e8cc; --danger: #a3301c; --ok: #2b6a3d; --warn: #8a5600; --info: #2c5a86;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11171b; --paper: #192127; --ink: #ece6da; --muted: #a4aaa8; --line: #2b353b; --soft: #1f282e;
    --accent: #8ec4d2; --accent-ink: #0d181c; --accent-soft: #1d3138;
    --brass: #dcab5b; --brass-bg: #33291a; --danger: #ff9c86; --ok: #8fd3a0; --warn: #f0c46c; --info: #9fc4ee;
  }
}
:root[data-theme="dark"] {
  --bg: #11171b; --paper: #192127; --ink: #ece6da; --muted: #a4aaa8; --line: #2b353b; --soft: #1f282e;
  --accent: #8ec4d2; --accent-ink: #0d181c; --accent-soft: #1d3138;
  --brass: #dcab5b; --brass-bg: #33291a; --danger: #ff9c86; --ok: #8fd3a0; --warn: #f0c46c; --info: #9fc4ee;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 var(--sans); -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; overflow-wrap: anywhere; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; }
h1 { font-size: 1.75rem; margin: 6px 0 10px; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; margin: 18px 0 8px; }
h3 { font-size: 1.05rem; margin: 0 0 6px; }
p { margin: 6px 0; }
ul, ol { margin: 6px 0; padding-left: 22px; } li { margin: 4px 0; }
.small { font-size: .86rem; } .muted { color: var(--muted); } .pre { white-space: pre-wrap; }
.eyebrow { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brass); font-weight: 700; margin: 0; }
.lede { font-size: 1.05rem; }

/* ---------- top bar and tabs ---------- */
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-family: var(--serif); font-weight: 600; font-size: 1.08rem; min-width: 0; }
.brand span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mark { flex: 0 0 auto; width: 20px; height: 24px; border-radius: 3px 4px 4px 3px; background: var(--paper); border: 2px solid var(--accent); border-left: 6px solid var(--brass); }
.top-r { display: flex; gap: 6px; flex: 0 0 auto; }
.chip { background: var(--paper); color: var(--accent); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: .86rem; font-weight: 600; min-height: 36px; cursor: pointer; }
.chip.lock { color: var(--ink); }
main { padding: 12px 16px calc(96px + env(safe-area-inset-bottom)); max-width: 680px; margin: 0 auto; }
main.center { min-height: 70vh; display: flex; align-items: center; justify-content: center; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--paper); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; font-size: .74rem; color: var(--muted); text-decoration: none; }
.tabs a span { font-size: 1.25rem; line-height: 1; }
.tabs a.on { color: var(--accent); font-weight: 700; }

/* ---------- blocks ---------- */
.hero { padding: 18px 2px 6px; }
.hero h1 { font-size: 2.05rem; }
.hero.small h1 { font-size: 1.6rem; }
.cover { background: var(--accent); color: var(--accent-ink); border-radius: var(--r); padding: 18px 18px 14px; margin: 4px 0 14px; position: relative; overflow: hidden;
  border-left: 12px solid var(--brass); }
.cover .eyebrow { color: color-mix(in srgb, var(--accent-ink) 75%, var(--brass)); }
.cover h1 { margin: 4px 0 6px; }
.cover .small { opacity: .9; }
.cover .shared { margin-top: 8px; background: color-mix(in srgb, var(--accent-ink) 14%, transparent); border-radius: 10px; padding: 6px 10px; font-size: .9rem; }
.card { display: block; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 0 0 12px; color: var(--ink); text-decoration: none; }
.card h2:first-child { margin-top: 0; }
.action { display: flex; gap: 12px; align-items: flex-start; }
.action b { display: block; font-family: var(--serif); font-size: 1.1rem; }
.action .small { display: block; color: var(--muted); }
.action .ai { font-size: 1.5rem; line-height: 1.2; }
.action.first { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); }
.action.fund { border-color: color-mix(in srgb, var(--brass) 45%, var(--line)); background: var(--brass-bg); }
.sechead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.sechead h2 { margin: 0 0 6px; }
.stack { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 18px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.push { margin-left: auto; }
.textlink { text-align: center; padding: 6px; }
.tip { background: var(--soft); border-radius: 12px; padding: 10px 12px; font-size: .9rem; }
.empty { color: var(--muted); padding: 10px 2px; }
.how ul.checks, ul.checks { list-style: none; padding-left: 0; }
ul.checks li { position: relative; padding-left: 26px; }
ul.checks li::before { content: "✓"; position: absolute; left: 4px; top: 0; color: var(--ok); font-weight: 700; }

/* binder tab dividers: one color per section */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 16px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { position: relative; display: flex; flex-direction: column; gap: 2px; min-height: 104px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 12px 10px 16px; text-decoration: none; color: var(--ink); border-left: 7px solid var(--tab, var(--accent)); }
.tile .ti { font-size: 1.35rem; line-height: 1.1; }
.tile b { font-size: .95rem; line-height: 1.25; }
.tile .tc { margin-top: auto; font-size: .78rem; color: var(--muted); }
.sech { border-left: 7px solid var(--tab, var(--accent)); padding-left: 10px; }
.tab-people { --tab: #3f7f8c; } .tab-accounts { --tab: #4a6fa5; } .tab-retirement { --tab: #6b5ea8; } .tab-insurance { --tab: #a0567a; }
.tab-property { --tab: #b5653a; } .tab-estate { --tab: #8a5f17; } .tab-digital { --tab: #3c7d5a; } .tab-debts { --tab: #a64545; }
.tab-taxes { --tab: #5b6b3a; } .tab-wishes { --tab: #7a6f9b; } .tab-pets { --tab: #b08a2e; } .tab-places { --tab: #4f6b78; }

/* lists */
.list { margin: 10px 0 14px; }
.erow { display: flex; align-items: center; gap: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; text-decoration: none; color: var(--ink); }
.er-t, .bc-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.go { color: var(--muted); font-size: 1.2rem; flex: 0 0 auto; }
.bcard { display: flex; align-items: center; gap: 10px; }
.bcard.revoked { opacity: .85; }
.dl { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr); gap: 6px 12px; margin: 0; }
.dl dt { color: var(--muted); font-size: .88rem; }
.dl dd { margin: 0; }
ul.files { list-style: none; padding: 0; }
.fileopen { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; text-align: left; cursor: pointer; width: 100%; color: var(--ink); }

/* ---------- forms ---------- */
.form label { display: block; margin-bottom: 12px; font-size: .9rem; color: var(--muted); }
.form label > input, .form label > select, .form label > textarea, .form .masked { display: block; margin-top: 4px; width: 100%; color: var(--ink); font-size: 1rem; }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); min-height: 44px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.extra { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; margin-bottom: 8px; }
legend { font-family: var(--serif); font-weight: 600; font-size: 1.02rem; padding: 0; }
.masked { display: flex !important; align-items: center; gap: 6px; }
.masked > span { color: var(--muted); letter-spacing: .1em; flex: 0 0 auto; }
.masked input { flex: 1; min-width: 0; }
.hint { display: block; color: var(--muted); font-size: .82rem; margin-top: 4px; }
.form label.check, label.check { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); font-size: .95rem; }
label.check input { width: 22px; height: 22px; min-height: 0; margin-top: 2px; flex: 0 0 auto; accent-color: var(--accent); }
.xrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 40px; gap: 6px; margin-bottom: 8px; align-items: start; }
.xrow .err, .xrow .warn { grid-column: 1 / -1; }
.filerow { display: flex; gap: 6px; margin-bottom: 6px; }
.x { flex: 0 0 auto; width: 40px; min-height: 44px; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; cursor: pointer; color: var(--muted); }
.suggest { display: block; width: 100%; text-align: left; margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--accent) 50%, var(--line)); background: var(--accent-soft); cursor: pointer; color: var(--ink); }
.suggest .small { display: block; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 12px; padding: 11px 16px;
  font-weight: 600; text-decoration: none; text-align: center; min-height: 44px; cursor: pointer; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.big { display: flex; padding: 15px 16px; font-size: 1.05rem; }
.btn.wide { display: flex; width: 100%; margin-top: 6px; }
.btn.ghost, button.ghost, a.ghost { background: transparent; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 12px; padding: 10px 14px; min-height: 44px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.small.btn, .btn.small, button.ghost.small, .ghost.small { padding: 7px 12px; font-size: .88rem; min-height: 40px; }
.danger { color: var(--danger) !important; }
.back { display: inline-block; margin: 4px 0 4px; text-decoration: none; }

/* ---------- messages ---------- */
.flash { background: color-mix(in srgb, var(--ok) 14%, var(--paper)); border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--line)); border-radius: 12px; padding: 9px 12px; }
.err { display: block; color: var(--danger); font-size: .9rem; margin: 4px 0; }
.warn { display: block; color: var(--warn); font-size: .9rem; margin: 4px 0; }
.warnbox { background: var(--brass-bg); border: 1px solid color-mix(in srgb, var(--brass) 40%, var(--line)); border-radius: 12px; padding: 10px 12px; }
.busy { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite; flex: 0 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.foot { margin-top: 26px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; }

/* ---------- what to do first, funded, shares ---------- */
.firstdoc h1 { margin-top: 2px; }
.firstdoc h2 { border-bottom: 2px solid var(--line); padding-bottom: 4px; }
ol.steps > li { margin: 10px 0; padding-left: 4px; }
ol.steps ul { padding-left: 18px; }
ul.fund { list-style: none; padding: 0; }
.fitem { display: flex; gap: 10px; align-items: flex-start; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; color: var(--ink); text-decoration: none; }
.fitem > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fi { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .9rem; color: #fff; }
.fi.ok { background: var(--ok); } .fi.info { background: var(--info); } .fi.warn { background: var(--warn); } .fi.check { background: var(--muted); }
:root:not([data-theme="light"]) .fi { color: var(--bg); }
.fsum { font-weight: 600; }
.share { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.share > span { display: flex; flex-direction: column; min-width: 0; }
.result { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.give { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; margin: 10px 0; }
.give dt { color: var(--muted); }
.give dd { margin: 0; font-weight: 600; }
.give .code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 1.25rem; letter-spacing: .06em; }

/* ---------- viewer (an overlay in the page, never the browser's full screen) ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; background: color-mix(in srgb, var(--bg) 96%, #000); }
.ov-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px 16px; border-bottom: 1px solid var(--line); }
.ov-bar b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-stage { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 10px; }
.ov-stage img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; }
.ov-stage.zoom { display: block; }
.ov-stage.zoom img { max-width: none; max-height: none; cursor: zoom-out; }
.ov-stage iframe { width: 100%; height: 100%; border: 0; background: #fff; border-radius: 8px; }
.ov-file { text-align: center; }
.ov-tools { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }

/* ---------- the printed binder ---------- */
.binderdoc { margin-top: 16px; }
.pcover { background: var(--paper); border: 1px solid var(--line); border-left: 12px solid var(--brass); border-radius: var(--r); padding: 18px; margin-bottom: 16px; }
.pcover h1 { font-size: 2rem; }
.pcover .big { font-size: 1.1rem; font-weight: 600; }
.pwarn { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: .9rem; }
.toc li { margin: 2px 0; }
.psec h2 { border-bottom: 2px solid var(--line); padding-bottom: 4px; }
.pentry { border-bottom: 1px solid var(--line); padding: 8px 0 10px; }
.pbreak { margin-top: 20px; }
.printonly { display: none; }


/* yearly review, Checklists links, attorney-review note (11/2/2026) */
.action.due { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); background: var(--brass-bg); }
.action.due b { color: var(--ink); }
.rday { gap: 12px; } .rday label { flex: 1 1 120px; min-width: 0; }
.rstatus { margin-top: 14px; }
ul.rlist { list-style: none; padding: 0; margin: 8px 0 12px; }
.ritem { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ritem:last-child { border-bottom: 0; }
.ritem > a { align-self: flex-end; padding: 4px 0; }
.cl h2 { margin-top: 0; }
ul.cl-links { padding-left: 20px; } ul.cl-links li { margin: 6px 0; }
.legalnote { display: block; background: var(--brass-bg); border: 2px dashed color-mix(in srgb, var(--brass) 70%, var(--line)); border-radius: 12px; padding: 10px 12px; margin: 10px 0 12px; }
.legalnote b { display: block; color: var(--brass); }
.legalnote span { display: block; font-size: .9rem; }
.legalline { color: var(--brass); font-size: .92rem; }
@media print {
  :root { --bg: #fff; --paper: #fff; --ink: #000; --muted: #444; --line: #bbb; --accent: #1f4652; --brass: #8a5f17; }
  html, body { background: #fff; color: #000; font-size: 11.5pt; }
  .top, .tabs, .noprint, .flash, .back, .tip, .foot, .overlay { display: none !important; }
  main { padding: 0; max-width: none; }
  .card, .pcover, .fitem { border-color: #bbb; box-shadow: none; }
  .pcover { border-left-width: 10px; min-height: 85vh; }
  .pbreak { break-before: page; margin-top: 0; }
  .pentry, .fitem, ol.steps > li { break-inside: avoid; }
  .psec h2 { break-after: avoid; }
  a { color: inherit; text-decoration: none; }
  .legalnote { border-color: #8a5f17; background: #fff; }
  .fi { color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
