/*! MakerVerge by VergeKits: styles.css. Apothecary warmth: ivory, charcoal, VergeKits gold, sage. */
@font-face { font-family: "InterMV"; src: url("fonts/inter-var.woff2") format("woff2-variations"), url("fonts/inter-var.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --bg: #F6F3EE; --surface: #FFFFFF; --raised: #EFEBE3; --hair: rgba(28,25,23,0.08); --hair2: rgba(28,25,23,0.14);
  --text: #1C1917; --text2: #57534E; --text3: #6F6A64; --charcoal: #1C1917; --charcoal2: #292524;
  --sage: #5E6E58; --sage-bg: rgba(94,110,88,0.12);
  --gold: #C9973A; --gold-text: #8A6416; --gold-bg: rgba(201,151,58,0.14);
  --pos: #1FA67A; --pos-text: #127A57; --pos-bg: rgba(31,166,122,0.13);
  --warn: #E9A23B; --warn-text: #8F5A06; --warn-bg: rgba(233,162,59,0.16);
  --bad: #D9534F; --bad-text: #B3302C; --bad-bg: rgba(217,83,79,0.12);
  --neutral: #8B95A7; --neutral-text: #556070; --neutral-bg: rgba(139,149,167,0.16);
  --info: #3B82C4; --info-text: #2565A3; --info-bg: rgba(59,130,196,0.12);
  --shadow: 0 1px 2px rgba(28,25,23,0.04), 0 8px 24px -12px rgba(28,25,23,0.14);
  --shadow-lg: 0 24px 64px -24px rgba(28,25,23,0.35);
  --r1: 10px; --r2: 14px; --r3: 20px;
  --font: "InterMV", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Roboto, sans-serif;
  --serif: "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --side: 252px; --tabbar: 64px;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #0C0F14; --surface: #141A22; --raised: #1C2430; --hair: rgba(243,241,236,0.08); --hair2: rgba(243,241,236,0.16);
  --text: #F3F1EC; --text2: #A8A29E; --text3: #9A948E; --charcoal: #080A0E; --charcoal2: #141A22;
  --sage: #9DB394; --sage-bg: rgba(157,179,148,0.14);
  --gold-text: #E6B85C; --gold-bg: rgba(230,184,92,0.14);
  --pos-text: #4FD1A1; --warn-text: #F2BC64; --bad-text: #F08A86; --neutral-text: #AEB6C4; --info-text: #7DB3E8;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px -12px rgba(0,0,0,0.6); --shadow-lg: 0 24px 64px -24px rgba(0,0,0,0.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.45; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; overscroll-behavior-y: none; min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold-text); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
.serif { font-family: var(--serif); }
.num, td.n, .money { font-variant-numeric: tabular-nums; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
svg.i { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 18px; height: 18px; }

/* ---------- splash ---------- */
#splash { position: fixed; inset: 0; display: grid; place-items: center; background: #1C1917; z-index: 50; transition: opacity .3s; }
#splash img { width: 96px; height: 96px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(201,151,58,.6), 0 18px 50px -10px rgba(201,151,58,.5); }
#splash p { color: #E6B85C; letter-spacing: .2em; text-transform: uppercase; font-size: 12px; font-weight: 700; text-align: center; margin-top: 14px; }
#splash.gone { opacity: 0; pointer-events: none; }

/* ---------- shell ---------- */
#app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100dvh; }
#app[hidden] { display: none; }
.side { position: sticky; top: 0; height: 100dvh; background: var(--charcoal); color: #E7E5E4; display: flex; flex-direction: column; padding: calc(16px + var(--sat)) 12px 16px calc(12px + var(--sal)); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; text-decoration: none; color: inherit; }
.brand img { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(201,151,58,.55); }
.brand b { display: block; font-size: 17px; letter-spacing: -0.01em; color: #fff; }
.brand small { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #E6B85C; font-weight: 700; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: #D6D3D1; text-decoration: none; font-weight: 500; font-size: 14.5px; transition: background .14s, color .14s; position: relative; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a[aria-current="page"] { background: rgba(201,151,58,.16); color: #fff; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--gold); }
.nav a .badge { margin-left: auto; background: var(--gold); color: #1C1917; font-size: 11.5px; font-weight: 800; border-radius: 99px; padding: 1px 7px; }
.side .foot { margin-top: auto; padding: 16px 10px 0; font-size: 12px; color: #A8A29E; }
.side .foot b { color: #E6B85C; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: calc(12px + var(--sat)) calc(28px + var(--sar)) 12px 28px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--hair); }
.top .ttl { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; min-width: 0; flex: 1; display: flex; align-items: center; gap: 10px; }
.top .ttl .mlogo { display: none; width: 32px; height: 32px; border-radius: 50%; }
.top .ttl span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search { position: relative; width: min(340px, 34vw); }
.search input { width: 100%; height: 42px; border-radius: 12px; border: 1px solid var(--hair2); background: var(--surface); padding: 0 12px 0 38px; font-size: 16px; }
.search svg { position: absolute; left: 11px; top: 10px; color: var(--text3); }
.search .res { position: absolute; top: 48px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--hair2); border-radius: 14px; box-shadow: var(--shadow-lg); max-height: 60vh; overflow: auto; z-index: 30; padding: 6px; }
.search .res a { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; text-decoration: none; color: var(--text); min-height: 44px; }
.search .res a:hover, .search .res a:focus { background: var(--raised); }
.search .res small { color: var(--text2); margin-left: auto; font-size: 12px; }
.saved { font-size: 12.5px; color: var(--text2); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.saved svg { color: var(--pos); }
.page { padding: 24px 28px 48px; max-width: 1280px; width: 100%; margin: 0 auto; }
.page-in { animation: pagein .24s cubic-bezier(.2,.8,.2,1); }
@keyframes pagein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- banners ---------- */
.banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; padding: 12px 14px; border-radius: var(--r2); background: var(--gold-bg); border: 1px solid rgba(201,151,58,.35); font-size: 14px; }
.banner b { color: var(--gold-text); }
.banner .sp { flex: 1; min-width: 160px; }
.banner.info { background: var(--info-bg); border-color: rgba(59,130,196,.3); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--hair2); background: var(--surface); color: var(--text); font-weight: 600; font-size: 14.5px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .14s, background .14s, box-shadow .14s; }
.btn:hover { background: var(--raised); }
.btn:active { transform: scale(.97); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1C1917; box-shadow: 0 8px 20px -10px rgba(201,151,58,.9); }
.btn.gold:hover { background: #D4A44A; }
.btn.dark { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
html[data-theme="dark"] .btn.dark { background: var(--raised); border-color: var(--hair2); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--raised); }
.btn.danger { color: var(--bad-text); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.icon { width: 44px; padding: 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- headings, sections ---------- */
.ph { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.ph h1 { font-size: 28px; font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }
.ph p { margin: 6px 0 0; color: var(--text2); max-width: 70ch; }
.ph .sp { flex: 1; min-width: 200px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--text2); text-decoration: none; font-weight: 600; font-size: 14px; min-height: 36px; margin-bottom: 4px; }
.sec { margin: 28px 0 12px; display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.sec h2 { font-size: 18px; font-weight: 700; }
.sec .sp { flex: 1; }
.muted { color: var(--text2); }
.small { font-size: 13px; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--raised); margin: 0 0 18px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg a, .seg button { flex: 1 0 auto; min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; text-decoration: none; color: var(--text2); font-weight: 600; font-size: 14px; border: 0; background: transparent; cursor: pointer; white-space: nowrap; }
.seg a[aria-current="page"], .seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(28,25,23,.12); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.chipbtn { min-height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--hair2); background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--text2); cursor: pointer; }
.chipbtn[aria-pressed="true"] { background: var(--charcoal); color: #fff; border-color: var(--charcoal); }
html[data-theme="dark"] .chipbtn[aria-pressed="true"] { background: var(--gold); color: #1C1917; border-color: var(--gold); }

/* ---------- cards and grids ---------- */
.card { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r3); box-shadow: var(--shadow); padding: 20px; position: relative; }
.card.pad0 { padding: 0; overflow: hidden; }
.card h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h3 .sp { flex: 1; }
a.card, .card.link { text-decoration: none; color: inherit; transition: transform .14s, box-shadow .24s; cursor: pointer; }
a.card::after, .card.link::after { content: ""; position: absolute; left: 20px; right: 20px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--gold); transform: scaleX(0); transition: transform .24s; }
a.card:hover::after, a.card:focus-visible::after, .card.link:hover::after { transform: scaleX(1); }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r3); box-shadow: var(--shadow); padding: 16px 18px; text-decoration: none; color: inherit; position: relative; overflow: hidden; min-width: 0; }
.kpi .lab { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); font-weight: 600; }
.kpi .lab .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--gold-bg); color: var(--gold-text); flex: none; }
.kpi .lab .ic.sage { background: var(--sage-bg); color: var(--sage); }
.kpi .val { font-family: var(--serif); font-size: 30px; font-weight: 600; letter-spacing: -0.01em; margin-top: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .sub { font-size: 12.5px; color: var(--text2); margin-top: 2px; }
.kpi.hero { background: linear-gradient(160deg, #24201C, #1C1917 60%); color: #F3F1EC; border-color: transparent; }
.kpi.hero .lab { color: #D6D3D1; }
.kpi.hero .lab .ic { background: rgba(201,151,58,.2); color: #E6B85C; }
.kpi.hero .sub { color: #B9B4AE; }
.kpi.hero::after { content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(201,151,58,.28), transparent 70%); }

/* ---------- lists ---------- */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; min-height: 56px; border-bottom: 1px solid var(--hair); text-decoration: none; color: inherit; }
.row:last-child { border-bottom: 0; }
a.row:hover { background: var(--raised); border-radius: 10px; }
.row .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--raised); color: var(--text2); flex: none; }
.row .ic.sage { background: var(--sage-bg); color: var(--sage); }
.row .ic.gold { background: var(--gold-bg); color: var(--gold-text); }
.row .t { flex: 1; min-width: 0; }
.row .t b { display: block; font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .t small { display: block; color: var(--text2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .r { text-align: right; flex: none; }
.row .r b { display: block; font-weight: 700; }
.row .r small { color: var(--text2); font-size: 12.5px; }

/* ---------- tables ---------- */
.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text2); padding: 12px 12px; border-bottom: 1px solid var(--hair2); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
table.t td { padding: 12px 12px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr[data-href] { cursor: pointer; }
table.t tbody tr[data-href]:hover td { background: var(--raised); }
table.t .n, table.t th.n { text-align: right; white-space: nowrap; }
table.t td b { font-weight: 600; }
table.t td small { display: block; color: var(--text2); font-size: 12px; }
table.t tfoot td { font-weight: 700; border-top: 1px solid var(--hair2); }
.more { display: flex; justify-content: center; padding: 14px; }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--neutral-bg); color: var(--neutral-text); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.pos { background: var(--pos-bg); color: var(--pos-text); }
.chip.warn { background: var(--warn-bg); color: var(--warn-text); }
.chip.bad { background: var(--bad-bg); color: var(--bad-text); }
.chip.info { background: var(--info-bg); color: var(--info-text); }
.chip.sage { background: var(--sage-bg); color: var(--sage); }
.chip.gold { background: var(--gold-bg); color: var(--gold-text); }
.chip.plain::before { display: none; }
.flag-low { color: var(--warn-text); font-weight: 700; }

/* ---------- empty ---------- */
.empty { text-align: center; padding: 40px 20px; }
.empty svg { width: 120px; height: 90px; margin: 0 auto 10px; display: block; }
.empty h3 { font-family: var(--serif); font-size: 20px; margin-bottom: 6px; justify-content: center; }
.empty p { color: var(--text2); margin: 0 auto 16px; max-width: 46ch; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field label, .field .lbl { font-size: 13px; font-weight: 600; color: var(--text2); }
.field .hint { font-size: 12.5px; color: var(--text3); }
.field .err { font-size: 12.5px; color: var(--bad-text); font-weight: 600; }
.inp, select.inp, textarea.inp { width: 100%; min-height: 46px; border-radius: 12px; border: 1px solid var(--hair2); background: var(--surface); padding: 0 12px; font-size: 16px; color: var(--text); }
textarea.inp { padding: 10px 12px; min-height: 84px; resize: vertical; }
.inp:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 4px var(--gold-bg); }
.inp.bad { border-color: var(--bad); }
.inp[readonly] { background: var(--raised); }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.fgrid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--gold); }
.inline { display: flex; gap: 8px; align-items: center; }
.inline .inp { flex: 1; }
.affix { position: relative; }
.affix span { position: absolute; right: 12px; top: 13px; color: var(--text3); font-size: 14px; pointer-events: none; }
.affix .inp { padding-right: 46px; }

/* ---------- sheet (dialog) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(12,10,9,.48); z-index: 60; opacity: 0; transition: opacity .24s; }
.scrim.on { opacity: 1; }
.sheet { position: fixed; z-index: 61; left: 50%; top: 50%; width: min(640px, calc(100vw - 32px)); max-height: min(86dvh, 860px); transform: translate(-50%, -48%) scale(.98); opacity: 0; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transition: transform .24s cubic-bezier(.2,.8,.2,1), opacity .24s; }
.sheet.wide { width: min(880px, calc(100vw - 32px)); }
.sheet.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.sheet .sh { display: flex; align-items: center; gap: 10px; padding: 18px 20px 12px; border-bottom: 1px solid var(--hair); }
.sheet .sh h2 { font-size: 19px; flex: 1; font-family: var(--serif); font-weight: 600; }
.sheet .sb { padding: 18px 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet .sf { display: flex; gap: 8px; padding: 12px 20px calc(14px + var(--sab)); border-top: 1px solid var(--hair); justify-content: flex-end; flex-wrap: wrap; }
.sheet .sf .sp { flex: 1; }
.menu a, .menu button { display: flex; width: 100%; align-items: center; gap: 14px; min-height: 56px; padding: 0 14px; border: 0; border-radius: 14px; background: transparent; text-decoration: none; color: var(--text); font-weight: 600; font-size: 16px; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--raised); }
.menu .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--gold-bg); color: var(--gold-text); }

/* ---------- toast ---------- */
#toasts { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--sab)); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(520px, calc(100vw - 24px)); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: #1C1917; color: #F3F1EC; border-radius: 14px; padding: 10px 10px 10px 16px; min-height: 48px; box-shadow: var(--shadow-lg); font-size: 14.5px; animation: toastin .24s cubic-bezier(.2,.8,.2,1); width: 100%; }
html[data-theme="dark"] .toast { background: #F3F1EC; color: #1C1917; }
.toast span { flex: 1; }
.toast button { min-height: 36px; padding: 0 12px; border-radius: 10px; border: 0; background: rgba(201,151,58,.22); color: #E6B85C; font-weight: 700; cursor: pointer; }
html[data-theme="dark"] .toast button { color: #8A6416; }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- mobile chrome ---------- */
.tabbar { display: none; }
.fab { display: none; }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--text2); }
.chart .grid line { stroke: var(--hair); }
.chart .bar { transform-origin: bottom; transform-box: fill-box; animation: grow .7s cubic-bezier(.2,.8,.2,1) both; }
.chart .line { stroke-dasharray: 1600; stroke-dashoffset: 1600; animation: draw .7s ease-out forwards; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes growx { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 8px 10px; align-items: center; font-size: 13.5px; }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .trk { height: 12px; background: var(--raised); border-radius: 6px; overflow: hidden; }
.hbar .fill { display: block; height: 100%; border-radius: 6px; background: var(--gold); transform-origin: left; animation: growx .7s cubic-bezier(.2,.8,.2,1) both; }
.hbar .fill.sage { background: var(--sage); }
.hbar .fill.warn { background: var(--warn); }
.hbar .v { text-align: right; font-weight: 600; white-space: nowrap; }

/* ---------- misc components ---------- */
.stat { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--hair2); font-size: 14.5px; }
.stat:last-child { border-bottom: 0; }
.stat b { font-weight: 700; text-align: right; }
.stat.total { border-top: 2px solid var(--text); border-bottom: 0; margin-top: 4px; padding-top: 12px; font-size: 16px; }
.stat.total b { font-family: var(--serif); font-size: 22px; }
.note { padding: 12px 14px; border-radius: 14px; background: var(--sage-bg); color: var(--text); font-size: 14px; border-left: 3px solid var(--sage); }
.note.gold { background: var(--gold-bg); border-left-color: var(--gold); }
.note.warn { background: var(--warn-bg); border-left-color: var(--warn); }
.big { font-family: var(--serif); font-size: 34px; font-weight: 600; letter-spacing: -0.01em; }
.split { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }
.pillbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--raised); }
.pillbar span { display: block; height: 100%; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.tally { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { position: relative; border: 1px solid var(--hair2); background: var(--surface); border-radius: 18px; padding: 14px; min-height: 120px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: transform .14s, box-shadow .14s; box-shadow: var(--shadow); -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.tile:active { transform: scale(.96); }
.tile b { font-size: 14px; line-height: 1.25; padding-right: 40px; }
.tile .cnt { font-family: var(--serif); font-size: 32px; font-weight: 600; margin-top: auto; }
.tile small { color: var(--text2); font-size: 12.5px; }
.tile .minus { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--hair2); background: var(--raised); display: grid; place-items: center; cursor: pointer; }
.tile.bump { animation: bump .3s; }
@keyframes bump { 40% { transform: scale(1.04); box-shadow: 0 0 0 4px var(--gold-bg); } }
.meter { height: 10px; border-radius: 5px; background: var(--raised); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--sage); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.photos figure { margin: 0; position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--raised); }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos button { position: absolute; top: 6px; right: 6px; }
.onb { min-height: 100dvh; display: grid; place-items: center; padding: calc(24px + var(--sat)) 18px calc(24px + var(--sab)); background: radial-gradient(800px 400px at 0% 0%, rgba(201,151,58,.18), transparent 60%), radial-gradient(700px 400px at 100% 100%, rgba(94,110,88,.18), transparent 60%), var(--bg); }
.onb .card { width: min(600px, 100%); padding: 28px 24px; }
.onb .logo { width: 72px; height: 72px; border-radius: 50%; display: block; margin: 0 auto 10px; box-shadow: 0 0 0 2px rgba(201,151,58,.5), 0 14px 40px -12px rgba(201,151,58,.55); }
.onb h1 { font-family: var(--serif); text-align: center; font-size: 30px; font-weight: 600; }
.onb .lead { text-align: center; color: var(--text2); margin: 8px auto 22px; max-width: 46ch; }
.steps { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.steps i { width: 28px; height: 4px; border-radius: 2px; background: var(--hair2); }
.steps i.on { background: var(--gold); }
.makes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.makes label { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--hair2); cursor: pointer; font-weight: 600; font-size: 14px; }
.makes input { width: 20px; height: 20px; accent-color: var(--gold); flex: none; }
.makes label:has(input:checked) { border-color: var(--gold); background: var(--gold-bg); }
.help { margin-top: 16px; font-size: 13.5px; color: var(--text2); text-align: center; }
.kbd { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--raised); padding: 1px 6px; border-radius: 6px; }
.lyebox { display: flex; gap: 12px; align-items: flex-start; }
.donut { width: 132px; height: 132px; flex: none; }
.cost-legend { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.cost-legend div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.check-row td:first-child { width: 96px; }
.lab-preview { border: 1.5px dashed var(--hair2); border-radius: 16px; padding: 18px; background: var(--surface); }
.lab-preview h4 { font-family: var(--serif); font-size: 20px; }

/* ---------- print ---------- */
#print { display: none; }
@media print {
  @page { margin: 14mm; }
  html, body { background: #fff !important; color: #1C1917 !important; }
  body > *:not(#print) { display: none !important; }
  #print { display: block !important; font-family: var(--font); color: #1C1917; font-size: 11pt; }
  #print * { color: #1C1917; }
  .doc { page-break-after: always; }
  .doc:last-child { page-break-after: auto; }
  .doc table { width: 100%; border-collapse: collapse; }
  .doc th { text-align: left; font-size: 9pt; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1.5pt solid #1C1917; padding: 6pt 4pt; }
  .doc td { padding: 6pt 4pt; border-bottom: .5pt solid #ccc; vertical-align: top; }
  .doc tr { page-break-inside: avoid; }
  .doc .n { text-align: right; white-space: nowrap; }
}
.doc .dh { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 2pt solid #C9973A; padding-bottom: 10pt; margin-bottom: 14pt; }
.doc .dh img { width: 54px; height: 54px; border-radius: 50%; }
.doc .dh h1 { font-family: var(--serif); font-size: 24pt; font-weight: 600; margin: 0; }
.doc .meta { text-align: right; font-size: 10pt; line-height: 1.5; }
.doc .two { display: flex; gap: 30px; margin-bottom: 14pt; font-size: 10pt; line-height: 1.5; }
.doc .two > div { flex: 1; }
.doc .tot { margin-left: auto; width: 46%; margin-top: 10pt; }
.doc .tot div { display: flex; justify-content: space-between; padding: 3pt 0; }
.doc .tot .g { border-top: 1.5pt solid #1C1917; font-weight: 700; font-size: 13pt; padding-top: 6pt; }
.doc .disc { margin-top: 18pt; font-size: 8.5pt; color: #57534E !important; border-top: .5pt solid #ccc; padding-top: 6pt; }
.doc .lbl-gold { color: #8A6416 !important; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 8.5pt; }

/* ---------- reduced motion and screenshot mode ---------- */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } .chart .line { stroke-dashoffset: 0; } }
html.shot *, html.shot *::before, html.shot *::after { animation: none !important; transition: none !important; }
html.shot .chart .line { stroke-dashoffset: 0; }
html.shot #toasts { display: none !important; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1024px) { :root { --side: 220px; } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .search { width: 220px; } }
@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  .side { display: none; }
  .top { padding: calc(10px + var(--sat)) calc(16px + var(--sar)) 10px calc(16px + var(--sal)); background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .top .ttl { font-size: 18px; }
  .top .ttl .mlogo { display: block; }
  .top .newb, .top .saved { display: none; }
  .search { width: auto; flex: 0 1 180px; }
  .search.open { position: absolute; left: 12px; right: 12px; top: calc(8px + var(--sat)); width: auto; z-index: 31; }
  .page { padding: 16px calc(16px + var(--sar)) calc(var(--tabbar) + 40px + var(--sab)) calc(16px + var(--sal)); }
  .ph h1 { font-size: 24px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .fgrid { grid-template-columns: 1fr; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar) + var(--sab)); padding: 0 var(--sar) var(--sab) var(--sal); background: var(--surface); border-top: 1px solid var(--hair2); box-shadow: 0 -8px 24px -16px rgba(28,25,23,.25); transform: translateZ(0); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--text2); font-size: 11.5px; font-weight: 600; min-width: 0; white-space: nowrap; }
  .tabbar a[aria-current="page"] { color: var(--gold-text); }
  .tabbar a[aria-current="page"] svg { stroke-width: 2; }
  .fab { display: grid; place-items: center; position: fixed; z-index: 41; right: calc(16px + var(--sar)); bottom: calc(var(--tabbar) + 16px + var(--sab)); width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--gold); color: #1C1917; box-shadow: 0 12px 28px -10px rgba(201,151,58,.9), 0 2px 6px rgba(28,25,23,.2); cursor: pointer; }
  .fab svg { width: 26px; height: 26px; stroke-width: 2.2; }
  #toasts { bottom: calc(var(--tabbar) + 88px + var(--sab)); }
  .sheet { left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 92dvh; border-radius: 22px 22px 0 0; transform: translateY(100%); opacity: 1; }
  .sheet.wide { width: 100%; }
  .sheet.on { transform: translateY(0); }
  .sheet .sh::before { content: ""; position: absolute; left: 50%; top: 7px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--hair2); }
  .sheet .sh { position: relative; padding-top: 22px; }
  table.t.stack thead { display: none; }
  table.t.stack, table.t.stack tbody, table.t.stack tr, table.t.stack td { display: block; width: 100%; }
  table.t.stack tr { padding: 10px 2px; border-bottom: 1px solid var(--hair); display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
  table.t.stack td { border: 0; padding: 2px 0; }
  table.t.stack td.n { text-align: right; }
  table.t.stack td[data-l]:not(.k)::before { content: attr(data-l) ": "; color: var(--text2); font-size: 12px; font-weight: 600; }
  table.t.stack td.k::before { content: none; }
  table.t.stack td.hide-m { display: none; }
  table.t.stack tfoot tr { border-bottom: 0; }
  .kpi .val { font-size: 25px; }
  .kpis { gap: 10px; }
  .kpi { padding: 14px; }
  .banner .btns { width: 100%; }
}
@media (max-width: 600px) {
  .search { flex: 0 0 44px; }
  .search:not(.open) input { padding: 0; width: 44px; color: transparent; cursor: pointer; }
  .search:not(.open) input::placeholder { color: transparent; }
  .search svg { left: 13px; top: 12px; }
}
@media (max-width: 380px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi .val { font-size: 21px; }
  .kpi .lab { font-size: 12px; }
  .kpi .lab .ic { display: none; }
  .tabbar a { font-size: 11px; }
  .makes { grid-template-columns: 1fr; }
  .search { flex-basis: 44px; }
  .search:not(.open) input { padding: 0; width: 44px; color: transparent; }
  .search:not(.open) input::placeholder { color: transparent; }
}
@media (min-width: 1800px) { .page { max-width: 1480px; } }
.mobile-only { display: none; }
@media (max-width: 900px) { .mobile-only { display: inline-flex; } }
.card .btn { max-width: 100%; }
@media (max-width: 420px) { .row { flex-wrap: wrap; } .row .t { min-width: 60%; } .card .btn { white-space: normal; text-align: left; line-height: 1.25; } }
/* touch screens: every tap target at least 44 x 44 px */
@media (pointer: coarse) { .btn.sm, .chipbtn, .seg a, .seg button { min-height: 44px; } .btn.icon.sm, .tile .minus { width: 44px; height: 44px; } }
