/* Adams Guide (Claude Ed.) — "pastor's study" palette: parchment, iron-gall ink, oxblood, brass */
:root {
  --paper: #f5f0e5; --sheet: #fffdf8; --sheet2: #faf5ea;
  --ink: #1f2a37; --ink2: #3c4756; --mute: #6b7280; --rule: #ddd3bf; --rule2: #e9e1cf;
  --ox: #8a2b2b; --ox2: #a83a36; --brass: #a8843d; --teal: #22585a; --sage: #4c6b3c; --plum: #5b3456;
  --good: #2f6b3a; --bad: #9b2c2c;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 10px; --sh: 0 1px 2px rgba(31,42,55,.06), 0 4px 18px rgba(31,42,55,.06);
  --mastH: 58px; --navW: 290px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.62 var(--serif); overflow-x: hidden; }
a { color: var(--ox); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ox2); }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* ---------- masthead ---------- */
.mast { position: sticky; top: 0; z-index: 30; height: var(--mastH); display: flex; align-items: center; gap: 14px; padding: 0 18px; background: var(--ink); color: #f1ead9; border-bottom: 3px solid var(--brass); }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.seal { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--ox); color: #f6e7c4; font-size: 18px; box-shadow: inset 0 0 0 2px #c79c4f; flex: none; }
.bt { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.bt b { font-size: 19px; letter-spacing: .02em; }
.bt small { font: 11px/1.3 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: #c8bfa8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search { margin-left: auto; display: flex; background: #2b3747; border-radius: 999px; overflow: hidden; border: 1px solid #3a4758; }
.search input { background: transparent; border: 0; padding: 7px 14px; width: 300px; color: #f1ead9; font: 14px var(--ui); outline: none; }
.search input::placeholder { color: #9aa3ae; }
.search button { background: transparent; border: 0; color: #d8c79b; padding: 0 12px; cursor: pointer; font-size: 17px; }
.menu { display: none; background: none; border: 0; width: 38px; height: 38px; padding: 8px 6px; cursor: pointer; flex: none; }
.menu span { display: block; height: 2px; background: #f1ead9; margin: 5px 0; border-radius: 2px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--navW) minmax(0, 1fr); min-height: calc(100vh - var(--mastH)); }
.nav { position: sticky; top: var(--mastH); height: calc(100vh - var(--mastH)); overflow-y: auto; padding: 18px 10px 40px 16px; border-right: 1px solid var(--rule); background: #efe8d8; font: 14px/1.35 var(--ui); }
.nav a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--ink2); text-decoration: none; }
.nav a:hover { background: #e5dcc6; color: var(--ink); }
.nav a.on { background: var(--ink); color: #f6eedb; }
.nav-home { font-weight: 600; }
.nav-group { margin-top: 16px; }
.nav-h { font: 600 11px/1.2 var(--ui); text-transform: uppercase; letter-spacing: .1em; color: var(--ox); padding: 4px 10px 6px; display: flex; gap: 8px; align-items: baseline; }
.nav-h .rn { font-family: var(--serif); font-size: 13px; color: var(--brass); }
.view { padding: 28px clamp(16px, 4vw, 52px) 60px; min-width: 0; outline: none; max-width: 1180px; }
.scrim { display: none; }

/* ---------- typography ---------- */
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; color: var(--ink); }
h1 { font-size: clamp(28px, 4vw, 42px); margin: 6px 0 10px; font-weight: 600; letter-spacing: -.01em; }
h1 em { color: var(--ox); font-style: italic; font-weight: 500; }
.eyebrow { font: 600 12px/1.3 var(--ui); text-transform: uppercase; letter-spacing: .12em; color: var(--brass); margin: 0; }
.lede { font-size: 19px; color: var(--ink2); max-width: 760px; margin: 0 0 8px; }
.sec { font-size: 21px; margin: 34px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--rule); position: relative; }
.sec::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 56px; height: 3px; background: var(--ox); }
.muted { color: var(--mute); } .small { font-size: 13px; }
.note { font: 14.5px/1.5 var(--ui); color: var(--ink2); background: var(--sheet2); border-left: 3px solid var(--brass); padding: 8px 12px; border-radius: 0 6px 6px 0; }
code { font-size: 12px; background: var(--rule2); padding: 1px 5px; border-radius: 4px; }
.page-h { padding-bottom: 14px; margin-bottom: 8px; border-bottom: 1px double var(--rule); }
.page-tools, .row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---------- buttons, chips ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid #c9bc9f; background: var(--sheet); color: var(--ink); font: 600 14px var(--ui); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink2); color: var(--ink); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.primary { background: var(--ox); border-color: var(--ox); color: #fff8ec; }
.btn.primary:hover { background: var(--ox2); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: #e1b7b2; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font: 500 12.5px/1.2 var(--ui); padding: 5px 10px; border-radius: 999px; text-decoration: none; border: 1px solid; }
.chip .glyph { opacity: .8; }
.chip-topic { color: var(--ox); border-color: #e3c4bd; background: #fbf1ee; }
.chip-diagram { color: var(--teal); border-color: #bcd6d4; background: #eef6f5; }
.chip-form { color: var(--sage); border-color: #c9d8bd; background: #f2f7ee; }
.chip-reference { color: var(--plum); border-color: #dac6d6; background: #f7eff5; }
.chip:hover { filter: brightness(.96); }
a.mini { font: 500 12px var(--ui); color: var(--ox); background: #fbf1ee; padding: 2px 8px; border-radius: 999px; text-decoration: none; margin-left: 6px; white-space: nowrap; }
a.plain { color: var(--ox); }
a.plain .glyph { display: none; }

/* ---------- home ---------- */
.hero { padding: 26px 0 10px; }
.hero h1 { font-size: clamp(32px, 5.2vw, 56px); max-width: 15em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.strand { position: relative; display: block; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 18px 18px 16px; text-decoration: none; color: var(--ink); box-shadow: var(--sh); transition: transform .15s; }
.strand:hover { transform: translateY(-2px); color: var(--ink); }
.strand .rn { position: absolute; right: 14px; top: 8px; font-size: 34px; color: var(--rule); font-weight: 700; }
.strand h3 { margin: 0 0 6px; color: var(--ox); font-size: 21px; }
.strand p { margin: 0 0 10px; font-size: 15.5px; color: var(--ink2); }
.vref { font: 600 12px var(--ui); color: var(--brass); letter-spacing: .04em; }
.parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.part-card { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px 18px; position: relative; box-shadow: var(--sh); }
.part-rn { position: absolute; right: 16px; top: 8px; font-size: 40px; color: #eadfc8; font-weight: 700; }
.part-card h3 { margin: 0 0 4px; font-size: 20px; }
.part-card p { margin: 0 0 8px; color: var(--mute); font-size: 15px; }
.part-card ul { margin: 0; padding-left: 18px; columns: 2; column-gap: 18px; font-size: 15px; }
.part-card li { break-inside: avoid; margin-bottom: 3px; }
.toolgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.toolcard { display: flex; flex-direction: column; background: var(--sheet); border: 1px solid var(--rule); border-top: 4px solid var(--teal); border-radius: var(--r); padding: 12px 14px; text-decoration: none; color: var(--ink); box-shadow: var(--sh); }
.toolcard.k-form { border-top-color: var(--sage); } .toolcard.k-reference { border-top-color: var(--plum); }
.toolcard:hover { color: var(--ink); background: #fff; }
.toolcard .kind { font: 600 11px var(--ui); text-transform: uppercase; letter-spacing: .1em; color: var(--mute); }
.toolcard h4 { margin: 4px 0 4px; font-size: 17px; }
.toolcard p { margin: 0 0 8px; font-size: 14px; color: var(--ink2); flex: 1; }
.toolcard .meta { font: 12px var(--ui); color: var(--brass); }
.privacy-note { margin-top: 30px; background: #eef3ee; border: 1px solid #cfdccc; border-radius: var(--r); padding: 12px 16px; font: 14.5px/1.5 var(--ui); }

/* ---------- contents ---------- */
.toc-part h2 { font-size: 22px; margin: 30px 0 8px; display: flex; gap: 10px; align-items: baseline; }
.toc-part .rn { font: 600 12px var(--ui); text-transform: uppercase; letter-spacing: .12em; color: var(--brass); }
.toc { list-style: none; padding: 0; margin: 0; counter-reset: t; }
.toc li { padding: 12px 0 12px 40px; border-bottom: 1px dotted var(--rule); position: relative; counter-increment: t; }
.toc li::before { content: counter(t); position: absolute; left: 0; top: 12px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--rule2); color: var(--ink2); font: 600 13px var(--ui); }
.toc-t { font-size: 19px; font-weight: 600; text-decoration: none; }
.toc p { margin: 2px 0 0; color: var(--ink2); font-size: 15.5px; }

/* ---------- topic ---------- */
.topic-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 34px; }
.topic-main p { max-width: 74ch; }
.principles { padding-left: 22px; } .principles li { margin-bottom: 6px; } .principles li::marker { color: var(--ox); font-weight: 700; }
.verses { display: grid; gap: 12px; }
.verse { margin: 0; background: var(--sheet); border: 1px solid var(--rule); border-left: 4px solid var(--ox); border-radius: 0 var(--r) var(--r) 0; padding: 12px 16px; box-shadow: var(--sh); }
.verse blockquote { margin: 0; font-style: italic; font-size: 17px; color: #2b3542; }
.verse figcaption { margin-top: 6px; font: 600 13px var(--ui); }
.verse figcaption a { text-decoration: none; }
.verse .kjv { font-size: 10px; letter-spacing: .12em; color: var(--brass); border: 1px solid #e0cfa6; border-radius: 3px; padding: 0 4px; margin-left: 4px; }
.verse.compact { padding: 9px 13px; margin: 12px 0; } .verse.compact blockquote { font-size: 15.5px; }
.pairs { width: 100%; border-collapse: collapse; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; font-size: 15.5px; margin-bottom: 10px; }
.pairs th { text-align: left; font: 600 12px var(--ui); text-transform: uppercase; letter-spacing: .08em; background: var(--ink); color: #f1ead9; padding: 8px 12px; }
.pairs td:last-child { white-space: nowrap; }
@media (max-width: 640px) { .pairs { font-size: 14px; } .pairs td, .pairs th { padding: 7px 8px; } .pairs td:last-child { white-space: normal; } }
.pairs td { padding: 9px 12px; border-top: 1px solid var(--rule2); vertical-align: top; }
.pairs td:first-child { color: var(--bad); text-decoration: line-through; text-decoration-color: rgba(155,44,44,.4); }
.pairs td:nth-child(2) { color: var(--good); font-weight: 600; }
.hw { padding-left: 20px; }
.sources .src { display: inline-block; font: 13.5px var(--ui); background: var(--sheet2); border: 1px solid var(--rule); padding: 4px 10px; border-radius: 6px; margin: 0 6px 6px 0; }
.topic-side { position: sticky; top: calc(var(--mastH) + 20px); align-self: start; display: grid; gap: 14px; }
.side-box { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--sh); }
.side-box h3 { margin: 0 0 8px; font: 600 12px var(--ui); text-transform: uppercase; letter-spacing: .1em; color: var(--mute); }
.stack { display: grid; gap: 5px; }
.side-link { display: flex; gap: 8px; align-items: baseline; font: 500 14px/1.3 var(--ui); text-decoration: none; padding: 6px 8px; border-radius: 6px; color: var(--ink); border-left: 3px solid var(--ox); background: var(--sheet2); }
.side-link.k-diagram { border-left-color: var(--teal); } .side-link.k-form { border-left-color: var(--sage); } .side-link.k-reference { border-left-color: var(--plum); }
.side-link:hover { background: #fff; color: var(--ox); }
.side-link small { color: var(--mute); margin-left: auto; white-space: nowrap; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--rule); font: 15px var(--ui); }
.pager a { text-decoration: none; }

/* ---------- tool pages ---------- */
.tool-h.k-diagram .eyebrow { color: var(--teal); } .tool-h.k-form .eyebrow { color: var(--sage); } .tool-h.k-reference .eyebrow { color: var(--plum); }
.linked { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.linked .lbl { font: 600 12px var(--ui); color: var(--mute); text-transform: uppercase; letter-spacing: .08em; margin-right: 4px; }
.tool-body { margin-top: 18px; }
.card { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--sh); margin: 14px 0; }
.filter-note { font: 14px var(--ui); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar input[type=search] { flex: 1 1 220px; padding: 9px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--sheet); font: 15px var(--ui); }

/* ---------- diagrams ---------- */
.dgm-ctrl { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 14px; font: 14px var(--ui); }
.seg { display: inline-flex; border: 1px solid #c9bc9f; border-radius: 9px; overflow: hidden; background: var(--sheet); flex-wrap: wrap; }
.segb { border: 0; background: transparent; padding: 7px 14px; cursor: pointer; font: 600 13px var(--ui); color: var(--ink2); border-right: 1px solid var(--rule2); }
.segb:last-child { border-right: 0; }
.segb.on { background: var(--ink); color: #f6eedb; }
.stepper { display: inline-flex; align-items: center; gap: 10px; }
.stepper span { font: 600 13px var(--ui); color: var(--mute); min-width: 86px; text-align: center; }
.dgm-wrap { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px; box-shadow: var(--sh); }
.dgm-wrap.two { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.dgm-wrap svg { width: 100%; height: auto; display: block; }
.dgm-side h3 { margin: 4px 0 8px; font-size: 20px; }
.dgm-side h3.bad { color: var(--bad); } .dgm-side h3.good { color: var(--good); }
.dgm-side .q { font-style: italic; color: var(--ink2); }
.dgm-side label { display: block; font: 600 13px var(--ui); margin: 10px 0 4px; }
.dgm-side textarea { width: 100%; border: 1px solid var(--rule); border-radius: 8px; padding: 8px 10px; background: #fff; font: 15px var(--ui); }
.dgm-side .ex { font-size: 15.5px; }
.dgm-note { margin-top: 18px; padding: 4px 0; color: var(--ink2); }
.dgm-note.warn { background: #fbefec; border: 1px solid #ecc7c0; border-radius: var(--r); padding: 12px 16px; font: 14.5px/1.5 var(--ui); color: #5e1e1e; }
.good { color: var(--good); } .bad { color: var(--bad); }

/* spiral */
.sp-base { fill: none; stroke: #e3d9c4; stroke-width: 6; stroke-linecap: round; }
.sp-lit { fill: none; stroke-width: 6; stroke-linecap: round; transition: d .3s; }
.sp-lit.down { stroke: var(--bad); } .sp-lit.up { stroke: var(--good); }
.sp-cap { font: italic 14px var(--serif); fill: var(--mute); }
.node { cursor: pointer; } .node circle { fill: var(--sheet); stroke: #c9bc9f; stroke-width: 2; }
.node text { font: 700 12px var(--ui); fill: var(--mute); pointer-events: none; }
.node.on circle { fill: var(--ink); stroke: var(--ink); } .node.on text { fill: #fff; }
.node.cur circle { fill: var(--brass); stroke: #7a5d22; r: 16; }
.meter { display: flex; align-items: center; gap: 10px; font: 600 11px var(--ui); text-transform: uppercase; letter-spacing: .08em; color: var(--mute); margin-bottom: 10px; }
.mbar { flex: 1; height: 12px; background: var(--rule2); border-radius: 99px; overflow: hidden; position: relative; }
.mbar i { position: absolute; left: 0; top: 0; bottom: 0; transition: width .35s; border-radius: 99px; }
.mbar i.down { background: var(--bad); } .mbar i.up { background: var(--good); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font: 14px/1.4 var(--ui); }
.steps li { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--rule2); cursor: pointer; color: var(--mute); }
.steps li b { display: block; color: var(--ink2); }
.steps li.done { color: var(--ink2); background: var(--sheet2); }
.steps li.cur { border-color: var(--brass); background: #fbf4e2; color: var(--ink); box-shadow: 0 0 0 2px #f0dfb6; }

/* wheel */
.wseg { cursor: pointer; } .wseg path { fill: #f3ecdc; stroke: var(--sheet); stroke-width: 3; transition: fill .2s; }
.wseg:hover path { fill: #eadfc6; } .wseg.done path { fill: #dfe9d8; } .wseg.sel path { fill: var(--ink); }
.wseg text { font: 600 11px var(--ui); fill: var(--ink2); pointer-events: none; } .wseg.sel text { fill: #f6eedb; }
.spoke { stroke: var(--bad); stroke-width: 2; stroke-dasharray: 5 5; } .spoke.solid { stroke: var(--good); stroke-dasharray: none; stroke-width: 3; }
.hub { fill: #f9e7e2; stroke: var(--bad); stroke-width: 2; } .hub.restored { fill: #e3efdd; stroke: var(--good); }
.hubt { font: 700 13px var(--ui); fill: var(--ink); letter-spacing: .06em; }

/* anger */
.person circle, .person path { fill: none; stroke: var(--ink2); stroke-width: 3; stroke-linecap: round; }
.person text, .pbox text, .lbl { font: 600 12px var(--ui); fill: var(--ink2); }
.person.hit circle, .person.hit path { stroke: var(--bad); }
.pbox rect { fill: var(--sheet2); stroke: var(--ink2); stroke-width: 2; } .pbox.hit rect { fill: #e3efdd; stroke: var(--good); }
.arr { fill: none; stroke-width: 4; } .arr.thin { stroke-width: 2; }
.arr.bad { stroke: var(--bad); } .arr.good { stroke: var(--good); }
.ahd { fill: var(--ink2); }

/* put off */
.po-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pill { border: 1px solid #c9bc9f; background: var(--sheet); border-radius: 999px; padding: 6px 14px; font: 600 13px var(--ui); cursor: pointer; }
.pill.on { background: var(--ox); color: #fff; border-color: var(--ox); }
.po-stage { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 10px; align-items: stretch; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 18px; box-shadow: var(--sh); margin-bottom: 14px; }
.po-col { border-radius: 10px; padding: 14px; opacity: .15; transform: translateY(6px); transition: all .35s; }
.po-col.show { opacity: 1; transform: none; }
.po-col .tag { font: 700 11px var(--ui); text-transform: uppercase; letter-spacing: .1em; }
.po-col p { margin: 6px 0 0; font-size: 18px; }
.po-col.off { background: #fbefec; } .po-col.off .tag { color: var(--bad); }
.po-col.off.struck p { text-decoration: line-through; text-decoration-color: var(--bad); color: #8b5b5b; }
.po-col.renew { background: #f6f0df; } .po-col.renew .tag { color: var(--brass); }
.po-col.on { background: #e8f1e3; } .po-col.on .tag { color: var(--good); } .po-col.on p { font-weight: 600; }
.po-arrow { align-self: center; font-size: 26px; color: var(--mute); opacity: .15; transition: opacity .3s; } .po-arrow.show { opacity: 1; }
.po-verse { grid-column: 1 / -1; opacity: 0; transition: opacity .4s; } .po-verse.show { opacity: 1; }

/* levels */
.ring { cursor: pointer; } .ring circle { stroke: var(--sheet); stroke-width: 3; transition: fill .2s; }
.ring .r0 { fill: #efe5cf; } .ring .r1 { fill: #e3d5b6; } .ring .r2 { fill: #d4c095; }
.ring.sel circle { fill: var(--ox); } .ring text { font: 700 13px var(--ui); fill: var(--ink); pointer-events: none; letter-spacing: .04em; } .ring.sel text { fill: #fff; }

/* signs */
.signs-wrap { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px; box-shadow: var(--sh); }
.signs-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 14px; font: 14px var(--ui); }
.signs-out h3 { margin: 0 0 10px; font-size: 18px; }
.matrix-d { margin-top: 14px; font: 14px var(--ui); } .matrix-d summary { cursor: pointer; font-weight: 600; color: var(--ox); }
.matrix { border-collapse: collapse; font: 12.5px var(--ui); background: var(--sheet); margin-top: 8px; }
.matrix th, .matrix td { border: 1px solid var(--rule2); padding: 4px 6px; text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; white-space: nowrap; }
.matrix thead th { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; height: 130px; vertical-align: bottom; }
.matrix thead th:first-child { writing-mode: horizontal-tb; transform: none; height: auto; }
.matrix thead a { text-decoration: none; }
.matrix .m2 { color: var(--ox); } .matrix .m1 { color: var(--brass); }
.matrix caption { caption-side: bottom; text-align: left; padding: 6px 0; color: var(--mute); }

/* bars */
.bar { display: grid; grid-template-columns: minmax(90px, 40%) 1fr 34px; align-items: center; gap: 8px; font: 13.5px var(--ui); margin: 5px 0; text-decoration: none; color: var(--ink); }
.bar i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--ox) var(--w), var(--rule2) var(--w)); }
.bar b { text-align: right; } .bar.link:hover span { color: var(--ox); text-decoration: underline; }
.bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* tree */
.tree { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 14px 10px; box-shadow: var(--sh); overflow-x: auto; font: 14.5px var(--ui); }
.tree ul { list-style: none; margin: 0; padding-left: 22px; position: relative; }
.tree > ul { padding-left: 0; }
.tree li { position: relative; padding: 3px 0; }
.tree ul ul li::before { content: ""; position: absolute; left: -14px; top: 0; bottom: 0; border-left: 1px solid var(--rule); }
.tree ul ul li::after { content: ""; position: absolute; left: -14px; top: 18px; width: 12px; border-top: 1px solid var(--rule); }
.tree ul ul li:last-child::before { bottom: auto; height: 18px; }
.tb { border: 1px solid var(--rule); background: var(--sheet2); border-radius: 8px; padding: 6px 12px; cursor: pointer; font: 600 14px var(--ui); display: inline-flex; gap: 8px; align-items: center; text-align: left; }
.tb.sel { background: var(--ink); color: #f6eedb; border-color: var(--ink); }
.tog { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--rule2); color: var(--ink); font-size: 13px; flex: none; }
.tog.leaf { background: transparent; color: var(--brass); }
.tn.org > .tb { border-color: #bcd6d4; } .tn.non > .tb { border-color: #e3c4bd; }
.tree-side { margin-top: 12px; background: var(--sheet2); border: 1px solid var(--rule); border-radius: var(--r); padding: 12px 16px; }

/* progress */
#pg { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--sh); width: 100%; height: auto; display: block; }
.std { stroke: var(--brass); stroke-width: 2; stroke-dasharray: 6 4; } .axis { stroke: #c9bc9f; }
.ln { fill: none; stroke-width: 3.5; stroke-linejoin: round; stroke-dasharray: 900; animation: draw 1.2s ease forwards; }
@keyframes draw { from { stroke-dashoffset: 900; } to { stroke-dashoffset: 0; } }
.lnA, .ptA { stroke: var(--teal); fill: var(--teal); } .lnB, .ptB { stroke: var(--plum); fill: var(--plum); } .lnC, .ptC { stroke: var(--ox); fill: var(--ox); }
.ln { fill: none !important; }
.who { font: 700 14px var(--ui); fill: var(--ink); }
#pg-side { margin-top: 12px; }

/* talk */
.tk { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px; box-shadow: var(--sh); display: grid; gap: 14px; }
.tkrow span { display: block; font: 600 14px var(--ui); margin-bottom: 6px; }
.tiles { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; }
.tiles i { font: 700 13px var(--ui); font-style: normal; display: grid; place-items: center; height: 34px; border-radius: 6px; background: var(--rule2); color: transparent; transition: all .25s; }
.tiles i.on.T { background: #d9dfe6; color: var(--ink2); } .tiles i.on.A { background: var(--good); color: #fff; }

/* forgiveness / salvation / approaches tables */
.tblwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.fg, .sal, .appr { width: 100%; border-collapse: collapse; background: var(--sheet); border: 1px solid var(--rule); font-size: 15px; }
.fg th, .fg td, .sal th, .sal td, .appr th, .appr td { border: 1px solid var(--rule2); padding: 8px 10px; vertical-align: top; text-align: left; }
.fg thead th, .sal thead th, .appr thead th { background: var(--ink); color: #f1ead9; font: 600 13px var(--ui); }
.fg tbody th, .appr tbody th, .sal tbody th { font: 600 13.5px var(--ui); background: var(--sheet2); width: 170px; }
.dim { opacity: .35; transition: opacity .2s; }
.appr td.sel { background: #fbf4e2; } .appr thead th.sel { background: var(--ox); }
.appr thead th small { display: block; font-weight: 400; opacity: .8; }
.sal td { text-align: center; cursor: pointer; width: 15%; font-size: 18px; color: var(--ink); }
.sal td:hover { background: #fbf4e2; } .sal td.pick { background: #efe5cf; }
.sal td.ok { background: #e3efdd; color: var(--good); } .sal td.no { background: #f9e7e2; color: var(--bad); }
.sal th small { display: block; font-weight: 400; color: var(--mute); margin-top: 3px; }
.quiz .q { font-size: 18px; }

/* discipline ladder */
.ladder { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ladder li { position: relative; }
.ladder button { width: 100%; min-height: 84px; border: 1px solid var(--rule); background: var(--sheet); border-radius: var(--r); cursor: pointer; font: 600 15px var(--ui); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; text-align: left; box-shadow: var(--sh); }
.ladder .n { width: 26px; height: 26px; border-radius: 50%; background: var(--rule2); display: grid; place-items: center; font-size: 13px; }
.ladder li.past button { background: var(--sheet2); } .ladder li.cur button { background: var(--ink); color: #f6eedb; border-color: var(--ink); }
.ladder li.cur .n { background: var(--brass); color: #fff; }
.ladder .rest { display: block; font: 600 11px var(--ui); color: var(--good); margin-top: 4px; text-align: center; }
#ld-side { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 14px 18px; box-shadow: var(--sh); }

/* ---------- forms ---------- */
.form-top { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; align-items: baseline; }
.form-top .intro { margin: 0; max-width: 70ch; color: var(--ink2); }
.saved { font: 12px var(--ui); color: var(--good); margin: 0; }
.saved::before { content: "\1F512  "; }
.recbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; padding: 10px 12px; background: #e9eef2; border-radius: var(--r); font: 14px var(--ui); }
.recbar label { font-weight: 600; }
.recbar select { padding: 6px 8px; border-radius: 6px; border: 1px solid #c4ccd4; background: #fff; max-width: 100%; flex: 1 1 200px; }
.paper { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 6px 22px 20px; box-shadow: var(--sh); margin-top: 14px; }
.print-title { display: none; }
.fsec { border-bottom: 1px dashed var(--rule); padding: 12px 0 16px; }
.fsec:last-child { border-bottom: 0; }
.fsec h3 { font-size: 18px; margin: 6px 0 10px; color: var(--ox); }
.fgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 14px; }
.fsec.cols2 .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fsec.cols2 .fld { grid-column: span 1 !important; }
.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; border: 0; padding: 0; margin: 0; }
.w-full { grid-column: span 4; } .w-half { grid-column: span 2; } .w-quarter { grid-column: span 1; }
.fld > label, .fld legend { font: 600 13px var(--ui); color: var(--ink2); padding: 0; }
.fld input[type=text], .fld input:not([type]), .fld input[type=date], .fld input[type=number], .fld input[type=datetime-local], .fld textarea, .fld select, .rows textarea, .rows input, .rows select, .money input {
  width: 100%; min-width: 0; border: 0; border-bottom: 1.5px solid #cbbd9e; background: #fffef9; padding: 6px 4px; font: 15.5px var(--ui); border-radius: 4px 4px 0 0; }
.fld textarea { border: 1.5px solid #e0d5bd; border-radius: 6px; resize: vertical; line-height: 1.45; }
.fld input:focus, .fld textarea:focus, .fld select:focus, .rows textarea:focus, .rows input:focus, .money input:focus { outline: none; border-color: var(--ox); background: #fff; }
.opts { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.opt { display: inline-flex; align-items: center; gap: 6px; font: 14.5px var(--ui); padding: 4px 9px 4px 6px; border: 1px solid var(--rule2); border-radius: 999px; cursor: pointer; background: #fffef9; }
.opt input { accent-color: var(--ox); width: 16px; height: 16px; margin: 0; }
.opt:has(input:checked) { background: #fbf1ee; border-color: #e3c4bd; }
.fld.list .opts { flex-direction: column; } .fld.list .opt { border-radius: 8px; border-color: transparent; background: transparent; padding: 5px 4px; }
.fld.list .opt:has(input:checked) { background: #eef5ea; }
.fld.list .opt:has(input:checked) span { text-decoration: line-through; text-decoration-color: rgba(47,107,58,.5); color: var(--good); }
.rows { width: 100%; border-collapse: collapse; font: 14.5px var(--ui); }
.rows th { text-align: left; font: 600 12px var(--ui); color: var(--mute); text-transform: uppercase; letter-spacing: .05em; padding: 4px; border-bottom: 1px solid var(--rule); }
.rows td { padding: 3px 4px; vertical-align: top; border-bottom: 1px solid var(--rule2); }
.rows textarea { resize: none; overflow: hidden; min-height: 34px; line-height: 1.4; }
.rows td.c { text-align: center; } .rows td.c input { width: 18px; height: 18px; accent-color: var(--good); }
.rows .x { width: 32px; }
.icon { border: 0; background: transparent; color: var(--mute); font-size: 20px; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.icon:hover { background: #f9e7e2; color: var(--bad); }
.rows + .btn, .tblwrap + .btn { margin-top: 8px; align-self: flex-start; }
.days { white-space: nowrap; }
.days label { display: inline-block; position: relative; }
.days input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.days span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--rule); font: 600 11px var(--ui); color: var(--mute); margin-right: 1px; }
.days input:checked + span { background: var(--good); color: #fff; border-color: var(--good); }
.days input:focus-visible + span { outline: 2px solid var(--brass); }
.money { width: 100%; border-collapse: collapse; font: 15px var(--ui); }
.money td, .money th { padding: 4px 6px; border-bottom: 1px solid var(--rule2); }
.money th { text-align: left; font: 600 12px var(--ui); color: var(--mute); text-transform: uppercase; }
.money td:not(:first-child), .money th:not(:first-child) { width: 140px; text-align: right; }
.money input { text-align: right; }
.money .tot td { font-weight: 700; border-top: 2px solid var(--ink2); }
.sumgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--sheet2); border: 1px solid var(--rule2); border-radius: 8px; padding: 10px 12px; font: 13px var(--ui); display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 18px; } .stat.neg b { color: var(--bad); } .stat.pos b { color: var(--good); }
.sumgrid .full { grid-column: 1 / -1; margin: 4px 0 0; }
.tally h4, .pf h4 { margin: 12px 0 4px; font: 600 13px var(--ui); color: var(--mute); text-transform: uppercase; letter-spacing: .06em; }
.pf { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.fsec .note { margin-top: 0; }
a.mini.no-print { font-size: 11px; }
body.print-blank .paper input, body.print-blank .paper textarea, body.print-blank .paper select { color: transparent !important; }

/* ---------- references ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.cards .filter-note { grid-column: 1 / -1; margin: 0; }
.flip { position: relative; min-height: 170px; perspective: 900px; cursor: pointer; outline: none; }
.flip .front, .flip .back { position: absolute; inset: 0; border-radius: var(--r); padding: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .45s; border: 1px solid var(--rule); box-shadow: var(--sh); overflow: auto; }
.flip .front { background: var(--sheet); display: flex; flex-direction: column; justify-content: center; }
.flip .q { font-size: 21px; font-style: italic; color: var(--ink); }
.flip .hint { font: 11px var(--ui); color: var(--mute); text-transform: uppercase; letter-spacing: .1em; margin-top: 10px; }
.flip .back { background: #fbf4e2; transform: rotateY(180deg); font-size: 15.5px; }
.flip .back p { margin: 0 0 6px; }
.flip.on .front { transform: rotateY(180deg); } .flip.on .back { transform: rotateY(360deg); }
.flip:focus-visible .front, .flip:focus-visible .back { outline: 2px solid var(--brass); }
.practice textarea { width: 100%; border: 1px solid var(--rule); border-radius: 8px; padding: 8px; font: 15px var(--ui); margin: 6px 0 8px; }
.practice .big { font-size: 20px; font-style: italic; }
.answer { background: #eef5ea; padding: 10px 12px; border-radius: 8px; }
.tallybox { position: sticky; top: calc(var(--mastH) + 8px); z-index: 5; background: var(--ink); color: #f1ead9; padding: 10px 14px; border-radius: var(--r); font: 14px/1.6 var(--ui); margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tallybox .chip { margin: 0; }
.fgroup h3 { font-size: 18px; margin: 18px 0 6px; color: var(--ox); }
.fgroup ol, .donts { margin: 0; padding-left: 28px; }
.fgroup li, .donts li { padding: 5px 0; border-bottom: 1px dotted var(--rule); font: 15px/1.4 var(--ui); }
.fgroup li label, .donts li label { cursor: pointer; display: inline-flex; gap: 8px; align-items: flex-start; }
.fgroup input, .donts input { margin-top: 3px; accent-color: var(--ox); width: 16px; height: 16px; flex: none; }
.donts input { accent-color: var(--good); }
.donts input:checked + span { color: var(--mute); text-decoration: line-through; }
li.hl, .vrow.hl, .doc.hl { background: #fbf4e2; box-shadow: inset 3px 0 0 var(--brass); }
.gloss { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin: 0; }
.gloss div { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 10px 14px; }
.gloss dt { font-weight: 700; color: var(--ox); } .gloss dd { margin: 2px 0 0; font-size: 15.5px; }
.doctrines { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.doc { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--sh); position: relative; }
.doc .dn { position: absolute; right: 12px; top: 6px; font-size: 30px; color: #eadfc8; font-weight: 700; }
.doc h3 { margin: 0; font-size: 20px; } .doc p { font-size: 15.5px; margin: 6px 0; }
.vindex { display: grid; gap: 8px; }
.vrow { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 10px 14px; }
.vrow h4 { margin: 0; font: 700 14px var(--ui); color: var(--ox); }
.vrow p { margin: 3px 0; font-style: italic; font-size: 15.5px; }
.results { list-style: none; padding: 0; } .results li { padding: 10px 0; border-bottom: 1px dotted var(--rule); }
.results .rk { font: 600 10.5px var(--ui); text-transform: uppercase; letter-spacing: .1em; background: var(--rule2); padding: 2px 7px; border-radius: 4px; margin-right: 8px; color: var(--ink2); }
.results p { margin: 4px 0 0; font-size: 15px; color: var(--ink2); }
mark { background: #f3e2b2; padding: 0 2px; }

/* ---------- footer, toast ---------- */
.foot { border-top: 3px double var(--rule); padding: 18px clamp(16px, 4vw, 52px) 26px calc(var(--navW) + clamp(16px, 4vw, 52px)); font: 13px/1.55 var(--ui); color: var(--mute); background: #efe8d8; }
.foot p { margin: 0 0 6px; max-width: 900px; }
.foot a { color: var(--ink2); }
.foot a.lib { color: var(--mute); text-decoration: none; border-bottom: 1px dotted var(--mute); }
.foot a.lib:hover { color: var(--ox); }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 140%); background: var(--ink); color: #f6eedb; padding: 10px 18px; border-radius: 999px; font: 14px var(--ui); box-shadow: 0 8px 24px rgba(0,0,0,.2); transition: transform .3s, opacity .3s; z-index: 60; max-width: calc(100vw - 30px); opacity: 0; visibility: hidden; }
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.toast a { color: #e9c983; margin-left: 8px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .topic-layout { grid-template-columns: minmax(0, 1fr); }
  .topic-side { position: static; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .sumgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  :root { --mastH: 54px; }
  .menu { display: block; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav { position: fixed; left: 0; top: var(--mastH); bottom: 0; height: auto; width: min(86vw, 320px); z-index: 40; transform: translateX(-102%); transition: transform .25s; box-shadow: 4px 0 24px rgba(0,0,0,.15); }
  body.nav-open .nav { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: var(--mastH) 0 0 0; background: rgba(20,25,32,.35); z-index: 35; }
  .search input { width: 180px; }
  .foot { padding-left: clamp(16px, 4vw, 52px); }
  .dgm-wrap.two, .signs-wrap { grid-template-columns: minmax(0, 1fr); }
  .po-stage { grid-template-columns: minmax(0, 1fr); } .po-arrow { transform: rotate(90deg); justify-self: center; }
  .ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .bt small { display: none; }
  .search { flex: 1; min-width: 0; } .search input { width: 100%; min-width: 0; }
  .brand .bt b { font-size: 16px; }
  .grid3, .parts { grid-template-columns: minmax(0, 1fr); }
  .part-card ul { columns: 1; }
  .fgrid, .fsec.cols2 .fgrid { grid-template-columns: minmax(0, 1fr); }
  .w-full, .w-half, .w-quarter { grid-column: span 1; }
  .paper { padding: 4px 12px 14px; }
  .signs-list { grid-template-columns: minmax(0, 1fr); }
  .pf { grid-template-columns: minmax(0, 1fr); }
  .sumgrid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rows { min-width: 560px; }
  .money td:not(:first-child), .money th:not(:first-child) { width: 104px; }
  .lede { font-size: 17px; }
  .pager { flex-direction: column; }
  .fg tbody th, .appr tbody th, .sal tbody th { width: auto; min-width: 110px; }
  .fg, .appr { min-width: 520px; } .sal { min-width: 520px; }
}

/* ---------- print ---------- */
@media print {
  @page { margin: 14mm 14mm 16mm; }
  body { background: #fff; font-size: 11.5pt; color: #000; }
  .mast, .nav, .scrim, .foot, .toast, .no-print, .page-tools, .pager, .topic-side, .dgm-ctrl .seg, .stepper button, .recbar, .toolbar, .tallybox .chip, .skip { display: none !important; }
  .shell { display: block; }
  .view { padding: 0; max-width: none; }
  .page-h { border-bottom: 2px solid #000; }
  .page-h::after { content: "Adams Guide (Claude Ed.) \00B7  counsel.sphl0ckman.com"; display: block; font: 8pt var(--ui); color: #555; margin-top: 4px; }
  .linked { display: none; }
  .topic-layout { display: block; }
  .verse, .paper, .card, .dgm-wrap, .side-box, .toolcard, .strand, .doc, .vrow, .gloss div, .tk, .signs-wrap, .tree, #pg, .po-stage { box-shadow: none !important; border-color: #999 !important; background: #fff !important; break-inside: avoid; }
  .verse { border-left: 3px solid #000 !important; }
  .sec::after { background: #000; }
  a { color: #000; text-decoration: none; }
  .chip { border-color: #999 !important; background: #fff !important; color: #000 !important; }
  .paper { border: 0 !important; padding: 0; }
  .print-title { display: block; font: 700 16pt var(--serif); margin: 6px 0 4px; }
  .form-top .intro { font-size: 10pt; }
  .fsec { break-inside: avoid; }
  .fld textarea, .rows textarea { border: 1px solid #888 !important; min-height: 4em; overflow: visible; height: auto !important; }
  body.print-blank .fld textarea { min-height: 7em; }
  .fld input, .fld select, .rows input, .rows select, .money input { border-bottom: 1px solid #888 !important; background: #fff !important; }
  .rows { min-width: 0 !important; }
  .opt { border-color: #bbb !important; background: #fff !important; }
  .tblwrap { overflow: visible; }
  .flip { min-height: 0; break-inside: avoid; }
  .flip .front, .flip .back { position: static; transform: none !important; backface-visibility: visible; border: 1px solid #999; margin-bottom: 4px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .po-col, .po-arrow, .po-verse { opacity: 1 !important; transform: none !important; }
  .dim { opacity: 1 !important; }
  .matrix-d { display: block; } .matrix-d > *:not(summary) { display: block; }
  .tallybox { position: static; background: #fff; color: #000; border: 1px solid #999; }
}
