:root {
  --bg: #EEF2F8; --surface: #FFFFFF; --surface-2: #F5F8FD; --ink: #14213D; --ink-2: #4A5B72; --ink-3: #66768C; --line: #B4C1D4; --line-strong: #8FA2BD;
  --navy: #0F1B2A; --navy-ink: #F4F6F9; --accent: #1F4FBF; --accent-ink: #FFFFFF; --accent-soft: #E3ECFB;
  --good: #1B7A4E; --good-soft: #E1F2E9; --warn: #9A5B00; --warn-soft: #FBEFD9; --bad: #B3261E; --bad-soft: #FBE4E2;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E141B; --surface: #151D27; --surface-2: #1A2430; --ink: #E7EDF3; --ink-2: #A9B8C7; --ink-3: #8798A9; --line: #2A3745; --line-strong: #46586B;
    --navy: #0A1119; --navy-ink: #E7EDF3; --accent: #86A8FF; --accent-ink: #0E141B; --accent-soft: #1E2B47;
    --good: #5FD39A; --good-soft: #15322A; --warn: #F2B65A; --warn-soft: #3A2B12; --bad: #FF8A80; --bad-soft: #3D1C1A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0E141B; --surface: #151D27; --surface-2: #1A2430; --ink: #E7EDF3; --ink-2: #A9B8C7; --ink-3: #8798A9; --line: #2A3745; --line-strong: #46586B;
    --navy: #0A1119; --navy-ink: #E7EDF3; --accent: #86A8FF; --accent-ink: #0E141B; --accent-soft: #1E2B47;
    --good: #5FD39A; --good-soft: #15322A; --warn: #F2B65A; --warn-soft: #3A2B12; --bad: #FF8A80; --bad-soft: #3D1C1A;
    color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; }
.wrap { max-width: 1180px; margin-inline: auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 24px; } h2 { font-size: 19px; } h3 { font-size: 16px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: var(--ink); }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--ink-2); } .small { font-size: 13px; } .tiny { font-size: 12px; color: var(--ink-3); }
.eyebrow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.hidden { display: none !important; }

/* bar */
.bar { position: sticky; top: 0; z-index: 30; background: var(--navy); color: var(--navy-ink); padding-top: env(safe-area-inset-top); }
.barin { display: flex; align-items: center; gap: 12px 18px; padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); min-height: 64px; }
.barspace { flex: 1 1 auto; }
.brand { color: var(--navy-ink); text-decoration: none; font-weight: 700; font-size: 17px; display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.logo-chip { background: #FFFFFF; border-radius: 8px; padding: 3px 6px; display: inline-flex; line-height: 0; flex: none; }
.logo-chip img { height: 41px; width: auto; display: block; }
.auth-logo { display: block; margin: 0 auto 4px; height: 96px; width: auto; }
.auth-logo-wrap { background: #FFFFFF; border-radius: 10px; padding: 8px; margin: -4px -4px 4px; text-align: center; }
.brand small { display: block; font-weight: 400; font-size: 11px; opacity: .7; }
.menubtn { display: none; flex: none; width: 42px; height: 42px; border-radius: 8px; border: 1px solid rgba(255,255,255,.3); background: transparent; padding: 11px 10px; flex-direction: column; justify-content: space-between; }
.menubtn span { display: block; height: 2px; border-radius: 2px; background: var(--navy-ink); }

/* layout: menu on the left */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); align-items: start; }
body:not(.authed) .shell { grid-template-columns: minmax(0, 1fr); }
body:not(.authed) .side, body:not(.authed) .menubtn { display: none !important; }
.content { min-width: 0; }
.side { position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 12px 12px; }
.nav { display: flex; flex-direction: column; flex: 1 0 auto; }
.nav-group { padding: 10px 0; }
.nav-group:first-child { padding-top: 0; }
.nav-group + .nav-group { border-top: 1px solid var(--line); }
.nav-h { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; padding: 2px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; position: relative; }
.nav a + a { margin-top: 3px; }
.nav a + a::before { content: ""; position: absolute; left: 10px; right: 10px; top: -2px; border-top: 1px dashed var(--line); }
.nav a:hover { background: var(--surface-2); }
.nav a:hover::before, .nav a:hover + a::before, .nav a.on::before, .nav a.on + a::before { border-color: transparent; }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.nav .ic { width: 18px; height: 18px; flex: none; opacity: .75; }
.nav a.on .ic { opacity: 1; }
.nav .badge { margin-left: auto; }
.badge { font-family: var(--mono); font-size: 11px; background: #E8B04B; color: #1b1300; border-radius: 10px; padding: 0 6px; font-weight: 700; }
.who { border-top: 1px solid var(--line); padding: 12px 10px 4px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.who b { font-size: 14px; } .who .row { gap: 14px; }
.scrim { display: none; }
@media (max-width: 900px) {
  .shell, body:not(.authed) .shell { grid-template-columns: minmax(0, 1fr); }
  .menubtn { display: inline-flex; }
  .side { position: fixed; z-index: 50; top: 0; left: 0; bottom: 0; height: auto; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .2s ease; box-shadow: 0 10px 40px rgba(0,0,0,.25); padding-top: calc(16px + env(safe-area-inset-top)); }
  body.menu-open .side { transform: none; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(8,14,22,.45); }
  .brand small { display: none; }
  .theme button { padding: 4px 7px; }
}
@media (max-width: 420px) { .brand > span:last-child { font-size: 15px; } }
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }
.linkbtn { color: var(--navy-ink); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; font-size: inherit; }

main { padding-block: 20px 60px; }
.page-head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; }
.page-head p { margin-top: 4px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.pad { padding: 18px 20px; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spacer { flex: 1 1 auto; }

/* buttons */
.btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 8px 14px; font-weight: 600; font-size: 14px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.bad { color: var(--bad); border-color: var(--bad); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* forms */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }
.span2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .lbl { font-weight: 600; font-size: 14px; }
.field .hint { font-size: 12px; color: var(--ink-3); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input:not([type]), select, textarea {
  border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input.amt { text-align: right; font-family: var(--mono); }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-right: 1px solid var(--line); background: var(--surface); padding: 8px 12px; color: var(--ink-2); font-size: 14px; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed=true] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks label { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; font-weight: 400; }
.section-title { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.section-title .n { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }

/* cost lines */
.costs { width: 100%; border-collapse: collapse; }
.costs th { font-size: 12px; color: var(--ink-3); text-align: left; font-weight: 600; padding: 0 6px 6px; }
.costs td { padding: 4px 6px; vertical-align: top; }
.costs td.amt-cell { text-align: right; padding-top: 12px; }
.costs .desc { font-size: 12px; color: var(--ink-3); padding: 0 6px 10px; }
.costs tr.sep td { border-bottom: 1px solid var(--line); }
.x { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; width: 34px; height: 36px; color: var(--ink-3); }
@media (max-width: 760px) {
  .costs thead { display: none; }
  .costs, .costs tbody, .costs tr, .costs td { display: block; width: 100%; }
  .costs tr.main { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
  .costs tr.main td { padding: 0; }
  .costs tr.main td:nth-child(1), .costs tr.main td:nth-child(2) { grid-column: 1 / -1; }
  .costs td.amt-cell { padding-top: 8px; }
}
.totals { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 28px; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 12px; }
.totals div { text-align: right; }
.totals .big { font-family: var(--mono); font-size: 19px; font-weight: 600; }

/* notes */
.notes { display: flex; flex-direction: column; gap: 6px; }
.note { border-radius: 8px; padding: 9px 12px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.note b.tag { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding-top: 2px; white-space: nowrap; min-width: 64px; }
.note.info { background: var(--accent-soft); } .note.info b.tag { color: var(--accent); }
.note.warn { background: var(--warn-soft); } .note.warn b.tag { color: var(--warn); }
.note.bad { background: var(--bad-soft); } .note.bad b.tag { color: var(--bad); }
.note.good { background: var(--good-soft); } .note.good b.tag { color: var(--good); }
.callout { border: 2px solid var(--accent); background: var(--accent-soft); border-radius: 12px; padding: 14px 16px; }

/* tables */
.tablewrap { overflow-x: auto; }
table.t { border-collapse: collapse; width: 100%; font-size: 14px; }
table.t th, table.t td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.t th { font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
table.t td.r, table.t th.r { text-align: right; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: var(--surface-2); }
table.t tfoot td { font-weight: 700; }
.over { color: var(--bad); font-weight: 600; } .ok { color: var(--good); font-weight: 600; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 20px; padding: 2px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.p-pending { background: var(--accent-soft); color: var(--accent); }
.p-info { background: var(--warn-soft); color: var(--warn); }
.p-approved { background: var(--good-soft); color: var(--good); }
.p-rejected { background: var(--bad-soft); color: var(--bad); }
.p-closed { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.flag { display: inline-block; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 4px; border: 1px solid currentColor; margin-left: 4px; }
.f-bad { color: var(--bad); } .f-warn { color: var(--warn); } .f-info { color: var(--accent); }

/* request cards */
.list { display: flex; flex-direction: column; gap: 10px; }
.rq { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 14px 16px; text-decoration: none; color: var(--ink); }
.rq:hover { border-color: var(--accent); }
.rq .t { font-weight: 600; }
.rq .m { font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 2px 12px; }
.rq .right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.track { grid-column: 1 / -1; display: flex; gap: 4px; margin-top: 6px; }
.track span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.track .d { background: var(--good); } .track .w { background: var(--accent); } .track .x { background: var(--bad); } .track .i { background: var(--warn); }
.empty { padding: 28px; text-align: center; color: var(--ink-2); }

/* detail */
.detail { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .detail { grid-template-columns: minmax(0, 1fr); } }
.dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 12px; font-size: 14px; margin: 0; }
.dl dt { color: var(--ink-3); } .dl dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .dl { grid-template-columns: minmax(0, 1fr); } .dl dd { margin-bottom: 6px; } }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding-bottom: 14px; position: relative; }
.tl li:not(:last-child)::after { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; }
.dot.d { background: var(--good); border-color: var(--good); } .dot.w { border-color: var(--accent); background: var(--accent-soft); } .dot.x { background: var(--bad); border-color: var(--bad); } .dot.i { background: var(--warn); border-color: var(--warn); }
.tl .who2 { font-weight: 600; font-size: 14px; } .tl .when { font-size: 12px; color: var(--ink-3); } .tl .cm { font-size: 13px; color: var(--ink-2); margin-top: 2px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { padding: 12px 14px; } .kpi .v { font-family: var(--mono); font-size: 24px; font-weight: 600; margin-top: 2px; }
.kpi.alert .v { color: var(--bad); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.filters select, .filters input { width: auto; min-width: 140px; }
.meter { height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; min-width: 70px; }
.meter i { display: block; height: 100%; background: var(--good); }
.meter i.w { background: var(--warn); } .meter i.x { background: var(--bad); }

.auth { max-width: 420px; margin: 40px auto; }
.auth-logo-wrap { display: flex; align-items: center; justify-content: center; gap: 14px; }
.auth-logo-wrap .auth-logo { margin: 0; height: 84px; }
.auth-id { text-align: center; margin: 2px 0 4px; }
.auth-apex { font-size: 24px; font-weight: 800; letter-spacing: .14em; line-height: 1.1; color: inherit; }
.auth-full { font-size: 12px; opacity: .75; margin-top: 4px; }
.auth-tag { margin-top: 6px; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: #A67C1F; font-weight: 700; }
.secret { font-family: var(--mono); font-size: 18px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 8px; padding: 8px 12px; display: inline-block; user-select: all; }
.guide-line { padding: 12px 0; border-bottom: 1px solid var(--line); }
.guide-line:last-child { border-bottom: 0; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--navy); color: var(--navy-ink); padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 40; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.err { background: var(--bad); color: #fff; }
details summary { cursor: pointer; font-weight: 600; }
.editor-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 36px; gap: 8px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 600px) { .editor-row { grid-template-columns: minmax(0, 1fr) 36px; } .editor-row > :first-child { grid-column: 1 / -1; } }

.theme { display: inline-flex; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; overflow: hidden; }
.theme button { background: transparent; border: 0; color: var(--navy-ink); opacity: .7; padding: 4px 9px; font-size: 12px; }
.theme button[aria-pressed=true] { opacity: 1; background: rgba(255,255,255,.18); font-weight: 600; }
.drafts { margin-bottom: 18px; }
.draft { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 12px 16px; border-style: dashed; align-items: center; }
.draft .t { font-weight: 600; } .draft .m { font-size: 13px; color: var(--ink-2); }
.p-draft { background: var(--surface-2); color: var(--ink-2); border: 1px dashed var(--line); }

.print-only { display: none; }
@media print {
  @page { margin: 12mm; }
  :root { --bg: #FFFFFF; --surface: #FFFFFF; --surface-2: #F3F5F8; --ink: #000000; --ink-2: #333333; --ink-3: #555555; --line: #BBBBBB; color-scheme: light; }
  body { background: #FFFFFF; color: #000000; font-size: 12px; }
  .shell { display: block !important; }
  .bar, .side, .scrim, .toast, .noprint, .btn, .filters, .theme, .x, input[type=file], .linkbtn { display: none !important; }
  .print-only { display: block !important; }
  .print-head { display: flex !important; align-items: center; gap: 12px; border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 12px; }
  .print-head img { height: 46px; }
  main { padding: 0; }
  .wrap { max-width: none; padding: 0; }
  .card { border: 1px solid #BBBBBB; break-inside: avoid; box-shadow: none; }
  .detail { grid-template-columns: 1fr; }
  details > *:not(summary) { display: block !important; }
  a { color: #000; text-decoration: none; }
  .tablewrap { overflow: visible; }
}
.bars { display: flex; flex-direction: column; gap: 8px; }
.barrow { display: grid; grid-template-columns: minmax(90px, 32%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; }
.barrow .bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barrow .bt { height: 12px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.barrow .bt i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.comments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.comments li { border-left: 3px solid var(--accent-soft); padding-left: 10px; font-size: 14px; }
.pickrow { display: flex; gap: 10px; align-items: center; }
.pickrow > input { width: 20px; height: 20px; flex: none; }
.pickrow > .card { flex: 1; min-width: 0; }
a.note:hover { outline: 1px solid var(--line); }

.tablewrap table.wide { min-width: 860px; }
.tablewrap table.wide select { min-width: 190px; }
.danger-zone { border-color: var(--bad); border-width: 1.5px; } .danger-zone h2 { color: var(--bad); }

/* spending overview charts (palette validated: light vs #FFFFFF, dark vs #151D27) */
:root { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948; --sref: #8A96A3; --sother: #B4BEC8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767; --sref: #7D8B99; --sother: #4A5867; } }
:root[data-theme="dark"] { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767; --sref: #7D8B99; --sother: #4A5867; }
.ov-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.ov-grid .wide { grid-column: 1 / -1; }
@media (max-width: 900px) { .ov-grid { grid-template-columns: minmax(0, 1fr); } }
.ov-card { padding: 16px 18px; }
.ov-card h3 { font-size: 15px; } .ov-card .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.ov-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink-2); margin: 10px 0 4px; }
.ov-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.ov-legend i.dash { height: 0; border-top: 2px dashed var(--sref); border-radius: 0; width: 14px; vertical-align: 3px; }
.ov-svg { display: block; width: 100%; overflow: visible; }
.ov-svg text { font-family: var(--font); fill: var(--ink-3); font-size: 11px; }
.ov-svg .grid { stroke: var(--line); stroke-width: 1; }
.ov-svg .hit { fill: transparent; cursor: pointer; }
.ov-svg .hit:hover, .ov-svg .hit.on { fill: var(--ink); fill-opacity: .05; }
.ov-pie { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; align-items: center; margin-top: 8px; }
@media (max-width: 520px) { .ov-pie { grid-template-columns: minmax(0, 1fr); justify-items: center; } }
.ov-pie table { width: 100%; font-size: 13px; border-collapse: collapse; }
.ov-pie td { padding: 4px 0; border-bottom: 1px solid var(--line); } .ov-pie td.r { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 10px; }
.ov-pie tr:last-child td { border-bottom: 0; }
.ov-pie i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
.vtip { position: fixed; z-index: 60; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.18); padding: 8px 10px; font-size: 12px; min-width: 150px; }
.vtip b { display: block; margin-bottom: 4px; font-size: 13px; }
.vtip .tr { display: flex; justify-content: space-between; gap: 14px; } .vtip .tr span:last-child { font-family: var(--mono); }
.vtip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.ov-hbar { display: grid; grid-template-columns: minmax(110px, 34%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; }
.ov-hbar .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-hbar .trk { position: relative; height: 12px; background: var(--surface-2); border-radius: 4px; }
.ov-hbar .trk b { position: absolute; left: 0; top: 0; bottom: 0; background: var(--s1); border-radius: 4px; }
.ov-hbar .trk u { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink-2); text-decoration: none; }
.ov-hbar .v { font-family: var(--mono); font-size: 12px; white-space: nowrap; color: var(--ink-2); }
.ov-filters select { width: auto; min-width: 0; } .ov-filters { flex-wrap: wrap; }

/* travel: trip search, fare reference, policy flags, annual plan */
.trip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 12px; margin-top: 8px; align-items: start; }
/* every box in a row starts on the same line, whether its label is one line or two and whether a hint sits under it */
.trip-grid .field > label { min-height: 2.7em; display: flex; align-items: flex-end; }
.trip-grid .field .seg { width: max-content; }
.steps-row { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 6px; padding: 0; font-size: 12px; color: var(--ink-2); }
.steps-row b { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--surface-2); color: var(--ink); font-size: 11px; margin-right: 4px; }
.shot-box { margin-top: 12px; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-2); }
.shot-thumb { display: block; max-width: 100%; width: 420px; margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 13px; cursor: pointer; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pol-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pol-list li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.45; }
.pol { flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; margin-top: 1px; }
.pol-ok { background: var(--good-soft); color: var(--good); box-shadow: inset 0 0 0 1.5px var(--good); } .pol-warn { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1.5px var(--warn); } .pol-bad { background: var(--bad-soft); color: var(--bad); box-shadow: inset 0 0 0 1.5px var(--bad); }
.f-bad { color: var(--bad); }
table.compact td { padding: 4px 8px; }
tr.auto td { background: var(--surface-2); }
.plan-item { display: inline-flex; gap: 4px; align-items: center; margin: 0 6px 4px 0; text-decoration: none; color: inherit; font-size: 13px; }
table.plan td { vertical-align: top; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.grid4 input { width: 64px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
details.walk { border-top: 1px solid var(--line); padding: 8px 0; }
details.walk summary { cursor: pointer; }
details.walk ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.nowrap { white-space: nowrap; }

/* Trip search (Concur-style): tabs, search bar, matrix, filters, result cards, steps, review */
.ts-tabs { display: flex; gap: 4px; align-items: flex-end; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.ts-tabs button { display: inline-flex; gap: 6px; align-items: center; border: 1px solid transparent; border-bottom: 0; background: none; padding: 10px 16px; border-radius: 8px 8px 0 0; color: var(--ink-2); font: inherit; font-weight: 600; cursor: pointer; }
.ts-tabs button[aria-selected=true] { background: var(--surface); border-color: var(--line); color: var(--accent); margin-bottom: -1px; }
.ts-search { border-top-left-radius: 0; margin-bottom: 14px; }
.ts-row { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-start; } /* top-aligned so every box sits on the same line, whatever sits under it (city name, time of day) */
.ts-row .field > .hint { display: block; min-height: 1.4em; }
.ts-row .field { min-width: 120px; }
.ts-row .field.grow { flex: 1 1 260px; }
.ts-row input[type=date] { min-width: 140px; }
.ts-time { margin-top: 4px; font-size: 13px; }
.ts-swap { align-self: flex-start; margin-top: 26px; }
.ts-busy { display: flex; gap: 10px; align-items: center; }
.spin { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: tsspin .8s linear infinite; }
@keyframes tsspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.ts-steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; margin: 6px 0 12px; font-size: 13px; color: var(--ink-2); }
.ts-steps li { display: flex; gap: 6px; align-items: center; }
.ts-steps li span { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; border: 1.5px solid var(--line); font-size: 12px; }
.ts-steps li.on { color: var(--ink); font-weight: 600; } .ts-steps li.on span { border-color: var(--accent); color: var(--accent); }
.ts-steps li.done span { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.ts-headline { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin: 6px 0 8px; }
.ts-matrix { margin-bottom: 12px; }
.ts-matrix th, .ts-matrix td { padding: 6px 8px; vertical-align: middle; }
.ts-matrix thead th { min-width: 84px; }
.ts-mcell { border: 0; background: none; color: var(--accent); font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; padding: 2px 4px; border-radius: 4px; }
.ts-mcell:hover { background: var(--surface-2); text-decoration: underline; }
.ts-logo-s { width: 22px; height: 22px; object-fit: contain; display: block; margin-left: auto; }
.ts-layout { display: grid; grid-template-columns: 230px 1fr; gap: 14px; align-items: start; }
.ts-filters summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.ts-fgroup { margin-top: 12px; display: grid; gap: 6px; font-size: 13px; }
.ts-fgroup label { display: flex; gap: 6px; align-items: center; }
.ts-fgroup label .tiny { margin-left: auto; }
.ts-sortbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ts-card { padding: 12px 14px; margin-bottom: 8px; }
.ts-c-main { display: grid; grid-template-columns: 40px minmax(150px, 1.4fr) 90px minmax(120px, 1fr) auto 150px; gap: 12px; align-items: center; }
.ts-logo { width: 36px; height: 36px; object-fit: contain; border-radius: 6px; background: #fff; display: block; }
.ts-t { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ts-plus { font-size: 11px; color: var(--warn); margin-left: 2px; }
.ts-c-tags { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.ts-tag { font-size: 11px; font-weight: 600; border-radius: 4px; padding: 2px 6px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.ts-tag.ts-llf { background: var(--good-soft); color: var(--good); }
.ts-c-price { display: grid; gap: 4px; justify-items: end; text-align: right; }
.ts-p { font-size: 18px; font-weight: 700; }
.ts-pol { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; font-weight: 600; white-space: nowrap; }
.ts-ok { color: var(--good); } .ts-warn { color: var(--warn); } .ts-bad { color: var(--bad); }
.ts-det-btn { margin-top: 6px; }
.ts-det { margin-top: 8px; padding: 10px 12px; background: var(--surface-2); border-radius: 8px; display: grid; gap: 10px; font-size: 13px; }
.ts-lay { margin-top: 8px; padding: 4px 8px; border-left: 3px solid var(--warn); font-size: 12px; color: var(--ink-2); }
.ts-chosen { margin-bottom: 8px; padding: 10px 14px; }
.ts-step-done { color: var(--good); font-weight: 700; }
.ts-review { margin-top: 8px; }
.ts-hcard { display: grid; grid-template-columns: 120px 1fr 150px; gap: 14px; align-items: center; }
.ts-himg { width: 120px; height: 84px; object-fit: cover; border-radius: 8px; background: var(--surface-2); display: block; }
.ts-hinfo { display: grid; gap: 4px; }
tr.ts-row-pick td { background: var(--accent-soft, var(--surface-2)); font-weight: 600; }
@media (max-width: 900px) {
  .ts-layout { grid-template-columns: 1fr; }
  .ts-filters:not([open]) { padding-bottom: 12px; }
  .ts-c-main { grid-template-columns: 36px 1fr auto; }
  .ts-c-dur, .ts-c-stops, .ts-c-tags { grid-column: 2 / 3; }
  .ts-c-price { grid-column: 3; grid-row: 1 / span 4; }
  .ts-hcard { grid-template-columns: 88px 1fr; }
  .ts-hcard .ts-c-price { grid-column: 1 / -1; grid-row: auto; justify-items: start; text-align: left; }
  .ts-himg { width: 88px; height: 66px; }
}

/* attachments: thumbnails + in-app viewer */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.att { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.att-open { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--surface); }
.att-open:hover, .att-open:focus-visible { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px var(--accent-soft); }
.att-th { position: relative; display: flex; align-items: center; justify-content: center; height: 150px; overflow: hidden; border-radius: 6px; background: var(--surface-2); }
.att-th img, .att-th canvas { max-width: 100%; max-height: 150px; object-fit: contain; }
.att-badge { position: absolute; top: 6px; left: 6px; font-size: 11px; font-weight: 700; background: var(--bad); color: #fff; border-radius: 4px; padding: 1px 5px; }
.att-ext { font-size: 20px; font-weight: 700; color: var(--ink-3); }
.att-name { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att .linkbtn { align-self: flex-start; }
#attv { position: fixed; inset: 0; z-index: 1000; background: rgba(8, 14, 22, .82); display: flex; flex-direction: column; }
#attv[hidden] { display: none; }
.attv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.attv-title { flex: 1; min-width: 160px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attv-body { flex: 1; overflow: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px; }
.attv-body img { max-width: 100%; height: auto; background: #fff; }
.attv-body canvas { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.35); max-width: 100%; height: auto !important; }
.attv-body p { color: #fff; }
body.attv-open { overflow: hidden; }
@media print { #attv { display: none !important; } }

/* signed-in user, top right of the header */
.whotop { display: flex; align-items: center; gap: 10px; margin-right: 12px; min-width: 0; color: var(--navy-ink); }
.whotop:empty { display: none; }
.whotop-id { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; min-width: 0; max-width: 300px; text-align: right; }
.whotop-id b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.whotop-id span { font-size: 12px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.whotop-btn { background: transparent; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; color: var(--navy-ink); font-size: 12px; padding: 4px 9px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.whotop-btn:hover, .whotop-btn:focus-visible { background: rgba(255,255,255,.15); }
@media (max-width: 900px) { .whotop-id span { display: none; } .whotop-id { max-width: 140px; } .whotop { gap: 6px; margin-right: 6px; } .whotop-btn { padding: 4px 7px; } }
@media (max-width: 560px) { .whotop-id { display: none; } }
@media print { .whotop { display: none !important; } }
.whotop-ini { display: none; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.18); color: var(--navy-ink); font-size: 13px; font-weight: 700; align-items: center; justify-content: center; text-decoration: none; }
.navwho { display: none; border-top: 1px solid var(--line); margin-top: 12px; padding: 12px 10px 4px; font-size: 13px; flex-direction: column; gap: 6px; }
.navwho .row { gap: 14px; }
@media (max-width: 560px) { .whotop-btn { display: none; } .whotop-ini { display: inline-flex; } .navwho { display: flex; } }
@media (max-width: 480px) { .brand > span:last-child { font-size: 13px; } .brand .logo-chip img { width: 46px; height: 30px; } .theme button { padding: 3px 5px; font-size: 11px; } .whotop { margin-right: 4px; } .whotop-ini { width: 28px; height: 28px; font-size: 12px; } }
.navtheme { border-color: var(--line); align-self: flex-start; margin-top: 6px; }
.navtheme button { color: var(--ink); }
.navtheme button[aria-pressed=true] { background: var(--surface-2); }
@media (max-width: 480px) { .bar .theme { display: none; } }
.nav .navwho a.linkbtn { display: inline; padding: 0; margin: 0; border: 0; background: none; color: var(--accent); text-decoration: underline; font-size: 13px; font-weight: 400; }

/* inline confirm: second click needed */
button[data-armed="1"] { color: #fff !important; background: #C8102E !important; border-radius: 6px; padding: 2px 8px; text-decoration: none; }
.tiny.bad { color: var(--bad); }
tr.ev-pend td { background: var(--warn-soft, #FFF8E6); }
tr.ev-ret td { border-top: 0; padding-top: 0; }

/* ---- Fits any screen (RC3.17) ---- */
/* Phones and tablets: 16px fields so iPhone/iPad do not zoom in when a field is tapped */
@media (max-width: 1100px) { input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: 16px !important; } }
/* Touch screens: buttons big enough for a finger */
@media (pointer: coarse) { .linkbtn { min-height: 32px; padding: 6px 4px; } .btn { min-height: 40px; } .btn.small { min-height: 36px; padding-top: 6px; padding-bottom: 6px; } }
/* Lists become cards when the space for the table is narrow (phones, tablets, split screen): one card per row, each value with its column name */
.tablewrap { container-type: inline-size; }
@container (max-width: 820px) {
  table.t.cards thead { display: none; }
  table.t.cards, table.t.cards tbody, table.t.cards tfoot, table.t.cards tr, table.t.cards td { display: block; width: auto; }
  table.t.cards tr { border: 1px solid var(--line); border-radius: 12px; margin: 10px 8px; padding: 6px 0; background: var(--surface); }
  table.t.cards tr.click:hover td { background: transparent; }
  table.t.cards td { --lw: min(36%, 170px); border: 0; padding: 4px 14px 4px calc(var(--lw) + 26px); position: relative; text-align: left !important; overflow-wrap: anywhere; min-height: 26px; }
  table.t.cards td::before { content: attr(data-label); position: absolute; left: 14px; top: 6px; width: var(--lw); font-family: var(--font); font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); }
  table.t.cards td[data-label=""] { padding-left: 14px; }
  table.t.cards td[data-label=""]::before { display: none; }
  table.t.cards td:empty { display: none; }
}
/* Wide tables (budget, reports): a hint that they scroll sideways */
.swipe-hint { display: none; font-size: 12px; color: var(--ink-3); margin: 4px 2px; }
@media (max-width: 1100px) { .swipe-hint.on { display: block; } }
[hidden] { display: none !important; }

/* Dashboard widgets: clickable and interactive */
a.wlink { display: block; color: inherit; text-decoration: none; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.kpi.wlink:hover, a.kpi.wlink:focus-visible { border-color: var(--accent); box-shadow: 0 4px 14px rgba(20, 40, 90, .14); transform: translateY(-1px); }
.kpi .open { font-size: 11px; color: var(--accent); margin-top: 4px; opacity: 0; transition: opacity .15s; }
a.kpi.wlink:hover .open, a.kpi.wlink:focus-visible .open { opacity: 1; }
@media (hover: none) { .kpi .open { opacity: .75; } }
a.barrow.wlink { display: grid; padding: 3px 6px; margin: -3px -6px; border-radius: 8px; }
a.barrow.wlink:hover, a.barrow.wlink:focus-visible { background: var(--surface-2); }
a.barrow.wlink:hover .bt i, a.barrow.wlink:focus-visible .bt i { filter: brightness(1.15); }
a.wlink2 { margin-left: 8px; font-weight: 500; color: var(--accent); text-decoration: none; }
a.wlink2:hover { text-decoration: underline; }
a.wlink, a.wlink * { text-decoration: none !important; }
a.wlink { color: inherit !important; }
a.kpi.wlink .open, a.wlink2 { color: var(--accent) !important; }
a.barrow.wlink .bv { color: inherit; }

/* ---- Horizon dashboard ---- */
:root { --dh-blue: #1F4FBF; --dh-red: #D9482B; --dh-track: #DCE6F6; --dh-tile: var(--surface); --dh-chip: #F5F8FD; --dh-chip-line: #E3EAF5; }
:root[data-theme="dark"] { --dh-blue: #6F95F5; --dh-track: #26364F; --dh-chip: #1A2430; --dh-chip-line: #2A3745; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --dh-blue: #6F95F5; --dh-track: #26364F; --dh-chip: #1A2430; --dh-chip-line: #2A3745; } }
.dh { display: block; }
.dh-hero { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; min-height: 132px; padding: 26px 28px 54px; border-radius: 20px; color: #fff; background: linear-gradient(115deg, #0B2A6F 0%, #1F4FBF 55%, #3F86F5 100%); position: relative; overflow: hidden; }
.dh-hero::after { content: ""; position: absolute; right: -60px; top: -110px; width: 320px; height: 320px; border-radius: 50%; background: rgba(255,255,255,.07); pointer-events: none; }
.dh-hl h1 { font-size: 28px; font-weight: 600; letter-spacing: -.01em; color: #fff; }
.dh-hl p { margin-top: 4px; opacity: .85; font-size: 14px; }
.dh-hr { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; flex: none; }
.dh-pill { border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.1); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.dh-av { width: 34px; height: 34px; border-radius: 50%; background: #fff; color: #1F4FBF; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.dh-qa { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: -34px 16px 0; position: relative; z-index: 2; }
.dh-q { display: grid; grid-template-columns: 38px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; background: var(--surface); border: 0; border-radius: 18px; padding: 12px; min-height: 68px; box-shadow: 0 6px 16px rgba(16,40,90,.14); color: var(--ink); text-decoration: none; }
.dh-q:hover { box-shadow: 0 8px 20px rgba(16,40,90,.2); }
.dh-q i { grid-row: 1 / 3; width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; }
.dh-q i .ic { width: 20px; height: 20px; }
.dh-q b { font-size: 14px; line-height: 1.2; align-self: end; }
.dh-q span { font-size: 12px; color: var(--ink-3); align-self: start; }
.dh-q .c1 { background: #E9E3FB; color: #5B3FC4; } .dh-q .c2 { background: #DDF5EF; color: #0E7C66; } .dh-q .c3 { background: #DCEBFC; color: #1F4FBF; } .dh-q .c4 { background: #FDF0D5; color: #A15C00; }
:root[data-theme="dark"] .dh-q i { filter: brightness(.95); }
.dh-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; margin-top: 16px; align-items: start; }
.dh-l, .dh-r { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dh-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; }
.dh-tile { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; color: var(--ink); text-decoration: none; min-width: 0; }
a.dh-tile:hover { border-color: var(--ink-3); }
.dh-th { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dh-th h2 { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.dh-n { background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12px; border-radius: 999px; padding: 0 9px; }
.dh-n.bad { background: var(--bad-soft); color: var(--bad); }
.dh-th > a, .dh-link { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; }
.dh-empty { color: var(--ink-2); font-size: 14px; }
.dh-wl { display: flex; flex-direction: column; gap: 10px; }
.dh-wi { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 26px; gap: 12px; align-items: center; background: var(--dh-chip); border: 1px solid var(--dh-chip-line); border-radius: 16px; padding: 10px 14px; color: var(--ink); text-decoration: none; }
.dh-wi:hover { border-color: var(--accent); }
.dh-wd { width: 44px; height: 44px; border-radius: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; line-height: 1; }
.dh-wd small { font-size: 9px; letter-spacing: .06em; margin-top: 2px; }
.dh-wd.bad { background: var(--bad-soft); color: var(--bad); } .dh-wd.warn { background: var(--warn-soft); color: var(--warn); } .dh-wd.info { background: var(--accent-soft); color: var(--accent); }
.dh-wm { min-width: 0; } .dh-wm b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dh-wm small { display: block; color: var(--ink-2); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dh-wa { text-align: right; font-weight: 700; font-size: 14px; white-space: nowrap; font-family: var(--mono); }
.dh-wa small { display: block; font-weight: 500; font-size: 12px; color: var(--ink-2); }
.dh-go { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--accent); }
.dh-bigrow { display: flex; align-items: center; gap: 14px; color: var(--ink-2); font-size: 13px; }
.dh-big { font-size: 44px; font-weight: 700; letter-spacing: -.03em; line-height: 1; color: var(--ink); }
.dh-ev { display: flex; gap: 12px; align-items: center; min-height: 40px; border-top: 1px solid var(--line); }
.dh-th + .dh-ev { border-top: 0; }
.dh-dt { flex: none; width: 38px; border-radius: 9px; background: var(--accent-soft); padding: 3px 0; color: var(--accent); font-weight: 700; font-size: 14px; line-height: 1.05; text-align: center; }
.dh-dt small { display: block; font-size: 9px; letter-spacing: .06em; }
.dh-ev b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dh-ev > span:last-child { color: var(--ink-2); font-size: 12px; margin-left: auto; white-space: nowrap; }
.dh-donut { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; font-size: 13px; color: var(--ink-2); }
.dh-donut b { color: var(--ink); font-size: 15px; }
.dh-dc { position: relative; flex: none; width: 84px; height: 84px; }
.dh-dc > div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; line-height: 1.1; color: var(--ink); }
.dh-dc small { font-size: 10px; font-weight: 500; color: var(--ink-2); }
.dh-bb { display: grid; grid-template-columns: 82px minmax(0, 1fr) 62px; gap: 8px; align-items: center; font-size: 13px; padding: 4px 0; }
.dh-bb > div { height: 9px; background: var(--dh-track); border-radius: 5px; overflow: hidden; }
.dh-bb i { display: block; height: 100%; background: var(--dh-blue); border-radius: 5px; }
.dh-bb b { text-align: right; font-weight: 600; white-space: nowrap; } .dh-bb b.hot { color: var(--bad); }
.dh-al { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: center; border-radius: 14px; padding: 8px 10px; margin-bottom: 8px; color: var(--ink); text-decoration: none; }
.dh-al:last-child { margin-bottom: 0; }
.dh-al.bad { background: var(--bad-soft); } .dh-al.warn { background: var(--warn-soft); }
.dh-al i { width: 28px; height: 28px; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 800; font-size: 13px; }
.dh-al.bad i { color: var(--bad); } .dh-al.warn i { color: var(--warn); }
.dh-al b { display: block; font-size: 13px; font-weight: 600; line-height: 1.25; } .dh-al small { display: block; font-size: 12px; color: var(--ink-2); line-height: 1.25; }
.dh + h2 { margin-top: 26px !important; }
/* tablet */
@media (max-width: 1100px) {
  .dh-grid { grid-template-columns: minmax(0, 1fr); }
  .dh-r { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
/* phone */
@media (max-width: 640px) {
  .dh-hero { padding: 18px 16px 50px; min-height: 124px; border-radius: 18px; }
  .dh-hl h1 { font-size: 24px; } .dh-hl p { font-size: 13px; }
  .dh-pill { display: none; }
  .dh-qa { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: -30px 10px 0; }
  .dh-q { min-height: 58px; padding: 10px; } .dh-q span { display: none; } .dh-q i { grid-row: 1; } .dh-q b { align-self: center; }
  .dh-r, .dh-pair { grid-template-columns: minmax(0, 1fr); }
  .dh-tile { padding: 16px; }
  .dh-wi { grid-template-columns: 40px minmax(0, 1fr) auto; padding: 10px 12px; }
  .dh-wi .dh-go { display: none; }
  .dh-wd { width: 40px; height: 40px; }
}
.dh-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 14px; padding: 10px 16px; margin-bottom: 12px; color: var(--ink); text-decoration: none; font-size: 14px; }
.dh-banner span { color: var(--ink-2); font-size: 13px; flex: 1 1 260px; }
.dh-banner em { font-style: normal; font-weight: 700; color: var(--accent); margin-left: auto; white-space: nowrap; }
@media (max-width: 640px) {
  .dh-wm b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; }
  .dh-wm small { font-size: 12px; }
  .dh-wa { font-size: 12.5px; }
  .dh-hl p { max-width: 230px; }
}
.dh-wd.good { background: var(--good-soft); color: var(--good); }
/* language menu in the top bar */
.langpick { background: transparent; color: var(--navy-ink); border: 1px solid rgba(255,255,255,.3); border-radius: 8px; padding: 3px 6px; font-size: 12px; margin-right: 8px; max-width: 120px; }
.langpick option { color: #14213D; background: #fff; }
@media (max-width: 480px) { .langpick { max-width: 92px; margin-right: 4px; } }
:root[data-lang="th"] body, :root[data-lang="ko"] body, :root[data-lang="zh"] body { line-height: 1.55; }

.field .hint.en-hint { display: block; margin-top: 3px; }

/* ================= Horizon style for every page ================= */
.card { border-radius: 18px; border-color: #E3EAF5; box-shadow: 0 1px 2px rgba(16, 40, 90, .05); }
:root[data-theme="dark"] .card { border-color: var(--line); box-shadow: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card { border-color: var(--line); box-shadow: none; } }
.btn { border-radius: 12px; padding: 9px 16px; }
.btn.primary { box-shadow: 0 4px 10px rgba(31, 79, 191, .28); }
.btn.good { border-radius: 12px; }
.btn.small { border-radius: 10px; }
.page-head { position: relative; overflow: hidden; align-items: flex-start; padding: 24px 28px 26px; margin-bottom: 18px; border-radius: 20px; color: #fff; background: linear-gradient(115deg, #0B2A6F 0%, #1F4FBF 55%, #3F86F5 100%); }
.page-head::after { content: ""; position: absolute; right: -60px; top: -120px; width: 320px; height: 320px; border-radius: 50%; background: rgba(255, 255, 255, .07); pointer-events: none; }
.page-head > * { position: relative; z-index: 1; }
.page-head h1 { font-size: 28px; font-weight: 600; letter-spacing: -.01em; color: #fff; }
.page-head p, .page-head .muted { color: rgba(255, 255, 255, .88); max-width: 64ch; }
.page-head .btn, .page-head .btn.primary { background: #fff; color: #1F4FBF; border-color: #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .18); }
.page-head .btn.bad { color: #B42318; }
.page-head .btn:hover { border-color: #fff; filter: brightness(.96); }
.page-head .num.muted { color: rgba(255, 255, 255, .88); }
.page-head .pill { box-shadow: 0 0 0 1px rgba(255, 255, 255, .5); }
.page-head .flag { color: #fff; }
.page-head.hz-over { margin-bottom: 0; padding-bottom: 58px; }
.hz-over + * { margin-top: -38px; position: relative; z-index: 2; }
.hz-over + * + * { margin-top: 16px; }
.hz-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.hz-tile { display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: var(--surface); border-radius: 18px; box-shadow: 0 6px 16px rgba(16, 40, 90, .12); min-width: 0; }
.hz-tile .ib { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.hz-tile b { display: block; font-size: 24px; line-height: 1.05; font-weight: 700; }
.hz-tile span { color: var(--ink-2); font-size: 13px; }
.hz-tile.alert b { color: var(--bad); }
.hz-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 12px; }
.hz-chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 600; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); cursor: pointer; }
.hz-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.hz-chips input { max-width: 260px; margin-left: auto; border-radius: 999px; }
.pill { padding: 3px 11px; }
.pill::before { width: 7px; height: 7px; }
@media (max-width: 900px) { .hz-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .page-head { padding: 18px 16px 20px; border-radius: 18px; } .page-head h1 { font-size: 24px; } .page-head.hz-over { padding-bottom: 50px; } }

/* My requests cards */
.rq2 { display: block; padding: 16px 18px 14px; border-left: 5px solid var(--accent); text-decoration: none; color: var(--ink); margin-bottom: 12px; }
.rq2:hover { box-shadow: 0 6px 16px rgba(16, 40, 90, .12); }
.rq2.s-approved { border-left-color: var(--good); } .rq2.s-info { border-left-color: #C77700; } .rq2.s-rejected { border-left-color: #D9482B; } .rq2.s-closed { border-left-color: var(--ink-3); }
.rq2-top { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 16px; align-items: start; }
.rq2 .t { font-weight: 700; font-size: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rq2 .m { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 2px 12px; }
.rq2 .who { font-size: 13px; margin-top: 6px; border: 0; padding: 0; display: block; }
.rq2 .amt { text-align: right; } .rq2 .amt b { display: block; font-size: 16px; }
.rq2 .act { align-self: center; }
.rq2-track { display: grid; gap: 6px; margin-top: 12px; }
.rq2-track div { min-width: 0; }
.rq2-track i { display: block; height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; }
.rq2-track i b { display: block; height: 100%; border-radius: 4px; background: var(--good); }
.rq2-track .w i b { width: 55%; background: var(--accent); } .rq2-track .x i b { background: #D9482B; width: 100%; } .rq2-track .q i b { background: #C77700; width: 100%; }
.rq2-track span { display: block; font-size: 11px; margin-top: 5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rq2-track .w span, .rq2-track .q span, .rq2-track .x span { color: var(--ink); font-weight: 700; }
@media (max-width: 700px) { .rq2-top { grid-template-columns: minmax(0, 1fr) auto; } .rq2 .act { grid-column: 1 / -1; } .rq2-track span { font-size: 10px; } }

/* Waiting for me: list and decision panel */
.ib { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 16px; align-items: start; }
.ib-list { display: flex; flex-direction: column; gap: 8px; }
.ib-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; border: 2px solid transparent; background: var(--surface); text-decoration: none; color: var(--ink); box-shadow: 0 1px 2px rgba(16, 40, 90, .05); }
.ib-row:hover { border-color: #C3D1E8; }
.ib-row.sel { border-color: var(--accent); background: var(--accent-soft); }
.ib-age { width: 46px; height: 46px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; line-height: 1; background: var(--accent-soft); color: var(--accent); }
.ib-age small { font-size: 9.5px; letter-spacing: .06em; margin-top: 2px; }
.ib-age.hot { background: var(--bad-soft); color: var(--bad); } .ib-age.warm { background: var(--warn-soft); color: var(--warn); }
.ib-row b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-row small { color: var(--ink-2); font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-row .a { text-align: right; font-size: 13px; font-weight: 700; } .ib-row .a small { font-weight: 500; }
.ib-panel { padding: 22px 24px; position: sticky; top: 80px; }
.ib-panel .big { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.ib-cost { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) auto; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.ib-pick { display: flex; gap: 8px; align-items: flex-start; }
.ib-pick > input { margin-top: 20px; }
.ib-pick > .ib-row { flex: 1; min-width: 0; }
@media (max-width: 1000px) { .ib { grid-template-columns: minmax(0, 1fr); } .ib-panel { display: none; } }

/* Request detail stepper */
.dt-steps { display: grid; gap: 0; padding: 18px 16px; background: var(--surface); border-radius: 18px; box-shadow: 0 6px 16px rgba(16, 40, 90, .12); margin-bottom: 0; }
.dt-step { position: relative; text-align: center; min-width: 0; padding: 0 4px; }
.dt-step .c { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; font-weight: 700; font-size: 12px; background: #DCE4F0; color: var(--ink-2); }
.dt-step.done .c { background: var(--good); color: #fff; } .dt-step.cur .c { background: var(--accent); color: #fff; box-shadow: 0 0 0 5px var(--accent-soft); } .dt-step.bad .c { background: #D9482B; color: #fff; } .dt-step.q .c { background: #C77700; color: #fff; }
.dt-step::before { content: ""; position: absolute; left: -50%; right: 50%; top: 17px; height: 3px; background: #DCE4F0; }
.dt-step:first-child::before { display: none; }
.dt-step.done::before, .dt-step.cur::before, .dt-step.bad::before, .dt-step.q::before { background: var(--good); }
.dt-step b { display: block; font-size: 13px; margin-top: 8px; overflow-wrap: anywhere; }
.dt-step small { display: block; color: var(--ink-2); font-size: 12px; } .dt-step em { display: block; font-style: normal; font-size: 11.5px; margin-top: 2px; font-weight: 600; color: var(--ink-3); }
.dt-step.cur em { color: var(--accent); }
@media (max-width: 760px) { .dt-steps { grid-template-columns: minmax(0, 1fr) !important; gap: 14px; } .dt-step { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 2px 12px; text-align: left; align-items: center; } .dt-step::before { display: none; } .dt-step .c { margin: 0; grid-row: 1 / span 3; } .dt-step b { margin-top: 0; } }

/* New request: steps, two columns, total card */
.rf-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 14px 18px; background: var(--surface); border-radius: 18px; box-shadow: 0 6px 16px rgba(16, 40, 90, .12); margin-bottom: 0; }
.rf-step { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 13.5px; color: var(--ink-3); min-width: 0; }
.rf-step i { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 13px; background: #EDF1F6; color: var(--ink-3); }
.rf-step.done, .rf-step.cur { color: var(--ink); }
.rf-step.done i { background: var(--good-soft); color: var(--good); } .rf-step.cur i { background: var(--accent); color: #fff; }
.rf-grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 16px; align-items: start; }
.rf-main > * + *, .rf-side > * + * { margin-top: 16px; }
.rf-total { background: linear-gradient(135deg, #0B2A6F, #1F4FBF); color: #fff; border-radius: 18px; padding: 18px 20px; }
.rf-total .eyebrow { color: rgba(255, 255, 255, .8); }
.rf-total .big { font-family: var(--font); font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.rf-total .sgd { opacity: .88; margin-top: 2px; }
.rf-side .section-title h2 { font-size: 17px; }
@media (max-width: 1000px) { .rf-grid { grid-template-columns: minmax(0, 1fr); } .rf-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.form-hz-note { font-size: 12.5px; }

/* Claims: ready to claim cards */
.cl-ready { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cl-card { padding: 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cl-card .t { font-weight: 700; font-size: 14.5px; }
.cl-promo { background: linear-gradient(135deg, #0B2A6F, #1F4FBF); color: #fff; border: 0; }
.cl-promo .btn { background: #fff; color: #1F4FBF; border-color: #fff; align-self: flex-start; }
.cl-promo .muted { color: rgba(255, 255, 255, .85); }
.pbar { height: 10px; background: #E3EAF5; border-radius: 5px; overflow: hidden; display: flex; }
.pbar i { display: block; height: 100%; } 
@media (max-width: 900px) { .cl-ready { grid-template-columns: minmax(0, 1fr); } }

/* Budget: overview cards and charts */
.bd-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) 1.2fr; gap: 14px; }
.bd-donut { position: relative; width: 70px; height: 70px; flex: none; }
.bd-donut div { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; }
.bd-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.bd-g { padding: 18px; min-width: 0; }
.bd-g.warn { border: 2px solid #F0B8B3; }
.bd-gl { display: grid; grid-template-columns: minmax(0, 1fr) 80px 74px; gap: 8px; align-items: center; font-size: 12.5px; padding: 5px 0; border-top: 1px solid var(--line); }
.bd-gl .pbar { height: 6px; }
.bd-row2 { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; }
.bd-months { position: relative; height: 150px; display: flex; align-items: flex-end; gap: 8px; padding-top: 10px; }
.bd-months > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; justify-content: flex-end; height: 100%; }
.bd-months i { display: block; width: 100%; border-radius: 6px 6px 2px 2px; background: var(--accent); min-height: 2px; }
.bd-months span { font-size: 11px; color: var(--ink-3); }
.bd-ent { display: grid; grid-template-columns: 82px minmax(0, 1fr) 70px; gap: 10px; align-items: center; font-size: 12.5px; padding: 4px 0; }
@media (max-width: 1000px) { .bd-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bd-groups, .bd-row2 { grid-template-columns: minmax(0, 1fr); } }
details.bd-full { margin-top: 16px; }
details.bd-full > summary { cursor: pointer; font-weight: 700; color: var(--accent); padding: 12px 18px; background: var(--surface); border-radius: 14px; border: 1px solid var(--line); list-style: none; }
details.bd-full[open] > summary { margin-bottom: 14px; }

.ib.solo { grid-template-columns: minmax(0, 1fr); } .ib.solo .ib-panel { display: none; }
.ib-row .a { white-space: nowrap; padding-left: 6px; }
.field .seg, .rf-side .seg { flex-wrap: wrap; }
.rf-side .seg > * { flex: 1 1 45%; min-width: 0; }
input[type=search], #mQ { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); outline: none; }
#mQ:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* stronger separators */
.card { border: 1.5px solid var(--line); box-shadow: 0 1px 3px rgba(16, 40, 90, .10); }
table.t th { background: var(--surface-2); border-bottom: 2px solid var(--line-strong); }
table.t td { border-bottom: 1px solid var(--line); }
table.t tbody tr:last-child td { border-bottom: 0; }
.ib-row { border: 2px solid var(--line); } .rq2 { border-top: 1.5px solid var(--line); border-right: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); }
.ib-row.sel { border-color: var(--accent); }
.nav a + a::before { border-top: 1px dashed var(--line-strong); }
.side { border-right: 1.5px solid var(--line-strong); }
.hz-tile, .bd-g, .cl-card { border: 1.5px solid var(--line); }
.ib-cost { border-top: 1px solid var(--line-strong); }
input, select, textarea, .seg { border-color: var(--line-strong); }
.seg button { border-right-color: var(--line-strong); }
.btn { border-color: var(--line-strong); }
.btn.primary { border-color: transparent; }

/* card-mode tables: label and value in a grid so long labels wrap instead of overlapping the value */
@container (max-width: 820px) {
  table.t.cards td { display: grid; grid-template-columns: minmax(90px, 46%) minmax(0, 1fr); column-gap: 10px; padding: 5px 14px; align-items: baseline; }
  table.t.cards td::before { position: static; width: auto; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
  table.t.cards td[data-label=""] { display: block; }
}

/* New request, right column: give controls room */
.rf-side .note { flex-direction: column; gap: 2px; }
.rf-side .note b.tag { min-width: 0; padding-top: 0; flex: none; }
.rf-side .note > span { min-width: 0; overflow-wrap: anywhere; }
.rf-side .seg { display: flex; flex-direction: column; width: 100%; flex-wrap: nowrap; }
.rf-side .seg > * { flex: none; width: 100%; text-align: left; border-right: 0; border-bottom: 1px solid var(--line-strong); padding: 10px 14px; white-space: normal; }
.rf-side .seg > *:last-child { border-bottom: 0; }
.rf-side .field, .rf-side section { margin-bottom: 4px; }
.rf-side .field > label, .rf-side label { display: block; margin-bottom: 6px; line-height: 1.35; }
.rf-side .field + .field { margin-top: 16px; }
.rf-side textarea { min-height: 84px; }
.rf-side input[type=file] { width: 100%; font-size: 13px; }
.rf-side .btn { width: 100%; justify-content: center; }

/* Over-budget funding panel */
.fund { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; background: var(--warn-soft); border: 1.5px solid #E8C888; }
.fund-h { display: flex; flex-direction: column; gap: 2px; font-size: 13px; } .fund-h b { font-size: 15px; color: var(--warn); }
.fund-opt { display: flex; flex-direction: column; gap: 2px; text-align: left; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; }
.fund-opt b { font-size: 14px; } .fund-opt small { color: var(--ink-2); font-size: 12px; white-space: normal; }
.fund-opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent-soft); }
.fund-in { padding: 4px 4px 8px 12px; border-left: 3px solid var(--accent); margin-left: 6px; display: flex; flex-direction: column; gap: 6px; }

/* Side menu: expanded, or collapsed to an icon rail */
.side { display: flex; flex-direction: column; }
.nav { flex: 1 1 auto; }
.nav a { padding: 11px 12px; gap: 14px; font-weight: 600; font-size: 14px; border-radius: 12px; }
.nav a + a { margin-top: 2px; } .nav a + a::before { display: none; }
.nav .ic { width: 22px; height: 22px; opacity: .8; }
.colbtn { display: flex; align-items: center; gap: 14px; margin: 8px 10px 0; padding: 12px; border: 0; border-top: 1.5px solid var(--line-strong); border-radius: 0; background: none; color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; position: sticky; bottom: 0; background: var(--surface); }
.colbtn:hover { color: var(--accent); }
.colbtn .ic { transition: transform .2s ease; }
@media (min-width: 901px) {
  body.side-collapsed .shell { grid-template-columns: 76px minmax(0, 1fr); }
  body.side-collapsed .side { overflow-x: hidden; }
  body.side-collapsed .nav-h { display: none; }
  body.side-collapsed .nav-group { padding: 8px 0; }
  body.side-collapsed .nav a { justify-content: center; padding: 12px 0; }
  body.side-collapsed .nav a > span:not(.badge) { display: none; }
  body.side-collapsed .nav a .badge { position: absolute; top: 4px; right: 8px; margin: 0; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; }
  body.side-collapsed .nav a.on { box-shadow: none; }
  body.side-collapsed .colbtn { justify-content: center; margin: 8px 8px 0; }
  body.side-collapsed .colbtn span { display: none; }
  body.side-collapsed .colbtn .ic { transform: rotate(180deg); }
}
@media (max-width: 900px) { .colbtn { display: none; } }
@media print { .colbtn { display: none !important; } }
.nav { padding-bottom: 6px; }
.colbtn .ic { width: 22px; height: 22px; flex: none; }

/* Claims: ready cards, then a slim banner for claims that need no request */
.cl-ready { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 380px)); gap: 16px; align-items: start; margin-top: 16px; }
.cl-empty { padding: 14px 18px; display: flex; flex-direction: column; gap: 4px; grid-column: 1 / -1; }
.cl-promo { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-top: 16px; padding: 18px 22px; background: linear-gradient(115deg, #0B2A6F, #1F4FBF); color: #fff; border-color: transparent; }
.cl-promo > div:first-child { flex: 1 1 320px; min-width: 0; }
.cl-promo-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.cl-promo-btns .btn { background: #fff; color: #1F4FBF; border-color: #fff; font-weight: 700; }

/* segmented buttons hug their content instead of stretching across the card */
.seg { align-self: flex-start; width: fit-content; max-width: 100%; border-color: var(--line-strong); }
.rf-side .seg { align-self: stretch; width: 100%; }

/* Direct claim header: short, with the category list tucked away */
.idtag { display: inline-block; vertical-align: middle; margin-left: 10px; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); color: #fff; font-size: 13px; font-weight: 600; letter-spacing: .02em; }
details.qual { margin-top: 6px; }
details.qual > summary { cursor: pointer; display: inline-block; font-size: 13px; font-weight: 700; color: #fff; text-decoration: underline; text-underline-offset: 3px; list-style: none; }
details.qual > summary::-webkit-details-marker { display: none; }
details.qual[open] > summary::after { content: " \25B4"; } details.qual:not([open]) > summary::after { content: " \25BE"; }
.qual-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; max-width: 760px; }
.qual-list span { padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); color: #fff; font-size: 12px; }
details.qual .tiny { color: rgba(255,255,255,.85); margin: 0; }
