/* Saltbush Air & Mechanical · Warranty desk — sample app by Phoenix Valley Tech */
:root {
  --paper: #F3F4F1; --sheet: #FFFFFF; --sunk: #EAECE7; --rule: #DADDD6; --rule-2: #C5CAC2;
  --ink: #16201E; --ink-2: #3D4846; --muted: #687370;
  --accent: #0E6B57; --accent-2: #0A5646; --accent-soft: #E0EFE9; --accent-line: #9FCDBE;
  --amber: #8A5A0B; --amber-bg: #F5EBD3; --amber-solid: #C98A1E;
  --brick: #A23B2A; --brick-bg: #F6E1DB; --brick-solid: #B9523F;
  --slate: #34536D; --slate-bg: #E1E9F0; --slate-solid: #5B7F9C;
  --neutral: #4F5A57; --neutral-bg: #E7E9E4; --neutral-solid: #A5ADA9;
  --sans: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --top-h: 60px; --rail-h: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + var(--rail-h) + 12px); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3, h4, p, dl, dd, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; height: auto; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mono, code { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.money { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: fixed; left: 12px; top: -80px; z-index: 200; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 6px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; color: #fff; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 32px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 6px; border: 1px solid var(--rule-2); background: var(--sheet); color: var(--ink); font-weight: 600; font-size: 14px; letter-spacing: -.005em; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .1s; }
.btn:hover { border-color: var(--ink-2); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn .ic { width: 17px; height: 17px; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--sunk); border-color: transparent; }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-lg { min-height: 50px; padding: 0 22px; font-size: 15px; }
.iconbtn { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--rule); border-radius: 6px; background: var(--sheet); cursor: pointer; flex: none; }
.iconbtn:hover { border-color: var(--ink-2); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.select { min-height: 44px; border: 1px solid var(--rule-2); border-radius: 6px; background: var(--sheet) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23687370' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px; padding: 0 34px 0 12px; appearance: none; -webkit-appearance: none; font-size: 14px; max-width: 100%; }
.select:hover { border-color: var(--ink-2); }

/* Demo pill */
.demo-pill { position: fixed; z-index: 70; left: 20px; bottom: 20px; display: flex; align-items: center; gap: 2px; padding: 3px 3px 3px 14px; border-radius: 999px; background: rgba(22, 32, 30, .94); color: #fff; font-size: 12.5px; font-weight: 600; box-shadow: 0 10px 30px rgba(10, 20, 18, .25); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); max-width: calc(100vw - 40px); }
.demo-pill a { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; min-height: 34px; }
.demo-pill a:hover { text-decoration: underline; color: #fff; }
.demo-pill .pvt-book { display: inline-flex; align-items: center; min-height: 34px; }
.demo-pill__dot { width: 8px; height: 8px; border-radius: 50%; background: #7FD1B9; box-shadow: 0 0 0 3px rgba(127, 209, 185, .25); flex: none; }
.demo-pill__x { position: relative; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: #C7D2CF; cursor: pointer; }
.demo-pill__x::before { content: ""; position: absolute; inset: -5px; }
.demo-pill__x:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.demo-pill__x .ic { width: 14px; height: 14px; }
.pill-short { display: none; }
@media (min-width: 761px) {
  body.dock-on .demo-pill:not(.open):not(:hover):not(:focus-within) { padding: 3px 14px 3px 12px; }
  body.dock-on .demo-pill:not(.open):not(:hover):not(:focus-within) .pill-text,
  body.dock-on .demo-pill:not(.open):not(:hover):not(:focus-within) .pvt-sep,
  body.dock-on .demo-pill:not(.open):not(:hover):not(:focus-within) .pvt-book,
  body.dock-on .demo-pill:not(.open):not(:hover):not(:focus-within) .demo-pill__x { display: none; }
  body.dock-on .demo-pill:not(.open):not(:hover):not(:focus-within) .pill-short { display: inline; }
}

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--top-h); background: rgba(243, 244, 241, .92); backdrop-filter: saturate(1.2) blur(12px); -webkit-backdrop-filter: saturate(1.2) blur(12px); border-bottom: 1px solid var(--rule); }
.topbar__in { height: 100%; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; min-height: 44px; }
.brand:hover { color: inherit; }
.brand__mark { width: 34px; height: 34px; flex: none; }
.brand__mark rect { fill: var(--ink); }
.brand__mark path { fill: none; stroke: #7FD1B9; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand__txt { display: flex; flex-direction: column; line-height: 1.1; }
.brand__txt strong { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.brand__txt span { font-size: 12px; color: var(--muted); font-weight: 500; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.asof { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
.asof .ic { width: 15px; height: 15px; }

/* Framing band */
.frame { padding: 56px 0 64px; border-bottom: 1px solid var(--rule); }
.frame__grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 56px; align-items: end; }
.eyebrow, .kicker { font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.frame h1 { margin-top: 18px; font-size: clamp(40px, 4.7vw, 64px); line-height: .98; letter-spacing: -.04em; font-weight: 800; max-width: 12ch; text-wrap: balance; }
.lede { margin-top: 22px; font-size: 17px; line-height: 1.55; color: var(--ink-2); max-width: 46ch; }
.frame__cta { margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.fine { font-size: 13px; color: var(--muted); }
.fine a { color: var(--accent); }
.frame__photo { position: relative; }
.frame__photo img { width: 100%; aspect-ratio: 1.5; object-fit: cover; object-position: 50% 60%; border-radius: 4px; background: var(--sunk); }
.frame__photo figcaption { margin-top: 12px; font-size: 13px; color: var(--muted); display: flex; gap: 10px; align-items: baseline; }
.frame__photo figcaption::before { content: ""; width: 24px; height: 1px; background: var(--ink); flex: none; transform: translateY(-4px); }

/* Desk + ledger strip */
.desk { padding-bottom: 72px; outline: none; }
.ledger { position: sticky; top: var(--top-h); z-index: 30; background: var(--ink); color: #E9EEEC; }
.ledger__in { min-height: var(--rail-h); display: flex; align-items: stretch; gap: 24px; }
.rail { display: flex; align-items: stretch; gap: 0; }
.rail__step { position: relative; display: flex; align-items: center; gap: 10px; padding: 0 22px 0 0; margin-right: 22px; background: none; border: 0; color: #9FB0AB; cursor: pointer; font-weight: 600; font-size: 14.5px; min-height: 44px; }
.rail__step::after { content: ""; position: absolute; left: 0; right: 22px; bottom: 0; height: 3px; background: transparent; transition: background .2s; }
.rail__step[aria-selected="true"] { color: #fff; }
.rail__step[aria-selected="true"]::after { background: #7FD1B9; }
.rail__step:hover { color: #fff; }
.rail__step:focus-visible { outline-color: #7FD1B9; }
.rail__n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 12px; border: 1px solid #4C5C58; }
.rail__step[aria-selected="true"] .rail__n { background: #7FD1B9; color: var(--ink); border-color: #7FD1B9; }
.rail__b { display: inline-flex; }
.rail__b .ic { width: 16px; height: 16px; color: #7FD1B9; stroke-width: 2.2; }
.rail__b em { font-style: normal; font-family: var(--mono); font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: #7FD1B9; color: var(--ink); }
.rail__b em.warn { background: #E9B85A; }
.owed { margin-left: auto; display: flex; align-items: baseline; gap: 12px; align-self: center; padding: 6px 0; }
.owed__label { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: #9FB0AB; }
.owed__num, .result__n, .dock__owed strong, .counts dd, .tally dd, .sheet__money dd, .orphan__amt { font-variant-numeric: lining-nums proportional-nums; }
.owed__num { font-size: 28px; font-weight: 800; letter-spacing: -.03em; color: #fff; }
.owed__sub { font-size: 13px; color: #B5C2BE; }
.owed.pulse .owed__num { animation: pulse .9s var(--ease); }
@keyframes pulse { 0% { color: #7FD1B9; } 100% { color: #fff; } }

.desk__body { padding-top: 40px; }
.viewhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px 40px; flex-wrap: wrap; padding-bottom: 26px; border-bottom: 1px solid var(--rule); margin-bottom: 28px; }
.viewhead h2 { margin-top: 8px; font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -.03em; line-height: 1.08; font-weight: 750; max-width: 24ch; }
.viewsub { margin-top: 10px; color: var(--ink-2); max-width: 64ch; }
.viewhead__act { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }

/* Import */
.slots { display: grid; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); align-items: stretch; }
.slots__join { display: grid; place-items: center; color: var(--rule-2); }
.slot { background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; padding: 22px; display: flex; flex-direction: column; gap: 18px; min-height: 300px; }
.slot.is-loaded { border-color: var(--accent-line); box-shadow: inset 0 3px 0 var(--accent); }
.slot.is-error { border-color: var(--brick-solid); }
.slot__head { display: flex; gap: 14px; align-items: flex-start; }
.slot__icon { width: 42px; height: 42px; border-radius: 6px; background: var(--sunk); display: grid; place-items: center; flex: none; }
.slot h3 { font-size: 18px; letter-spacing: -.015em; }
.slot__head p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.drop { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; border: 1.5px dashed var(--rule-2); border-radius: 6px; padding: 28px 16px; cursor: pointer; transition: border-color .15s, background .15s; min-height: 160px; }
.drop:hover, .drop.over, .drop:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.drop__ic { width: 44px; height: 44px; border-radius: 50%; background: var(--sunk); display: grid; place-items: center; }
.drop.over .drop__ic { background: var(--accent); color: #fff; }
.drop__t u { color: var(--accent); text-underline-offset: 3px; }
.drop__s { font-size: 12.5px; color: var(--muted); }
.slot__loading { flex: 1; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.slot__loading p { font-size: 14px; color: var(--ink-2); }
.bar { height: 4px; background: var(--sunk); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 40%; background: var(--accent); animation: load 1s var(--ease) infinite; }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.skel { display: grid; gap: 8px; }
.skel span { height: 12px; border-radius: 3px; background: linear-gradient(90deg, var(--sunk), #F6F7F4, var(--sunk)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skel span:nth-child(2) { width: 82%; } .skel span:nth-child(3) { width: 64%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.slot__err { display: flex; gap: 12px; padding: 12px 14px; border-radius: 6px; background: var(--brick-bg); color: var(--brick); font-size: 14px; }
.slot__err p { color: var(--ink-2); }
.slot__done { display: flex; flex-direction: column; gap: 16px; }
.slot__file { display: flex; gap: 10px; align-items: flex-start; }
.slot__file .ok { color: var(--accent); stroke-width: 2.4; margin-top: 2px; }
.slot__file b { display: block; font-family: var(--mono); font-size: 13.5px; font-weight: 500; word-break: break-all; }
.slot__file small { color: var(--muted); font-size: 12.5px; }
.counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.counts div { padding: 12px 0; }
.counts div + div { padding-left: 14px; border-left: 1px solid var(--rule); }
.counts dt { font-size: 12px; color: var(--muted); }
.counts dd { font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
.counts dd.warn { color: var(--amber); }
.probs { border: 1px solid #E6D3A6; background: #FBF5E6; border-radius: 6px; padding: 10px 14px; font-size: 13.5px; }
.probs summary { cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--amber); min-height: 32px; }
.probs ul { margin: 6px 0 8px; display: grid; gap: 4px; }
.probs li .mono { color: var(--amber); margin-right: 6px; }
.probs code { background: #F3E6C3; padding: 0 5px; border-radius: 3px; }
.probs p { font-size: 12.5px; }
.note { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.note .ic { width: 15px; height: 15px; }
.handoff { margin-top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding: 18px 22px; border-radius: 6px; background: var(--accent-soft); border: 1px solid var(--accent-line); }

/* Match */
.tally { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: 6px; background: var(--sheet); margin-bottom: 36px; }
.tally div { padding: 16px 20px; }
.tally div + div { border-left: 1px solid var(--rule); }
.tally dt { font-size: 12.5px; color: var(--muted); }
.tally dd { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.tally .hot dd { color: var(--amber); }
.block { margin-bottom: 40px; }
.block__t { font-size: 17px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.block__t .muted { font-weight: 500; font-size: 13px; }
.count { font-family: var(--mono); font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--sunk); color: var(--ink-2); }
.done { display: flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 600; font-size: 14px; }
.done .ic { stroke-width: 2.4; }
.pair { background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; padding: 18px 20px; margin-bottom: 14px; transition: opacity .25s, transform .25s; }
.pair.leaving, .orphan.leaving { opacity: 0; transform: translateX(16px); }
.pair__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tagline { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13.5px; color: var(--accent); }
.tagline.t-dup { color: var(--brick); }
.tagline .ic { width: 16px; height: 16px; }
.conf { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12.5px; }
.conf__bar { width: 90px; height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; }
.conf__bar i { display: block; height: 100%; background: var(--accent); }
.pair__why { margin-top: 6px; color: var(--ink-2); font-size: 14px; }
.pair__grid { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr); gap: 0; align-items: start; }
.pair__grid h4 { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.pair__grid h4 .ic { width: 16px; height: 16px; color: var(--muted); }
.pair__grid h4 .mono { font-weight: 400; }
.pair__arrow { display: grid; place-items: center; color: var(--rule-2); padding-top: 50px; }
.kv { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 10px; padding: 6px 8px; border-top: 1px solid var(--rule); font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { overflow-wrap: anywhere; }
.kv.is-diff { background: var(--amber-bg); border-top-color: #E7D3A3; }
.kv.is-diff dd { color: var(--amber); font-weight: 600; }
.pair__act { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.orphan { display: flex; justify-content: space-between; align-items: center; gap: 16px 24px; flex-wrap: wrap; background: var(--sheet); border: 1px solid var(--rule); border-left: 3px solid var(--slate-solid); border-radius: 6px; padding: 16px 20px; margin-bottom: 12px; transition: opacity .25s, transform .25s; }
.orphan__main { display: flex; gap: 18px; align-items: flex-start; min-width: 0; flex: 1 1 380px; }
.orphan__amt { font-size: 22px; font-weight: 800; letter-spacing: -.02em; min-width: 92px; }
.orphan__main p { font-size: 14px; }
.orphan__main .note { margin-top: 4px; }
.orphan__act { display: flex; gap: 8px; flex: 0 1 460px; min-width: 0; }
.orphan__act .select { flex: 1; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mini { display: inline-flex; gap: 8px; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 6px; background: var(--sheet); cursor: pointer; font-size: 13px; font-variant-numeric: tabular-nums; }
.mini:hover { border-color: var(--ink-2); }
.mini .mono { color: var(--ink-2); }
.autolist summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; }
.autolist summary::-webkit-details-marker { display: none; }
.autolist summary .block__t { margin: 0; }
.autolist summary .ic { transition: transform .2s; }
.autolist[open] summary .ic { transform: rotate(180deg); }
.autolist[open] summary .muted { display: none; }

/* Tables */
.tablewrap { background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl-claims { font-size: 14px; }
.tbl th { text-align: left; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 11px 12px; border-bottom: 1px solid var(--rule-2); white-space: nowrap; background: #FAFBF9; position: sticky; top: 0; }
.tbl td { padding: 10px 11px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.tbl .r { text-align: right; }
.tbl td.money { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.tbl td.owedcell { font-weight: 600; }
.tbl-claims tbody tr { cursor: pointer; transition: background .12s; }
.tbl-claims tbody tr:hover { background: #F7F8F5; }
.tbl-claims tbody tr:focus-visible { outline-offset: -2px; }
.tbl-claims td:first-child .linkbtn { font-size: 13px; text-decoration: none; white-space: nowrap; }
.tbl-claims td:first-child small { max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl-claims .partcell b { font-weight: 600; }
.tbl-claims .partcell small { max-width: 300px; }
.tbl-claims .partcell small.mono { font-size: 11.5px; }
.tbl-claims .distcell { color: var(--ink-2); font-size: 13px; min-width: 120px; }
.tbl .nowrap, .tbl-claims td:nth-child(7), .tbl-claims td:nth-child(8) { white-space: nowrap; }
.tbl-claims .row-overdue td.owedcell { color: var(--amber); }
.tbl-claims .row-short td.owedcell { color: var(--brick); }
.tbl-claims .row-denied td { color: var(--muted); }
.late { color: var(--amber); font-weight: 600; }
.hint { color: var(--accent) !important; }

/* Status chips */
.st { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-overdue { color: var(--amber); background: var(--amber-bg); }
.st-short { color: var(--brick); background: var(--brick-bg); }
.st-paper { color: var(--slate); background: var(--slate-bg); }
.st-pending { color: var(--neutral); background: var(--neutral-bg); }
.st-paid { color: var(--accent); background: var(--accent-soft); }
.st-denied { color: var(--muted); background: #ECEDEA; text-decoration: line-through; text-decoration-thickness: 1px; }
.docs { display: inline-flex; gap: 3px; }
.docs i { font-style: normal; font-family: var(--mono); font-size: 10px; padding: 2px 4px; border-radius: 3px; line-height: 1.2; }
.docs i.on { background: var(--sunk); color: var(--ink-2); }
.docs i.off { background: var(--slate-bg); color: var(--slate); text-decoration: line-through; box-shadow: inset 0 0 0 1px #B8C9D8; }

/* Claims filters */
.filters { display: flex; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 999px; background: var(--sheet); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.fchip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.fchip .money { font-family: var(--mono); font-weight: 500; font-size: 12px; color: var(--muted); }
.fchip:hover { border-color: var(--ink-2); }
.fchip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.fchip[aria-pressed="true"] .money { color: #B5C2BE; }
.fchip.st-overdue i { background: var(--amber-solid); } .fchip.st-short i { background: var(--brick-solid); } .fchip.st-paper i { background: var(--slate-solid); }
.fchip.st-pending i { background: var(--neutral-solid); } .fchip.st-paid i { background: var(--accent); } .fchip.st-denied i { background: var(--muted); }
.fchip.st-overdue, .fchip.st-short, .fchip.st-paper, .fchip.st-pending, .fchip.st-paid, .fchip.st-denied { background: var(--sheet); color: var(--ink-2); text-decoration: none; }
.fchip[aria-pressed="true"].st-overdue, .fchip[aria-pressed="true"].st-short, .fchip[aria-pressed="true"].st-paper, .fchip[aria-pressed="true"].st-pending, .fchip[aria-pressed="true"].st-paid, .fchip[aria-pressed="true"].st-denied { background: var(--ink); color: #fff; }
.fctl { display: flex; gap: 8px; }
.search { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--rule-2); border-radius: 6px; background: var(--sheet); width: 280px; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search .ic { color: var(--muted); width: 16px; height: 16px; }
.search input { border: 0; outline: 0; background: transparent; width: 100%; min-height: 40px; font-size: 14px; }
.seg { display: inline-flex; align-items: center; border: 1px solid var(--rule-2); border-radius: 6px; background: var(--sheet); padding: 3px; gap: 2px; }
.seg__l { font-size: 12.5px; color: var(--muted); padding: 0 8px 0 6px; }
.seg button { min-height: 40px; min-width: 50px; padding: 0 10px; border: 0; border-radius: 4px; background: transparent; cursor: pointer; font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.cards { display: none; }
.listnote { margin-top: 12px; }
.nores { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 16px; background: var(--sheet); border: 1px dashed var(--rule-2); border-radius: 6px; color: var(--muted); }

/* Empty state */
.empty { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.empty__img img { width: 100%; height: 100%; min-height: 300px; object-fit: cover; filter: contrast(1.05); }
.empty__txt { padding: 40px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.empty__txt h2 { font-size: 28px; letter-spacing: -.03em; line-height: 1.1; }
.empty__txt p { color: var(--ink-2); max-width: 42ch; }

/* Recover */
.result { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 32px 56px; align-items: end; padding: 8px 0 36px; border-bottom: 1px solid var(--rule); margin-bottom: 36px; }
.result__l { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.result__n { font-size: clamp(56px, 7.4vw, 104px); line-height: .95; font-weight: 800; letter-spacing: -.05em; color: var(--ink); margin-top: 8px; }
.result__s { margin-top: 14px; color: var(--ink-2); font-size: 15.5px; }
.stack { display: flex; height: 18px; border-radius: 3px; overflow: hidden; gap: 2px; background: var(--sunk); }
.stack i { display: block; min-width: 4px; }
.stack i.st-overdue { background: var(--amber-solid); } .stack i.st-short { background: var(--brick-solid); } .stack i.st-paper { background: var(--slate-solid); } .stack i.st-pending { background: var(--neutral-solid); }
.legend { margin-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.legend button { width: 100%; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px; align-items: baseline; text-align: left; background: none; border: 0; border-top: 1px solid var(--rule); padding: 10px 2px; cursor: pointer; }
.legend button:hover span { text-decoration: underline; }
.legend i { width: 10px; height: 10px; border-radius: 2px; grid-row: 1; }
.legend i.st-overdue { background: var(--amber-solid); } .legend i.st-short { background: var(--brick-solid); } .legend i.st-paper { background: var(--slate-solid); } .legend i.st-pending { background: var(--neutral-solid); }
.legend span { font-weight: 600; font-size: 14px; }
.legend b { font-family: var(--mono); font-size: 14px; }
.legend small { grid-column: 2 / 4; color: var(--muted); font-size: 12px; }
.actions { display: grid; gap: 0; background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; counter-reset: a; }
.actions li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 20px; }
.actions li + li { border-top: 1px solid var(--rule); }
.actions__ic { width: 44px; height: 44px; border-radius: 6px; background: var(--sunk); display: grid; place-items: center; }
.actions li:first-child .actions__ic { background: var(--accent-soft); color: var(--accent); }
.actions b { font-size: 15.5px; letter-spacing: -.01em; }
.actions small { display: block; color: var(--muted); font-size: 13px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.aging { background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; padding: 8px 20px; }
.aging li { display: grid; grid-template-columns: 92px minmax(0, 1fr) 84px; grid-template-rows: auto auto; column-gap: 14px; align-items: center; padding: 12px 0; }
.aging li + li { border-top: 1px solid var(--rule); }
.aging__l { font-size: 13.5px; font-weight: 600; }
.aging__bar { height: 12px; background: var(--sunk); border-radius: 2px; overflow: hidden; }
.aging__bar i { display: block; height: 100%; background: var(--neutral-solid); transition: width .5s var(--ease); }
.aging li.old .aging__bar i { background: var(--amber-solid); }
.aging b { font-family: var(--mono); font-size: 14px; text-align: right; }
.aging small { grid-column: 2 / 4; color: var(--muted); font-size: 12px; }
.tbl-dist td b { font-weight: 600; }

/* Dialogs: sheet + modal */
dialog { border: 0; padding: 0; color: var(--ink); background: var(--sheet); }
dialog::backdrop { background: rgba(16, 24, 22, .42); }
.sheet { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(600px, 100vw); max-width: 100vw; box-shadow: -20px 0 60px rgba(10, 20, 18, .2); }
.sheet[open] { animation: slidein .28s var(--ease); }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
.sheet__in { height: 100%; overflow-y: auto; scroll-padding-bottom: 96px; padding: 24px 28px 0; display: flex; flex-direction: column; gap: 22px; }
.sheet__head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.sheet__head h2 { font-size: 24px; letter-spacing: -.025em; line-height: 1.15; margin: 6px 0 2px; }
.sheet__status { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--paper); border-radius: 6px; font-size: 14px; }
.sheet__status .st { flex: none; margin-top: 1px; }
.sheet__money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.sheet__money div { padding: 12px 0; }
.sheet__money div + div { padding-left: 14px; border-left: 1px solid var(--rule); }
.sheet__money dt { font-size: 12px; color: var(--muted); }
.sheet__money dd { font-size: 21px; font-weight: 750; letter-spacing: -.02em; }
.sheet__money .o dd { color: var(--accent); }
.sheet__sec h3 { font-size: 14px; font-weight: 700; margin-bottom: 10px; display: flex; gap: 8px; align-items: baseline; }
.sheet__sec h3 .muted { font-weight: 500; font-size: 12.5px; }
.kvs .kv { grid-template-columns: 120px minmax(0, 1fr); padding: 7px 0; }
.tl { border-left: 1px solid var(--rule-2); margin-left: 6px; display: grid; gap: 12px; }
.tl li { position: relative; padding-left: 18px; font-size: 14px; }
.tl li::before { content: ""; position: absolute; left: -5px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--sheet); border: 1.5px solid var(--rule-2); }
.tl li > span:first-child { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.tl li em { display: block; font-style: normal; color: var(--ink-2); font-size: 13px; }
.tl li.cr::before { background: var(--accent); border-color: var(--accent); }
.tl li.pend::before { background: var(--amber-solid); border-color: var(--amber-solid); }
.tl li.exp::before { border-style: dashed; }
.tl li.exp { color: var(--muted); }
.rtag-wrap { margin-top: 16px; }
.rtag-label { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.rtag-label span { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.rtag { position: relative; display: flex; align-items: stretch; background: #F7F1E3; border: 1px solid #DDD0B2; border-radius: 6px 20px 20px 6px; padding: 14px 16px 14px 46px; overflow: hidden; }
.rtag__hole { position: absolute; left: 14px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--sheet); box-shadow: inset 0 0 0 1px #CDBF9E, 0 0 0 4px #EDE3CB; }
.rtag::before { content: ""; position: absolute; left: 38px; top: 10px; bottom: 10px; border-left: 1.5px dashed #D6C8A6; }
.rtag__body { flex: 1; min-width: 0; padding-left: 8px; }
.rtag__head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; border-bottom: 1px solid #E2D6BA; padding: 0 0 6px; margin-bottom: 8px; }
.rtag__head b { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #6B5A33; white-space: nowrap; }
.rtag__head span { font-size: 12px; color: #7D6E4E; text-align: right; }
.rtag dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }
.rtag__row dt { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #8C7C58; }
.rtag__row dd { font-family: var(--mono); font-size: 13px; color: #2B2615; overflow-wrap: anywhere; }
.rtag__row.big, .rtag__row.wide { grid-column: 1 / -1; }
.rtag__row.big dd { font-size: 18px; font-weight: 600; letter-spacing: .02em; }
.rtag__row.miss dd { color: var(--slate); text-decoration: line-through; text-decoration-thickness: 1px; }
.rtag__stamp { position: absolute; right: 16px; top: 52px; transform: rotate(-5deg); font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border: 1.5px solid currentColor; border-radius: 4px; background: rgba(255, 255, 255, .5); }
.rtag.is-ok .rtag__stamp { color: var(--accent); }
.rtag.is-missing .rtag__stamp { color: var(--slate); }
.rtag.is-missing { background: #F3F2EC; border-style: dashed; border-color: #B8C9D8; }
.checklist { display: grid; border: 1px solid var(--rule); border-radius: 6px; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.checklist li + li { border-top: 1px solid var(--rule); }
.tick { flex: 1; display: flex; align-items: flex-start; gap: 12px; cursor: pointer; min-height: 44px; padding-top: 2px; min-width: 0; }
.tick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.box { width: 24px; height: 24px; border-radius: 5px; border: 1.5px solid var(--rule-2); display: grid; place-items: center; flex: none; background: var(--sheet); }
.box .ic { width: 15px; height: 15px; stroke-width: 2.6; color: #fff; opacity: 0; }
.tick input:checked + .box { background: var(--accent); border-color: var(--accent); }
.tick input:checked + .box .ic { opacity: 1; }
.tick input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.tick__t b { display: block; font-size: 14px; font-weight: 600; }
.tick__t small { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.tick__t small .ic { width: 14px; height: 14px; color: var(--accent); }
.checklist li:not(.on) .tick__t b { color: var(--slate); }
.attach { flex: none; }
.attach label.btn { cursor: pointer; }
.attach label.btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
textarea { width: 100%; border: 1px solid var(--rule-2); border-radius: 6px; padding: 10px 12px; background: var(--sheet); font-size: 14px; resize: vertical; }
textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sheet__in > section:last-of-type { padding-bottom: 12px; }
.sheet__foot { position: sticky; bottom: 0; z-index: 2; flex-wrap: wrap; margin: auto -28px 0; padding: 14px 28px calc(14px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); border-top: 1px solid var(--rule); display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.sheet__foot .done { margin-right: auto; }
.dtabs { display: flex; gap: 6px; flex-wrap: wrap; }
.dtabs button { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 12px; border: 1px solid var(--rule); border-radius: 6px; background: var(--sheet); cursor: pointer; font-weight: 600; font-size: 13.5px; }
.dtabs button .money { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.dtabs button .ic { width: 15px; height: 15px; color: var(--accent); stroke-width: 2.4; }
.dtabs button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.dtabs button[aria-pressed="true"] .money { color: #B5C2BE; }
.draft { display: grid; gap: 10px; }
.draft h3 { font-size: 14px; display: flex; gap: 8px; align-items: center; }
.draft__meta { display: grid; border: 1px solid var(--rule); border-radius: 6px; }
.draft__meta p { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; padding: 9px 12px; font-size: 13.5px; }
.draft__meta p + p { border-top: 1px solid var(--rule); }
.draft__meta span { color: var(--muted); }
.draft__meta b { font-weight: 600; overflow-wrap: anywhere; }
.draft__body { font-family: var(--mono); font-size: 12.5px; line-height: 1.55; background: #FAFBF9; white-space: pre-wrap; }

.modal { width: min(820px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); border-radius: 8px; box-shadow: 0 30px 80px rgba(10, 20, 18, .3); }
.modal[open] { animation: rise .25s var(--ease); }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.modal__in { display: flex; flex-direction: column; max-height: calc(100dvh - 48px); }
.modal__head { display: flex; justify-content: space-between; gap: 16px; padding: 22px 24px 16px; border-bottom: 1px solid var(--rule); }
.modal__head h2 { font-size: 22px; letter-spacing: -.02em; margin: 6px 0 4px; }
.modal__head p.muted { font-size: 14px; }
.maps { overflow-y: auto; padding: 8px 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.map { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.map label { display: flex; gap: 8px; align-items: baseline; font-size: 13.5px; }
.map label em { font-style: normal; font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.map label .muted { font-size: 12px; }
.map.need .select { border-color: var(--brick-solid); background-color: #FDF6F4; }
.map.need label em { color: var(--brick); }
.map .ex { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal__foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--rule); flex-wrap: wrap; }
.maperr { margin-right: auto; display: flex; gap: 6px; align-items: center; color: var(--brick); font-size: 13.5px; font-weight: 600; }

/* Toasts + dock */
.toasts { position: fixed; z-index: 90; right: 24px; bottom: 24px; display: grid; width: min(400px, calc(100vw - 48px)); pointer-events: none; }
.foot-status { display: none; flex: 1 1 100%; order: -1; margin: 0 0 4px; padding: 9px 12px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-2); font-size: 13.5px; font-weight: 600; }
.foot-status.on { display: block; animation: rise .2s var(--ease); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 6px; font-size: 14px; box-shadow: 0 12px 30px rgba(10, 20, 18, .25); animation: rise .25s var(--ease); transition: opacity .3s; }
.toast.out { opacity: 0; }
.dock { display: none; }

/* Footer */
.foot { border-top: 1px solid var(--rule); padding: 40px 0 120px; font-size: 13.5px; color: var(--ink-2); }
.foot__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 56px; }
.foot p + p { margin-top: 10px; }
.foot__brand { font-weight: 800; font-size: 16px; color: var(--ink); letter-spacing: -.01em; }
.foot__brand span { font-weight: 500; color: var(--muted); }
.foot__credit { color: var(--muted); }
.pvt-band + .foot { padding-top: 40px; }

/* ---------- Mid widths ---------- */
@media (max-width: 1100px) {
  .frame__grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .frame h1 { max-width: 14ch; }
  .frame__photo img { aspect-ratio: 2.1; }
  .owed__sub { display: none; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .tbl-claims th:nth-child(8), .tbl-claims td:nth-child(8) { display: none; }
  .result { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 920px) {
  .slots { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .slots__join { display: none; }
  .rail__step { padding-right: 14px; margin-right: 14px; }
  .rail__step::after { right: 14px; }
  .tbl-claims th:nth-child(6), .tbl-claims td:nth-child(6) { display: none; }
  .tbl-claims .partcell small { white-space: normal; }
  .owed__label { display: none; }
  .tbl td, .tbl th { padding-left: 8px; padding-right: 8px; }
  .tally { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tally div:nth-child(3) { border-left: 0; }
  .tally div:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

/* ---------- Phone ---------- */
@media (max-width: 760px) {
  :root { --top-h: 56px; --rail-h: 56px; }
  body { font-size: 15px; }
  .wrap { padding: 0 16px; }
  .asof { display: none; }
  .brand__txt span { font-size: 11.5px; }
  #resetDemo span { display: none; }
  #resetDemo { width: 44px; padding: 0; border: 1px solid var(--rule); }
  .frame { padding: 64px 0 36px; }
  .frame__grid { gap: 24px; }
  .frame h1 { font-size: 40px; margin-top: 12px; max-width: none; }
  .lede { font-size: 16px; margin-top: 16px; }
  .frame__cta { margin-top: 22px; }
  .frame__cta .btn { width: 100%; }
  .frame__photo { margin: 0 -16px; }
  .frame__photo img { aspect-ratio: 1.5; border-radius: 0; object-position: 50% 30%; }
  .frame__photo figcaption { padding: 0 16px; }

  .ledger__in { padding: 0; }
  .rail { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rail__step { flex-direction: column; justify-content: center; gap: 2px; padding: 6px 2px; margin: 0; font-size: 12.5px; min-height: var(--rail-h); }
  .rail__step::after { left: 14%; right: 14%; }
  .rail__n { width: 20px; height: 20px; font-size: 11px; }
  .rail__b { position: absolute; top: 5px; right: calc(50% - 26px); }
  .rail__b em { font-size: 10px; padding: 0 5px; }
  .rail__b .ic { width: 13px; height: 13px; }
  .owed { display: none; }

  .desk__body { padding-top: 26px; }
  .viewhead { padding-bottom: 18px; margin-bottom: 20px; }
  .viewhead h2 { font-size: 26px; }
  .viewhead__act { align-items: stretch; width: 100%; }
  .viewhead__act .btn { width: 100%; }
  .slot { padding: 18px 16px; min-height: 0; }
  .counts dd { font-size: 20px; }
  .handoff .btn { width: 100%; }

  .tally { margin-bottom: 26px; }
  .tally div { padding: 12px 14px; }
  .tally dd { font-size: 24px; }
  .pair { padding: 16px 14px; }
  .pair__grid { grid-template-columns: minmax(0, 1fr); }
  .pair__arrow { padding: 6px 0; transform: rotate(90deg); }
  .kv { grid-template-columns: 112px minmax(0, 1fr); }
  .pair__act .btn { flex: 1 1 140px; }
  .orphan { padding: 14px; }
  .orphan__main { flex-basis: 100%; flex-direction: column; gap: 6px; }
  .orphan__act { flex: 1 1 100%; flex-direction: column; }
  .autolist .tablewrap { font-size: 12.5px; }

  .filters { position: sticky; top: calc(var(--top-h) + var(--rail-h)); z-index: 20; margin: 0 -16px 14px; padding: 10px 16px; background: rgba(243, 244, 241, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
  .fchips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .fchips::-webkit-scrollbar { display: none; }
  .fchip { min-height: 40px; }
  .fctl { width: 100%; }
  .search { width: auto; flex: 1; min-width: 0; }
  .fctl .select { width: 44%; flex: none; }
  .claims-table { display: none; }
  .cards { display: grid; gap: 10px; }
  .ccard { width: 100%; text-align: left; display: grid; gap: 4px; padding: 14px; border: 1px solid var(--rule); border-radius: 6px; background: var(--sheet); cursor: pointer; }
  .ccard.row-overdue { border-left: 3px solid var(--amber-solid); }
  .ccard.row-short { border-left: 3px solid var(--brick-solid); }
  .ccard.row-paperwork { border-left: 3px solid var(--slate-solid); }
  .ccard__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .ccard__top .mono { font-size: 13px; color: var(--ink-2); }
  .ccard__part { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
  .ccard__who { font-size: 13px; color: var(--muted); }
  .ccard__nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--rule); font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums; }
  .ccard__nums small { display: block; font-family: var(--sans); font-size: 11.5px; color: var(--muted); }
  .ccard__nums .o { font-weight: 600; }
  .ccard.row-overdue .o { color: var(--amber); } .ccard.row-short .o { color: var(--brick); }
  .ccard__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
  .ccard__age { font-size: 12.5px; color: var(--muted); }
  .seg { width: 100%; }
  .seg__l { flex: 1; }

  .empty { grid-template-columns: minmax(0, 1fr); }
  .empty__img img { min-height: 0; aspect-ratio: 1.6; }
  .empty__txt { padding: 22px 18px 24px; }
  .empty__txt h2 { font-size: 24px; }
  .empty__txt .btn { flex: 1 1 100%; }

  .result { padding-bottom: 26px; margin-bottom: 26px; gap: 24px; }
  .result__n { font-size: 64px; }
  .legend { grid-template-columns: minmax(0, 1fr); }
  .actions li { grid-template-columns: 40px minmax(0, 1fr); padding: 14px; gap: 12px; }
  .actions__ic { width: 40px; height: 40px; }
  .actions li .btn { grid-column: 1 / -1; width: 100%; }
  .aging { padding: 4px 14px; }
  .aging li { grid-template-columns: 78px minmax(0, 1fr) 72px; column-gap: 10px; }
  .tbl-dist small { font-size: 11.5px; }
  .tbl-dist th:nth-child(2), .tbl-dist td:nth-child(2), .tbl-dist th:nth-child(3), .tbl-dist td:nth-child(3) { display: none; }

  .sheet { width: 100vw; height: 100dvh; margin: 0; box-shadow: none; }
  .sheet[open] { animation: slideup .28s var(--ease); }
  @keyframes slideup { from { transform: translateY(30px); opacity: 0; } }
  .sheet__in { padding: 16px 16px 0; gap: 18px; }
  .sheet__foot { margin: auto -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .sheet__foot .btn { flex: 1; }
  .sheet__money dd { font-size: 18px; }
  .kvs .kv { grid-template-columns: 104px minmax(0, 1fr); }
  .checklist li { flex-wrap: wrap; }
  .attach { margin-left: 36px; }
  .draft__body { font-size: 11.5px; }
  .modal { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .modal__in { max-height: 100dvh; height: 100%; }
  .maps { grid-template-columns: minmax(0, 1fr); padding: 4px 16px; flex: 1; }
  .modal__head { padding: 16px; }
  .modal__foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .modal__foot .btn { flex: 1; }
  .maperr { flex-basis: 100%; }

  .dock { display: flex; position: fixed; z-index: 35; left: 0; right: 0; bottom: 0; align-items: center; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--ink); color: #fff; transform: translateY(110%); transition: transform .25s var(--ease); }
  .dock.on { transform: none; }
  .dock__owed { flex: 1; min-width: 0; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: baseline; }
  .dock__owed span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #9FB0AB; grid-column: 1; }
  .dock__owed strong { font-size: 24px; font-weight: 800; letter-spacing: -.03em; grid-column: 1 / -1; line-height: 1.1; }
  .dock__owed small { grid-column: 2; grid-row: 1; color: #B5C2BE; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dock .btn { flex: none; max-width: 56%; overflow: hidden; text-overflow: ellipsis; }
  .toasts { width: auto; }
  body.toast-on .demo-pill { visibility: hidden; }
  .toast { padding: 10px 14px; font-size: 13.5px; }
  .demo-pill { left: 12px; right: auto; top: calc(var(--top-h) + 8px); bottom: auto; }
  body.dock-on .demo-pill { top: auto; bottom: var(--dock-h, 66px); left: 0; right: 0; max-width: none; border-radius: 0; justify-content: space-between; padding: 0 4px 0 16px; box-shadow: none; background: #26332F; backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 1px solid rgba(255,255,255,.08); }
  body.dock-on .demo-pill a { min-height: 32px; white-space: nowrap; }
  .pill-long { display: none; }
  .demo-pill { font-size: 11.5px; padding-left: 12px; }
  .foot { padding-bottom: 110px; }
  .foot__in { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
@media (min-width: 761px) and (max-width: 840px) {
  .tbl-claims .partcell small.mono { display: none; }
  .tbl-claims td:first-child small { max-width: 120px; }
}
@media (max-width: 380px) {
  .frame h1 { font-size: 38px; }
  .result__n { font-size: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
