:root {
  --bg: #f4f4f4; --panel: #ffffff; --ink: #222222; --muted: #595859; --line: #e2e2e2; --accent: #df6a24; --accent2: #b9531a; --brand: #df6a24; --brand-ink: #ffffff;
  --warn-bg: #fdebd0; --bad: #922b21; --bad-bg: #fadbd8; --ok: #1e8449; --chip: #eef1f5; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161616; --panel: #222222; --ink: #eeeeee; --muted: #b5b5b5; --line: #383838; --accent: #f08a4b; --accent2: #f5a36f; --brand: #df6a24; --brand-ink: #ffffff;
    --warn-bg: #4a3a1c; --bad: #f1948a; --bad-bg: #4a2320; --ok: #58d68d; --chip: #252c36; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #161616; --panel: #222222; --ink: #eeeeee; --muted: #b5b5b5; --line: #383838; --accent: #f08a4b; --accent2: #f5a36f; --brand: #df6a24; --brand-ink: #ffffff;
  --warn-bg: #4a3a1c; --bad: #f1948a; --bad-bg: #4a2320; --ok: #58d68d; --chip: #252c36; --shadow: none;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--accent2); text-decoration: none; } a:hover { text-decoration: underline; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink); }
.brand img { height: 38px; width: auto; display: block; background: #fff; border-radius: 6px; padding: 2px 6px; }
.brand .app { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: .3px; }
.top { border-bottom: 3px solid var(--brand) !important; }
.search { flex: 1; max-width: 620px; } .search input { width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; }
.user { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; white-space: nowrap; }
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
button.primary, .btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
button.ghost { background: transparent; } button:disabled { opacity: .5; cursor: default; }
.menu { display: none; }
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - 57px); }
.nav { border-right: 1px solid var(--line); background: var(--panel); padding: 12px 8px; overflow-y: auto; }
.nav h4 { margin: 14px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.nav a { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; color: var(--ink); }
.nav a:hover { background: var(--chip); text-decoration: none; } .nav a.on { background: var(--chip); font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.view { padding: 20px 24px 60px; min-width: 0; }
h1 { font-size: 22px; margin: 0 0 4px; } h2 { font-size: 16px; margin: 22px 0 8px; } .sub { color: var(--muted); margin: 0 0 16px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.tile .hd { color: #fff; padding: 10px 12px; font-weight: 600; } .tile .desc { padding: 8px 12px 0; color: var(--muted); font-size: 12px; }
.tile ul { list-style: none; margin: 6px 0 0; padding: 0 12px 10px; } .tile li { padding: 3px 0; }
.tile .kpi { margin-top: auto; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; min-width: 130px; }
.stat b { display: block; font-size: 22px; } .stat span { color: var(--muted); font-size: 12px; } .stat.bad b { color: var(--bad); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; box-shadow: var(--shadow); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.toolbar input, .toolbar select, .form input, .form select, .form textarea { font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
.tablewrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { position: sticky; top: 0; background: var(--chip); cursor: pointer; white-space: nowrap; font-weight: 600; }
tr.clk:hover td { background: var(--chip); cursor: pointer; }
tr.over td { background: var(--bad-bg); } td.need { color: var(--bad); }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--chip); font-size: 12px; white-space: nowrap; }
.chip.bad { background: var(--bad-bg); color: var(--bad); } .chip.warn { background: var(--warn-bg); } .chip.ok { color: var(--ok); }
.kv { display: grid; grid-template-columns: minmax(140px, 240px) 1fr; gap: 6px 16px; } .kv div:nth-child(odd) { color: var(--muted); }
.band { display: grid; grid-template-columns: 150px 1fr; gap: 12px; margin-bottom: 12px; align-items: stretch; }
.band .lab { color: #fff; border-radius: 10px; padding: 10px; font-weight: 600; display: flex; align-items: center; }
.band .boxes { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sop { background: var(--panel); border: 2px solid; border-radius: 10px; width: 170px; overflow: hidden; }
.sop .t { color: #fff; padding: 6px 8px; font-weight: 600; font-size: 12px; } .sop .c { padding: 6px 8px; font-size: 12px; color: var(--muted); }
.arrow { color: var(--muted); font-size: 18px; }
.flow { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.step { min-width: 180px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.step .t { color: #fff; padding: 6px 8px; font-weight: 600; font-size: 12px; } .step p { margin: 6px 8px; font-size: 12px; }
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.form textarea { min-height: 60px; } .gate { margin: 12px 0; padding: 10px 12px; border-radius: 8px; background: var(--warn-bg); }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; color: var(--muted); }
.loading, .empty { color: var(--muted); padding: 30px 0; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 10; max-width: 90vw; }
.banner { background: var(--warn-bg); border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; font-size: 13px; }
@media (max-width: 800px) {
  .menu { display: inline-block; } .shell { grid-template-columns: 1fr; }
  .nav { display: none; position: fixed; top: 57px; left: 0; bottom: 0; width: 260px; z-index: 6; } .nav.open { display: block; }
  .view { padding: 16px; } .user span { display: none; } .band { grid-template-columns: 1fr; } .kv { grid-template-columns: 1fr; }
  .top { gap: 8px; } .brand span:last-child { display: none; }
}
/* menu groups, info dots, profiles, bulk bar */
.nav details { margin: 2px 0; } .nav summary { cursor: pointer; list-style: none; margin: 10px 10px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); display: flex; justify-content: space-between; }
.nav summary::-webkit-details-marker { display: none; } .nav summary::after { content: "▾"; } .nav details:not([open]) summary::after { content: "▸"; }
.info { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; background: var(--chip); color: var(--muted); font: 600 10px/1 Georgia, serif; font-style: italic; cursor: help; position: relative; vertical-align: middle; flex: none; }
.info:hover, .info:focus { background: var(--accent2); color: #fff; outline: none; }
.info:hover::after, .info:focus::after { content: attr(data-tip); position: absolute; left: 50%; top: 20px; transform: translateX(-50%); width: max-content; max-width: 280px; white-space: normal; background: #1c2430; color: #fff; font: 400 12px/1.4 "Segoe UI", system-ui, sans-serif; font-style: normal; text-transform: none; letter-spacing: 0; padding: 7px 9px; border-radius: 6px; z-index: 20; box-shadow: var(--shadow); text-align: left; }
th .info:hover::after { top: 20px; }
.form label { flex-direction: column; } .form label .info { display: inline-flex; }
.profhead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; } .profhead h1 { margin: 0; }
button.status { border-radius: 999px; font-weight: 600; } button.status.on { color: #1e8449; border-color: #1e8449; background: #eafaf1; } button.status.off { color: #922b21; border-color: #922b21; background: #fadbd8; }
.chip.ok { background: #eafaf1; color: #1e8449; } .chip.bad { background: var(--bad-bg); color: var(--bad); }
.bulk { background: var(--warn-bg); border-radius: 8px; padding: 8px 10px; }
h3.mini { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 12px 0 6px; } h3.mini:first-child { margin-top: 0; }
.checkline { display: flex; gap: 8px; align-items: center; margin: 12px 0; }
#files details { padding: 4px 0; border-bottom: 1px solid var(--line); } #files ul { margin: 4px 0 6px 18px; padding: 0; }
[hidden] { display: none !important; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0; border-bottom: 1px solid var(--line); } .tabs a { padding: 7px 12px; border-radius: 8px 8px 0 0; color: var(--muted); }
.tabs a.on { background: var(--panel); color: var(--ink); font-weight: 600; border: 1px solid var(--line); border-bottom-color: var(--panel); margin-bottom: -1px; }
label.tick { display: inline-flex; gap: 4px; align-items: center; margin: 2px 10px 2px 0; font-size: 12px; color: var(--ink); white-space: nowrap; }
.tree { list-style: none; padding-left: 16px; margin: 4px 0; } .tree summary { cursor: pointer; } .mini-btn { font-size: 11px; padding: 1px 6px; margin-left: 4px; }
.num { text-align: right; font-variant-numeric: tabular-nums; } .tot td { font-weight: 600; border-top: 2px solid var(--line); }
/* collapsible sections (particulars, product reviews) and compact field lists */
details.sec { border-bottom: 1px solid var(--line); } details.sec > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
details.sec > summary::-webkit-details-marker { display: none; } details.sec > summary::before { content: "▸"; color: var(--muted); font-size: 12px; width: 12px; }
details.sec[open] > summary::before { content: "▾"; } details.sec > summary h2, details.sec > summary h3 { margin: 12px 0; display: inline-flex; align-items: center; gap: 8px; }
.kv.cols { grid-template-columns: repeat(auto-fill, minmax(110px, 160px) minmax(140px, 1fr)); gap: 4px 14px; font-size: 13px; }
.form.tight { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 12px; } .form.tight input, .form.tight select { padding: 5px 8px; }
.same { grid-column: 1 / -1; justify-self: start; font-size: 12px; padding: 3px 10px; }
@media (max-width: 700px) { .kv.cols { grid-template-columns: 1fr; } }
/* menu: jump box, count badges, the always-open top block, the QMS logs sub-list */
.nav #navq { width: calc(100% - 12px); margin: 0 6px 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; font-size: 13px; }
.nav .navtop { padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.nav a { padding: 5px 10px; } .nav a .l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a .n { flex: none; font-size: 11px; font-weight: 600; min-width: 20px; text-align: center; padding: 0 6px; border-radius: 999px; background: var(--chip); color: var(--muted); }
.nav a.on { box-shadow: inset 3px 0 0 var(--brand); } .nav a.on .n { background: var(--brand); color: #fff; }
.nav details.sub summary { text-transform: none; letter-spacing: 0; font-size: 12px; margin: 4px 10px; }
.nav.filtering summary { pointer-events: none; }
@media (min-width: 801px) { .nav { position: sticky; top: 60px; height: calc(100vh - 60px); } }
/* home + process map */
a.stat { color: var(--ink); } a.stat:hover { text-decoration: none; border-color: var(--brand); }
kbd { font: 600 11px/1 ui-monospace, monospace; padding: 2px 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--panel); }
.homecols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; } .homecols h2 { display: flex; justify-content: space-between; align-items: baseline; } .homecols h2 a { font-size: 12px; font-weight: 400; }
@media (max-width: 1100px) { .homecols { grid-template-columns: 1fr; } }
.pmap { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; overflow-x: auto; }
.pmap svg { width: 100%; min-width: 640px; height: auto; display: block; font-family: inherit; }
.pmap .lane { opacity: .07; } .pmap .ln { font-size: 11px; font-weight: 700; text-anchor: end; letter-spacing: .6px; text-transform: uppercase; }
.pmap .pn rect:first-child { fill: var(--panel); stroke-width: 1.5; } .pmap .pn .t { font-size: 15px; font-weight: 600; fill: var(--ink); } .pmap .pn .s { font-size: 11.5px; fill: var(--muted); }
.pmap .pn .cnt text { fill: #fff; font-size: 12px; font-weight: 700; text-anchor: middle; } .pmap .pn:hover rect:first-child { stroke-width: 3; }
.pmap .pe path { fill: none; stroke: var(--muted); stroke-width: 1.4; opacity: .55; } .pmap marker path { fill: var(--muted); }
.pmap .pe circle { fill: var(--panel); stroke: var(--muted); stroke-width: 1; } .pmap .pe text { font-size: 10px; font-weight: 700; fill: var(--muted); text-anchor: middle; }
.pmap.focus .pe:not(.hi), .pmap.focus .pn:not(.hi) { opacity: .18; } .pmap .pe.hi path { stroke: var(--brand); stroke-width: 2.4; opacity: 1; } .pmap .pe.hi circle { stroke: var(--brand); }
.pmap.compact .pe circle, .pmap.compact .pe text { display: none; }
.plinks { columns: 2 360px; margin: 0; padding-left: 26px; font-size: 13px; } .plinks li { break-inside: avoid; padding: 2px 0; }
.ptile { color: var(--ink); } .ptile:hover { text-decoration: none; border-color: var(--brand); } .ptile .desc { padding-bottom: 10px; }
.pio { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 8px 0 18px; } @media (max-width: 700px) { .pio { grid-template-columns: 1fr; } }
.pchip { display: flex; flex-direction: column; border: 1px solid var(--line); border-left: 4px solid; border-radius: 8px; padding: 6px 10px; margin: 0 0 6px; background: var(--panel); color: var(--ink); }
.pchip span { color: var(--muted); font-size: 12px; } .pchip:hover { text-decoration: none; background: var(--chip); }
.pflow { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px 26px; counter-reset: s; }
.pstep { position: relative; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow); }
.pstep::after { content: "→"; position: absolute; right: -21px; top: 38%; color: var(--muted); font-size: 16px; } .pstep:last-child::after { content: ""; }
.pstep .ph { display: flex; gap: 8px; align-items: center; } .pstep .no { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--c); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.pstep .ph b { flex: 1; } .pstep .n { background: var(--c); color: #fff; border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 700; }
.pstep .who { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 6px 0 2px; } .pstep p { margin: 0 0 8px; font-size: 13px; }
.pstep .refs { font-size: 12px; border-top: 1px dashed var(--line); padding-top: 6px; } .pstep .refs .chip { padding: 0 6px; }
/* document review panel */
.docpanel { margin: 8px 0 14px; } .dvtabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.dvtabs button { font-size: 12px; padding: 3px 10px; border-radius: 999px; } .dvtabs button.on { background: var(--brand); color: #fff; border-color: var(--brand); } .dvtabs .btn { font-size: 12px; padding: 3px 10px; margin-left: auto; }
.docview { height: 72vh; min-height: 420px; background: var(--chip); border: 1px solid var(--line); border-radius: 10px; overflow: auto; }
.docview iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; } .docview img { max-width: 100%; display: block; margin: 0 auto; }
.rejForm { margin-top: 8px; border-color: var(--bad); }
.rejForm textarea, .rvForm textarea, .rvForm select { font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); margin-top: 4px; }

/* ==================================================================== design system (Apple-style structure, MPS colours)
   Type: system SF / Inter stack, tight large titles. Curvature: 20px containers, 12px controls. Depth: hairline + ambient shadow,
   frosted header and menu. Controls: flat fields that light up in MPS orange on focus; segmented tabs; tactile press. */
:root {
  --r-lg: 20px; --r-sm: 12px; --field: #f0f0f1; --brand-tint: rgba(223, 106, 36, .12); --ring: 0 0 0 3px rgba(223, 106, 36, .22);
  --glass: rgba(255, 255, 255, .72); --shadow: 0 1px 1px rgba(0, 0, 0, .03), 0 4px 30px rgba(0, 0, 0, .04); --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Inter", "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; --mono: "SF Mono", SFMono-Regular, ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --field: #2c2c2c; --brand-tint: rgba(240, 138, 75, .16); --glass: rgba(34, 34, 34, .72); --shadow: 0 4px 30px rgba(0, 0, 0, .25); } }
:root[data-theme="dark"] { --field: #2c2c2c; --brand-tint: rgba(240, 138, 75, .16); --glass: rgba(34, 34, 34, .72); --shadow: 0 4px 30px rgba(0, 0, 0, .25); }
body { font-family: var(--font); font-size: 14px; -webkit-font-smoothing: antialiased; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.022em; line-height: 1.15; margin-bottom: 6px; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -.012em; } h3 { letter-spacing: -.01em; }
.sub { font-weight: 400; } .num, td.num, .stat b { font-variant-numeric: tabular-nums; }
code, kbd, .mono { font-family: var(--mono); }

/* frosted header and menu */
.top { background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid var(--line) !important; box-shadow: inset 0 -2px 0 var(--brand); }
.brand img { border-radius: 10px; }
.search input { background: var(--field); border: 1px solid transparent; border-radius: var(--r-sm); padding: 9px 14px; transition: all .2s var(--ease); }
.search input:focus { outline: none; background: var(--panel); border-color: var(--brand); box-shadow: var(--ring); }
.nav { background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); padding: 14px 10px; }
.nav a { border-radius: 10px; padding: 6px 10px; font-weight: 500; transition: background .15s var(--ease), transform .2s var(--ease); }
.nav a:hover { background: var(--field); } .nav a:active { transform: scale(.97); }
.nav a.on { background: var(--brand-tint); color: var(--accent2); font-weight: 600; box-shadow: none; } .nav a.on .n { background: var(--brand); color: #fff; }
.nav summary { font-size: 11px; font-weight: 700; letter-spacing: .06em; margin: 14px 10px 4px; }
.nav summary::after, .nav details:not([open]) summary::after, details.sec > summary::before, details.sec[open] > summary::before {
  content: ""; width: 12px; height: 12px; background: currentColor; opacity: .7; transition: transform .2s var(--ease);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='3' stroke='black'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8.25 4.5l7.5 7.5-7.5 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='3' stroke='black'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8.25 4.5l7.5 7.5-7.5 7.5'/%3E%3C/svg%3E") center / contain no-repeat; }
.nav details[open] summary::after, details.sec[open] > summary::before { transform: rotate(90deg); }
details.sec > summary::before { flex: none; color: var(--muted); }
.nav #navq { background: var(--field); border: 1px solid transparent; border-radius: var(--r-sm); padding: 8px 12px; transition: all .2s var(--ease); }
.nav #navq:focus { outline: none; background: var(--panel); border-color: var(--brand); box-shadow: var(--ring); }
.nav .navtop { border-bottom: 0; } .nav .navtop a { font-weight: 600; }

/* containers: 20px curvature, hairline + ambient shadow */
.card, .tile, .tablewrap, .stat, .pmap, .pstep, .docview, .pchip, .sop, .step, .fam { border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card { padding: 18px 20px; border-color: var(--line); } .tile .hd { padding: 12px 16px; letter-spacing: -.01em; } .tile ul, .tile .desc { padding-left: 16px; padding-right: 16px; }
.tablewrap { box-shadow: var(--shadow); } .pchip, .pstep { border-radius: 16px; } .docview { box-shadow: none; }
a.tile:hover, a.stat:hover, .ptile:hover { transform: translateY(-1px); box-shadow: 0 6px 30px rgba(0, 0, 0, .08); } .tile, .stat { transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }

/* metric cards: small uppercase label above a bold value */
.stats { gap: 12px; } .stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 2px; padding: 14px 18px; min-width: 150px; }
.stat span { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat b { font-size: 26px; font-weight: 700; letter-spacing: -.022em; line-height: 1.1; }

/* tables: quiet headers, hairlines, soft hover */
th { background: var(--panel); color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); }
th, td { padding: 9px 12px; } tr:last-child td { border-bottom: 0; } tr.clk { transition: background .12s; } tr.clk:hover td { background: var(--field); }
tr.over td { background: var(--bad-bg); }

/* controls: 12px, flat fields that light up in orange on focus, tactile press */
button, .btn { border-radius: var(--r-sm); padding: 7px 14px; font-weight: 500; border: 1px solid transparent; background: var(--field); color: var(--ink); transition: transform .2s var(--ease), background .15s, box-shadow .2s, filter .15s; }
button:hover:not(:disabled), .btn:hover { filter: brightness(.97); text-decoration: none; } button:active:not(:disabled), .btn:active { transform: scale(.97); }
button.primary, .btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; } button.primary:hover:not(:disabled), .btn.primary:hover { filter: brightness(1.06); }
button.ghost { background: transparent; } button:focus-visible, .btn:focus-visible, a:focus-visible { outline: none; box-shadow: var(--ring); }
.toolbar input, .toolbar select, .form input, .form select, .form textarea, .rejForm textarea, .rvForm textarea, .rvForm select, .fz input, #filter, #estNotes {
  background: var(--field); border: 1px solid transparent; border-radius: var(--r-sm); padding: 8px 12px; color: var(--ink); transition: all .2s var(--ease); }
.toolbar input:focus, .toolbar select:focus, .form input:focus, .form select:focus, .form textarea:focus, .rejForm textarea:focus, .rvForm textarea:focus, .rvForm select:focus, #filter:focus {
  outline: none; background: var(--panel); border-color: var(--brand); box-shadow: var(--ring); }
.form label, label.tick { font-weight: 500; } input[type=checkbox], input[type=radio] { accent-color: var(--brand); }
.mini-btn { border-radius: 8px; padding: 2px 8px; } .same { border-radius: 999px; background: var(--brand-tint); color: var(--accent2); }

/* segmented tabs */
.tabs, .dvtabs { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--field); border: 0; border-radius: var(--r-sm); margin: 10px 0 14px; max-width: 100%; }
.tabs a, .dvtabs button { border: 0; border-radius: 9px; padding: 6px 14px; font-size: 13px; font-weight: 500; color: var(--muted); background: transparent; margin: 0; transition: all .2s var(--ease); }
.tabs a:hover, .dvtabs button:hover { color: var(--ink); text-decoration: none; filter: none; }
.tabs a.on, .dvtabs button.on { background: var(--panel); color: var(--ink); font-weight: 600; border: 0; margin: 0; box-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 1px rgba(0, 0, 0, .04); }
.dvtabs { display: flex; } .dvtabs .btn { margin-left: auto; background: transparent; }

/* chips, banners, gates, toast */
.chip { padding: 2px 10px; font-weight: 500; font-size: 11.5px; } .chip.ok { background: rgba(30, 132, 73, .12); color: var(--ok); } .chip.warn { background: var(--warn-bg); }
.banner, .gate { border-radius: var(--r-sm); padding: 10px 14px; } .banner.ok { background: rgba(30, 132, 73, .12); }
.toast { background: rgba(30, 30, 30, .86); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); color: #fff; border-radius: 999px; padding: 10px 20px; box-shadow: 0 8px 30px rgba(0, 0, 0, .2); font-weight: 500; }
button.status { border-radius: 999px; }

/* layout rhythm */
.view { padding: 24px 28px 64px; } .crumbs { font-size: 13px; } .toolbar { gap: 8px; }
@media (max-width: 800px) { .view { padding: 16px; } .nav { top: 57px; border-radius: 0 var(--r-lg) var(--r-lg) 0; box-shadow: 0 10px 40px rgba(0, 0, 0, .2); } h1 { font-size: 22px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
.pmap.compact svg { min-width: 0; }
/* investment feasibility calculator */
.fzgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; margin-bottom: 14px; } .fzgrid .card { margin: 0; }
.fzin { display: flex; align-items: center; gap: 6px; } .fzin input { flex: 1; min-width: 0; } .fzin i { font-style: normal; color: var(--muted); font-size: 12px; white-space: nowrap; }
table.fzt { font-variant-numeric: tabular-nums; } table.fzt td, table.fzt th { padding: 6px 8px; white-space: nowrap; } table.fzt td:first-child { white-space: normal; min-width: 190px; }
table.fzt input.fz-s { width: 100%; min-width: 58px; text-align: right; background: var(--field); border: 1px solid transparent; border-radius: 10px; padding: 6px 8px; font: inherit; color: var(--ink); }
table.fzt input.fz-s:focus { outline: none; background: var(--panel); border-color: var(--brand); box-shadow: var(--ring); }
table.fzt tr.tot td { font-weight: 700; border-top: 1px solid var(--line); } table.fzt tr.sub1 td { font-weight: 600; color: var(--ink); } table.fzt td.neg { color: var(--bad); }
table.fzt tr.fzh td { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-top: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-top: 14px; }
.fzchart { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px 6px; margin: 4px 0 6px; box-shadow: var(--shadow); }
.fzct { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; } .fzct .sub { margin: 0; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; } .fzchart svg { width: 100%; height: auto; display: block; }
.fzchart .gl { stroke: var(--line); stroke-width: 1; } .fzchart .gl.z { stroke: var(--muted); } .fzchart .ax { font-size: 10.5px; fill: var(--muted); } .fzchart .lbl { font-size: 11px; font-weight: 600; fill: var(--ink); }
.fzchart .fzb:hover rect[rx] { opacity: .8; } .fztip { position: absolute; pointer-events: none; background: rgba(30, 30, 30, .9); color: #fff; font-size: 12px; padding: 5px 9px; border-radius: 8px; white-space: nowrap; }
.form label .lt { display: flex; align-items: center; gap: 6px; } table.fzs td:first-child { min-width: 0; } table.fzs td { padding: 6px 4px; }
.fzchart .lbl.in { fill: #fff; }
