/* OcSS by Oviqa - V1 prototype. Light-blue theme. */
:root {
  --bg: #F3F8FC;
  --surface: #FFFFFF;
  --sky-50: #EEF6FD;
  --sky-100: #DDEEFB;
  --sky-200: #BCDDF4;
  --sky-300: #8EC6EC;
  --blue: #2381CF;
  --blue-600: #1A6CB2;
  --blue-700: #145890;
  --ink: #0F2537;
  --ink-2: #2A4256;
  --muted: #5C7083;
  --faint: #8FA0B0;
  --line: #DCE6EF;
  --line-2: #C9D7E4;
  --brand: #0B4F63;
  --lime: #A6D936;

  --red: #C2412D;   --red-bg: #FDEDEA;
  --amber: #B7740B; --amber-bg: #FDF3DF;
  --green: #23845A; --green-bg: #E5F5EC;
  --violet: #6A4FB6; --violet-bg: #F0ECFA;
  --grey-bg: #EEF2F6;

  --g-id: #1F3B57;  --g-id-bg: #E6EDF4;
  --g-ms: #2366B0;  --g-ms-bg: #E3EEFA;
  --g-ds: #2F7A55;  --g-ds-bg: #E4F2EA;
  --g-tm: #1677B5;  --g-tm-bg: #E1F0FA;
  --g-sf: #A2522A;  --g-sf-bg: #F8EAE2;
  --g-qr: #6A4FB6;  --g-qr-bg: #EEEAF9;
  --g-rv: #3F4A55;  --g-rv-bg: #ECEFF2;
  --g-ag: #1B87B8;  --g-ag-bg: #E0F2FA;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-sm: 6px; --r: 10px; --r-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 37, 55, .06);
  --shadow: 0 1px 2px rgba(15, 37, 55, .05), 0 8px 24px rgba(15, 37, 55, .07);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- buttons, chips ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: var(--sky-300); background: var(--sky-50); text-decoration: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-600); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--grey-bg); color: var(--ink-2); white-space: nowrap; }
.chip.blue { background: var(--sky-100); color: var(--blue-700); }
.chip.red { background: var(--red-bg); color: var(--red); }
.chip.amber { background: var(--amber-bg); color: var(--amber); }
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.violet { background: var(--violet-bg); color: var(--violet); }
.chip.planned { background: transparent; border: 1px dashed var(--line-2); color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

/* ---------- shell ---------- */
.top { position: sticky; top: 0; z-index: 30; height: 56px; display: flex; align-items: center; gap: 18px; padding: 0 20px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; display: block; }
.brand b { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--brand); }
.brand span { font-size: 12px; color: var(--muted); }
.top nav { display: flex; gap: 4px; margin-left: 12px; }
.top nav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.top nav a:hover { background: var(--sky-50); color: var(--ink); text-decoration: none; }
.top nav a.on { background: var(--sky-100); color: var(--blue-700); }
.top .sp { flex: 1; }
.study-pill { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.study-pill b { font-weight: 600; }
.user { position: relative; }
.user > button { display: flex; align-items: center; gap: 10px; border: 0; background: none; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.user > button:hover { background: var(--sky-50); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--sky-100); color: var(--blue-700); display: grid; place-items: center; font-weight: 600; font-size: 12px; }
.user .who { text-align: left; line-height: 1.2; }
.user .who small { display: block; color: var(--muted); font-size: 11.5px; }
.menu { position: absolute; right: 0; top: 44px; width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: none; }
.menu.open { display: block; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: left; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.menu button:hover { background: var(--sky-50); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.main { padding: 20px 20px 48px; max-width: 1640px; margin: 0 auto; }
.foot-note { text-align: center; color: var(--faint); font-size: 12px; padding: 0 20px 24px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login .art { background: linear-gradient(160deg, #E4F1FC 0%, #CFE6F8 55%, #BCDDF4 100%); padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; position: relative; }
.login .art h1 { font-size: 40px; line-height: 1.1; max-width: 520px; margin-top: 56px; font-weight: 650; }
.login .art p { color: var(--ink-2); font-size: 16px; max-width: 480px; }
.login .steps { display: grid; gap: 10px; max-width: 460px; margin-top: 28px; }
.login .steps div { display: flex; gap: 12px; align-items: center; background: rgba(255, 255, 255, .7); border: 1px solid rgba(255, 255, 255, .9); padding: 12px 14px; border-radius: 12px; font-weight: 500; }
.login .steps i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 12.5px; font-weight: 600; flex: none; }
.login .form { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.login form { width: 100%; max-width: 380px; display: grid; gap: 16px; }
.login form h2 { font-size: 24px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field input, .field select { height: 42px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 12px; background: #fff; }
.field input:focus, .field select:focus { outline: 2px solid var(--sky-200); border-color: var(--blue); }
.hint { font-size: 12.5px; color: var(--muted); }
.roles { display: grid; gap: 8px; }
.role { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.role input { margin-top: 3px; }
.role b { display: block; font-weight: 600; font-size: 13.5px; }
.role span { font-size: 12.5px; color: var(--muted); }
.role:has(input:checked) { border-color: var(--blue); background: var(--sky-50); }
.or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* ---------- page heads, cards ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 650; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card.pad { padding: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.eyebrow { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--blue-600); }

/* studies */
.studies { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.study-card { padding: 22px; display: grid; gap: 14px; }
.study-card .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat { background: var(--sky-50); border-radius: 10px; padding: 10px 12px; }
.stat b { font-size: 20px; display: block; }
.stat span { font-size: 12px; color: var(--muted); }
.road { display: grid; gap: 10px; }
.road .card { padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start; }
.road .card.dim { background: transparent; border-style: dashed; box-shadow: none; }
.road .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--sky-100); color: var(--blue-700); display: grid; place-items: center; flex: none; }
.road h3 { font-size: 15px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.road p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.empty { padding: 36px; text-align: center; color: var(--muted); }

/* ---------- upload / scanner ---------- */
.flow { display: flex; gap: 8px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.flow .st { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--muted); font-weight: 500; }
.flow .st i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--grey-bg); font-size: 12px; }
.flow .st.on { color: var(--blue-700); border-color: var(--sky-300); background: var(--sky-50); }
.flow .st.on i { background: var(--blue); color: #fff; }
.flow .st.done i { background: var(--green); color: #fff; }
.flow .ln { width: 24px; border-top: 1px solid var(--line-2); }
.upload { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.drop { border: 2px dashed var(--sky-300); border-radius: var(--r-lg); background: var(--sky-50); padding: 40px 24px; text-align: center; display: grid; gap: 10px; place-items: center; transition: background .15s, border-color .15s; }
.drop.over { background: var(--sky-100); border-color: var(--blue); }
.drop .big { width: 56px; height: 56px; border-radius: 16px; background: #fff; display: grid; place-items: center; color: var(--blue); box-shadow: var(--shadow-sm); }
.drop .big svg { width: 26px; height: 26px; }
.drop h2 { font-size: 18px; }
.drop p { margin: 0; color: var(--muted); font-size: 13.5px; max-width: 460px; }
.spec { padding: 18px 20px; display: grid; gap: 12px; align-content: start; }
.spec h3 { font-size: 14px; }
.spec table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.spec td { padding: 6px 4px; border-top: 1px solid var(--line); vertical-align: top; }
.spec td:first-child { font-weight: 600; width: 92px; }
.samples { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.scan { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.files { padding: 14px; }
.files h3 { font-size: 13px; margin: 2px 4px 10px; color: var(--muted); font-weight: 600; }
.file { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; font-size: 13px; }
.file:nth-child(odd) { background: var(--sky-50); }
.file .tag { width: 64px; font-weight: 600; font-size: 12px; }
.file .n { margin-left: auto; color: var(--muted); font-size: 12px; }
.checks { padding: 6px 0; }
.check { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); align-items: start; opacity: .35; transition: opacity .25s; }
.check:first-child { border-top: 0; }
.check.run { opacity: 1; }
.check .st { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--grey-bg); color: var(--muted); }
.check.ok .st { background: var(--green-bg); color: var(--green); }
.check.warn .st { background: var(--amber-bg); color: var(--amber); }
.check.err .st { background: var(--red-bg); color: var(--red); }
.check h4 { font-size: 14px; font-weight: 600; }
.check p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.check ul { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); }
.check .cnt { font-size: 12px; color: var(--muted); white-space: nowrap; }
.verdict { padding: 18px 20px; display: flex; align-items: center; gap: 16px; border-radius: var(--r-lg); margin-bottom: 16px; }
.verdict.ok { background: var(--green-bg); border: 1px solid #BFE3CF; }
.verdict.err { background: var(--red-bg); border: 1px solid #F3C8BF; }
.verdict .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #fff; flex: none; }
.verdict.ok .ic { color: var(--green); } .verdict.err .ic { color: var(--red); }
.verdict h2 { font-size: 16px; }
.verdict p { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }
.verdict .act { margin-left: auto; display: flex; gap: 8px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--sky-200); border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- study status ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; text-align: left; cursor: pointer; display: grid; gap: 2px; }
.kpi:hover { border-color: var(--sky-300); background: var(--sky-50); }
.kpi b { font-size: 22px; font-weight: 650; line-height: 1.2; }
.kpi span { font-size: 12px; color: var(--muted); }
.kpi.red b { color: var(--red); } .kpi.amber b { color: var(--amber); } .kpi.blue b { color: var(--blue-600); }
.tools { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 8px; height: 34px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 10px; background: #fff; width: 220px; color: var(--muted); }
.search input { border: 0; outline: 0; width: 100%; background: none; }
.seg { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 3px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--sky-50); }
.seg button { height: 28px; padding: 0 14px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.55); cursor: pointer; font-size: 13px; line-height: 1; color: var(--muted); font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.seg button:hover { color: var(--ink); border-color: var(--line-2); background: #fff; }
.seg button.on { background: #fff; border-color: var(--sky-300); color: var(--blue-700); font-weight: 600; box-shadow: 0 1px 2px rgba(16,36,58,.08); }
.head-actions { display: flex; align-items: center; gap: 8px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.legend { margin-left: auto; display: flex; gap: 14px; font-size: 12px; color: var(--muted); align-items: center; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-flag { width: 0; height: 0; border-top: 8px solid var(--red); border-left: 8px solid transparent; }
.lg-pend { color: var(--amber); font-weight: 700; }
.viewnote { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 10px; background: var(--sky-50); border: 1px solid var(--sky-200); font-size: 13px; color: var(--blue-700); margin-bottom: 10px; }

.tbl-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); overflow: hidden; }
.tbl-scroll { max-height: calc(100vh - 290px); min-height: 360px; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--sky-300) transparent; }
table.status { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 12px; font-variant-numeric: tabular-nums; }
table.status td.dt { font-size: 11.5px; letter-spacing: -0.01em; padding: 0 1px; }
table.status thead th { position: sticky; z-index: 2; background: #fff; font-weight: 600; text-align: center; color: var(--ink-2); }
table.status thead tr.grp th { top: 0; height: 28px; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--line); border-top: 3px solid; }
table.status thead tr.cols th { top: 31px; height: 40px; font-size: 11px; line-height: 1.15; padding: 4px 3px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
table.status thead tr.cols th:hover { color: var(--blue-700); background: var(--sky-50) !important; }
table.status td { height: 38px; padding: 0 2px; text-align: center; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.status td.wrap { white-space: normal; line-height: 1.15; }
table.status tbody tr:hover td { background: var(--sky-50); }
table.status td:hover { box-shadow: inset 0 0 0 2px var(--sky-300); }
table.status td.gs, table.status th.gs { border-left: 1px solid var(--line-2); }
table.status td.flag::after { content: ""; position: absolute; top: 0; right: 0; border-top: 9px solid var(--red); border-left: 9px solid transparent; }
table.status td.flag.med::after { border-top-color: var(--amber); }
table.status td.flag.done::after { border-top-color: var(--green); }
table.status tr.nmi td:first-child { box-shadow: inset 3px 0 0 var(--g-ag); }
.subj { font-weight: 600; color: var(--blue-700); }
.muted { color: var(--faint); }
.pend { color: var(--amber); font-weight: 700; margin-left: 2px; }
.q-open { color: var(--red); font-weight: 700; }
.q-ans { color: var(--amber); font-weight: 700; }
.q-closed { color: var(--muted); font-weight: 600; }
.yes { color: var(--green); display: inline-flex; }
.yes svg { width: 15px; height: 15px; stroke-width: 2.6; }
.disp { display: inline-flex; align-items: flex-start; gap: 5px; max-width: 100%; font-size: 11.5px; text-align: left; line-height: 1.15; }
.disp .dot { margin-top: 4px; }
table.status td.wrap { padding: 0 2px 0 4px; }
.disp { gap: 4px; letter-spacing: -0.01em; }
.disp .dot { width: 6px; height: 6px; }
.d-ok { color: var(--green); } .d-sf { color: var(--muted); } .d-wd { color: var(--amber); } .d-ae { color: var(--red); } .d-ot { color: var(--violet); }
.disp span { color: var(--ink); }
@media (max-width: 1500px) { .main { padding-left: 14px; padding-right: 14px; } table.status { font-size: 11.5px; } table.status td.dt { font-size: 10.8px; } .disp { font-size: 10.6px; } table.status thead tr.cols th { font-size: 10.5px; } }
.pill-red { display: inline-block; padding: 1px 4px; border-radius: 99px; background: var(--red-bg); color: var(--red); font-weight: 600; font-size: 10.5px; }
.pill-ag { display: inline-block; padding: 1px 4px; border-radius: 99px; background: var(--g-ag-bg); color: var(--g-ag); font-weight: 600; font-size: 11px; }
.note-ic { color: var(--blue-600); display: inline-flex; }
.tbl-foot { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); background: #FBFDFF; }

/* subject cards (narrow screens) */
.cards { display: none; gap: 10px; }
.scard { padding: 14px; }
.scard header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.scard dl { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 0; font-size: 12.5px; }
.scard dt { color: var(--muted); }
.scard dd { margin: 0; text-align: right; cursor: pointer; }

/* ---------- report ---------- */
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 12px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs svg { width: 13px; height: 13px; }
.rep-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; }
.rep-head h1 { font-size: 24px; font-weight: 650; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.rep-head .val { font-size: 15px; font-weight: 600; padding: 4px 10px; border-radius: 8px; background: var(--sky-100); color: var(--blue-700); }
.rep-head .meta { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }
.agent-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 99px; background: var(--g-ag-bg); color: #0F6C95; font-weight: 600; font-size: 12.5px; }
.agent-chip i { width: 22px; height: 22px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.agent-chip i svg { width: 13px; height: 13px; }
.rep { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.rep .col { display: grid; gap: 16px; }
.sec { padding: 18px 20px; }
.sec > h2 { font-size: 15px; font-weight: 650; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.sec > h2 small { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.summary { font-size: 15px; line-height: 1.6; color: var(--ink-2); margin: 0; }
.summary b { color: var(--ink); }
.finding { border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 10px; padding: 12px 14px; display: grid; gap: 4px; }
.finding + .finding { margin-top: 10px; }
.finding.med { border-left-color: var(--amber); }
.finding.low { border-left-color: var(--sky-300); }
.finding.done { border-left-color: var(--green); background: #FAFEFB; }
.finding h3 { font-size: 14px; font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.finding p { margin: 0; font-size: 13px; color: var(--ink-2); }
.finding .rule { font-size: 12px; color: var(--muted); }
.ok-box { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 10px; background: var(--green-bg); color: var(--green); font-weight: 500; font-size: 13.5px; }
.ev { margin-top: 14px; }
.ev:first-of-type { margin-top: 0; }
.ev h3 { font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.dom { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 5px; background: var(--sky-100); color: var(--blue-700); letter-spacing: .03em; }
.ev-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ev-tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; padding: 6px 8px; background: var(--sky-50); border-bottom: 1px solid var(--line); }
.ev-tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ev-tbl tr.hl td { background: #FFF8EC; }
.ev-tbl tr.hl-red td { background: #FEF1EE; }
.ev-tbl tr.click { cursor: pointer; }
.ev-tbl tr.click:hover td { background: var(--sky-50); }
.chk { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.chk:first-of-type { border-top: 0; }
.chk .s { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.chk .s svg { width: 12px; height: 12px; stroke-width: 3; }
.chk.ok .s { background: var(--green-bg); color: var(--green); }
.chk.bad .s { background: var(--red-bg); color: var(--red); }
.chk.na .s { background: var(--grey-bg); color: var(--faint); }
.chk small { display: block; color: var(--muted); font-size: 12px; }
.glance { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 13px; margin: 0; }
.glance dt { color: var(--muted); }
.glance dd { margin: 0; text-align: right; font-weight: 500; }
.decide { display: grid; gap: 8px; }
.decide select, .decide textarea { width: 100%; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; background: #fff; }
.decide textarea { min-height: 64px; resize: vertical; }
.audit { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 12.5px; }
.audit li { display: grid; grid-template-columns: 10px 1fr; gap: 10px; }
.audit li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sky-300); margin-top: 5px; }
.audit small { color: var(--muted); display: block; }
.links { display: grid; gap: 2px; }
.links a { display: flex; justify-content: space-between; gap: 8px; padding: 7px 8px; border-radius: 8px; font-size: 13px; color: var(--ink-2); }
.links a:hover { background: var(--sky-50); text-decoration: none; }
.links a.cur { background: var(--sky-100); color: var(--blue-700); font-weight: 600; }
.timeline { position: relative; height: 92px; margin: 6px 8px 0; }
.timeline .bar { position: absolute; left: 0; right: 0; top: 34px; border-top: 2px solid var(--line-2); }
.timeline .pt { position: absolute; top: 0; transform: translateX(-50%); text-align: center; font-size: 11.5px; width: 92px; }
.timeline .pt i { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--blue); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--blue); margin: 27px auto 6px; }
.timeline .pt.bad i { background: var(--red); box-shadow: 0 0 0 1px var(--red); }
.timeline .pt b { display: block; font-weight: 600; }
.timeline .pt span { color: var(--muted); }
.timeline .pt.up { top: -2px; }
.bars { display: grid; gap: 8px; }
.bars .row { display: grid; grid-template-columns: 170px 1fr 40px; gap: 10px; align-items: center; font-size: 13px; }
.bars .track { height: 10px; background: var(--sky-50); border-radius: 99px; overflow: hidden; }
.bars .fill { height: 100%; background: var(--blue); border-radius: 99px; }
.bars .row b { text-align: right; }
.prov { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }

/* ---------- agents page ---------- */
.ag-groups { display: grid; gap: 22px; }
.ag-group h2 { font-size: 15px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.ag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.ag-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: stretch; }
.agent { padding: 16px; display: flex; flex-direction: column; gap: 8px; height: 100%; }
.agent p { min-height: 3.9em; }
.agent header { display: flex; align-items: center; gap: 10px; }
.agent .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--g-ag-bg); color: var(--g-ag); display: grid; place-items: center; flex: none; }
.agent h3 { font-size: 14.5px; }
.agent p { margin: 0; font-size: 13px; color: var(--muted); }
.agent .cols { display: flex; flex-wrap: wrap; gap: 4px; }
.agent .cols a { font-size: 11.5px; padding: 2px 7px; border-radius: 6px; background: var(--sky-50); color: var(--blue-700); }
.agent.idle { background: transparent; border-style: dashed; box-shadow: none; }
.agent .foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; margin-top: auto; }
.flowline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-bottom: 22px; }
.flowline div { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); position: relative; }
.flowline div:first-child { border-radius: 12px 0 0 12px; }
.flowline div:last-child { border-radius: 0 12px 12px 0; background: var(--sky-50); }
.flowline div + div { border-left: 0; }
.flowline b { display: block; font-size: 13.5px; }
.flowline span { font-size: 12.5px; color: var(--muted); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; opacity: 0; transition: .25s; z-index: 50; pointer-events: none; }
.toast.on { opacity: 1; transform: translateX(-50%); }

@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .rep { grid-template-columns: 1fr; }
}
@media (max-width: 1099px) {
  .tbl-wrap { display: none; }
  .cards { display: grid; }
  .legend { display: none; }
  .upload, .scan, .studies { grid-template-columns: 1fr; }
  .top nav { display: none; }
  .study-pill { display: none; }
}
@media (max-width: 760px) {
  .login { grid-template-columns: 1fr; }
  .login .art { display: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .user .who { display: none; }
  .flowline { grid-template-columns: 1fr 1fr; }
  .study-card .stats { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 14px 14px 40px; }
  .verdict { flex-wrap: wrap; } .verdict .act { margin-left: 0; }
  .bars .row { grid-template-columns: 110px 1fr 32px; }
}

@media (max-width: 1400px) { table.status td.dt { font-size: 10.3px; letter-spacing: -0.02em; } table.status { font-size: 11px; } }

.tl { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding: 4px 0; }
.tl-pt { flex: 1; min-width: 96px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; background: #fff; }
.tl-pt i { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.tl-pt b { font-size: 13px; } .tl-pt span { font-size: 12.5px; color: var(--muted); }
.tl-pt.bad { border-color: #F0B7AA; background: var(--red-bg); } .tl-pt.bad i { background: var(--red); }
.tl-pt.cur { box-shadow: 0 0 0 2px var(--sky-300); }
.tl-gap { align-self: center; font-size: 11.5px; color: var(--muted); padding: 0 8px; white-space: nowrap; position: relative; }
.tl-gap::before { content: ""; display: block; border-top: 1px dashed var(--line-2); margin-bottom: 4px; }
@media (max-width: 1400px) {
  .disp .dot { display: none; }
  .disp.d-ok span { color: var(--green); } .disp.d-sf span { color: var(--muted); } .disp.d-wd span { color: var(--amber); } .disp.d-ae span { color: var(--red); } .disp.d-ot span { color: var(--violet); }
}

@media (max-width: 1099px) { .ag-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .ag-grid { grid-template-columns: minmax(0, 1fr); } .agent p { min-height: 0; } }

/* 30-column table on smaller laptops */
@media (max-width: 1350px) { table.status { font-size: 10.6px; } table.status td { padding-left: 1px; padding-right: 1px; } table.status td.dt { font-size: 9.9px; letter-spacing: -0.035em; } .pill-red { font-size: 9.8px; padding: 1px 3px; } }

/* =====================================================================
   v2 (25-Nov): raw-data path, Excel-style study table, report menus, agent workbooks
   ===================================================================== */
:root { --grid: #C3CFDB; --grid-strong: #6F8396; --x-g1: #FCE4D6; --x-g1-ink: #B23B1E; --x-g2: #DDEBF7; --x-g2-ink: #1F4E79; --x-g3: #E2EFDA; --x-g3-ink: #375623; --x-g4: #FFF2CC; --x-g4-ink: #7F6000; --x-g5: #EDEDED; --x-g5-ink: #404040; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; background: var(--sky-100); color: var(--blue-700); letter-spacing: .02em; }

/* upload: two paths */
.paths { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.path-card { display: flex; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.path-card b { font-size: 14.5px; }
.path-card p { margin: 3px 0 8px; font-size: 13px; color: var(--muted); }
.pc-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--sky-100); color: var(--blue-700); display: grid; place-items: center; flex: none; }
.pc-flow { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.pc-flow span { padding: 2px 8px; border-radius: 99px; background: var(--grey-bg); }
.pc-flow span.hl { background: var(--sky-100); color: var(--blue-700); font-weight: 600; }
.pc-flow svg { width: 12px; height: 12px; color: var(--faint); }

/* raw mapping */
.map-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; margin-bottom: 12px; border: 1px solid; }
.map-banner.warn { background: var(--amber-bg); border-color: #EED8A8; }
.map-banner.ok { background: var(--green-bg); border-color: #BFE3CF; }
.map-banner .ic { width: 32px; height: 32px; border-radius: 10px; background: #fff; display: grid; place-items: center; flex: none; }
.map-banner.warn .ic { color: var(--amber); } .map-banner.ok .ic { color: var(--green); }
.map-banner b { display: block; font-size: 14px; } .map-banner span { font-size: 12.5px; color: var(--ink-2); }
.map-banner .btn { margin-left: auto; }
.map { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 14px; align-items: start; }
.mfiles { padding: 12px; display: grid; gap: 4px; position: sticky; top: 72px; }
.mfiles h3 { font-size: 12.5px; color: var(--muted); font-weight: 600; margin: 2px 6px 6px; }
.mfile { display: grid; grid-template-columns: 18px 1fr auto auto; gap: 8px; align-items: center; text-align: left; padding: 8px; border: 1px solid transparent; border-radius: 9px; background: none; cursor: pointer; }
.mfile:hover { background: var(--sky-50); }
.mfile.on { background: var(--sky-50); border-color: var(--sky-200); }
.mfile b { display: block; font-size: 12.5px; font-weight: 600; } .mfile small { font-size: 11.5px; color: var(--muted); }
.mfile .doms { display: flex; gap: 3px; }
.mfile .need { min-width: 20px; height: 20px; border-radius: 99px; background: var(--amber); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.mfile .okk { color: var(--green); display: grid; place-items: center; }
.mmain { padding: 0 16px 16px; min-width: 0; }
.mtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 -16px 14px; padding: 0 12px; overflow-x: auto; }
.mtabs button { border: 0; background: none; padding: 12px 12px 10px; font-weight: 600; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.mtabs button.on { color: var(--blue-700); border-bottom-color: var(--blue); }
.mblock { overflow-x: auto; }
.mblock + .mblock { margin-top: 18px; }
.mblock h4 { font-size: 13.5px; display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.mblock h4 small { font-weight: 500; color: var(--muted); font-size: 12px; }
.mtbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mtbl th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 7px 8px; background: var(--sky-50); border: 1px solid var(--line); white-space: nowrap; }
.mtbl td { padding: 6px 8px; border: 1px solid var(--line); vertical-align: middle; }
.mtbl td svg { width: 12px; height: 12px; color: var(--faint); }
.mtbl code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; background: var(--grey-bg); padding: 1px 5px; border-radius: 4px; color: var(--ink); white-space: nowrap; }
.mtbl tr.need td { background: #FFFAEF; }
.mtbl tr.der td { color: var(--muted); background: #FBFCFE; }
.conf { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.conf i { display: block; width: 52px; height: 6px; border-radius: 99px; background: var(--grey-bg); overflow: hidden; position: relative; }
.conf i u { display: block; height: 100%; border-radius: 99px; }
.conf.hi u { background: var(--green); } .conf.mid u { background: var(--blue); } .conf.lo u { background: var(--amber); }
.conf b { font-size: 11.5px; font-weight: 600; width: 32px; }
.mout { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.mout button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 5px 8px; cursor: pointer; font-size: 12px; color: var(--muted); }
.mout button.on { border-color: var(--sky-300); background: var(--sky-50); color: var(--blue-700); }
.mprev { overflow-x: auto; }
.mprev .mtbl td { white-space: nowrap; }

/* ---------- study table: Excel-style grid ---------- */
.tbl-wrap { border: 1px solid var(--grid-strong); }
table.status td { border-bottom: 1px solid var(--grid); border-right: 1px solid var(--grid); }
table.status thead tr.grp th { border-right: 1px solid var(--grid-strong); border-bottom: 1px solid var(--grid-strong); }
table.status thead tr.cols th { border-right: 1px solid var(--grid); border-bottom: 2px solid var(--grid-strong); }
table.status td.gs, table.status th.gs { border-left: 1px solid var(--grid-strong); }
table.status tr > :last-child { border-right: 0; }
table.status td.fixed { cursor: default; }
table.status td.fixed:hover { box-shadow: none; }
table.status thead th.fixed { cursor: default; }
table.status thead tr.cols th.fixed:hover { color: var(--ink-2); background: #fff !important; }
table.status thead tr.grp th[data-grp] { cursor: pointer; }
table.status thead tr.grp th[data-grp]:hover { filter: brightness(.96); text-decoration: underline; text-underline-offset: 3px; }
table.status tbody tr:nth-child(even) td { background: #FAFCFE; }
table.status tbody tr:hover td { background: var(--sky-50); }
table.status td[data-col="subject"]:hover .subj { text-decoration: underline; }
.lg-click { color: var(--blue-700); font-weight: 500; }
.lg-click svg { width: 13px; height: 13px; }

/* ---------- report menu ---------- */
.pop { position: fixed; z-index: 60; width: 340px; max-width: calc(100vw - 16px); background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 37, 55, .18); padding: 6px; animation: pop .12s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.pop-h { padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.pop-h b { display: block; font-size: 13.5px; }
.pop-h span { font-size: 12px; color: var(--muted); }
.pop-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 600; padding: 8px 10px 4px; }
.pop-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink); }
.pop-item:hover, .pop-item:focus { background: var(--sky-50); text-decoration: none; outline: none; }
.pop-item.off { opacity: .55; cursor: default; }
.pop-item.off:hover { background: none; }
.pi-ic { width: 30px; height: 30px; border-radius: 8px; background: var(--sky-100); color: var(--blue-700); display: grid; place-items: center; flex: none; }
.pi-ic.star { background: var(--blue); color: #fff; }
.pi-t { flex: 1; min-width: 0; }
.pi-t b { display: block; font-size: 13px; font-weight: 600; }
.pi-t small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.3; }

/* ---------- workbook ---------- */
.wb-head { margin-bottom: 12px; }
.subj-pick { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--muted); }
.subj-pick select { border: 0; background: none; font-weight: 600; color: var(--ink); outline: 0; }
.needs { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 12px; background: var(--amber-bg); border: 1px solid #EED8A8; margin-bottom: 12px; color: var(--amber); }
.needs b { display: block; color: var(--ink); } .needs span { font-size: 13px; color: var(--ink-2); }
.wbook { overflow: hidden; }
.sheet-tabs { display: flex; gap: 2px; padding: 8px 10px 0; background: #F4F7FA; border-bottom: 1px solid var(--grid); overflow-x: auto; scrollbar-width: thin; }
.sheet-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; margin-bottom: -1px; }
.sheet-tabs a:hover { color: var(--ink); background: #fff; text-decoration: none; }
.sheet-tabs a.on { background: #fff; border-color: var(--grid); color: #1E6B3F; font-weight: 600; box-shadow: inset 0 3px 0 #217346; }
.sheet-tabs .cnt { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.sheet-tabs .cnt.amber { background: var(--amber); }
.sheet-pop { padding: 10px 16px; font-size: 12.5px; color: var(--ink-2); border-bottom: 1px solid var(--line); background: #FCFDFE; }
.sheet-body { padding: 16px; }
.wb-scroll { overflow-x: auto; scrollbar-width: thin; }
.wb-notes { padding: 0 16px 14px; }
.wb-notes p { margin: 2px 0; font-size: 12px; color: var(--muted); }
table.wb { border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; min-width: 100%; }
table.wb th, table.wb td { border: 1px solid #A6B4C2; padding: 5px 9px; }
table.wb th { font-weight: 700; text-align: center; vertical-align: middle; white-space: pre-line; background: #F2F5F8; color: var(--ink); font-size: 12px; }
table.wb.list th.ch { background: #E9EFF5; text-align: left; white-space: nowrap; }
table.wb td { text-align: center; vertical-align: top; }
table.wb.list td { text-align: left; white-space: nowrap; }
table.wb td.wrap { white-space: normal; min-width: 220px; max-width: 360px; }
table.wb td.lab { text-align: left; white-space: normal; min-width: 280px; }
table.wb.summary td:not(.lab) { white-space: nowrap; min-width: 84px; }
table.wb tr.sec td { background: #EEF2F6; font-weight: 700; text-align: left; }
table.wb tr.l1 td.lab { padding-left: 14px; }
table.wb tr.l2 td.lab { padding-left: 30px; }
table.wb tr.l3 td.lab { padding-left: 48px; color: var(--ink-2); font-size: 12px; }
table.wb tr.socrow td.lab { font-weight: 600; }
table.wb tr.miss td { color: var(--amber); font-style: italic; }
table.wb tr.flag td.lab { color: var(--red); }
table.wb th.corner { background: #FFFF00; color: var(--ink); min-width: 280px; text-align: left; font-size: 13px; }
table.wb th.gh { font-size: 12.5px; }
table.wb th.g1 { background: var(--x-g1); color: var(--x-g1-ink); } table.wb th.g2 { background: var(--x-g2); color: var(--x-g2-ink); } table.wb th.g3 { background: var(--x-g3); color: var(--x-g3-ink); }
table.wb th.g4 { background: var(--x-g4); color: var(--x-g4-ink); } table.wb th.g5 { background: var(--x-g5); color: var(--x-g5-ink); }
table.wb th.t-id, table.wb th.t-ms, table.wb th.t-ds, table.wb th.t-tm, table.wb th.t-sf, table.wb th.t-qr, table.wb th.t-rv { color: #fff; text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }
table.wb th.t-id { background: var(--g-id); } table.wb th.t-ms { background: var(--g-ms); } table.wb th.t-ds { background: var(--g-ds); } table.wb th.t-tm { background: var(--g-tm); } table.wb th.t-sf { background: var(--g-sf); } table.wb th.t-qr { background: var(--g-qr); } table.wb th.t-rv { background: var(--g-rv); }
table.wb tbody tr:hover td { background: #F5F9FD; }
table.wb tr.sec:hover td { background: #EEF2F6; }
table.wb tr.sf td { background: #F3F3F3; color: #555; }
table.wb tr.hl td { background: #FFF4CE !important; }
table.wb tr.hl td:first-child { box-shadow: inset 4px 0 0 var(--amber); }
table.wb tr.rev td { background: #FFFBF0; }
table.wb tr.dim td { color: var(--faint); }
table.wb tr.empty td { text-align: center; color: var(--muted); padding: 22px; white-space: normal; font-style: italic; }
table.wb td.subj { font-weight: 600; color: var(--blue-700); }
table.wb td.subj.link { cursor: pointer; text-decoration: underline; text-decoration-color: var(--sky-300); text-underline-offset: 2px; }
table.wb td.b { font-weight: 600; }
table.wb td.good { color: var(--green); font-weight: 600; }
table.wb td.bad { color: var(--red); font-weight: 600; }
table.wb td.warn { color: var(--amber); font-weight: 600; }
table.wb td.small { font-size: 11px; color: var(--muted); }
table.wb td.small.warn { color: var(--amber); }
table.wb td.fc { font-weight: 700; font-size: 11.5px; }
table.wb td.fc.err { color: var(--red); background: #FEF3F1; }
table.wb td.fc.rev { color: var(--amber); background: #FFF9EB; }
table.wb td.fc.ok { color: var(--green); background: #F1FAF5; }
table.wb td.fc.na { color: var(--muted); background: #F5F7F9; }
.wb-act { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--blue); color: #fff !important; font-size: 11.5px; font-weight: 600; }
.wb-act:hover { background: var(--blue-600); text-decoration: none; }
td.done .wb-act { background: var(--green-bg); color: var(--green) !important; }

/* disposition pathway strip */
.pathway { display: flex; align-items: stretch; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.pw { min-width: 96px; padding: 8px 12px; border-radius: 10px; background: var(--sky-50); border: 1px solid var(--sky-200); display: grid; gap: 1px; }
.pw b { font-size: 20px; line-height: 1.1; color: var(--blue-700); }
.pw span { font-size: 11.5px; color: var(--ink-2); }
.pw.out { background: #FFF6F3; border-color: #F3D0C6; } .pw.out b { color: var(--red); }
.pw.ok { background: var(--green-bg); border-color: #BFE3CF; } .pw.ok b { color: var(--green); }
.pathway .arr { align-self: center; color: var(--faint); display: grid; }
.pathway .arr svg { width: 14px; height: 14px; }

/* patient profile */
.pp-head { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); border: 1px solid #A6B4C2; border-radius: 8px; overflow: hidden; margin-bottom: 14px; }
.pp-head div { padding: 8px 10px; border-right: 1px solid #D3DCE5; background: #F7FAFC; min-width: 0; }
.pp-head div:last-child { border-right: 0; }
.pp-head span, .pp-brief span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pp-head b, .pp-brief b { font-size: 13.5px; overflow-wrap: anywhere; }
.pp-brief { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.pp-brief div { padding: 8px 10px; border-radius: 8px; background: var(--sky-50); border: 1px solid var(--sky-200); min-width: 0; }
.pp-sec { font-size: 13.5px; margin: 18px 0 0; padding: 6px 10px; background: #2F5D8A; color: #fff; border-radius: 6px 6px 0 0; display: flex; justify-content: space-between; }
.pp-sec small { font-weight: 500; opacity: .85; }
.sheet-body > table.wb { width: 100%; }
.pp-none { margin: 0; padding: 8px 10px; border: 1px solid #D3DCE5; border-top: 0; }
.swimmer svg { width: 100%; max-width: 980px; height: auto; font-size: 11px; }
.swimmer text { fill: var(--ink-2); }
.sw-grid { stroke: #E3E9EF; }
.sw-bar { fill: #7FB2DE; }
.sw-bar.pbo { fill: #C7CED6; }
.sw-sae { fill: var(--red); }
.sw-on { fill: var(--blue-600); }
.swimmer .sw-lab { font-size: 10.5px; fill: var(--muted); }
.swimmer g.on .sw-bar { fill: var(--amber); }
.swimmer g.on text { font-weight: 700; fill: var(--ink); }
.sw-key { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.sw-key span { display: inline-flex; align-items: center; gap: 6px; }
.sw-key i { display: inline-block; width: 18px; height: 8px; border-radius: 3px; }
.k-bar { background: #7FB2DE; } .k-pbo { background: #C7CED6; } .k-sel { background: var(--amber); }
.sw-key i.k-sae { width: 9px; height: 9px; background: var(--red); transform: rotate(45deg); border-radius: 1px; }
.sw-key i.k-on { width: 0; height: 0; border-left: 8px solid var(--blue-600); border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-radius: 0; }

.agent.star { border-color: var(--sky-300); box-shadow: 0 0 0 2px var(--sky-100); }
.agent.star .ic { background: var(--blue); color: #fff; }
.agent .foot a { font-weight: 600; }

@media (max-width: 1099px) {
  .paths, .map { grid-template-columns: 1fr; }
  .mfiles { position: static; }
  .pp-head, .pp-brief { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .pp-head, .pp-brief { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet-body { padding: 10px; }
  .map-banner { flex-wrap: wrap; } .map-banner .btn { margin-left: 0; }
}

/* gridlines take 1px per cell: give it back from padding */
table.status td { padding-left: 1px; padding-right: 1px; }
table.status td.wrap { padding: 0 1px 0 3px; }
@media (max-width: 1500px) { table.status td.dt { letter-spacing: -0.03em; } .disp { font-size: 10.3px; letter-spacing: -0.02em; } table.status td.wrap { font-size: 10.6px; } }

/* listings: frozen header row and subject column, like Excel freeze panes */
.wb-scroll.list { max-height: calc(100vh - 300px); overflow: auto; border: 1px solid #A6B4C2; }
.wb-scroll.list table.wb { border-style: hidden; }
table.wb.list thead th { position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 #A6B4C2; }
table.wb.list tbody td:first-child { position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: inset -1px 0 0 #A6B4C2; }
table.wb.list thead th:first-child { left: 0; z-index: 3; }
table.wb.list tbody tr:hover td:first-child { background: #F5F9FD; }
table.wb.list tr.sf td:first-child { background: #F3F3F3; }
table.wb.list { font-size: 12px; }
table.wb td.wrap { min-width: 180px; max-width: 300px; }
table.wb td.wrap-s { white-space: normal; min-width: 120px; max-width: 170px; }

table.wb.pp { width: 100%; }
table.wb.pp td { text-align: left; }
table.wb.pp th { text-align: left; }
.mfiles { overflow: hidden; }
.mfile { grid-template-columns: 18px minmax(0, 1fr) auto auto; min-width: 0; }
.mfile b, .mfile small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mfile .doms { flex-wrap: wrap; justify-content: flex-end; }

.mtbl td.nw { white-space: nowrap; }
.mtbl .chip { white-space: normal; height: auto; min-height: 22px; line-height: 1.3; padding: 2px 8px; font-size: 11px; }
@media (max-width: 640px) { table.wb td.lab, table.wb th.corner { min-width: 170px; } .pathway .pw { min-width: 0; flex: 1 1 40%; } .wb-head .head-actions { flex-wrap: wrap; } }
@media (max-width: 1350px) { table.status thead tr.cols th { font-size: 9.6px; padding: 3px 1px; letter-spacing: -0.01em; } table.status thead tr.grp th { font-size: 9.4px; letter-spacing: .02em; } table.status td.wrap { font-size: 9.8px; } .disp { font-size: 9.8px; } table.status td.dt { font-size: 9.6px; } table.status { font-size: 10.4px; } }
@media (max-width: 1350px) { table.status thead tr.cols th { font-size: 9.1px; overflow-wrap: anywhere; } }

/* clean rounded corners: colour stripe drawn inside the header cell, no doubled outer borders */
.tbl-wrap { border-radius: 12px; border-color: var(--grid-strong); }
table.status thead tr.grp th { border-top: 0; height: 31px; }
table.status tr > :first-child { border-left: 0; }
table.status thead tr.grp th:first-child { border-top-left-radius: 11px; }
table.status thead tr.grp th:last-child { border-top-right-radius: 11px; }

.mfile { grid-template-columns: 18px minmax(0, 1fr) auto; align-items: start; }
.mfile > svg { margin-top: 2px; }
.mfile .doms { display: flex; gap: 4px; margin-top: 5px; justify-content: flex-start; }
.mfile .need, .mfile .okk { align-self: center; }

/* ---------------------------------------------------------------- Version 2 / 3 previews */
.road a.card { color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.road a.card:hover { border-color: var(--sky-300); box-shadow: var(--shadow-sm); }
.ver { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--sky-50); margin-right: 10px; }
.ver a { height: 28px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 7px; font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.ver a:hover { color: var(--ink); background: #fff; }
.ver a.on { background: var(--brand); color: #fff; font-weight: 600; }
.page-head h1 .chip { vertical-align: middle; margin-left: 8px; font-size: 11.5px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sec-h h2 { font-size: 15px; font-weight: 650; }
.small { font-size: 12.5px; }
.tbl-x { overflow-x: auto; }
.v-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--sky-100); color: var(--blue-700); display: grid; place-items: center; flex: none; }
.v-ic .i { width: 18px; height: 18px; }
.cbar { display: inline-block; flex: 1; min-width: 40px; height: 6px; border-radius: 9px; background: var(--grey-bg); overflow: hidden; vertical-align: middle; }
.cbar i { display: block; height: 100%; border-radius: 9px; background: var(--green); }
.cbar.mid i { background: var(--blue); } .cbar.low i { background: var(--amber); } .cbar.q i { background: var(--violet); }
table.vt { width: 100%; border-collapse: collapse; font-size: 13px; }
table.vt th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--sky-50); }
table.vt td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.vt tr:last-child td { border-bottom: 0; }
table.vt code { font-size: 12px; background: var(--grey-bg); padding: 2px 6px; border-radius: 5px; }
table.vt.click tbody tr { cursor: pointer; } table.vt.click tbody tr:hover td { background: var(--sky-50); }
table.vt tr.live td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
table.vt td .i { width: 14px; height: 14px; color: var(--faint); vertical-align: middle; }

/* V2 */
.vflow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.vflow > .i { width: 16px; height: 16px; color: var(--faint); }
.vf { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; min-width: 112px; }
.vf b { display: block; font-size: 22px; font-weight: 650; line-height: 1.1; }
.vf span { font-size: 12px; color: var(--muted); }
.vf.hl { border-color: var(--sky-300); background: var(--sky-50); } .vf.hl b { color: var(--blue-700); }
.vf.warn b { color: var(--amber); } .vf.ok b { color: var(--green); }
.v2-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; margin-bottom: 16px; }
.v2-src { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 8px 12px; align-items: center; padding: 14px 16px; }
.v2-src .v-ic { grid-row: span 2; }
.v2-src-t b { display: block; font-size: 14px; } .v2-src-t small { color: var(--muted); font-size: 12px; }
.v2-src-m { grid-column: 2; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.v2-src.add { grid-template-rows: auto; border-style: dashed; background: transparent; cursor: pointer; color: var(--muted); font: inherit; text-align: left; }
.v2-src.add .v-ic { grid-row: auto; background: var(--grey-bg); color: var(--muted); }
.v2-main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.v2-queue, .v2-learn, .v3-ta, .v3-studies { padding: 16px; }
.v2-queue td.arrow .i { color: var(--faint); }
.v2-queue td.act { white-space: nowrap; text-align: right; } .v2-queue td.act .btn + .btn { margin-left: 6px; }
.v2-queue tr.ok td { background: var(--green-bg); }
.conf { display: flex; align-items: center; gap: 8px; min-width: 110px; font-weight: 600; font-size: 12.5px; }
.learn { display: grid; gap: 10px; margin: 10px 0 14px; }
.lr { display: grid; grid-template-columns: 96px 1fr 40px; align-items: center; gap: 10px; font-size: 13px; }
.lr b { text-align: right; } .lr.now span { font-weight: 600; color: var(--blue-700); } .lr .cbar { height: 8px; }
.learn-note { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--blue-700); background: var(--sky-50); border-radius: 8px; padding: 8px 10px; }
.learn-note .i { width: 16px; height: 16px; flex: none; }

/* V3 portfolio */
.page-head .crumbs { margin: 6px 0 0; }
.ta-seg { margin-bottom: 14px; }
.v3-kpis .kpi { cursor: default; }
.v3-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 14px; align-items: start; }
.v3-grid.one { grid-template-columns: 1fr; }
.ta-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "n c" "m m" "b x"; gap: 4px 10px; width: 100%; text-align: left; font: inherit; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 12px 4px; cursor: pointer; }
.ta-row:hover { background: var(--sky-50); }
.ta-row b { grid-area: n; font-size: 14px; } .ta-row .chip { grid-area: c; } .ta-row .muted { grid-area: m; font-size: 12px; }
.ta-row .cbar { grid-area: b; align-self: center; } .ta-row .num { grid-area: x; font-weight: 650; font-size: 13px; }
.ask-fab { position: fixed; right: 24px; bottom: 24px; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 99px; background: var(--brand); color: #fff; font-weight: 600; box-shadow: 0 8px 24px rgba(11, 79, 99, .3); z-index: 20; }
.ask-fab .i { width: 18px; height: 18px; } .ask-fab:hover { background: #093f50; }

/* V3 Ask OcSS */
.ask { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 14px; height: calc(100vh - 150px); min-height: 540px; }
.ask-side { padding: 16px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.ask-side h2 { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.ask-side .btn { justify-content: flex-start; } .ask-side #playAll { margin-top: auto; }
.qchip { text-align: left; font: inherit; font-size: 13px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink-2); cursor: pointer; line-height: 1.35; }
.qchip:hover { border-color: var(--sky-300); background: var(--sky-50); color: var(--blue-700); }
.ask-main { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.ask-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.ask-h h1 { font-size: 18px; font-weight: 650; }
.ask-h h1 .chip { vertical-align: middle; margin-left: 6px; font-size: 11.5px; }
.ask-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; background: var(--bg); }
.ask-empty { margin: auto; display: grid; justify-items: center; gap: 10px; color: var(--muted); }
.bot-ic { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; }
.bot-ic .i { width: 16px; height: 16px; } .bot-ic.lg { width: 48px; height: 48px; } .bot-ic.lg .i { width: 24px; height: 24px; }
.msg { display: flex; gap: 10px; align-items: flex-start; max-width: 100%; }
.msg.me { justify-content: flex-end; }
.msg .bubble { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 13.5px; line-height: 1.5; min-width: 0; max-width: min(860px, 100%); }
.msg.me .bubble { background: var(--blue); border-color: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot .bubble { border-top-left-radius: 4px; flex: 0 1 auto; }
.msg .bubble p { margin: 0; }
.msg .bubble > * + * { margin-top: 10px; }
.bubble.typing { display: flex; gap: 4px; padding: 14px; }
.bubble.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: blink 1s infinite; }
.bubble.typing i:nth-child(2) { animation-delay: .15s; } .bubble.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.bubble .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.bubble .chips { display: grid; gap: 6px; }
.chat-wb { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.wb-mini { max-height: 300px; overflow: auto; }
.wb-mini table.wb { font-size: 11.5px; }
.chat-t td, .chat-t th { padding: 6px 8px; font-size: 12.5px; }
.chat-bars { display: grid; gap: 8px; }
.chat-bars .lr { grid-template-columns: 150px 1fr 34px auto; }
.chat-f { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.chat-f li { display: flex; gap: 8px; align-items: center; }
.ask-in { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: #fff; }
.ask-in input { flex: 1; height: 40px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 14px; font: inherit; font-size: 14px; }
.ask-in input:focus { outline: 2px solid var(--sky-200); border-color: var(--blue); }

@media (max-width: 1100px) { .v2-main, .v3-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .ver { margin: 0; } .ver a { padding: 0 8px; font-size: 12px; }
  .ask { grid-template-columns: 1fr; height: auto; }
  .ask-side { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; } .ask-side h2, .ask-side .btn { display: none; } .qchip { flex: none; max-width: 240px; }
  .ask-main { height: 70vh; }
  .chat-bars .lr { grid-template-columns: 100px 1fr 30px; } .chat-bars .lr small { display: none; }
}
table.status thead tr.grp th[data-grp="tm"] { letter-spacing: 0; font-size: 9.5px; padding-left: 2px; padding-right: 2px; }
@media (max-width: 900px) { .head-actions { flex-wrap: wrap; } .ta-seg, #roleSeg { max-width: 100%; overflow-x: auto; } .ask-h { flex-wrap: wrap; } }
