/* interfaces.css — Interfaces module (ICD / ICF). Dark navy + gold, same family as stk.css / noc.html.
 * Base (desktop) rules first; the phone rules live in ONE @media (max-width: 820px) block at the END
 * so they win over the base rules (CLAUDE.md "Every page is phone-laid-out"). */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
html, body { font-family: 'Open Sans', sans-serif; background: #070c18; color: #C8CCCC; font-size: 13px; line-height: 1.45; }
body { min-height: 100vh; }
html.lock, html.lock body { overflow: hidden; }
a { color: #7CC4EA; }
button, input, select, textarea { font-family: inherit; }
h1, h2, h3 { font-weight: 700; }
.muted { color: #5A7090; }
.small { font-size: 11px; }
.gold { color: #E8C060; }
.bad-t { color: #F08080; }

/* ── header ─────────────────────────────────────────────────────────────────────────────────── */
.top { position: sticky; top: 0; z-index: 60; }
.page-header { background: linear-gradient(180deg, #0E1520 0%, #0A0E18 100%); border-bottom: 1px solid #1E2840;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px;
  padding-top: env(safe-area-inset-top); padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right)); }
.hleft { display: flex; align-items: center; gap: 14px; min-width: 0; }
.logo-wrap { display: inline-flex; flex: none; }
.logo-wrap a { display: inline-flex; }
.hlogo { height: 34px; border-radius: 4px; display: block; }
.htitles { min-width: 0; }
.page-title { font-size: 13px; font-weight: 800; letter-spacing: 2.5px; text-transform: uppercase; color: #E8C060; }
.page-subtitle { font-size: 9px; letter-spacing: 1.5px; color: #4A6080; text-transform: uppercase; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hright { display: flex; align-items: center; gap: 8px; flex: none; }
.user-chip { display: flex; align-items: center; gap: 9px; background: #0B1220; border: 1px solid #22304A; border-radius: 22px;
  padding: 3px 12px 3px 3px; color: inherit; cursor: pointer; min-height: 38px; text-align: left; }
.user-chip:hover, .user-chip[aria-expanded="true"] { border-color: #E8C060; }
.uc-av { width: 30px; height: 30px; border-radius: 50%; background: #1A2A48; color: #E8C060; font-weight: 800; font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center; flex: none; letter-spacing: .5px; }
.uc-txt { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-size: 11px; font-weight: 700; color: #DCE6F2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.user-role { font-size: 8.5px; letter-spacing: 1px; color: #6C84A4; text-transform: uppercase; }
.user-role:empty { display: none; }
.hbtn { min-height: 38px; }
.hbtn .hb-l { margin-left: 2px; }
.ico { flex: none; display: inline-block; vertical-align: middle; }
/* the bell notifications.js drops into .tab-right */
#notifBell { font-family: inherit; font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: #8FB0C8;
  background: #0E1626; border: 1px solid #22304A; border-radius: 4px; padding: 0 12px; min-height: 38px; cursor: pointer; white-space: nowrap; }
#notifBell:hover { color: #E8C060; border-color: #3A4860; }
body .notif-panel { top: calc(62px + env(safe-area-inset-top, 0px)); }

/* user menu */
.umenu { position: fixed; z-index: 1500; top: calc(58px + env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right));
  width: 240px; max-width: calc(100vw - 24px); background: #0A1120; border: 1px solid #263451; border-radius: 10px;
  box-shadow: 0 16px 44px rgba(0,0,0,.55); padding: 6px; }
.um-head { padding: 8px 10px 10px; border-bottom: 1px solid #1A2438; margin-bottom: 4px; }
.um-name { font-weight: 700; color: #F0F4F8; font-size: 12.5px; overflow-wrap: anywhere; }
.um-sub { font-size: 10.5px; color: #6C84A4; margin-top: 2px; overflow-wrap: anywhere; }
.um-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: none; color: #C8D4E2;
  font-size: 12.5px; padding: 10px; border-radius: 6px; cursor: pointer; text-decoration: none; min-height: 40px; }
.um-item:hover { background: #13213A; color: #E8C060; }
.um-item.danger { color: #F08080; }

/* tabs */
.tabbar { display: flex; gap: 2px; background: #090D18; border-bottom: 1px solid #1A2030; padding: 0 max(16px, env(safe-area-inset-left));
  overflow-x: auto; scrollbar-width: none; }
.tabbar::-webkit-scrollbar { display: none; }
.tab { position: relative; font-size: 10.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: #5A7090; background: none;
  border: none; border-bottom: 3px solid transparent; padding: 0 16px; min-height: 44px; cursor: pointer; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.tab:hover { color: #C8CCCC; }
.tab.active { color: #E8C060; border-bottom-color: #E8C060; }
.tab .ti { font-size: 13px; line-height: 1; }
/* view-only accounts (no Interfaces permission): one quiet line under the tabs */
.vonote { background: #0E1626; border-bottom: 1px solid #1A2030; color: #A8B8CC; font-size: 11.5px; line-height: 1.45;
  padding: 7px max(16px, env(safe-area-inset-left)); }
.vonote b { color: #E8C060; font-weight: 700; }
.tab .tbadge { background: #C0392B; color: #fff; border-radius: 9px; font-size: 9px; line-height: 15px; min-width: 16px; padding: 0 5px; letter-spacing: 0; text-align: center; }

/* ── generic bits ──────────────────────────────────────────────────────────────────────────── */
.wrap { padding: 18px max(24px, env(safe-area-inset-right)) 40px max(24px, env(safe-area-inset-left)); max-width: 1400px; margin: 0 auto; }
.vhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.vhead h1 { font-size: 16px; color: #F0F4F8; letter-spacing: .3px; }
.vhead p { color: #6C84A4; font-size: 12px; margin-top: 2px; }
.vh-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: #0B1220; border: 1px solid #1A2438; border-radius: 8px; }
.sec { padding: 14px 16px; margin-bottom: 14px; }
.sec > h3, .sec-h { font-size: 10.5px; font-weight: 800; letter-spacing: 1.3px; text-transform: uppercase; color: #E8C060; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sec-h .sp { flex: 1; }
.sec-h .n { color: #5A7090; font-weight: 700; }
.empty { padding: 36px 20px; text-align: center; color: #4A6080; }
.empty.small { padding: 14px 8px; font-size: 12px; }
.empty b { color: #8FA6BF; }
.err-box { border: 1px solid #4A2430; background: rgba(239,68,68,.07); color: #F0A0A0; border-radius: 8px; padding: 14px 16px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; color: #DCE6F2; }
.pre.dim { color: #5A7090; font-style: italic; }
.hint { color: #6C84A4; font-size: 11.5px; }
.ref { font-weight: 800; color: #F0F4F8; letter-spacing: .3px; white-space: nowrap; }
.co { display: inline-block; font-size: 9px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: #9FB4CC; background: #13213A;
  border-radius: 3px; padding: 1px 6px; vertical-align: 1px; }

.btn { font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: #8FB0C8; background: #0E1626;
  border: 1px solid #22304A; border-radius: 4px; padding: 0 14px; min-height: 34px; cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; gap: 6px; text-decoration: none; white-space: nowrap; }
.btn:hover { color: #E8C060; border-color: #3A4860; }
.btn.primary { background: linear-gradient(180deg, #2A5048, #1E3A34); color: #6ACCA0; border-color: #2A5048; }
.btn.primary:hover { color: #9CE8C4; }
.btn.gold { background: linear-gradient(180deg, #4A3C18, #34290F); color: #F2CF72; border-color: #5A4820; }
.btn.danger { color: #F08080; border-color: #4A2430; }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 9.5px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.on { color: #E8C060; border-color: #E8C060; background: rgba(232,192,96,.1); }
.linkbtn { background: none; border: none; color: #7CC4EA; font: inherit; cursor: pointer; padding: 0; text-align: left; text-decoration: none; }
.linkbtn:hover { text-decoration: underline; }
.linkbtn.ref { color: #F0F4F8; font-weight: 800; letter-spacing: .3px; white-space: nowrap; }
.x { background: none; border: none; color: #8FA6BF; font-size: 22px; line-height: 1; cursor: pointer; min-width: 38px; min-height: 38px; border-radius: 6px; flex: none; }
.x:hover { color: #E8C060; background: #13213A; }

.inp, .sel { background: #0B1220; color: #DCE6F2; border: 1px solid #22304A; border-radius: 4px; padding: 7px 10px; font-size: 12.5px; min-height: 34px; max-width: 100%; }
textarea.inp { resize: vertical; line-height: 1.5; width: 100%; }
.inp:focus, .sel:focus { outline: none; border-color: #2097D1; }
.inp.num { width: 80px; }
input[type="color"] { width: 44px; height: 32px; border: 1px solid #22304A; border-radius: 4px; background: #0B1220; padding: 2px; cursor: pointer; }
input[type="color"][data-unset="1"] { opacity: .45; }
.fld { display: flex; flex-direction: column; min-width: 0; }
.fld .lbl, .lbl { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: #5A7090; margin: 0 0 4px; }
.fld .inp, .fld .sel { width: 100%; }
.ro { min-height: 34px; display: flex; align-items: center; gap: 6px; color: #DCE6F2; padding: 0 2px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .span2 { grid-column: 1 / -1; }

/* chips / tags */
.st { display: inline-block; font-size: 9px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; border-radius: 3px; padding: 2px 7px; white-space: nowrap; vertical-align: 1px; }
.st.ok { background: rgba(34,197,94,.14); color: #5BD68A; }
.st.run { background: rgba(32,151,209,.16); color: #7CC4EA; }
.st.warn { background: rgba(245,158,11,.15); color: #F5B54A; }
.st.gold { background: rgba(232,192,96,.15); color: #E8C060; }
.st.bad { background: rgba(239,68,68,.15); color: #F08080; }
.st.dim { background: #121B2C; color: #6A80A0; }
.st + .st { margin-left: 4px; }
.dtag { --dc: #2A4A78; display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .5px; color: #E6EEF8; background: #1A2A48; border: 1px solid #2A4A78; background: color-mix(in srgb, var(--dc) 45%, #0B1220);
  border: 1px solid color-mix(in srgb, var(--dc) 80%, #0B1220); border-radius: 3px; padding: 0 6px; line-height: 17px; white-space: nowrap; vertical-align: 1px; }
.arrow { color: #5A7090; margin: 0 3px; }
.tag { display: inline-block; font-size: 10px; font-weight: 700; border-radius: 3px; padding: 1px 7px; background: #13213A; color: #7CC4EA; }

/* toolbar */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .grow { flex: 1 1 220px; min-width: 0; }
.toolbar .tb-gap { flex: 1; }
.chipx { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: #E8C060; border: 1px solid #5A4820; background: rgba(232,192,96,.08);
  border-radius: 14px; padding: 0 4px 0 10px; min-height: 30px; }
.chipx button { background: none; border: none; color: #E8C060; font-size: 15px; cursor: pointer; min-width: 26px; min-height: 26px; }

/* tables */
.tblwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
table.tbl th { text-align: left; font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase; color: #4A6080; padding: 9px 10px; border-bottom: 1px solid #1A2438; white-space: nowrap; font-weight: 700; }
table.tbl td { padding: 9px 10px; border-bottom: 1px solid #111A2A; vertical-align: top; }
table.tbl tr.click { cursor: pointer; }
table.tbl tbody tr:hover td { background: #0E1626; }
table.tbl td.acts { white-space: nowrap; text-align: right; }
table.tbl td.acts .btn + .btn { margin-left: 6px; }
table.tbl tr.retired td { opacity: .55; }
table.tbl-set td { vertical-align: middle; }
table.tbl-set td.c-name .inp { width: 100%; min-width: 220px; }
td.subj { color: #DCE6F2; min-width: 220px; }
td .sub { display: block; color: #5A7090; font-size: 11px; margin-top: 2px; }

/* register view (ICDs / Enhancements): level chips, level group rows, stage cells */
.segs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.seg { background: #0B1220; border: 1px solid #1E2C44; color: #8FA6C2; border-radius: 16px; padding: 0 12px; min-height: 34px;
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg:hover { border-color: #2A4A78; color: #DCE6F2; }
.seg.on { background: rgba(32,151,209,.14); border-color: #2097D1; color: #E6F2FA; }
.seg .n { font-size: 10.5px; color: #6F87A6; font-weight: 700; }
.seg.on .n { color: #8CCBEB; }
table.reg td.c-id { color: #6F87A6; font-weight: 700; white-space: nowrap; width: 1%; }
table.reg tr.grp th { background: #0A111E; color: #E8C060; font-size: 10.5px; letter-spacing: 1.2px; padding: 8px 10px; border-bottom: 1px solid #1A2438; }
table.reg tr.grp th .n { color: #6F87A6; margin-left: 6px; }
table.reg tbody tr.grp:hover th { background: #0A111E; }
table.reg .sd { font-size: 11px; white-space: nowrap; }
table.reg td .linkbtn.ref { white-space: nowrap; font-size: 11.5px; }
.flagmark { display: inline-block; font-size: 10.5px; color: #E8C060; border: 1px solid #5A4820; border-radius: 9px; padding: 0 6px; margin-left: 4px; white-space: nowrap; }
.mono, .tag.mono { font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
.notes { background: rgba(232,192,96,.07); border: 1px solid #5A4820; border-radius: 8px; padding: 10px 14px; margin: 0 0 14px; color: #E6D6A8; font-size: 12.5px; }
.notes ul { margin: 6px 0 0 18px; padding: 0; }
.notes li { margin: 2px 0; }
.hero-pair .hp-l { font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase; color: #5A7090; margin-right: 6px; }
.tchips { display: flex; flex-wrap: wrap; gap: 6px; }
.tchip { font-size: 11px; border-radius: 10px; padding: 2px 9px; border: 1px solid #1E2C44; color: #6F87A6; text-decoration: line-through; }
.tchip.y { color: #9EE6C8; border-color: #2D6A55; background: rgba(58,160,138,.12); text-decoration: none; }
.tchip.u { text-decoration: none; border-style: dashed; }
.schs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.sch { background: #0B1220; border: 1px solid #1A2438; border-radius: 6px; padding: 10px 12px; }
.sch-h { font-size: 10px; font-weight: 800; letter-spacing: 1.2px; color: #E8C060; margin-bottom: 6px; }
.sch-r { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; padding: 3px 0; border-bottom: 1px dashed #141E30; }
.sch-r:last-child { border-bottom: none; }
.sch-r .lbl { margin: 0; }
.sch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.yn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.yn { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: #B8C8DC; }
.yn .sel { width: 84px; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #B8C8DC; min-height: 36px; }
.chk input { width: 18px; height: 18px; }
.imp-head { font-size: 13px; margin: 12px 0 8px; color: #DCE6F2; }
.imp-k { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.imp-det { margin: 0; padding-left: 16px; font-size: 11px; color: #A8B8CC; }
.imp-tbl { max-height: 60vh; overflow: auto; border: 1px solid #1A2438; border-radius: 6px; margin-top: 6px; }
.codes { display: flex; flex-wrap: wrap; gap: 6px; }
.mx thead th.g-EXT { color: #C9A44E; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: #0B1220; border: 1px solid #1A2438; border-left: 3px solid #2A4A78; border-radius: 6px; padding: 10px 14px; }
.kpi .v { font-size: 22px; font-weight: 800; color: #F0F4F8; line-height: 1.1; }
.kpi .l { font-size: 9px; letter-spacing: 1.2px; text-transform: uppercase; color: #5A7090; margin-top: 3px; }
.kpi.k-icd { border-left-color: #2097D1; } .kpi.k-items { border-left-color: #3AA08A; }
.kpi.k-icfs { border-left-color: #E8C060; } .kpi.k-over { border-left-color: #E05050; }
.kpi.k-over .v { color: #F08080; }

/* ── matrix ────────────────────────────────────────────────────────────────────────────────── */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-bottom: 10px; font-size: 11px; color: #8FA6BF; }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 14px; height: 14px; border-radius: 3px; display: inline-block; border: 1px solid #22304A; }
.mx-box { overflow: auto; max-height: min(74vh, 780px); border: 1px solid #1A2438; border-radius: 8px; background: #0B1220;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch; margin-bottom: 18px; }
table.mx { border-collapse: separate; border-spacing: 0; }
.mx th, .mx td { padding: 0; }
.mx thead th { position: sticky; top: 0; z-index: 2; background: #0D1526; height: 38px; min-width: 50px; font-size: 10px; font-weight: 800;
  color: #8FA6BF; border-bottom: 1px solid #22304A; border-right: 1px solid #111A2A; letter-spacing: .5px; }
.mx thead th.corner { left: 0; z-index: 3; text-align: left; padding: 0 10px; color: #4A6080; font-size: 9px; letter-spacing: 1px; text-transform: uppercase; border-right: 1px solid #22304A; }
.mx tbody th { position: sticky; left: 0; z-index: 1; background: #0D1526; text-align: left; padding: 0 10px; border-right: 1px solid #22304A;
  border-bottom: 1px solid #111A2A; white-space: nowrap; font-weight: 400; }
.mx tbody th b { color: #E6EEF8; font-size: 11px; letter-spacing: .5px; margin-right: 6px; }
.mx tbody th .nm { color: #6C84A4; font-size: 11px; display: inline-block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.mx td { border-right: 1px solid #111A2A; border-bottom: 1px solid #111A2A; }
.mx td.diag { background: repeating-linear-gradient(135deg, #0A0F1A 0 6px, #0C1220 6px 12px); }
.mx-c { position: relative; width: 50px; height: 42px; display: flex; align-items: center; justify-content: center; background: none; border: none;
  color: #3A4C66; cursor: pointer; font-size: 13px; font-weight: 800; }
.mx-c:hover { outline: 2px solid #E8C060; outline-offset: -2px; }
.mx-c.lvl-icd { background: rgba(32,151,209,.16); color: #9FD4F0; }
.mx-c.lvl-items { background: rgba(58,160,138,.2); color: #8FE0C8; }
.mx-c.lvl-icfs { background: rgba(232,192,96,.2); color: #F2D88A; }
.mx-c.lvl-over { background: rgba(224,80,80,.28); color: #FFB0B0; }
.mx-c .mx-b { position: absolute; top: 3px; right: 3px; min-width: 15px; height: 15px; border-radius: 8px; background: #E8C060; color: #1A1408;
  font-size: 9px; line-height: 15px; padding: 0 3px; font-weight: 800; }
.mx-c.lvl-over .mx-b { background: #E05050; color: #fff; }
.sw.lvl-empty { background: #0B1220; } .sw.lvl-icd { background: rgba(32,151,209,.35); } .sw.lvl-items { background: rgba(58,160,138,.4); }
.sw.lvl-icfs { background: rgba(232,192,96,.45); } .sw.lvl-over { background: rgba(224,80,80,.55); }
.pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.pair-card { display: flex; flex-direction: column; gap: 4px; text-align: left; background: #0B1220; border: 1px solid #1A2438; border-left: 3px solid #2097D1;
  border-radius: 8px; padding: 10px 12px; color: inherit; cursor: pointer; min-height: 44px; }
.pair-card:hover { border-color: #3A4860; }
.pair-card.lvl-items { border-left-color: #3AA08A; } .pair-card.lvl-icfs { border-left-color: #E8C060; } .pair-card.lvl-over { border-left-color: #E05050; }
.pc-top { font-weight: 800; color: #F0F4F8; }
.pc-names { color: #6C84A4; font-size: 11px; }
.pc-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: #8FA6BF; }
.pc-stats .bad { color: #F08080; font-weight: 700; }
.rows { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.row-btn { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; text-align: left; background: #0B1220; border: 1px solid #1A2438; border-radius: 6px;
  padding: 9px 12px; color: inherit; cursor: pointer; min-height: 44px; width: 100%; }
.row-btn:hover { border-color: #E8C060; }
.row-btn .rb-t { flex: 1 1 100%; color: #C8D4E2; }
.pair-names { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: #C8D4E2; }
.pair-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 11.5px; color: #8FA6BF; }

/* ── ICD detail ────────────────────────────────────────────────────────────────────────────── */
.back { margin-bottom: 12px; }
.hero { padding: 16px 18px; margin-bottom: 14px; }
.hero-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.hero-top .ref { font-size: 15px; }
.hero-top .rev { color: #E8C060; font-weight: 700; }
.hero h2 { font-size: 18px; color: #F0F4F8; margin: 6px 0 4px; overflow-wrap: anywhere; }
.hero-pair { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: #8FA6BF; }
.hero-meta { color: #5A7090; font-size: 11.5px; margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.hero-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid2 > .sec { margin-bottom: 14px; }
.revs { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.revs li { border-left: 3px solid #22304A; padding: 2px 0 2px 10px; }
.revs li.cur { border-left-color: #E8C060; }
.revs .rv { font-weight: 800; color: #F0F4F8; margin-right: 6px; }
.revs .meta { color: #5A7090; font-size: 11px; }
.revs .note { color: #C8D4E2; margin-top: 2px; overflow-wrap: anywhere; }
.files { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.files li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 0; border-bottom: 1px dashed #1A2438; }
.files li:last-child { border-bottom: none; }
.files a.fname { color: #7CC4EA; text-decoration: none; overflow-wrap: anywhere; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; min-height: 30px; }
.files a.fname:hover { text-decoration: underline; }
.files .meta { color: #5A7090; font-size: 11px; }
.files .sp { flex: 1; }

/* ICF cards (My ICFs) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.icf-card { display: flex; flex-direction: column; gap: 5px; text-align: left; background: #0B1220; border: 1px solid #1A2438; border-left: 3px solid #2097D1;
  border-radius: 8px; padding: 11px 13px; color: inherit; cursor: pointer; width: 100%; min-height: 44px; }
.icf-card:hover { border-color: #3A4860; }
.icf-card.over { border-left-color: #E05050; }
.icf-card.act { border-left-color: #E8C060; }
.ic-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.ic-top .ref { margin-right: 2px; }
.ic-subj { color: #E6EEF8; font-weight: 600; overflow-wrap: anywhere; }
.ic-meta { color: #6C84A4; font-size: 11.5px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; }
.ic-why { color: #E8C060; font-size: 11.5px; font-weight: 600; }
.mine-sec { margin-bottom: 20px; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; border: 1px solid #5A4820; background: rgba(232,192,96,.07); color: #E8D8A8;
  border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; }
.banner .bt { flex: 1 1 260px; }

/* ── layers (modals / sheets) ──────────────────────────────────────────────────────────────── */
.ov { position: fixed; inset: 0; background: rgba(2,5,12,.74); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 12px; }
.sheet { background: #0A1120; border: 1px solid #263451; border-radius: 10px; width: min(560px, 100%); max-height: 92vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.6); min-height: 0; }
.ov.wide .sheet { width: min(760px, 100%); }
.ov.full .sheet { width: min(1000px, 100%); }
.ov.full.narrow .sheet { width: min(780px, 100%); }
.sh { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-bottom: 1px solid #1A2438; background: #0D1526; border-radius: 10px 10px 0 0; min-height: 52px; }
.sh .t { flex: 1; min-width: 0; font-weight: 700; color: #E8C060; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh .t .ref { color: #E8C060; font-size: 14px; }
.sh-chips { display: flex; gap: 4px; flex: none; }
.sb { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px 16px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sf { flex: none; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px; border-top: 1px solid #1A2438; background: #0A1120; border-radius: 0 0 10px 10px; }
.sf .sf-gap { flex: 1; }
.d-err { margin-top: 12px; border: 1px solid #4A2430; background: rgba(239,68,68,.08); color: #F0A0A0; border-radius: 6px; padding: 8px 12px; }
.d-txt { color: #C8D4E2; margin-bottom: 10px; }
.d-txt b { color: #F0F4F8; }

/* ICF detail */
.icf-top h2 { font-size: 17px; color: #F0F4F8; overflow-wrap: anywhere; }
.icf-top .ft { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: #8FA6BF; margin-top: 6px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 18px; margin: 14px 0; padding: 12px 14px; background: #0B1220;
  border: 1px solid #1A2438; border-radius: 8px; }
.kv > div { min-width: 0; overflow-wrap: anywhere; color: #DCE6F2; }
.kv .lbl { margin-bottom: 2px; }
.kv .linkbtn { font-weight: 700; min-height: 24px; }
.kv .btn { margin-left: 6px; }
.rej { border: 1px solid #4A2430; background: rgba(239,68,68,.07); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; color: #F0B0B0; overflow-wrap: anywhere; }
.rej b { color: #F08080; }
.isec { margin-bottom: 18px; }
.isec > .sec-h { border-bottom: 1px solid #1A2438; padding-bottom: 6px; }
.resp { border-left: 3px solid #3AA08A; padding-left: 12px; }

/* sign-off timeline */
.tl-ph { font-size: 9.5px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: #6C84A4; margin: 12px 0 6px; }
.tl-ph:first-child { margin-top: 0; }
ol.tl { list-style: none; position: relative; margin-left: 4px; }
.tl-s { position: relative; display: flex; gap: 12px; padding: 0 0 12px 26px; }
.tl-s::before { content: ''; position: absolute; left: 8px; top: 20px; bottom: 0; width: 2px; background: #1A2438; }
.tl-s:last-child::before { display: none; }
.tl-dot { position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #0B1220; border: 2px solid #2A3A58;
  font-size: 10px; line-height: 14px; text-align: center; color: #0A1120; font-weight: 800; }
.tl-s.done .tl-dot { background: #3AA08A; border-color: #3AA08A; }
.tl-s.pend .tl-dot { background: #E8C060; border-color: #E8C060; box-shadow: 0 0 0 4px rgba(232,192,96,.18); }
.tl-s.stopped .tl-dot { background: #E05050; border-color: #E05050; color: #fff; }
.tl-main { flex: 1; min-width: 0; }
.tl-s.pend .tl-main { background: rgba(232,192,96,.07); border: 1px solid #5A4820; border-radius: 6px; padding: 6px 10px; margin: -4px 0 0 -6px; }
.tl-role { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #6C84A4; }
.tl-rej { font-size: 9px; color: #F5B54A; letter-spacing: .5px; text-transform: none; font-weight: 600; margin-left: 4px; }
.tl-who { color: #F0F4F8; font-weight: 600; overflow-wrap: anywhere; }
.tl-s.wait .tl-who { color: #6C84A4; font-weight: 400; }
.tl-wait { color: #E8C060; font-weight: 700; }
.tl-when { color: #6C84A4; font-size: 11px; }
.tl-cmt { color: #C8D4E2; font-style: italic; margin-top: 2px; overflow-wrap: anywhere; }
.tl-sig { flex: none; width: 150px; display: flex; align-items: center; justify-content: flex-end; }
.tl-sig img { max-width: 150px; max-height: 48px; background: #fff; border-radius: 4px; padding: 2px 4px; display: block; }
.tl-sig .nosig { font-size: 10px; color: #4A6080; font-style: italic; }
.ladder-prev { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; color: #8FA6BF; font-size: 12px; }
.ladder-prev b { color: #C8D4E2; }

/* history / comments */
.hist { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.hist .ev { color: #8FA6BF; font-size: 12px; overflow-wrap: anywhere; }
.hist .ev b { color: #C8D4E2; }
.hist .ev .when { color: #4A6080; font-size: 11px; }
.hist .ev .note { color: #C8D4E2; }
.hist .cm { background: #0E1828; border: 1px solid #1A2A44; border-radius: 8px; padding: 8px 12px; }
.hist .cm .who { font-size: 11.5px; color: #8FA6BF; }
.hist .cm .who b { color: #F0F4F8; }
.hist .cm .txt { white-space: pre-wrap; color: #DCE6F2; margin-top: 3px; overflow-wrap: anywhere; }
.cbox { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.cbox textarea { flex: 1; min-height: 40px; }

/* signature note + pad */
.signote { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; border-radius: 6px; padding: 8px 12px; margin-top: 12px; font-size: 12px; }
.signote.ok { border: 1px solid #1E3A34; background: rgba(58,160,138,.08); color: #9CE8C4; }
.signote.ok img { max-height: 36px; max-width: 140px; background: #fff; border-radius: 3px; padding: 1px 3px; }
.signote.warn { border: 1px solid #5A4820; background: rgba(232,192,96,.08); color: #E8D8A8; }
.signote .st-t { flex: 1 1 240px; }
.sigpad { position: relative; height: 190px; background: #fff; border-radius: 8px; border: 2px dashed #8FA6BF; overflow: hidden; margin-top: 10px; }
.sigpad canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.sigpad .sp-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #A0A8B8; font-size: 15px; pointer-events: none; }
.sigpad .sp-line { position: absolute; left: 8%; right: 8%; bottom: 34px; border-bottom: 1px solid #C8CED8; pointer-events: none; }
.sp-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 8px; }
.sig-saved { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.sig-saved .lbl { flex: 1 1 100%; margin: 0; }
.sig-prev { max-height: 70px; max-width: 260px; background: #fff; border-radius: 4px; padding: 3px 6px; }

/* settings */
.set-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.add-row { display: grid; grid-template-columns: 110px 1fr 90px auto auto; gap: 10px; align-items: end; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #1A2438; }
.lad-note { color: #8FA6BF; font-size: 12px; margin-bottom: 10px; }
.lad-list { margin: 0; padding: 0; list-style: none; }
.lad-list li { overflow-wrap: anywhere; }
.lad-list .none { color: #4A6080; font-style: italic; }

/* no access */
.noacc { max-width: 520px; margin: 8vh auto 0; padding: 28px 24px; text-align: center; }
.noacc .na-ico { font-size: 34px; }
.noacc h2 { color: #F0F4F8; font-size: 17px; margin: 8px 0 6px; }
.noacc p { color: #A8B8CC; margin-top: 6px; }
.noacc .na-acts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

.file-pick { position: fixed; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #13213A; border: 1px solid #2A3E60; color: #DCE6F2;
  padding: 10px 16px; border-radius: 6px; z-index: 9500; font-size: 12.5px; box-shadow: 0 8px 24px rgba(0,0,0,.5); max-width: min(560px, calc(100vw - 24px)); }
.toast.ok { border-color: #2A5048; color: #9CE8C4; }
.toast.bad { border-color: #6A2A34; color: #F8B0B0; }

/* ── KPI variants (ICF list / S-curve) ──────────────────────────────────────────────────────── */
.kpis.kpis6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi.k-ok { border-left-color: #22C55E; } .kpi.k-run { border-left-color: #2097D1; } .kpi.k-dim { border-left-color: #3A4C6A; }
.kpi .of { font-size: 13px; color: #6F87A6; font-weight: 700; }

/* ── ICF list ───────────────────────────────────────────────────────────────────────────────── */
table.reg tr.grp.sub th { background: #0B1424; color: #9FB4D0; font-size: 10px; letter-spacing: .8px; padding: 6px 10px 6px 22px; font-weight: 700; }
table.il td { vertical-align: top; }
/* short area names ("BB05", "ESS") still give a finger-size target */
table.il .linkbtn { display: inline-flex; align-items: center; min-width: 48px; min-height: 32px; font-weight: 700; }
.lvt { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.more { display: inline-block; margin-left: 3px; font-size: 10px; font-weight: 800; color: #8FA6C2; cursor: help; }
.rf { display: block; font-size: 10.5px; color: #A8B8CC; white-space: nowrap; }
.rf b { color: #E8C060; font-weight: 700; }
.lk { display: inline-flex; flex-wrap: wrap; gap: 3px; }
.sigdots { display: inline-flex; gap: 3px; vertical-align: middle; }
.sigdots i { width: 8px; height: 8px; border-radius: 50%; background: #1E2C44; display: inline-block; }
.sigdots i.on { background: #22C55E; }
.sig-n { font-size: 10.5px; color: #A8B8CC; margin-left: 5px; font-weight: 700; }
.rlist { list-style: none; display: flex; flex-direction: column; gap: 3px; }
.pre-s { white-space: pre-wrap; }
.sig-row { display: flex; flex-wrap: wrap; gap: 6px; }
.sigp { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 12px; background: #121B2C; color: #6A80A0; }
.sigp.on { background: rgba(34,197,94,.14); color: #5BD68A; }
.lrow { display: flex; gap: 6px; align-items: stretch; }
.lrow .row-btn { flex: 1 1 auto; min-width: 0; }
.row-btn .rb-s { font-size: 10.5px; color: #6F87A6; flex: 1 1 100%; }

/* ── S-curve ────────────────────────────────────────────────────────────────────────────────── */
.sc-filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; margin-bottom: 12px; }
.sc-filters .segs { margin: 0; }
.sc-cut { min-width: 160px; }
.sc-card { position: relative; }
.sc-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 6px; font-size: 11.5px; color: #A8B8CC; }
.sc-legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.sc-wrap { width: 100%; outline: none; touch-action: pan-y; cursor: crosshair; }
.sc-wrap:focus-visible { box-shadow: 0 0 0 2px #2097D1; border-radius: 4px; }
.sc-svg { display: block; }
.sc-svg .ax { fill: #6F87A6; font-size: 10px; font-variant-numeric: tabular-nums; }
.sc-svg .ax.cut { fill: #A8B8CC; font-weight: 700; }
.sc-svg .dl { fill: #DCE6F2; font-size: 11px; font-weight: 700; }
/* a surface-coloured halo keeps a label readable where a line passes behind it */
.sc-svg .dl, .sc-svg .ax.cut { paint-order: stroke; stroke: #0B1220; stroke-width: 4px; stroke-linejoin: round; }
.sc-tip { position: absolute; z-index: 5; pointer-events: none; background: #0A1120; border: 1px solid #263451; border-radius: 6px; padding: 7px 10px;
  box-shadow: 0 8px 22px rgba(0,0,0,.5); font-size: 11.5px; min-width: 150px; }
.sc-tip .tt-h { color: #A8B8CC; font-size: 10.5px; margin-bottom: 4px; }
.sc-tip .tt-r { display: flex; align-items: center; gap: 7px; padding: 1px 0; }
.sc-tip .tt-k { width: 14px; height: 0; border-top: 2.5px solid; flex: none; }
.sc-tip .tt-r b { color: #F0F4F8; min-width: 26px; font-variant-numeric: tabular-nums; }
.sc-tip .tt-n { color: #A8B8CC; }
table.sc-tbl tr.cur td { background: rgba(32,151,209,.07); }
table.tbl tr.tot td { border-top: 1px solid #2A3A55; font-weight: 700; }
.sc-rules { margin: 4px 0 0 18px; color: #A8B8CC; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.sc-rules b { color: #DCE6F2; }

/* ── phone (BFR breakpoint) ────────────────────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .top { position: static; }
  .page-header { gap: 8px; min-height: 0; padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: 8px;
    padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .hleft { gap: 10px; flex: 1 1 0; }
  .hlogo { height: 30px; }
  .page-title { font-size: 12px; letter-spacing: 2px; }
  .page-subtitle { letter-spacing: 1px; }
  .hright { gap: 6px; }
  .user-chip { padding: 3px; border-radius: 22px; min-height: 40px; min-width: 40px; justify-content: center; }
  .uc-av { width: 32px; height: 32px; }
  .uc-txt { display: none; }
  .hbtn { min-height: 40px; min-width: 44px; padding: 0 10px; }
  .hbtn .ico { width: 19px; height: 19px; }
  .hbtn .hb-l { display: none; }
  #notifBell { font-size: 0; min-width: 44px; min-height: 40px; padding: 0 10px; position: relative; }
  #notifBell::before { content: '🔔'; font-size: 17px; letter-spacing: 0; }
  #notifBell .notif-badge { font-size: 9px; top: -5px; right: -5px; }
  body .notif-panel { top: calc(58px + env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right)); }
  .umenu { top: calc(56px + env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); }
  .um-item { min-height: 44px; }

  /* tabs: one swipeable row, icon over label */
  .tabbar { gap: 0; padding: 0 max(4px, env(safe-area-inset-left)) 0 max(4px, env(safe-area-inset-right)); }
  .tab { flex: 1 0 auto; flex-direction: column; justify-content: center; gap: 3px; min-height: 52px; padding: 6px 9px 4px; font-size: 9px; letter-spacing: .6px; }
  .tab .ti { font-size: 16px; }
  .tab .tbadge { position: absolute; top: 4px; left: calc(50% + 6px); }

  .wrap { padding: 14px max(12px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .vhead { align-items: stretch; }
  .vhead > div:first-child { flex: 1 1 100%; }
  .vh-acts { flex: 1 1 100%; }
  .vh-acts .btn { flex: 1 1 auto; }
  .btn { min-height: 40px; font-size: 10.5px; }
  .btn.small { min-height: 36px; padding: 0 12px; font-size: 10px; }
  .inp, .sel, textarea.inp { font-size: 16px; min-height: 40px; }
  .inp.num { width: 90px; }
  input[type="color"] { width: 52px; height: 40px; }
  .x { min-width: 44px; min-height: 44px; font-size: 24px; }
  .linkbtn { min-height: 32px; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .grid2 { grid-template-columns: 1fr; gap: 0; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 8px 12px; }
  .kpi .v { font-size: 19px; }
  .toolbar .sel { flex: 1 1 140px; min-width: 0; }
  .toolbar .grow { flex: 1 1 170px; }
  .toolbar > .btn[data-act="icf-overdue"] { flex: 0 0 auto; }
  .toolbar .tb-gap { display: none; }
  .toolbar > .btn { flex: 1 1 auto; }
  .chipx { min-height: 36px; }
  .chipx button { min-width: 34px; min-height: 34px; }
  .sec { padding: 12px; }
  .hero { padding: 14px; }
  .hero h2 { font-size: 16px; }
  .hero-acts .btn { flex: 1 1 auto; }
  .cards { grid-template-columns: 1fr; }
  .pairs { grid-template-columns: 1fr; }

  /* matrix: its own scroll box (sticky header row + discipline column); names shortened */
  .mx-box { max-height: 70vh; margin-bottom: 14px; }
  .mx thead th { min-width: 44px; height: 36px; }
  .mx tbody th { padding: 0 8px; }
  .mx tbody th .nm { max-width: 76px; font-size: 10px; }
  .mx-c { width: 44px; height: 42px; }

  /* tables become small cards: first cell full width, the rest flow with their label (data-l) */
  table.tbl.stack, table.tbl.stack tbody { display: block; width: 100%; }
  table.tbl.stack thead { display: none; }
  table.tbl.stack tr { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 14px; padding: 10px 12px; border-bottom: 1px solid #111A2A; }
  table.tbl.stack td { display: block; padding: 0; border: none; min-width: 0; max-width: 100%; }
  table.tbl.stack td:first-child, table.tbl.stack td.full { flex: 1 1 100%; }
  table.tbl.stack td.subj { min-width: 0; }
  table.tbl.stack td[data-l]::before { content: attr(data-l); display: block; font-size: 9px; font-weight: 700; letter-spacing: 1px;
    text-transform: uppercase; color: #4A6080; margin-bottom: 2px; }
  table.tbl.stack td.acts { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px; text-align: left; white-space: normal; }
  table.tbl.stack td.acts .btn + .btn { margin-left: 0; }
  table.tbl.stack td.acts .btn { flex: 1 1 auto; }
  table.tbl.stack td .inp, table.tbl.stack td .sel { width: 100%; }
  table.tbl.stack td .inp.num { width: 90px; }
  table.tbl.stack td.c-name { flex: 1 1 100%; }
  table.tbl-set td.c-name .inp { min-width: 0; }
  table.tbl.stack tbody tr:hover td { background: none; }
  /* register cards: "ID · document no." on one line, then the title, then the rest */
  table.tbl.stack.reg td.c-id { flex: 0 0 auto; width: auto; }
  table.tbl.stack.reg td.c-id::before, table.tbl.stack.reg td.c-id + td::before { display: none; }
  table.tbl.stack.reg td.c-id + td { flex: 1 1 auto; }
  table.tbl.stack tr.grp { padding: 0; border: none; }
  table.tbl.stack tr.grp th { display: block; width: 100%; }
  .segs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
  .segs::-webkit-scrollbar { display: none; }
  .seg { flex: 0 0 auto; min-height: 40px; }
  .imp-k { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .imp-tbl { max-height: none; }
  .yn-grid { grid-template-columns: 1fr 1fr; }
  .add-row { grid-template-columns: 1fr 1fr; }
  .add-row .fld.nm { grid-column: 1 / -1; }
  .add-row .btn { grid-column: 1 / -1; }

  /* layers: dialogs inside the safe area (100vw - 24px), sheets full screen; header + footer pinned */
  .ov { padding: calc(10px + env(safe-area-inset-top)) 12px calc(10px + env(safe-area-inset-bottom)); align-items: center; }
  .sheet, .ov.wide .sheet { width: 100%; max-height: 100%; }
  .ov.full { padding: 0; }
  .ov.full .sheet { width: 100%; height: 100%; max-height: none; border: none; border-radius: 0; }
  .ov.full .sh { border-radius: 0; padding-top: calc(6px + env(safe-area-inset-top)); padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(6px, env(safe-area-inset-right)); }
  .ov.full .sf { border-radius: 0; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .ov.full .sb:last-child { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .sh { padding: 4px 4px 4px 14px; }
  .sb { padding: 12px 14px; }
  .sf { padding: 10px 14px; }
  .sf .sf-gap { display: none; }
  .sf .btn { flex: 1 1 auto; min-height: 44px; }
  .sh-chips .st:nth-child(n+2) { display: none; }
  .kv { grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 10px 12px; }
  .kv .wide2 { grid-column: 1 / -1; }
  .tl-s { flex-wrap: wrap; gap: 6px; }
  .tl-sig { width: auto; flex: 1 1 100%; justify-content: flex-start; }
  .tl-sig:empty { display: none; }
  .cbox { flex-direction: column; align-items: stretch; }
  .sigpad { height: 170px; }
  .files li .btn { min-height: 36px; }
  .noacc { margin-top: 4vh; padding: 22px 16px; }
  .kpis.kpis6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lvt { max-width: 100%; }
  .rf { white-space: normal; overflow-wrap: anywhere; }
  table.reg tr.grp.sub th { padding-left: 12px; }
  .sc-filters { align-items: stretch; }
  .sc-cut { flex: 1 1 100%; }
  .lrow { flex-direction: column; }

  .toast { bottom: calc(18px + env(safe-area-inset-bottom)); }
}
