/* Adridge CareFund - dark theme (default) and day theme. Responsive for desktop, tablet and phone.
   The design system is shared with Adridge STEM. */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1016; --surface: #131a22; --surface-2: #1a232d; --surface-3: #222d3a; --line: #2a3644; --line-soft: #1f2933;
  --text: #e8edf2; --text-2: #a9b6c4; --text-3: #7c8a99;
  --accent: #35c4a4; --accent-ink: #06231c; --accent-soft: rgba(53,196,164,.14);
  --good: #0ca30c; --warn: #fab219; --serious: #ec835a; --crit: #e05252; --info: #5aa6ee;
  --good-soft: rgba(12,163,12,.16); --warn-soft: rgba(250,178,25,.14); --crit-soft: rgba(224,82,82,.16); --info-soft: rgba(90,166,238,.14);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c;
  --shadow: 0 8px 28px rgba(0,0,0,.45);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f1f3f6; --surface: #ffffff; --surface-2: #f6f7f9; --surface-3: #eceff3; --line: #d5dae1; --line-soft: #e6e9ee;
  --text: #121821; --text-2: #46515e; --text-3: #6b7683;
  --accent: #0d8a70; --accent-ink: #ffffff; --accent-soft: rgba(13,138,112,.11);
  --good: #0a8a0a; --warn: #a86f00; --serious: #c25a2c; --crit: #c93030; --info: #1f6fc4;
  --good-soft: rgba(10,138,10,.11); --warn-soft: rgba(250,178,25,.2); --crit-soft: rgba(201,48,48,.1); --info-soft: rgba(31,111,196,.1);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300;
  --shadow: 0 8px 28px rgba(20,30,45,.16);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 20px; } h2 { font-size: 16px; } h3 { font-size: 14px; } h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
.num, td.num, .mono { font-variant-numeric: tabular-nums; } .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--text-3); } .small { font-size: 12px; } .nowrap { white-space: nowrap; }
.splash { display: grid; place-items: center; height: 100vh; color: var(--text-3); letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; } .gap-s { gap: 6px; }
.hide { display: none !important; }

/* Controls */
button, input, select, textarea { font: inherit; color: inherit; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 13px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; white-space: nowrap; font-weight: 550; }
.btn:hover { background: var(--surface-3); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); } .btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--crit); } .btn.ghost { background: transparent; border-color: transparent; } .btn.ghost:hover { background: var(--surface-2); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.icon { width: 36px; padding: 0; }
input[type=text], input[type=password], input[type=number], input[type=url], input[type=date], input[type=email], input[type=search], select, textarea {
  width: 100%; min-height: 38px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); }
textarea { min-height: 70px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, .switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-2); font-weight: 550; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text); } .check input { width: 17px; height: 17px; accent-color: var(--accent); }

/* iPhone-style switch */
.switch { position: relative; display: inline-flex; align-items: center; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch input:disabled { cursor: not-allowed; }
.switch .track { width: 51px; height: 31px; border-radius: 16px; background: var(--surface-3); border: 1px solid var(--line); transition: background .2s, border-color .2s; position: relative; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 25px; height: 25px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.35); transition: transform .2s cubic-bezier(.3,1.3,.6,1); }
.switch input:checked + .track { background: #34c759; border-color: #34c759; }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:disabled + .track { opacity: .5; }
@keyframes pulse { 50% { opacity: .55; } }
input[type=range] { accent-color: var(--accent); width: 130px; }

/* Application frame */
.shell { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line-soft); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 8px 14px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; } .brand img { width: 28px; height: 28px; } .brand small { display: block; font-weight: 500; color: var(--text-3); font-size: 11px; letter-spacing: .02em; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--text-2); font-weight: 560; } .nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); } .nav svg { width: 18px; height: 18px; flex: none; }
.side .foot { margin-top: auto; padding: 8px; font-size: 11.5px; color: var(--text-3); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 10px; padding: 10px 22px; border-bottom: 1px solid var(--line-soft); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.crumb { font-size: 12.5px; color: var(--text-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .crumb b { color: var(--text); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; } .seg button { min-height: 32px; padding: 0 10px; border: 0; background: transparent; cursor: pointer; font-weight: 600; font-size: 12px; color: var(--text-3); } .seg button.on { background: var(--accent-soft); color: var(--accent); }
.content { padding: 20px 22px 60px; max-width: 1500px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; } .page-head p { margin: 3px 0 0; color: var(--text-3); font-size: 13px; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 10px; background: var(--crit); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; position: absolute; top: -4px; right: -4px; }
.pop { position: absolute; right: 0; top: 44px; width: min(380px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); z-index: 40; max-height: 70vh; overflow: auto; }
.pop .item { padding: 10px 14px; border-top: 1px solid var(--line-soft); } .pop .item:first-of-type { border-top: 0; } .pop .item.unread { background: var(--accent-soft); }

/* Cards, tables, pills */
.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 13px; padding: 16px; min-width: 0; }
.card > h3, .card > .row > h3 { margin-bottom: 2px; } .card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 14px; } .grid.kpi { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); } .grid.cards { grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); } .grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); } .grid.charts { grid-template-columns: repeat(auto-fit, minmax(430px, 1fr)); }
.kpi-tile.sm { padding: 10px 12px; } .kpi-tile.sm .v { font-size: 20px; } .grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } tr.sel td { background: var(--info-soft); } .card h4 { margin: 0 0 6px; font-size: 12.5px; color: var(--text-2); font-weight: 650; }
.kpi-tile { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 13px; padding: 13px 15px; } .kpi-tile .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 4px; } .kpi-tile .l { font-size: 12px; color: var(--text-3); font-weight: 560; } .kpi-tile .s { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 650; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.online, .pill.good { background: var(--good-soft); color: var(--good); } .pill.offline, .pill.critical { background: var(--crit-soft); color: var(--crit); } .pill.warning, .pill.stale { background: var(--warn-soft); color: var(--warn); } .pill.info { background: var(--info-soft); color: var(--info); } .pill.plain::before { display: none; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; } th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 600; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; } tr:last-child td { border-bottom: 0; } td.num, th.num { text-align: right; }
.empty { padding: 26px 12px; text-align: center; color: var(--text-3); font-size: 13px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-soft); margin-bottom: 16px; overflow-x: auto; } .tabs button { padding: 9px 12px; border: 0; background: none; color: var(--text-3); font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; } .tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; } .filters label.field { min-width: 150px; flex: 1 1 150px; max-width: 260px; }
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 6px 12px; font-size: 13px; } .kv dt { color: var(--text-3); } .kv dd { margin: 0; font-weight: 560; word-break: break-word; }
.split { display: grid; grid-template-columns: 300px 1fr; gap: 14px; align-items: start; }

/* Charts */
.chart { position: relative; } .chart svg { display: block; width: 100%; height: auto; overflow: visible; } .chart .grid-line { stroke: var(--line-soft); stroke-width: 1; } .chart .axis-text { fill: var(--text-3); font-size: 11px; }
.chart .tip { position: absolute; pointer-events: none; background: var(--surface-3); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 12px; box-shadow: var(--shadow); white-space: nowrap; z-index: 5; transform: translate(-50%, -110%); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* Modal, toast */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 100; display: grid; place-items: center; padding: 14px; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 15px; width: min(680px, 100%); max-height: calc(100vh - 28px); display: flex; flex-direction: column; box-shadow: var(--shadow); } .modal.wide { width: min(920px, 100%); }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); } .modal .body { padding: 16px 18px; overflow: auto; } .modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line-soft); }
#toasts { position: fixed; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 8px; z-index: 200; max-width: calc(100vw - 28px); }
.toast { background: var(--surface-3); border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 9px; box-shadow: var(--shadow); font-size: 13px; } .toast.err { border-left-color: var(--crit); } .toast.warn { border-left-color: var(--warn); }
.note { border: 1px solid var(--line); border-left: 4px solid var(--info); background: var(--info-soft); border-radius: 9px; padding: 9px 12px; font-size: 12.5px; color: var(--text-2); } .note.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.progress { height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; min-width: 90px; } .progress i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s; }
code.block { display: block; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 9px; font-size: 12px; overflow-x: auto; white-space: pre; user-select: all; }

/* Sign-in */
.login { min-height: 100vh; display: grid; place-items: center; padding: 18px; } .login .card { width: min(390px, 100%); padding: 26px; } .login h1 { font-size: 21px; }

/* ---- Spec Sheet ---- */
.sheet-card { padding: 26px 30px; } .sheet { max-width: 880px; margin: 0 auto; font-size: 13.5px; line-height: 1.55; color: var(--text); }
.sheet-kicker { font-size: 11px; letter-spacing: .14em; font-weight: 700; color: var(--text-3); } .sheet h1 { font-size: 26px; margin: 4px 0 2px; } .sheet-path { color: var(--text-3); margin-bottom: 14px; }
.sheet-sec { margin-top: 22px; } .sheet h2 { font-size: 16px; padding-bottom: 5px; border-bottom: 1px solid var(--line); margin-bottom: 10px; color: var(--accent); } .sheet h3 { font-size: 13.5px; margin: 12px 0 6px; } .sheet p { margin: 0 0 9px; text-align: justify; }
/* Bottom border of the last row: the wrapper clips the last pixel, so the space is on the wrapper */
.sheet .table-wrap { margin: 0 0 10px; padding: 0 1px 1px 0; } .sheet-table { width: 100%; border-collapse: collapse; table-layout: fixed; margin: 0; font-size: 12.5px; } .sheet-table th, .sheet-table td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.sheet-table tbody tr:last-child td { border-bottom: 1px solid var(--line); } /* the general table style removes the last bottom border */
/* PDF preview: always white "paper", whatever the theme */
.paper { --text: #111827; --text-2: #374151; --text-3: #5b6673; --line: #c3ced9; --line-soft: #dde3ea; --surface-2: #f6f8fa; --surface-3: #dbe6f0; --accent: #1f3a57; --info: #5f7f9f; --info-soft: #eaf1f8; --good: #3d8b5f; --good-soft: #e9f6ee; --warn: #b7892b; --warn-soft: #fff7e0;
  background: #fff; color: #111827; border-radius: 4px; padding: 34px 38px; box-shadow: 0 2px 14px rgba(0,0,0,.35); max-height: 62vh; overflow: auto; }

/* ---------------------------------------------------------------- Adridge CareFund additions ---------------------------------------------------------------- */
.page-foot { margin-top: auto; padding: 14px 22px 18px; font-size: 11.5px; color: var(--text-3); border-top: 1px solid var(--line-soft); }
.back { display: inline-block; margin-bottom: 10px; font-weight: 600; font-size: 13px; }
.btn.danger-fill { background: var(--crit); border-color: var(--crit); color: #fff; } .linklike { all: unset; color: var(--accent); cursor: pointer; font-weight: 600; overflow-wrap: anywhere; } .linklike:hover { text-decoration: underline; } .linklike:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
a:focus-visible, .nav a:focus-visible, .tabs button:focus-visible, .seg button:focus-visible, tr.click:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
label.field > span:first-child { display: block; } .form-grid .wide { grid-column: 1 / -1; } .code-input { font-size: 22px; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.switch { gap: 8px; } .switch-state { min-width: 26px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; color: var(--text-3); } .switch.on .switch-state { color: var(--text); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line-soft); } .set-row:first-of-type { border-top: 0; } .set-l { display: flex; flex-direction: column; min-width: 0; font-weight: 600; } .set-l .small { font-weight: 450; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--surface-2); } td.num, th.num { text-align: right; white-space: nowrap; } tfoot td { font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; } td .sub { display: block; font-size: 11.5px; color: var(--text-3); }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 12px; } .toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.file-list { display: flex; flex-direction: column; gap: 8px; } .file { display: flex; gap: 9px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--surface-2); min-width: 0; }
.detail { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 14px; align-items: start; } .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.timeline { display: flex; flex-direction: column; gap: 8px; } .timeline > div { padding: 8px 10px; border-left: 3px solid var(--line); background: var(--surface-2); border-radius: 0 8px 8px 0; font-size: 13px; } .timeline > div.good { border-left-color: var(--good); } .timeline > div.bad { border-left-color: var(--crit); } .timeline > div.old { opacity: .6; }
.kpi-tile .v.sm { font-size: 20px; } .kpi-tile a { color: inherit; } .task-list { display: flex; flex-wrap: wrap; gap: 8px; } .task { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line-soft); color: var(--text); font-weight: 600; font-size: 12.5px; } .task b { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: inline-grid; place-items: center; font-size: 11.5px; } .task.zero b { background: var(--surface-3); color: var(--text-3); }
.chart-card .range { font-size: 12px; color: var(--text-3); } .bars text { font-size: 10.5px; fill: var(--text-3); } .bars .v { fill: var(--text-2); font-weight: 600; }
.hbar { display: grid; grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 12.5px; padding: 5px 0; } .hbar .track { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; } .hbar .track i { display: block; height: 100%; border-radius: 5px; background: var(--s1); min-width: 2px; } .hbar b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.prog { display: flex; flex-direction: column; gap: 5px; padding: 9px 0; border-top: 1px solid var(--line-soft); } .prog:first-child { border-top: 0; } .prog .progress { height: 9px; } .prog .progress i.over { background: var(--warn); }
.more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; } .more-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); font-weight: 600; font-size: 12px; text-align: center; } .more-grid a.active { background: var(--accent-soft); color: var(--accent); }
.match-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 120px; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-soft); } .match-row:first-child { border-top: 0; } .match-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; } .perm { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; padding: 4px 0; border-bottom: 1px dashed var(--line-soft); } .perm .mono { overflow-wrap: anywhere; }
.diff { font-size: 12px; } .diff pre { margin: 4px 0 0; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; }
/* Spec Sheet */
.spec-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; align-items: start; } .spec-toc { position: sticky; top: 64px; display: flex; flex-direction: column; gap: 2px; } .spec-toc a { padding: 7px 10px; border-radius: 8px; color: var(--text-2); font-weight: 560; font-size: 13px; } .spec-toc a:hover { background: var(--surface-2); text-decoration: none; } .spec-toc a.locked { color: var(--text-3); }
.spec-meta { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 8px 0 4px; } .sheet h3 { color: var(--text); } .sheet .sheet-sec { scroll-margin-top: 70px; } .sheet-list { margin: 0 0 10px; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; } .sheet-note { color: var(--text-3); font-size: 12.5px; }
.diagram { border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px; margin: 0 0 10px; background: var(--surface-2); } .diagram figcaption { font-weight: 650; margin-bottom: 8px; } .diagram details { margin-top: 8px; font-size: 12.5px; } .diagram summary { cursor: pointer; font-weight: 650; color: var(--text-2); } .diagram ol { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.flow-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; } svg.flowchart { display: block; width: 100%; max-width: 660px; min-width: 470px; height: auto; margin: 0 auto; }
.fl-line { fill: none; stroke: var(--text-3); stroke-width: 1; } .fl-line.dash { stroke-dasharray: 3 2.5; } .fl-line.life { stroke: var(--line); } .fl-head { fill: var(--text-3); } .fl-text { font-size: 9px; fill: var(--text); } .fl-text.fl-on { fill: #fff; font-weight: 700; } .fl-text.fl-b { font-weight: 700; } .fl-label { font-size: 7.5px; font-weight: 700; fill: var(--text-3); } .fl-mono { font-size: 6.8px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; fill: var(--text); }
.fl-term { fill: #1f3a57; stroke: #1f3a57; } .fl-box { fill: var(--info-soft); stroke: var(--info); } .fl-box.fl-yes { fill: var(--good-soft); stroke: var(--good); } .fl-box.fl-no { fill: var(--surface-3); stroke: var(--text-3); } .fl-box.fl-actor { fill: var(--surface-3); stroke: var(--text-3); } .fl-dia { fill: var(--warn-soft); stroke: var(--warn); } .fl-zone { fill: var(--surface); stroke: var(--text-3); stroke-dasharray: 3 2.5; } .fl-ent { fill: var(--surface); stroke: var(--info); } .fl-ent-head { fill: #1f3a57; }
.paper .fl-zone, .paper .fl-ent { fill: #fff; } .paper .diagram { background: #fff; }
/* Phone and tablet */
.bottom-nav { display: none; }
@media (max-width: 1100px) { .detail { grid-template-columns: minmax(0, 1fr); } .spec-layout { grid-template-columns: minmax(0, 1fr); } .spec-toc { position: static; flex-direction: row; flex-wrap: wrap; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); } .side { display: none; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line-soft); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav a, .bottom-nav button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 6px; font-size: 10px; color: var(--text-3); font-weight: 600; min-height: 54px; text-align: center; min-width: 0; } .bottom-nav span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .bottom-nav .active { color: var(--accent); }
  .top { padding: 8px 12px; } .content { padding: 14px 12px 24px; } .page-foot { padding: 12px 12px calc(74px + env(safe-area-inset-bottom)); } .split { grid-template-columns: minmax(0, 1fr); } .grid.cards, .grid.two, .grid.charts { grid-template-columns: minmax(0, 1fr); } .grid.kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid > *, .split > *, .stack > *, .card, .content > *, .detail > * { min-width: 0; max-width: 100%; }
  .crumb .long { display: none; } #toasts { bottom: 76px; } .modal footer { position: sticky; bottom: 0; background: var(--surface); } .filters label.field { max-width: none; flex-basis: 46%; min-width: 0; } h1 { font-size: 18px; } .kv { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
  .btn { min-height: 42px; } .btn.sm { min-height: 36px; } input, select, textarea { font-size: 16px; } /* touch targets; 16 px stops iOS zooming into fields */
  .sheet-card { padding: 16px 14px; } .paper { padding: 18px 14px; } .sheet h1 { font-size: 21px; } .match-row { grid-template-columns: auto minmax(0, 1fr); } .match-row .amt { grid-column: 2; }
  /* Wide tables become cards: each cell shows its column label */
  table.cards thead { display: none; } table.cards, table.cards tbody, table.cards tfoot, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards tr { border: 1px solid var(--line-soft); border-radius: 10px; padding: 6px 10px; margin-bottom: 8px; background: var(--surface-2); } table.cards td { display: flex; justify-content: space-between; gap: 14px; padding: 5px 0; border-bottom: 1px dashed var(--line-soft); text-align: right; } table.cards td:last-child { border-bottom: 0; }
  table.cards td::before { content: attr(data-label); color: var(--text-3); font-size: 11.5px; font-weight: 600; text-align: left; flex: none; max-width: 45%; } table.cards td:empty { display: none; } table.cards td .sub { text-align: right; } .table-wrap { margin: 0; }
}
@media print {
  .side, .top, .bottom-nav, .filters, .btn, #toasts, .page-foot, .spec-toc, .tabs, .pager { display: none !important; } .shell { display: block; } body { background: #fff; color: #000; } .card, .kpi-tile { break-inside: avoid; border-color: #ccc; }
  body.print-paper > #app, body.print-paper > #toasts { display: none !important; } body.print-paper .modal-back { position: static; background: none; padding: 0; display: block; } body.print-paper .modal { border: 0; box-shadow: none; width: auto; max-height: none; display: block; } body.print-paper .modal header, body.print-paper .modal footer, body.print-paper .note { display: none !important; }
  body.print-paper .modal .body { padding: 0; overflow: visible; } .paper { box-shadow: none; max-height: none; overflow: visible; padding: 0; } .sheet-sec, .diagram { break-inside: avoid-page; } .diagram details > ol { display: block; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
