/* AFCA Finance workspace mockup. Tokens, cards and tiles follow Admin
   (apps/web/app/(admin)/admin.css); colours are the conference palette. */
@font-face { font-family: Geist; src: url(assets/geist-latin.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --background: oklch(0.968 0.019 88);
  --foreground: oklch(0.23 0.024 62);
  --card: oklch(0.995 0.007 90);
  --muted: oklch(0.94 0.016 86);
  --muted-foreground: oklch(0.5 0.024 68);
  --border: oklch(0.89 0.018 84);
  --sidebar: oklch(0.952 0.022 87);
  --primary: #2fa343;
  --green: #258a37;
  --gold: #9a7a0a;
  --brown: #5b3a1c;
  --red: #c22e22;
  --clay: #e23a2c;
  --radius: 0.625rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--background); color: var(--foreground); font: 14px/1.5 Geist, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }

/* Shell */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; overflow: auto; background: var(--sidebar); padding: 16px 12px 24px; display: flex; flex-direction: column; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.brand img { width: 34px; height: auto; }
.brand b { display: block; font-size: 14px; font-weight: 600; line-height: 1.2; }
.brand span { display: block; font-size: 12px; color: var(--muted-foreground); }
.group + .group { margin-top: 18px; }
.group h4 { margin: 0 0 4px; padding: 0 10px; font-size: 12px; font-weight: 500; color: var(--muted-foreground); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; font-size: 13.5px; color: oklch(0.29 0.022 62); transition: background .15s; }
.nav a svg { width: 17px; height: 17px; flex: none; stroke: currentColor; opacity: .8; }
.nav a:hover { background: oklch(0.93 0.018 86); }
.nav a[aria-current="page"] { background: var(--card); box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--border) 75%, transparent), 0 1px 2px rgb(0 0 0 / .04); font-weight: 500; }
.nav a .count { margin-left: auto; font-size: 12px; color: var(--muted-foreground); }

.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 32px; background: color-mix(in oklch, var(--background) 88%, transparent); backdrop-filter: blur(10px); }
.env { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--border); }
.env button { border: 0; background: none; padding: 5px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--muted-foreground); cursor: pointer; }
.env button[aria-pressed="true"] { background: var(--primary); color: #fff; }
.env button[data-env="test"][aria-pressed="true"] { background: var(--clay); }
.tool { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--card); box-shadow: inset 0 0 0 1px var(--border); font-size: 13px; font-weight: 500; cursor: pointer; }
.sandbox-strip { display: none; background: var(--clay); color: #fff; text-align: center; font-size: 12.5px; font-weight: 500; padding: 4px; }
body.is-sandbox .sandbox-strip { display: block; }

.page { max-width: 1240px; padding: 8px 32px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 12px 0 24px; }
.page-head h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.page-head p { margin-top: 4px; color: var(--muted-foreground); }
.back { display: inline-block; margin-bottom: 6px; font-size: 13px; color: var(--muted-foreground); }
.back:hover { color: var(--foreground); }

/* Surfaces */
.card { background: var(--card); border: 1px solid color-mix(in oklch, var(--border) 85%, transparent); border-radius: calc(var(--radius) * 1.6); box-shadow: 0 1px 2px rgb(0 0 0 / .05), 0 10px 24px -8px rgb(0 0 0 / .10), inset 0 1px 0 rgb(255 255 255 / .75); }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 22px 6px; }
.card-head h2 { font-size: 15px; font-weight: 600; }
.card-head a, .link { font-size: 13px; font-weight: 500; color: var(--green); }
.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.stack > * + * { margin-top: 16px; }

/* Metric tiles: monochrome icon, the digit carries the colour */
.tile { display: block; padding: 18px 20px; cursor: pointer; transition: box-shadow .25s var(--ease), transform .25s var(--ease); }
.tile:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgb(0 0 0 / .06), 0 18px 38px -10px rgb(0 0 0 / .16), inset 0 1px 0 rgb(255 255 255 / .75); }
.tile .lab { display: flex; justify-content: space-between; color: var(--muted-foreground); font-size: 13px; font-weight: 500; }
.tile .lab svg { width: 18px; height: 18px; stroke: var(--foreground); opacity: .7; }
.tile b { display: block; margin-top: 14px; font-size: 30px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.tile small { display: block; margin-top: 8px; color: var(--muted-foreground); font-size: 12.5px; }
.t-green b { color: var(--green); } .t-gold b { color: var(--gold); } .t-brown b { color: var(--brown); } .t-red b { color: var(--red); }

/* Rows */
.rows { list-style: none; margin: 0; padding: 4px 10px 10px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 18px; padding: 12px; border-radius: 10px; }
.row + .row { box-shadow: 0 -1px 0 color-mix(in oklch, var(--border) 70%, transparent); }
.row:hover { background: color-mix(in oklch, var(--muted) 60%, transparent); }
.row b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row span.sub { display: block; color: var(--muted-foreground); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .amt { font-weight: 600; text-align: right; }
.row .amt small { display: block; font-weight: 400; color: var(--muted-foreground); font-size: 12px; }

.state { font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.s-green { color: var(--green); } .s-gold { color: var(--gold); } .s-red { color: var(--red); } .s-muted { color: var(--muted-foreground); } .s-brown { color: var(--brown); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 34px; padding: 0 14px; border-radius: 9px; border: 0; background: var(--primary); color: #fff; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; box-shadow: inset 0 1px 0 rgb(255 255 255 / .2), 0 1px 2px rgb(0 0 0 / .12); }
.btn:hover { background: var(--green); }
.btn.ghost { background: var(--card); color: var(--foreground); box-shadow: inset 0 0 0 1px var(--border); }
.btn.ghost:hover { background: var(--muted); }
.btn[disabled] { background: var(--muted); color: var(--muted-foreground); box-shadow: none; cursor: not-allowed; }

/* Tables */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px 22px 8px; }
.seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 10px; background: var(--muted); }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 7px; font-size: 13px; color: var(--muted-foreground); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--foreground); font-weight: 500; box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.seg button b { margin-left: 6px; font-weight: 500; }
.search { position: relative; margin-left: auto; width: 280px; }
.search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); stroke: var(--muted-foreground); }
.input { width: 100%; height: 36px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--border); background: var(--card); outline: none; }
.search .input { padding-left: 36px; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 18%, transparent); }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted-foreground); padding: 10px 22px; }
td { padding: 13px 22px; box-shadow: 0 -1px 0 color-mix(in oklch, var(--border) 70%, transparent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: color-mix(in oklch, var(--muted) 55%, transparent); }
td.r, th.r { text-align: right; }
td .sub { display: block; color: var(--muted-foreground); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }

/* Facts */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.facts dt { font-size: 12px; color: var(--muted-foreground); }
.facts dd { margin: 2px 0 0; font-weight: 500; }
dl { margin: 0; }

/* Steps: one line of progress, the current one stands out */
.steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.steps div { padding-top: 10px; border-top: 3px solid var(--border); font-size: 12.5px; color: var(--muted-foreground); }
.steps div b { display: block; color: var(--foreground); font-weight: 500; font-size: 13px; }
.steps .done { border-color: var(--primary); }
.steps .now { border-color: var(--gold); }
.steps .now b { color: var(--gold); }

/* Allocation */
.alloc { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; align-items: center; padding: 12px 0; }
.alloc + .alloc { box-shadow: 0 -1px 0 color-mix(in oklch, var(--border) 70%, transparent); }
.alloc .input { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.meter { height: 8px; border-radius: 99px; background: var(--muted); overflow: hidden; margin-top: 14px; }
.meter i { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .4s var(--ease); }
.balance { display: flex; justify-content: space-between; margin-top: 10px; font-size: 13px; }

.notice { padding: 12px 16px; border-radius: 12px; background: oklch(0.95 0.05 80); color: oklch(0.42 0.11 65); font-size: 13px; }
.notice.ok { background: oklch(0.94 0.05 148); color: oklch(0.38 0.11 148); }
.notice.bad { background: oklch(0.95 0.03 25); color: oklch(0.48 0.18 27); }
.trail { list-style: none; margin: 0; padding: 0; }
.trail li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 9px 0; font-size: 13px; }
.trail li + li { box-shadow: 0 -1px 0 color-mix(in oklch, var(--border) 70%, transparent); }
.trail time { color: var(--muted-foreground); }

/* Bids */
.bids { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.bid { padding: 16px; border-radius: 12px; background: color-mix(in oklch, var(--muted) 55%, var(--card)); cursor: pointer; transition: box-shadow .2s; }
.bid[aria-pressed="true"] { background: var(--card); box-shadow: inset 0 0 0 2px var(--primary); }
.bid b { display: block; font-weight: 600; }
.bid .price { margin-top: 10px; font-size: 22px; font-weight: 600; }
.bid p { margin-top: 6px; color: var(--muted-foreground); font-size: 12.5px; }
.bid .best { color: var(--green); font-weight: 500; font-size: 12.5px; }

/* Chart */
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 14px; align-items: end; height: 190px; padding: 12px 22px 0; }
.bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 3px; }
.bar .pair { display: flex; gap: 4px; align-items: flex-end; height: calc(100% - 22px); width: 100%; justify-content: center; }
.bar i { display: block; width: 40%; max-width: 22px; border-radius: 5px 5px 2px 2px; transition: height .5s var(--ease); }
.bar i.in { background: var(--primary); }
.bar i.out { background: #c98c5c; }
.bar span { font-size: 12px; color: var(--muted-foreground); }
.key { display: flex; gap: 18px; padding: 10px 22px 18px; font-size: 12.5px; color: var(--muted-foreground); }
.key span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; background: var(--primary); }
.key span.o::before { background: #c98c5c; }
.budget { padding: 4px 22px 18px; }
.budget > div { padding: 10px 0; }
.budget > div + div { box-shadow: 0 -1px 0 color-mix(in oklch, var(--border) 70%, transparent); }
.budget .l { display: flex; justify-content: space-between; font-size: 13px; }
.budget .meter { margin-top: 8px; height: 6px; }
.budget .over i { background: var(--clay); }

/* Toast */
.toast { position: fixed; left: 50%; top: 18px; z-index: 20; transform: translate(-50%, -12px); opacity: 0; pointer-events: none; padding: 10px 16px; border-radius: 12px; background: var(--foreground); color: #fff; font-size: 13px; font-weight: 500; transition: opacity .25s, transform .3s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Screen transition */
.page > section { animation: rise .35s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .page > section { animation: none; } }

@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; height: auto; flex-direction: row; overflow-x: auto; gap: 8px; padding: 10px 12px; }
  .rail .brand, .group h4 { display: none; }
  #nav { display: flex; gap: 4px; }
  .group + .group { margin-top: 0; }
  .group .nav { display: flex; gap: 4px; }
  .tile b { font-size: 24px; }
  .row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .row > div:first-child { grid-column: 1 / -1; }
  .row b, .row span.sub { white-space: normal; }
  td, th { padding-left: 14px; padding-right: 14px; }
  .tile .lab svg { display: none; }
  .nav a { white-space: nowrap; }
  .nav a .count { display: none; }
  .page, .top { padding-left: 16px; padding-right: 16px; }
  .g3, .g2, .bids { grid-template-columns: minmax(0, 1fr); }
  .search { width: 100%; margin-left: 0; }
  .hide-sm { display: none; }
}

/* ---------------------------------------------------------------- v2 -- */
.small { font-size: 12.5px; } .w5 { font-weight: 500; } .h2 { font-size: 15px; font-weight: 600; }
.sub { display: block; color: var(--muted-foreground); font-size: 12.5px; }
b .sub, .row .sub { display: block; }
.r { text-align: right; }
.mt { margin-top: 16px; }

/* Module navigation: the open module shows its submodules */
#nav { display: flex; flex-direction: column; gap: 2px; }
.modlink { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; font-size: 13.5px; font-weight: 500; color: oklch(0.29 0.022 62); }
.modlink svg { width: 18px; height: 18px; flex: none; stroke: currentColor; opacity: .75; }
.modlink svg:last-child:not(:first-child) { width: 14px; height: 14px; margin-left: auto; opacity: 0; transition: opacity .15s; }
.modlink:hover { background: oklch(0.93 0.018 86); }
.modlink:hover svg:last-child:not(:first-child) { opacity: .5; }
.modlink[data-on] { color: var(--foreground); }
.subs { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 8px 19px; padding-left: 12px; box-shadow: inset 1px 0 0 var(--border); }
.subs a { display: flex; align-items: center; padding: 6px 10px; border-radius: 8px; font-size: 13px; color: oklch(0.36 0.022 62); }
.subs a:hover { background: oklch(0.93 0.018 86); }
.subs a[aria-current="page"] { background: var(--card); color: var(--foreground); font-weight: 500; box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--border) 75%, transparent), 0 1px 2px rgb(0 0 0 / .04); }
.subs .count { margin-left: auto; font-size: 11.5px; color: var(--muted-foreground); }

/* Top bar */
.top { justify-content: flex-start; }
.spacer { flex: 1; }
.searchbar { display: flex; align-items: center; gap: 10px; width: min(420px, 40vw); height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--card); box-shadow: inset 0 0 0 1px var(--border); color: var(--muted-foreground); font-size: 13px; cursor: text; }
.searchbar svg { width: 16px; height: 16px; stroke: currentColor; }
.searchbar b { color: var(--foreground); font-weight: 500; }
.searchbar kbd { margin-left: auto; padding: 1px 7px; border-radius: 6px; background: var(--muted); font: 500 11.5px Geist, sans-serif; }
.iconbtn { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--card); box-shadow: inset 0 0 0 1px var(--border); cursor: pointer; }
.iconbtn svg { width: 18px; height: 18px; stroke: var(--foreground); }
.iconbtn.plus { background: var(--primary); box-shadow: none; }
.iconbtn.plus svg { stroke: #fff; }
.iconbtn .dot { position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--clay); color: #fff; font: 600 10.5px/17px Geist, sans-serif; font-style: normal; }
.menuwrap { position: relative; }
.menu { position: absolute; right: 0; top: 44px; z-index: 30; min-width: 280px; padding: 10px; border-radius: 14px; background: var(--card); box-shadow: 0 0 0 1px var(--border), 0 18px 40px -12px rgb(0 0 0 / .25); }
.menu h4 { margin: 6px 8px 4px; font-size: 11.5px; font-weight: 500; color: var(--muted-foreground); }
.menu a { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; font-size: 13px; }
.menu a:hover { background: var(--muted); }
.menu a svg { width: 14px; height: 14px; stroke: var(--green); }
.menu.create { display: grid; grid-template-columns: repeat(3, 180px); gap: 4px; }
.menu.create[hidden], .menu[hidden] { display: none; }
.menu.alerts { width: 340px; }
.menu.alerts a { display: block; }

/* Command palette */
.palette { position: fixed; inset: 0; z-index: 40; display: grid; place-items: start center; padding-top: 12vh; background: rgb(34 28 20 / .28); }
.palette[hidden] { display: none; }
.palbox { width: min(640px, calc(100vw - 32px)); border-radius: 16px; background: var(--card); box-shadow: 0 30px 80px -20px rgb(0 0 0 / .45); overflow: hidden; }
.palbox input { width: 100%; height: 54px; padding: 0 20px; border: 0; outline: none; background: none; font-size: 16px; box-shadow: 0 1px 0 var(--border); }
#palres { max-height: 420px; overflow: auto; padding: 8px; }
#palres a { display: grid; grid-template-columns: 90px minmax(0, 1fr); column-gap: 10px; padding: 9px 12px; border-radius: 10px; }
#palres a .k { grid-row: span 2; font-size: 11.5px; color: var(--muted-foreground); padding-top: 2px; }
#palres a b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#palres a[data-sel], #palres a:hover { background: var(--muted); }

/* Page parts */
.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.input.slim { width: auto; height: 34px; padding: 0 10px; font-size: 13px; }
.input.r { text-align: right; }
select.input { appearance: auto; }
.field { display: block; }
.field > span { display: block; margin-bottom: 4px; font-size: 12px; color: var(--muted-foreground); }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.link-btn { margin-top: 10px; border: 0; background: none; padding: 0; color: var(--green); font-weight: 500; font-size: 13px; cursor: pointer; }
.totals { display: flex; justify-content: flex-end; align-items: baseline; gap: 24px; margin-top: 16px; font-size: 14px; }
.totals b { font-size: 20px; }
.totals.sub { margin-top: 4px; }
.lines td, .lines th { padding-left: 6px; padding-right: 6px; box-shadow: none; }
.lines td { padding-top: 6px; padding-bottom: 6px; overflow: visible; }
.row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.seg.small button { padding: 4px 10px; font-size: 12.5px; }
.bulk { display: flex; align-items: center; gap: 8px; margin: 0 22px 8px; padding: 8px 12px; border-radius: 10px; background: oklch(0.94 0.05 148); }
.bulk b { margin-right: auto; font-weight: 500; color: oklch(0.38 0.11 148); }
.cb { width: 16px; height: 16px; accent-color: var(--primary); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 22px 14px; font-size: 12.5px; }
.pager .pages { display: flex; gap: 4px; }
.pager button { min-width: 32px; height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--foreground); cursor: pointer; font-size: 12.5px; }
.pager button[aria-current="page"] { background: var(--foreground); color: #fff; }
.pager button:disabled { opacity: .4; cursor: default; }
.pager button:hover:not(:disabled):not([aria-current]) { background: var(--muted); }
.row.approve-row { grid-template-columns: minmax(0, 1fr) auto auto auto; }
.acts { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.shortcuts { padding: 4px 10px 12px; }
.shortcuts a { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 9px; font-size: 13.5px; }
.shortcuts a:hover { background: var(--muted); }
.shortcuts svg { width: 15px; height: 15px; stroke: var(--muted-foreground); }
.mini + .mini { margin-top: 14px; }
.mini .meter { margin-top: 6px; }
.big { display: block; margin: 6px 0 4px; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.acct { display: flex; flex-direction: column; gap: 2px; transition: box-shadow .2s; }
.acct > b { font-size: 15px; font-weight: 600; margin-top: 2px; }
.proj { display: block; }
.proj .title { display: block; margin-top: 2px; font-size: 16px; font-weight: 600; }
.bignet { font-size: 18px; font-weight: 600; }
.proj .facts { margin-top: 14px; }
.grant > div .meter { margin: 10px 0 6px; max-width: 520px; }
.grouprow td { background: color-mix(in oklch, var(--muted) 55%, transparent); }
.totalrow td { box-shadow: 0 -2px 0 var(--border); }
.checkline { display: flex; gap: 12px; align-items: flex-start; }
.tick { flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border-radius: 99px; box-shadow: inset 0 0 0 1.5px var(--border); }
.tick.on { background: var(--primary); box-shadow: none; }
.tick svg { width: 14px; height: 14px; stroke: #fff; }
.choice { display: grid; gap: 8px; margin-top: 12px; }
.choice label { display: block; padding: 10px 12px; border-radius: 10px; background: color-mix(in oklch, var(--muted) 55%, var(--card)); cursor: pointer; }
.switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--border); transition: background .2s; cursor: pointer; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 99px; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform .2s var(--ease); }
.switch input:checked + i { background: var(--primary); }
.switch input:checked + i::after { transform: translateX(16px); }
.meter.over i { background: var(--clay); }

/* Charts */
.chart { display: block; width: 100%; height: auto; }
.chart text { font: 11.5px Geist, sans-serif; fill: var(--muted-foreground); }
.chart .gridline { stroke: var(--border); stroke-dasharray: 3 4; }
.chart .floor { stroke: var(--clay); stroke-dasharray: 5 5; }
.chart .floortext { fill: var(--clay); }
.ie { display: grid; grid-template-columns: minmax(0, 1fr) 220px; align-items: center; }
.ie-tot { display: grid; gap: 18px; padding: 10px 24px; box-shadow: inset 1px 0 0 var(--border); }
.ie-tot b { display: block; font-size: 20px; font-weight: 600; }
.donut-wrap { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 16px; align-items: center; padding: 8px 22px 20px; }
.donut { width: 128px; height: 128px; }
.dlist { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.dlist li { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.dlist i { width: 9px; height: 9px; border-radius: 3px; }
.dlist span { margin-left: auto; color: var(--muted-foreground); }
.agebar { display: flex; gap: 3px; height: 12px; margin: 18px 22px 0; border-radius: 99px; overflow: hidden; }
.card-pad .agebar { margin: 10px 0 0; }
.agelegend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 14px 22px 18px; }
.agelegend.tight { grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 14px 0 0; }
.agelegend b { display: block; font-size: 16px; font-weight: 600; }

/* Statements */
.statement { padding: 6px 26px 18px; }
.st-sec { padding: 14px 0 6px; }
.st-sec + .st-sec { box-shadow: 0 -1px 0 var(--border); }
.st-sec h3 { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--muted-foreground); }
.st-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px 160px; gap: 12px; padding: 6px 0; font-size: 14px; }
.st-row span:not(:first-child) { text-align: right; }
.st-row.total { font-weight: 600; }
.st-cols { display: grid; grid-template-columns: minmax(0, 1fr) 160px 160px; gap: 12px; padding: 0 26px 6px; font-size: 12px; color: var(--muted-foreground); }
.st-cols span:not(:first-child) { text-align: right; }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.kcol { padding: 12px; border-radius: 16px; background: color-mix(in oklch, var(--muted) 70%, transparent); }
.kcol h3 { display: flex; justify-content: space-between; margin: 2px 4px 10px; font-size: 13px; font-weight: 600; }
.kcol h3 span { color: var(--muted-foreground); font-weight: 500; }
.kcard { display: flex; flex-direction: column; gap: 4px; padding: 14px; }
.kcard + .kcard { margin-top: 10px; }

/* Documents */
.dropzone { display: grid; place-items: center; height: 120px; border-radius: 16px; background: color-mix(in oklch, var(--card) 70%, transparent); box-shadow: inset 0 0 0 2px color-mix(in oklch, var(--border) 90%, transparent); color: var(--muted-foreground); font-size: 13.5px; }

/* Record as a document, list beside it */
.page.full { max-width: none; padding: 0; }
.docsplit { display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: calc(100vh - 60px); }
.doclist { background: color-mix(in oklch, var(--card) 70%, var(--background)); box-shadow: 1px 0 0 var(--border); height: calc(100vh - 60px); position: sticky; top: 60px; overflow: auto; }
.doclist-head { position: sticky; top: 0; display: flex; justify-content: space-between; gap: 8px; padding: 12px; background: inherit; box-shadow: 0 1px 0 var(--border); }
.doclist ul { list-style: none; margin: 0; padding: 6px; }
.doclist a { display: flex; justify-content: space-between; gap: 10px; padding: 10px; border-radius: 10px; font-size: 13px; }
.doclist a b { display: block; font-weight: 500; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doclist a .r b { max-width: none; }
.doclist a:hover { background: var(--muted); }
.doclist a[aria-current="page"] { background: var(--card); box-shadow: inset 0 0 0 1px var(--border); }
.docmain { display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: auto auto auto 1fr; column-gap: 20px; padding: 16px 28px 48px; align-content: start; }
.doc-top { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
.doc-top h1 { font-size: 22px; font-weight: 600; }
.doc-top .x svg { width: 20px; height: 20px; stroke: var(--muted-foreground); transform: rotate(45deg); }
.actionbar { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 2px; margin: 10px 0 14px; padding: 4px; border-radius: 12px; background: var(--card); box-shadow: inset 0 0 0 1px var(--border); width: max-content; max-width: 100%; }
.actionbar button { border: 0; background: none; padding: 7px 12px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.actionbar button:hover { background: var(--muted); }
.whatsnext { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; padding: 12px 16px; border-radius: 12px; background: oklch(0.95 0.05 80); font-size: 13.5px; color: oklch(0.36 0.09 65); }
.whatsnext .btn { margin-left: auto; }
.paperwrap { min-width: 0; }
.paper { position: relative; overflow: hidden; padding: 44px 48px; border-radius: 6px; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .08), 0 20px 50px -20px rgb(0 0 0 / .2); font-size: 13px; }
.ribbon { position: absolute; top: 22px; left: -38px; width: 150px; padding: 5px 0; transform: rotate(-45deg); text-align: center; color: #fff; font-size: 11.5px; font-weight: 600; }
.ribbon.r-green { background: var(--primary); } .ribbon.r-gold { background: #d79a00; } .ribbon.r-red { background: var(--clay); } .ribbon.r-brown { background: var(--brown); } .ribbon.r-muted { background: #9a948a; }
.p-top { display: flex; justify-content: space-between; align-items: flex-start; }
.p-top img { width: 96px; margin-left: 18px; }
.p-top .r { display: flex; flex-direction: column; align-items: flex-end; }
.p-top h2 { font-size: 30px; font-weight: 400; letter-spacing: .02em; }
.p-top .r b { font-size: 18px; }
.p-addr { margin-top: 26px; }
.p-addr span, .p-meta span { display: block; color: oklch(0.4 0.02 62); }
.p-meta { display: flex; justify-content: space-between; gap: 24px; margin-top: 28px; }
.p-meta .r div { display: grid; grid-template-columns: 110px 120px; gap: 10px; padding: 3px 0; }
.p-meta .r div span:first-child { color: var(--muted-foreground); text-align: right; }
.p-lines { margin-top: 26px; }
.p-lines th { background: #3a332b; color: #fff; padding: 9px 10px; }
.p-lines td { padding: 12px 10px; white-space: normal; box-shadow: 0 1px 0 var(--border); }
.p-tot { margin: 16px 0 0 auto; width: 300px; }
.p-tot div { display: flex; justify-content: space-between; padding: 6px 10px; }
.p-tot .due { margin-top: 6px; background: var(--muted); font-weight: 600; border-radius: 6px; }
.p-foot { margin-top: 30px; display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: oklch(0.4 0.02 62); }
.docside > * + * { margin-top: 16px; }

@media (max-width: 1180px) { .docmain { grid-template-columns: minmax(0, 1fr); } .docside { margin-top: 16px; } .ie { grid-template-columns: minmax(0, 1fr); } .ie-tot { box-shadow: none; grid-auto-flow: column; } .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 980px) { .docsplit { grid-template-columns: minmax(0, 1fr); } .doclist { display: none; } .menu.create { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 820px) {
  #nav { flex-direction: row; }
  .subs { display: none; }
  .modlink span { white-space: nowrap; }
  .searchbar { width: auto; flex: 1; }
  .searchbar span, .searchbar kbd, #switch { display: none; }
  .top { flex-wrap: wrap; }
  .kanban, .agelegend, .agelegend.tight { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .paper { padding: 28px 20px; }
  .p-meta { flex-direction: column; }
  .st-row, .st-cols { grid-template-columns: minmax(0, 1fr) 110px 110px; }
  .row.approve-row { grid-template-columns: minmax(0, 1fr); }
}
.chart { max-height: 270px; }
.p-lines td.num, .p-lines td.r { white-space: nowrap; }
.card:not([data-table]) table { table-layout: auto; }
.card:not([data-table]) td.r, .card:not([data-table]) th.r { white-space: nowrap; }
.card:not([data-table]) td:first-child { white-space: normal; }

/* v3: Operations Hub, QuickBooks, walkthrough */
.key span.o.m::before { background: #7a8a6a; }
.key span[style*="--k"]::before { background: var(--k); }
.dotc { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 99px; }
.platname { display: inline-flex; align-items: center; gap: 8px; }

.flow { display: grid; grid-template-columns: minmax(0, 1.25fr) 20px minmax(0, 1fr) 20px minmax(0, 1fr) 20px minmax(0, 1fr); gap: 10px; align-items: center; padding: 4px 18px 20px; }
.flow-col { display: grid; gap: 8px; align-content: start; }
.flow-col h3 { margin: 0 0 2px 2px; font-size: 12px; font-weight: 500; color: var(--muted-foreground); }
.flow-node { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: color-mix(in oklch, var(--muted) 55%, var(--card)); font-size: 13px; transition: background .15s; }
a.flow-node:hover { background: var(--muted); }
.flow-node > span:first-of-type { flex: 1; min-width: 0; }
.flow-node b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-node .sub { display: block; font-size: 12px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-node > i { flex: none; width: 9px; height: 9px; border-radius: 99px; }
.flow-node .num { font-weight: 600; white-space: nowrap; }
.flow-node.core { background: color-mix(in oklch, var(--primary) 10%, var(--card)); }
.flow-node.qbo { background: color-mix(in oklch, var(--primary) 16%, var(--card)); }
.flow-arrow svg { width: 18px; height: 18px; stroke: var(--muted-foreground); }

.feedrow { grid-template-columns: auto minmax(0, 1fr) auto auto; cursor: pointer; }
.feedrow.arrive { animation: arrive .7s var(--ease); }
@keyframes arrive { from { opacity: 0; transform: translateY(-8px); background: color-mix(in oklch, var(--primary) 14%, transparent); } }

.platcard { display: flex; flex-direction: column; gap: 2px; padding: 18px 20px; transition: box-shadow .25s var(--ease), transform .25s var(--ease); }
.platcard:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgb(0 0 0 / .06), 0 18px 38px -10px rgb(0 0 0 / .16); }
.platcard-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.platcard .pic svg { width: 20px; height: 20px; stroke: currentColor; }
.platcard > b { font-weight: 600; }
.platcard .sub { color: var(--muted-foreground); font-size: 12.5px; }
.platcard-num { margin-top: 14px; }
.platcard-num b { display: block; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.platcard-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }

.chain { list-style: none; margin: 0; padding: 6px 22px 18px; }
.chain li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 10px 0; position: relative; }
.chain li:not(:last-child)::after { content: ""; position: absolute; left: 10.5px; top: 36px; bottom: -8px; width: 1.5px; background: var(--border); }
.chain li.done:not(:last-child)::after { background: var(--primary); }
.chain b { display: block; font-weight: 500; }
.chain .sub, .chain time { display: block; color: var(--muted-foreground); font-size: 12.5px; }
.chain li.stop .tick { box-shadow: inset 0 0 0 1.5px var(--red); }

.xlist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.xcard { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; }
.xcard-top { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted-foreground); }
.xcard > b { font-size: 15px; font-weight: 600; }
.xcard p { font-size: 13px; color: var(--muted-foreground); flex: 1; }
.xcard-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.xcard .acts { display: flex; gap: 8px; }

.row.conn { grid-template-columns: minmax(0, 1fr) auto 120px; }
.qconn .row-head b { font-size: 15px; }
.tile .meter { margin-top: 12px; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; }
.checklist b { display: block; font-weight: 500; }
.checklist .sub { display: block; font-size: 12.5px; }
.split2 { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.split2 b { display: block; font-weight: 500; }
.split2 .sub { color: var(--muted-foreground); font-size: 13px; }
.diff { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 4px 20px 20px; }
.diff > div { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: color-mix(in oklch, var(--muted) 50%, var(--card)); }
.diff h3 { font-size: 13px; font-weight: 600; }
.diff .choice { width: 100%; margin-top: 0; }
.diffrow { cursor: pointer; }
.diffrow:hover td { background: color-mix(in oklch, var(--muted) 60%, transparent); }
.whybox { padding: 4px 0 6px; font-size: 13px; color: var(--red); }
.whybox a { margin-left: 8px; font-weight: 600; color: var(--green); }

/* Walkthrough bar and cover */
.walkbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 32px; background: var(--card); box-shadow: 0 1px 0 var(--border); font-size: 13px; }
.walkbar p { color: var(--muted-foreground); }
.walkbar p b { color: var(--foreground); font-weight: 600; }
.walkbar-acts { display: flex; align-items: center; gap: 4px; }
.linkbtn { min-height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: none; font-size: 13px; font-weight: 500; color: oklch(0.35 0.03 62); cursor: pointer; }
.linkbtn:hover { background: var(--muted); }
.linkbtn.strong { background: var(--primary); color: #fff; }
.menu.chapters { top: 38px; min-width: 260px; padding: 6px; }
.menu.chapters a { display: flex; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.menu.chapters a:hover { background: var(--muted); }
.menu.chapters .num { width: 18px; color: var(--muted-foreground); }
.cover { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(34, 28, 20, 0.55); backdrop-filter: blur(6px); }
.cover[hidden] { display: none; }
.cover-box { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 32px; border-radius: 20px; background: #fffaef; box-shadow: 0 30px 60px -20px rgba(34, 28, 20, 0.5); }
.cover-logo { width: 44px; }
.cover-box h1 { margin-top: 18px; font-size: 30px; font-weight: 650; letter-spacing: -0.02em; color: #221c14; }
.cover-lead { margin-top: 6px; font-size: 16px; color: #5b3a1c; }
.cover-points { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 14px; }
.cover-points b { display: block; font-weight: 600; color: #221c14; }
.cover-points span { color: #5b3a1c; font-size: 13.5px; }
.cover-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 12px; }
.cover-box > .sub { color: #9a7b4e; font-size: 12.5px; }

/* driver.js skin, as Admin's Observer tour */
.afca-tour.driver-popover { background: #fffaef; color: #33230f; border: 1px solid #e7d4ae; border-radius: 14px; box-shadow: 0 24px 48px -20px rgba(34, 28, 20, 0.45); max-width: 340px; padding: 18px 18px 16px; font-family: Geist, system-ui, sans-serif; }
.afca-tour .driver-popover-title { font: 700 16px/1.3 Geist, system-ui, sans-serif; color: #221c14; letter-spacing: -0.01em; }
.afca-tour .driver-popover-description { font: 13.5px/1.55 Geist, system-ui, sans-serif; color: #5b3a1c; }
.afca-tour .driver-popover-progress-text { font-size: 11px; color: #9a7b4e; }
.afca-tour .driver-popover-footer button { text-shadow: none; border-radius: 999px; font: 600 13px Geist, system-ui, sans-serif; padding: 7px 15px; border: 1px solid #e7d4ae; background: #fff; color: #5b3a1c; }
.afca-tour .driver-popover-footer .driver-popover-next-btn, .afca-tour .driver-popover-footer .driver-popover-next-btn:hover { background: #2fa343; border-color: #2fa343; color: #fff; }
.afca-tour .driver-popover-close-btn { color: #9a7b4e; }
.afca-tour .driver-popover-arrow { border-color: #fffaef; }
@media (prefers-reduced-motion: reduce) { .afca-tour.driver-popover, .driver-active .driver-active-element, .driver-overlay, .feedrow.arrive { transition: none !important; animation: none !important; } }

@media (max-width: 1100px) { .flow { grid-template-columns: minmax(0, 1fr); } .flow-arrow { display: none; } }
@media (max-width: 820px) { .xlist, .diff { grid-template-columns: minmax(0, 1fr); } .walkbar { padding: 6px 16px; } .walkbar p { display: none; } .row.conn { grid-template-columns: minmax(0, 1fr) auto; } .row.conn > .sub { display: none; } }
.flow-col, .flow-node { min-width: 0; }
.flow-node { overflow: hidden; }
.flow-node .num.small { font-size: 12px; font-weight: 500; color: var(--muted-foreground); }
.flow { align-items: start; grid-template-columns: minmax(0, 1.2fr) 14px minmax(0, 1fr) 14px minmax(0, 1fr) 14px minmax(0, 0.9fr); }
.flow-arrow { align-self: center; }
.head-actions { flex: none; }
@media (max-width: 1100px) { .flow { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 820px) { .page-head { flex-wrap: wrap; align-items: flex-start; } .head-actions { flex: initial; max-width: 100%; } .page-head .seg { max-width: 100%; overflow-x: auto; } .platcard-num b { font-size: 21px; } }
@media (max-width: 820px) {
  .card:has(table) { overflow-x: auto; }
  .card table { min-width: 560px; }
  .xcard .acts { flex-wrap: wrap; } .xcard .btn { white-space: normal; height: auto; min-height: 36px; text-align: left; }
  .row-head { flex-wrap: wrap; } #mapseg { max-width: 100%; overflow-x: auto; }
}

/* Sidebar as Admin's: a slim scrollbar on desktop, a drawer on phones */
.rail { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.rail:hover { scrollbar-color: color-mix(in oklch, var(--foreground) 18%, transparent) transparent; }
.rail::-webkit-scrollbar { width: 6px; }
.rail::-webkit-scrollbar-thumb { border-radius: 99px; background: transparent; }
.rail:hover::-webkit-scrollbar-thumb { background: color-mix(in oklch, var(--foreground) 18%, transparent); }
.menubtn { display: none; }
.scrim { display: none; }
@media (max-width: 820px) {
  .menubtn { display: grid; margin-right: auto; }
  .rail { position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(300px, 86vw); height: 100dvh; flex-direction: column; gap: 18px; overflow-x: hidden; overflow-y: auto; padding: 16px 12px 24px; box-shadow: 0 30px 60px -20px rgb(0 0 0 / .35); transform: translateX(-102%); transition: transform .28s var(--ease); }
  body.nav-open .rail { transform: none; }
  .rail .brand { display: flex; }
  #nav { display: block; }
  .subs { display: block; }
  .nav a .count { display: inline; }
  .scrim { position: fixed; inset: 0; z-index: 55; background: rgb(34 28 20 / .45); }
  body.nav-open .scrim { display: block; }
  .top { flex-wrap: nowrap; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .top .env button { padding: 5px 10px; }
  .searchbar { flex: none; width: 36px; padding: 0; justify-content: center; }
  .page-head h1 { font-size: 23px; }
  .page-head p { font-size: 13.5px; }
  .tile { padding: 14px 16px; }
  .tile b { font-size: 21px; }
  .g4 { gap: 10px; }
  .flow { padding: 4px 14px 16px; }
  .walkbar { padding: 6px 12px; }
}
@media (prefers-reduced-motion: reduce) { .rail { transition: none; } }

/* Sidebar measured from Admin (3 Nov): 240 wide, 8px group padding, 32px
   labels, 36px items with 2px gaps, 28px sub-items on a 1px rail. */
.shell { grid-template-columns: 240px minmax(0, 1fr); }
.rail { padding: 8px 0 16px; gap: 0; }
.brand { height: 56px; margin: 0 8px; padding: 8px 12px; gap: 8px; border-radius: 20px; }
.brand img { width: 32px; }
.navgroup { padding: 8px; }
.navgroup + .navgroup { margin-top: 0; }
.navgroup h4 { display: flex; align-items: center; height: 32px; margin: 0; padding: 0 12px; font-size: 12px; font-weight: 500; color: color-mix(in oklch, var(--foreground) 70%, transparent); }
.navgroup .mod + .mod { margin-top: 2px; }
.modlink { height: 36px; gap: 8px; padding: 8px 12px; border-radius: 20px; font-size: 14px; font-weight: 400; }
.modlink svg { width: 16px; height: 16px; opacity: 1; stroke-width: 2; }
.modlink[data-on] { font-weight: 500; }
.subs { gap: 4px; margin: 4px 14px 4px 14px; padding: 2px 10px; box-shadow: inset 1px 0 0 var(--border); }
.subs a { height: 28px; padding: 0 12px; border-radius: 20px; font-size: 14px; color: oklch(0.29 0.022 62); }
.subs a[aria-current="page"] { background: oklch(0.925 0.022 85); box-shadow: none; font-weight: 400; color: var(--foreground); }
.subs .count { font-size: 12px; }
@media (max-width: 820px) { .shell { grid-template-columns: minmax(0, 1fr); } .rail { padding: 8px 0 24px; } .navgroup h4 { display: flex; } }

/* Introduction, in the shape of ISER's entry screen */
.cover:has(.intro) { display: block; padding: 0; background: var(--background); backdrop-filter: none; overflow: auto; }
.cover:has(.intro)[hidden] { display: none; }
.intro { display: grid; grid-template-columns: 320px minmax(0, 1fr); min-height: 100dvh; }
.in-rail { position: sticky; top: 0; display: flex; flex-direction: column; gap: 40px; height: 100dvh; padding: 40px 32px; background: var(--sidebar); box-shadow: inset -1px 0 0 var(--border); }
.in-logo { width: 56px; }
.in-rail ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.in-rail ol button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border: 0; border-radius: 12px; background: none; font-size: 14px; color: color-mix(in oklch, var(--muted-foreground) 70%, transparent); text-align: left; cursor: default; }
.in-rail ol button.done { color: var(--muted-foreground); cursor: pointer; }
.in-rail ol button.done:hover { background: color-mix(in oklch, var(--card) 60%, transparent); color: var(--foreground); }
.in-rail ol button[aria-current="step"] { background: var(--card); color: var(--foreground); font-weight: 600; box-shadow: 0 1px 2px rgb(0 0 0 / .05), inset 0 0 0 1px color-mix(in oklch, var(--border) 70%, transparent); }
.in-rail ol button > span { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 99px; background: var(--muted); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; transition: background .2s var(--ease); }
.in-rail ol button.done > span { background: var(--foreground); color: var(--background); }
.in-rail ol button[aria-current="step"] > span { background: var(--primary); color: #fff; }
.in-rail svg { width: 13px; height: 13px; stroke: currentColor; }
.in-bar, .in-count { display: none; }
.in-main { display: flex; flex-direction: column; min-width: 0; }
.in-body { flex: 1; width: 100%; max-width: 820px; padding: 40px 56px; }
.in-body h1 { font-size: 40px; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; outline: none; }
.in-lead { margin-top: 12px; max-width: 62ch; font-size: 16px; line-height: 1.6; color: var(--muted-foreground); }
.in-content { margin-top: 36px; animation: rise .45s var(--ease) backwards; }
.in-hero { display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-radius: 18px; background: color-mix(in oklch, var(--primary) 9%, var(--card)); }
.in-hero img { width: 48px; }
.in-hero b { display: block; font-size: 16px; font-weight: 600; }
.in-hero span { display: block; margin-top: 2px; font-size: 14px; color: var(--muted-foreground); }
.in-facts, .in-grid { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.in-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 0; }
.in-facts li, .in-grid li { padding: 16px 20px; border-radius: 16px; background: var(--card); box-shadow: 0 1px 2px rgb(0 0 0 / .04), inset 0 0 0 1px color-mix(in oklch, var(--border) 60%, transparent); }
.in-facts b, .in-grid b { display: block; font-weight: 600; }
.in-facts span, .in-grid span { display: block; margin-top: 4px; font-size: 14px; line-height: 1.5; color: var(--muted-foreground); }
.in-note { margin-top: 18px; font-size: 14px; color: var(--muted-foreground); }
.in-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.in-choices button { display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px; border: 0; border-radius: 16px; background: var(--card); text-align: left; cursor: pointer; box-shadow: 0 1px 2px rgb(0 0 0 / .04), inset 0 0 0 1px color-mix(in oklch, var(--border) 60%, transparent); transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.in-choices button:hover { transform: translateY(-1px); box-shadow: 0 12px 28px -14px rgb(0 0 0 / .25), inset 0 0 0 1px var(--border); }
.in-choices button[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--primary), 0 12px 28px -16px rgb(47 163 67 / .45); }
.in-choices b { display: block; font-weight: 600; }
.in-choices span span { display: block; margin-top: 4px; font-size: 14px; line-height: 1.5; color: var(--muted-foreground); }
.in-choices small, .in-ready small { display: block; margin-top: 10px; font-size: 12.5px; color: var(--muted-foreground); }
.in-radio { display: grid; place-items: center; flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 99px; box-shadow: inset 0 0 0 1.5px var(--border); }
.in-radio svg { width: 13px; height: 13px; stroke: #fff; }
[aria-checked="true"] .in-radio, .in-hide input:checked + .in-radio { background: var(--primary); box-shadow: none; }
.in-ready { display: flex; flex-direction: column; align-items: flex-start; padding: 22px 24px; border-radius: 18px; background: var(--card); box-shadow: inset 0 0 0 2px var(--primary); }
.in-ready b { font-size: 18px; font-weight: 600; }
.in-ready span { margin-top: 4px; color: var(--muted-foreground); }
.in-ready .linkbtn { margin: 12px 0 0 -12px; }
.in-foot { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 56px; background: color-mix(in oklch, var(--background) 94%, transparent); backdrop-filter: blur(10px); box-shadow: 0 -1px 0 var(--border); }
.in-foot .btn { min-height: 42px; padding: 0 20px; }
.in-skip { margin-left: auto; }
.in-hide { order: 9; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted-foreground); cursor: pointer; }
.in-skip + .in-hide, .in-foot > .btn:not(.in-skip):last-of-type ~ .in-hide { margin-left: 0; }
.in-hide input { position: absolute; opacity: 0; }
@media (max-width: 1000px) {
  .intro { grid-template-columns: minmax(0, 1fr); }
  .in-rail { position: static; height: auto; gap: 18px; padding: 24px 16px 18px; box-shadow: inset 0 -1px 0 var(--border); }
  .in-rail ol { display: none; }
  .in-bar { display: block; height: 4px; border-radius: 99px; background: var(--muted); overflow: hidden; }
  .in-bar i { display: block; height: 100%; border-radius: 99px; background: var(--primary); transition: width .3s var(--ease); }
  .in-count { display: block; margin-top: -10px; font-size: 12px; color: var(--muted-foreground); }
  .in-body { padding: 28px 16px; }
  .in-body h1 { font-size: 28px; }
  .in-foot { padding: 14px 16px; }
  .in-hide { order: -1; width: 100%; }
  .in-grid, .in-choices { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .in-content { animation: none; } }
@media (max-width: 1400px) { .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; } .flow-arrow { display: none; } }
@media (max-width: 760px) { .flow { grid-template-columns: minmax(0, 1fr); } }
.tile b { font-size: clamp(22px, 2.1vw, 30px); }
.cover:has(.intro) { place-items: normal; } .intro { width: 100%; }
