/* CE Field & Software Mastery — Daylight Field UI (earth-tone palette)
   Palette: linen #F3EDE3 · sage #D8D4B8 · sand #F7EEDD · taupe #E5DCCB · moss #7A8B5A
            clay #9A4A2A · sand-yellow #E8C97A · soil #2B1A0E · muted #6B5A4A · border #E0D5C0 */
@font-face { font-family: Nunito; font-weight: 500; font-display: swap; src: url(../fonts/nunito-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Nunito; font-weight: 600; font-display: swap; src: url(../fonts/nunito-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Nunito; font-weight: 700; font-display: swap; src: url(../fonts/nunito-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: Nunito; font-weight: 800; font-display: swap; src: url(../fonts/nunito-latin-800-normal.woff2) format("woff2"); }

:root {
  --linen: #F3EDE3; --sage: #D8D4B8; --sand: #F7EEDD; --taupe: #E5DCCB; --moss: #7A8B5A; --clay: #9A4A2A; --yellow: #E8C97A;
  --soil: #2B1A0E; --muted: #6B5A4A; --border: #E0D5C0; --white: #FFFFFF; --cream: #FAF7F2;
  --shadow: 0 4px 12px rgba(43, 26, 14, 0.06); --shadow-2: 0 8px 24px rgba(43, 26, 14, 0.10);
  --r-card: 18px; --r-big: 24px; --bw: 1px;
}
:root[data-glare] { --muted: #2B1A0E; --border: #6B5A4A; --taupe: #D8D4B8; --bw: 2px; --shadow: 0 2px 6px rgba(43, 26, 14, 0.18); }
:root[data-glare] body { font-weight: 600; }
* { box-sizing: border-box; min-width: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body { margin: 0; background: var(--linen); color: var(--soil); font: 500 16px/1.55 Nunito, "Segoe UI", system-ui, sans-serif; overflow-x: clip; }
a { color: var(--clay); }
h1, h2, h3 { color: var(--soil); font-weight: 800; line-height: 1.2; }
h1 { font-size: 1.45rem; margin: 0; } h2 { font-size: 1.12rem; margin: 0 0 .5rem; } h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
p { margin: .3rem 0 .6rem; } ul, ol { padding-left: 1.25rem; margin: .3rem 0 .6rem; } li { margin: .25rem 0; }
code, pre { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .84rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; } .pad { padding: 12px 4px; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.big { width: 34px; height: 34px; color: var(--clay); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 8px; }

/* frame: centered phone-width app on large screens */
.frame { min-height: 100vh; }
.app { max-width: 100%; margin: 0 auto; min-height: 100vh; background: var(--linen); position: relative; padding: 0 16px calc(92px + env(safe-area-inset-bottom)); }


/* header */
.hdr { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 0 10px; background: var(--linen); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--soil); }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--soil); color: var(--white); display: grid; place-items: center; font-weight: 800; font-size: 15px; letter-spacing: .5px; flex: none; }
.b-tx { display: flex; flex-direction: column; line-height: 1.15; } .b-tx b { font-weight: 800; font-size: 15.5px; } .b-tx small { color: var(--muted); font-weight: 600; font-size: 13px; }
.h-btns { display: flex; gap: 8px; }
.iconbtn { width: 38px; height: 38px; border-radius: 50%; border: var(--bw) solid var(--border); background: var(--white); color: var(--soil); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); padding: 0; flex: none; }
.iconbtn.sm { width: 34px; height: 34px; } .iconbtn .ic { width: 20px; height: 20px; }
#glareBtn[aria-pressed="true"] { background: var(--yellow); }
.mark.on { color: var(--clay); } .mark.on .ic { fill: var(--yellow); }

/* search */
.searchbar { display: flex; align-items: center; gap: 8px; background: var(--white); border: var(--bw) solid var(--border); border-radius: 999px; padding: 4px 6px 4px 16px; box-shadow: var(--shadow); margin-top: 4px; }
.searchbar .s-ic { color: var(--muted); display: flex; }
.searchbar input { flex: 1; border: 0; background: transparent; font: inherit; font-size: 16px; color: var(--soil); padding: 10px 0; outline: none; }
.searchbar input::placeholder { color: var(--muted); }
.mic { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--clay); cursor: pointer; display: grid; place-items: center; }
.mic.live { background: var(--yellow); }

/* mode pills */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 12px; }
.mode { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 999px; border: var(--bw) solid transparent; background: var(--taupe); color: var(--soil); font: 700 15px Nunito, sans-serif; cursor: pointer; transition: background .2s, color .2s; }
.mode.on { background: var(--moss); color: var(--white); box-shadow: var(--shadow); }

/* tabs */
.tabs { display: flex; gap: 4px; background: var(--taupe); border-radius: 999px; padding: 4px; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1 0 auto; text-align: center; padding: 8px 7px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.tab.on { background: var(--white); color: var(--soil); font-weight: 800; box-shadow: var(--shadow); }

/* hero */
.hero { position: relative; border-radius: var(--r-big); background: var(--sage); overflow: hidden; box-shadow: var(--shadow); }
.hero-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hero-track::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; display: grid; grid-template-columns: 1.25fr .9fr; gap: 6px; padding: 18px 16px 34px 18px; min-height: 226px; }
.topo { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: var(--soil); stroke-width: 1; opacity: .09; pointer-events: none; }
.sl-l { position: relative; display: flex; flex-direction: column; align-items: flex-start; }
.sl-l h2 { font-size: 1.32rem; line-height: 1.12; margin: 10px 0 4px; text-wrap: balance; }
.sl-l p { color: var(--soil); font-weight: 600; font-size: 14px; margin: 0 0 12px; }
.pill-badge { background: var(--white); color: var(--soil); border-radius: 999px; padding: 3px 12px; font-size: 12.5px; font-weight: 700; }
.sl-r { position: relative; display: flex; align-items: flex-end; justify-content: center; }
.hero-art { width: 100%; max-width: 150px; height: auto; }
.hero-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 999px; border: 0; background: rgba(43, 26, 14, .25); padding: 0; cursor: pointer; transition: width .2s; }
.dot.on { width: 22px; background: var(--soil); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 999px; font: 700 14.5px Nunito, sans-serif; text-decoration: none; cursor: pointer; border: var(--bw) solid transparent; }
.btn .ic { width: 18px; height: 18px; }
.btn.dark { background: var(--soil); color: var(--white); }
.btn.white { background: var(--white); color: var(--soil); border-color: var(--border); }
.btn.moss { background: var(--moss); color: var(--white); }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 13.5px; }
.btn.full { width: 100%; margin: 10px 0; }
.link { background: none; border: 0; color: var(--clay); font: inherit; font-weight: 700; cursor: pointer; padding: 0; text-decoration: underline; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0 6px; }
.stats.two { grid-template-columns: 1fr 1fr; }
.stat { background: var(--sand); border: var(--bw) solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 10px 6px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.stat .ic { color: var(--clay); width: 20px; height: 20px; }
.stat b { color: var(--clay); font-weight: 800; font-size: 1.3rem; line-height: 1.2; margin-top: 4px; white-space: nowrap; }
.stat span { color: var(--muted); font-size: 11.5px; font-weight: 600; line-height: 1.2; }

/* section heading & list cards */
.sec-h { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 2px 10px; }
.sec-h h2 { margin: 0; font-size: 1.12rem; }
.sec-h a { font-weight: 700; text-decoration: none; font-size: 14.5px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; }
.lst { display: flex; flex-direction: column; gap: 10px; margin: 6px 0; }
.lcard { display: flex; align-items: center; gap: 12px; background: var(--sand); border: var(--bw) solid var(--border); border-radius: var(--r-card); padding: 12px 12px 12px 12px; text-decoration: none; color: var(--soil); box-shadow: var(--shadow); min-height: 64px; transition: transform .15s; }
.lcard:active { transform: scale(.99); }
.lc-ic { width: 42px; height: 42px; border-radius: 50%; background: var(--taupe); color: var(--clay); display: grid; place-items: center; flex: none; }
.lc-tx { flex: 1; display: flex; flex-direction: column; } .lc-tx b { font-weight: 800; font-size: 15px; line-height: 1.25; } .lc-tx small { color: var(--muted); font-weight: 600; font-size: 13px; line-height: 1.3; }
.lc-badge { min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px; background: var(--clay); color: var(--white); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.lc-badge:empty { background: transparent; }
.lc-badge .ic { width: 18px; height: 18px; }

/* generic cards */
.card { background: var(--sand); border: var(--bw) solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 14px 14px; margin: 12px 0; }
.card.note { background: var(--white); }
.card.intro { display: flex; gap: 12px; align-items: flex-start; background: var(--sage); border: 0; }
.card.intro p { margin: 0; font-weight: 600; }
.card.more summary { cursor: pointer; padding: 4px 0; } .card.more[open] summary { margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--taupe); color: var(--soil); }
.chip.ref { background: var(--white); color: var(--clay); border: var(--bw) solid var(--border); }
.lead { color: var(--muted); font-weight: 600; }

/* page heading */
.phead { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0 8px; }
.phead.plain { margin-top: 10px; }
.ph-t { flex: 1; } .ph-t h1 { text-wrap: balance; } .ph-t p { color: var(--muted); font-weight: 600; margin: 2px 0 0; font-size: 14px; }

/* tables */
.tblwrap { overflow-x: auto; margin: 6px 0; border-radius: 12px; }
.tbl { border-collapse: collapse; width: 100%; font-size: 13.5px; background: var(--white); }
.tbl th, .tbl td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; vertical-align: top; }
.tbl thead th { background: var(--taupe); font-weight: 800; color: var(--soil); }
.tbl tfoot td { font-weight: 800; background: var(--taupe); }
.tbl td[contenteditable] { background: var(--cream); min-width: 60px; }
.kvt { width: 100%; border-collapse: collapse; } .kvt th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px 6px 0; width: 50%; vertical-align: top; } .kvt td { padding: 6px 0; font-weight: 700; }
.kvt tr + tr th, .kvt tr + tr td { border-top: 1px solid var(--border); }
@media (max-width: 600px) {
  .tbl.stack thead { display: none; } .tbl.stack tr { display: grid; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .tbl.stack td { border: 0; padding: 3px 8px; } .tbl.stack td:first-child { font-weight: 800; }
}

/* guides */
.gh { display: flex; gap: 12px; } .gh .ic { color: var(--clay); width: 28px; height: 28px; margin-top: 2px; } .gh h2 { margin-bottom: 2px; }
.steps-s li { margin: .45rem 0; } .steps-s b { color: var(--soil); }
.formula { background: var(--white); border: var(--bw) solid var(--border); border-radius: 14px; padding: 10px 12px; margin: 8px 0; }
.formula b { display: block; margin-bottom: 4px; }
.formula code { display: block; background: var(--cream); border-radius: 8px; padding: 8px 10px; color: var(--clay); font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .82rem; }
.formula p { margin: 6px 0 0; font-size: 14px; }
.tag { background: var(--yellow); color: var(--soil); border-radius: 999px; padding: 1px 8px; font-size: 11.5px; font-weight: 800; margin-right: 4px; }
.chk { list-style: none; padding: 0; } .chk li { margin: 2px 0; } .chk label { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--moss); flex: none; margin-top: 2px; }

/* SOPs */
.prog { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 700; font-size: 14px; margin: 10px 2px; }
.bar { flex: 1; height: 8px; background: var(--taupe); border-radius: 999px; overflow: hidden; } .bar span { display: block; height: 100%; background: var(--moss); transition: width .3s; }
.h-out { margin: 18px 2px 4px; }
.step.done { border-left: 5px solid var(--moss); }
.st-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stage { font-size: 11.5px; font-weight: 800; color: var(--clay); text-transform: uppercase; letter-spacing: .03em; }
.tick { display: flex; gap: 6px; align-items: center; font-weight: 700; font-size: 13.5px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.step h3 { margin-top: 6px; }
.step .body ol { padding-left: 1.1rem; }
.hc { border: 2px solid var(--moss); background: var(--white); }
.hc-t { display: flex; align-items: center; gap: 6px; color: var(--moss); font-weight: 800; margin: 4px 0; } .hc-t .ic { width: 20px; height: 20px; }
.tip { background: var(--cream); border-left: 4px solid var(--yellow); border-radius: 0 10px 10px 0; padding: 8px 10px; color: var(--muted); font-size: 14px; font-weight: 600; }
.code { border: var(--bw) solid var(--border); border-radius: 12px; overflow: hidden; margin: 8px 0; background: var(--white); }
.code-h { display: flex; justify-content: space-between; padding: 6px 10px; background: var(--taupe); font-size: 12px; font-weight: 800; }
.code pre { margin: 0; padding: 10px; overflow: auto; max-height: 300px; color: var(--soil); }
.note-d { border-top: 1px solid var(--border); padding: 8px 0; } .note-d summary { cursor: pointer; font-weight: 800; } .note-d p { margin: 6px 0 2px; font-size: 14.5px; }
figure.schem { margin: 10px 0 2px; } figure.schem svg { width: 100%; height: auto; display: block; }

/* SVG schematics (shared with templates) — earth palette */
svg .win { fill: var(--white); stroke: var(--border); } svg .ttl { fill: var(--taupe); } svg .ttl-t { fill: var(--soil); font: 700 12px Nunito, sans-serif; }
svg .dot-c { fill: var(--muted); opacity: .45; } svg .tab { fill: transparent; } svg .tab-on { fill: var(--moss); } svg .tab-t { fill: var(--soil); font: 600 11px Nunito, sans-serif; }
svg .rib { fill: var(--sand); stroke: var(--border); } svg .btn { fill: var(--white); stroke: var(--border); } svg .btn.hi { fill: #F6E6C2; stroke: var(--clay); stroke-width: 2; }
svg .ico { fill: var(--clay); opacity: .75; } svg .btn-t { fill: var(--soil); font: 600 10px Nunito, sans-serif; } svg .grp-t { fill: var(--muted); font: 600 10px Nunito, sans-serif; } svg .sep { stroke: var(--border); }
svg .badge { fill: var(--clay); } svg .badge-t { fill: var(--white); font: 800 11px Nunito, sans-serif; } svg .path-t { fill: var(--clay); font: 800 12px Nunito, sans-serif; }
svg .fld-l { fill: var(--muted); font: 600 12px Nunito, sans-serif; } svg .fld { fill: var(--cream); stroke: var(--border); } svg .fld.hi { stroke: var(--clay); stroke-width: 2; } svg .fld-v { fill: var(--soil); font: 700 12px Nunito, sans-serif; }
svg .canvas { fill: var(--white); stroke: var(--border); }
svg .member { stroke: var(--soil); stroke-width: 4; stroke-linecap: round; } svg .node { fill: var(--clay); } svg .nnum { fill: var(--clay); font: 700 11px Nunito, sans-serif; } svg .mnum { fill: var(--muted); font: 600 11px Nunito, sans-serif; }
svg .support { fill: var(--muted); } svg .hatch { stroke: var(--muted); }
svg .load { stroke: var(--clay); stroke-width: 1.4; } svg .loadhead { fill: var(--clay); }
svg .arrow { stroke: var(--clay); stroke-width: 2.2; } svg .arrowhead { fill: var(--clay); }
svg .react { stroke: var(--moss); stroke-width: 2.2; } svg .reacthead { fill: var(--moss); }
svg .defl { fill: none; stroke: var(--moss); stroke-width: 1.8; stroke-dasharray: 5 3; } svg .bmd { fill: rgba(154, 74, 42, .18); stroke: var(--clay); }
svg .lbl { fill: var(--soil); font: 600 12px Nunito, sans-serif; } svg .tick { fill: var(--muted); font: 600 11px Nunito, sans-serif; }
svg .axis { stroke: var(--muted); stroke-width: 1.2; } svg .grid { stroke: var(--border); stroke-width: .8; }
svg .soil1 { fill: #C9A77A; } svg .soil2 { fill: #8C7660; } svg .cut { fill: rgba(232, 201, 122, .35); stroke: var(--clay); stroke-dasharray: 6 4; }
svg .meshl { stroke: rgba(43, 26, 14, .28); stroke-width: .6; } svg .water { fill: none; stroke: var(--moss); stroke-width: 2.6; stroke-dasharray: 8 4; }
svg .slip { fill: none; stroke: var(--clay); stroke-width: 4; } svg .bh { stroke: var(--soil); stroke-width: 3; stroke-dasharray: 2 3; }
svg .curve { fill: none; stroke: var(--clay); stroke-width: 2.4; } svg .dash { stroke: var(--moss); stroke-dasharray: 6 4; }
.chart .series { stroke-width: 2.4; } .chart path.series { fill: none; } .chart .s0 { stroke: var(--clay); fill: var(--clay); } .chart .s1 { stroke: var(--moss); fill: var(--moss); } .chart .s2 { stroke: var(--yellow); fill: var(--yellow); }
.chart .bar { fill: var(--moss); } .chart .bar-crit { fill: var(--clay); } .chart .bar-float { fill: var(--muted); opacity: .5; }

/* templates */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.how summary { cursor: pointer; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fld { display: flex; flex-direction: column; font-size: 13px; font-weight: 700; color: var(--muted); }
.fld.wide { grid-column: 1 / -1; } .fld em { font-style: normal; font-weight: 600; }
input, select, textarea { font: 600 16px Nunito, sans-serif; color: var(--soil); background: var(--white); border: var(--bw) solid var(--border); border-radius: 12px; padding: 9px 11px; margin-top: 4px; width: 100%; }
.fhead { grid-column: 1 / -1; color: var(--clay); font-weight: 800; font-size: 12.5px; margin-top: 6px; }
.rows-ed { grid-column: 1 / -1; } .rows-l { font-weight: 800; font-size: 13.5px; margin: 6px 0 2px; }
.rows-ed table { border-collapse: collapse; font-size: 12.5px; } .rows-ed th { text-align: left; color: var(--muted); font-weight: 700; padding: 2px 4px; white-space: nowrap; }
.rows-ed td { padding: 1px 2px; } .rows-ed input { min-width: 70px; padding: 6px 7px; font-size: 14px; border-radius: 8px; margin: 0; }
.rows-ed .x { border: 0; background: none; color: var(--clay); font-size: 20px; cursor: pointer; width: 32px; height: 36px; }
.out-sec h3 { margin-top: 0; }
table.kv { width: 100%; border-collapse: collapse; font-size: 14px; }
table.kv th { text-align: left; font-weight: 600; color: var(--muted); padding: 6px 6px 6px 0; vertical-align: top; }
table.kv td { padding: 6px 4px; } table.kv tr + tr > * { border-top: 1px solid var(--border); }
table.kv td.num { font-weight: 800; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
table.kv { table-layout: fixed; } table.kv th { width: 46%; } table.kv td.u { width: 22%; overflow-wrap: anywhere; } table.kv td.st { width: 15%; white-space: normal !important; } table.kv td.u { color: var(--muted); font-size: 12.5px; }
table.kv td.st { font-size: 11.5px; font-weight: 800; white-space: nowrap; }
tr.ok td.st { color: var(--moss); } tr.ng td.st { color: var(--clay); } tr.warn td.st { color: #8A6A1E; }
tr.ng { background: rgba(154, 74, 42, .08); }
.out-sec.note { font-size: 14px; color: var(--muted); font-weight: 600; background: var(--white); }
.err { color: var(--clay); font-weight: 700; }
.print-only { display: none; }

/* study */
.seg { display: flex; background: var(--taupe); border-radius: 999px; padding: 4px; gap: 4px; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 999px; padding: 9px 6px; font: 700 13.5px Nunito, sans-serif; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--moss); color: var(--white); }
.fc { min-height: 220px; background: var(--sage); border-radius: var(--r-big); padding: 18px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; box-shadow: var(--shadow); transition: background .2s; }
.fc.flipped { background: var(--white); border: 2px solid var(--moss); }
.fc-n { color: var(--muted); font-weight: 700; font-size: 13px; } .fc-q { font-weight: 800; font-size: 1.2rem; line-height: 1.35; text-wrap: balance; } .fc-h { color: var(--clay); font-weight: 700; font-size: 13px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 12px 0 4px; } .row3 .btn { padding: 0 8px; font-size: 13.5px; }
.q { font-size: 1.05rem; margin: 6px 0 10px; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { text-align: left; min-height: 48px; border-radius: 14px; border: var(--bw) solid var(--border); background: var(--white); padding: 10px 14px; font: 700 15px Nunito, sans-serif; color: var(--soil); cursor: pointer; }
.opt.right { background: var(--moss); color: var(--white); border-color: var(--moss); } .opt.wrong { background: rgba(154, 74, 42, .14); border-color: var(--clay); }
.expl { background: var(--cream); border-radius: 12px; padding: 10px 12px; margin: 10px 0; font-size: 14.5px; }
.bignum { font-size: 2.4rem; font-weight: 800; color: var(--clay); margin: 4px 0; }
.prob summary { cursor: pointer; } .ans { background: var(--white); border-radius: 12px; padding: 8px 10px; }
.res { background: var(--white); }

/* bottom nav */
.bnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--cream); border-top: var(--bw) solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.bnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: 11.5px; padding: 6px 0; position: relative; min-height: 48px; }
.bnav a.on { color: var(--clay); } .bnav a.on::after { content: ""; position: absolute; bottom: 0; width: 18px; height: 4px; border-radius: 999px; background: var(--clay); }

/* drawer & toast */
.scrim { position: fixed; inset: 0; background: rgba(43, 26, 14, .32); z-index: 50; }
.drawer { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 82vh; overflow: auto; background: var(--linen); border-radius: 24px 24px 0 0; padding: 16px 18px calc(24px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-2); }
.dr-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; } .dr-h h2 { margin: 0; }
.drawer li { font-size: 14.5px; }
.toast { position: fixed; z-index: 70; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom)); background: var(--soil); color: var(--white); padding: 10px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; max-width: 90vw; text-align: center; box-shadow: var(--shadow-2); }

@media (max-width: 380px) { .fgrid { grid-template-columns: 1fr; } .stat b { font-size: 1.1rem; } .slide { grid-template-columns: 1.4fr .8fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ==================== RESPONSIVE LAYOUT ====================
   Phone (< 700px): single column, bottom navigation (spec layout).
   Tablet (700–1099px): full width, bottom navigation, 2-column lists.
   Laptop/desktop (≥ 1100px): left sidebar navigation, wide content, multi-column grids. */
@media (min-width: 700px) {
  .app { padding: 0 28px calc(96px + env(safe-area-inset-bottom)); }
  .lst { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card .lst, .more .lst { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slide { min-height: 280px; grid-template-columns: 1.4fr 1fr; padding: 28px 28px 40px; }
  .sl-l h2 { font-size: 1.8rem; } .sl-l p { font-size: 15.5px; }
  .hero-art { max-width: 220px; }
  .stat { padding: 14px 8px; } .stat b { font-size: 1.6rem; } .stat span { font-size: 13px; }
  .bnav { max-width: none; } .bnav a { font-size: 12.5px; }
  .fgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fc { min-height: 260px; } .fc-q { font-size: 1.4rem; }
  .row3, .opts { max-width: 720px; }
  h1 { font-size: 1.7rem; }
}
@media (min-width: 1100px) {
  .app { padding: 0 40px 48px 280px; max-width: 1680px; }
  /* bottom bar becomes a fixed left sidebar */
  .bnav { top: 0; bottom: 0; right: auto; width: 240px; display: flex; flex-direction: column; gap: 4px; padding: 24px 14px 24px; border-top: 0; border-right: var(--bw) solid var(--border); background: var(--cream); }
  .bnav a { flex-direction: row; justify-content: flex-start; gap: 14px; padding: 12px 16px; min-height: 48px; border-radius: 14px; font-size: 15px; }
  .bnav a .ic { width: 22px; height: 22px; }
  .bnav a:hover { background: var(--taupe); }
  .bnav a.on { background: var(--sand); color: var(--clay); box-shadow: var(--shadow); }
  .bnav a.on::after { left: 0; top: 12px; bottom: 12px; width: 4px; height: auto; }
  .hdr { padding-top: 18px; padding-bottom: 14px; }
  .b-tx b { font-size: 18px; } .b-tx small { font-size: 14px; }
  .hero-btns { margin-top: 22px; }
  .sl-l { justify-content: center; }
  .tab { font-size: 15px; padding: 10px 14px; }
  /* home overview: hero beside stats */
  .lst { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card .lst, .more .lst { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slide { min-height: 300px; padding: 36px 48px 48px; align-items: center; }
  .sl-l h2 { font-size: 2.2rem; }
  .hero-art { max-width: 260px; }
  .stats { gap: 14px; }
  /* reading pages: comfortable measure, wide tables */
  .card { padding: 18px 22px; }
  .steps-s, .step .body, .formula p, .card > p, .card > ul, .note-d p { max-width: 980px; }
  figure.schem svg { max-width: 900px; }
  /* templates: inputs left, results right */
  .tpl-grid { display: grid; grid-template-columns: minmax(380px, 460px) minmax(0, 1fr); gap: 20px; align-items: start; }
  .tpl-grid #tplForm { position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow: auto; margin-top: 12px; }
  .tpl-grid .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* drawer as right-side panel */
  .drawer { left: auto; right: 0; top: 0; bottom: 0; width: 460px; max-width: 92vw; max-height: none; border-radius: 24px 0 0 24px; }
  .toast { bottom: 32px; }
  .phead .ph-t h1 { font-size: 1.9rem; }
}
@media (min-width: 1500px) {
  .lst { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .card .lst, .more .lst { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* print: clean PDF of templates and guides */
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body, .app { background: #fff; } .frame { padding: 0; } .app { max-width: none; padding: 0 !important; box-shadow: none; border: 0; }
  .tpl-grid { display: block; }
  .no-print, .hdr, .bnav, .toolbar, .searchbar, .modes, .tabs, .drawer, .scrim, .toast, .iconbtn, .tick { display: none !important; }
  .print-only { display: block; margin-bottom: 8pt; }
  .card { break-inside: avoid; box-shadow: none; background: #fff; }
  a { color: #000; text-decoration: none; }
}
