/* Roche supplier-site look: Roche Sans, warm soft surfaces, Roche blue interactive colour, rectangular controls */
@font-face { font-family: 'Roche Sans'; src: url('https://fonts.roche.com/fonts/roche-sans/latest/RocheSans-Light.woff2') format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Roche Sans'; src: url('https://fonts.roche.com/fonts/roche-sans/latest/RocheSans-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Roche Sans'; src: url('https://fonts.roche.com/fonts/roche-sans/latest/RocheSans-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Roche Sans'; src: url('https://fonts.roche.com/fonts/roche-sans/latest/RocheSans-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
:root {
  --bg: #fff7f5;
  --bg-grad: radial-gradient(1200px 500px at 0% 0%, #fde3d8 0%, rgba(253, 227, 216, 0) 60%), radial-gradient(900px 500px at 100% 0%, #dcefff 0%, rgba(220, 239, 255, 0) 60%);
  --surface: #ffffff;
  --surface-2: #f5f5f2;
  --border: #dbd6d1;
  --border-strong: #aec0ee;
  --text: #212121;
  --muted: #5c6470;
  --faint: #a19a95;
  --accent: #0b41cd;
  --accent-2: #052066;
  --accent-active: #5c80de;
  --accent-soft: #d7e0f7;
  --green: #007a3d;
  --amber: #a85d00;
  --red: #b21a20;
  --yellow: #fff1c2;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(33, 33, 33, .04);
  --font: 'Roche Sans', Arial, Helvetica, sans-serif;
  --mono: 'Roche Sans', Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg-grad), var(--bg); background-attachment: fixed; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; letter-spacing: 0; line-height: 1.2; }
h1 { font-size: 2rem; font-weight: 300; letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; font-weight: 300; }
h3 { font-size: 1rem; font-weight: 500; margin-bottom: 4px; }
h4 { font-size: 0.85rem; color: var(--muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0; }
a { color: var(--accent); }
small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.4; }
.label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* header */
.top { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 16px; padding: 12px 32px; background: rgba(255, 247, 245, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--accent); }
.logo { width: 36px; height: 36px; }
.brand-title { font-weight: 500; color: var(--text); }
.brand-sub { font-size: 12px; color: var(--muted); }
.tabs { display: flex; gap: 20px; }
.tab { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 10px 2px; font: inherit; font-size: 15px; white-space: nowrap; color: var(--text); cursor: pointer; }
.tab.active { border-bottom-color: var(--accent); color: var(--accent); font-weight: 500; }
.tab:hover:not(.active) { color: var(--text); }

.view { display: none; padding: 28px 32px 40px; max-width: 1360px; margin: 0 auto; }
.view.active { display: block; }
.intro { max-width: 860px; margin-bottom: 24px; }
.intro p { color: var(--muted); margin-top: 8px; }

/* layout */
.layout { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.inputs { padding: 16px; position: sticky; top: 86px; max-height: calc(100vh - 100px); overflow: auto; }
.scenarios { margin-bottom: 12px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 6px; background: var(--surface-2); padding: 4px; border-radius: var(--radius); }
.seg button { border: 0; background: transparent; font: inherit; font-size: 13px; padding: 7px 4px; border-radius: var(--radius); cursor: pointer; color: var(--muted); }
.seg button.active { background: var(--accent); color: #fff; font-weight: 500; }
.seg button:hover:not(.active) { background: var(--accent-soft); color: var(--text); }
details { border-top: 1px solid var(--border); padding: 10px 0; }
summary { cursor: pointer; font-weight: 500; font-size: 14px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::after { content: '+'; color: var(--faint); font-size: 18px; }
details[open] summary::after { content: '–'; }
summary::-webkit-details-marker { display: none; }
.field { margin-top: 12px; }
.field label { display: block; font-size: 13px; color: var(--text); margin-bottom: 4px; }
.field input[type=number], .field input[type=text], .field input:not([type]), .field input[type=date], .field select { width: 100%; font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font-family: var(--mono); font-size: 13px; }
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.range { display: grid; grid-template-columns: 1fr 44px; gap: 8px; align-items: center; }
.range output { font-family: var(--mono); font-size: 13px; text-align: right; color: var(--accent); font-weight: 500; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.field.check label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.field.sub { padding-left: 12px; border-left: 2px solid var(--border); display: none; }
.field.sub.on { display: block; }
.field.sub label { margin-top: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid3 label { font-size: 12px; }

/* results */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.kpi.accent .k-label, .kpi.accent .k-sub { color: rgba(255,255,255,.8); }
.k-label { font-size: 12px; color: var(--muted); }
.k-value { font-size: 1.7rem; font-weight: 600; font-variant-numeric: tabular-nums; margin: 4px 0 2px; letter-spacing: -0.02em; }
.k-sub { font-size: 12px; color: var(--muted); }
.cards2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.cards2 .card { margin-bottom: 0; }
.card.soft { background: var(--surface-2); box-shadow: none; }
.hint { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.chart { position: relative; height: 260px; }

.corridor { margin: 14px 0 6px; }
.cor-row { display: grid; grid-template-columns: 240px 1fr; gap: 12px; align-items: center; margin: 8px 0; font-size: 13px; }
.cor-track { position: relative; height: 26px; background: var(--surface-2); border-radius: var(--radius); }
.cor-bar { position: absolute; top: 5px; height: 16px; border-radius: 4px; background: var(--accent); opacity: .85; }
.cor-bar.light { background: var(--accent-soft); opacity: 1; }
.cor-mark { position: absolute; top: 2px; width: 3px; height: 22px; background: var(--text); border-radius: 2px; }
.cor-lab.before { text-align: right; }
.cor-lab { position: absolute; top: 4px; font-family: var(--mono); font-size: 11.5px; white-space: nowrap; color: var(--text); }
.cor-axis { position: relative; height: 16px; font-family: var(--mono); font-size: 11px; color: var(--faint); margin-left: 252px; }
.cor-axis span { position: absolute; transform: translateX(-50%); }
.mirror { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--accent-soft); font-size: 14px; }
.mirror b { color: var(--accent); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 600; border-top: 2px solid var(--text); }
tr.mirror-row td { color: var(--accent); font-weight: 500; }
td.cust, th.cust { background: var(--surface-2); }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.btn { border: 0; background: var(--accent); color: #fff; font: inherit; font-size: 14px; font-weight: 700; padding: 10px 18px; border-radius: var(--radius); cursor: pointer; }
.btn:hover { background: var(--accent-2); }
.btn:hover { background: var(--accent-2); }
.btn.ghost { background: var(--surface); color: var(--accent); border: 1px solid var(--border-strong); font-weight: 500; }
.btn.ghost:hover { background: var(--accent-soft); }
.copied { font-size: 13px; color: var(--green); }

/* hub */
.hub { display: grid; grid-template-columns: 280px 1fr; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); min-height: 620px; }
.hub-nav { background: var(--surface-2); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--border); }
.hub-user { display: flex; gap: 10px; align-items: center; padding: 6px 8px 18px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.hub-name { font-weight: 600; font-size: 14px; }
.hub-id { font-size: 11.5px; color: var(--muted); }
.hnav { text-align: left; border: 0; background: transparent; font: inherit; font-size: 14px; padding: 10px 12px; border-radius: var(--radius); cursor: pointer; color: var(--text); }
.hnav.active { background: var(--surface); font-weight: 500; box-shadow: var(--shadow); color: var(--accent); }
.hnav:hover:not(.active) { background: rgba(11,65,205,.06); }
.hub-foot { margin-top: auto; font-size: 11.5px; color: var(--muted); padding: 12px 8px 0; border-top: 1px solid var(--border); }
.hub-main { padding: 26px 28px; }
.hpage { display: none; }
.hpage.active { display: block; }
.hp-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.pill { font-size: 12px; background: var(--yellow); color: var(--text); padding: 4px 10px; border-radius: 999px; }
.search { display: flex; gap: 8px; }
.search input { flex: 1; font: inherit; font-size: 15px; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.search input:focus { outline: 2px solid var(--accent); }
.chips { display: flex; gap: 6px; margin: 10px 0 16px; }
.chip { font-family: var(--mono); font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.inv-result { min-height: 40px; margin-bottom: 20px; }
.inv-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; background: var(--surface-2); }
.inv-top { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.inv-top .amt { font-family: var(--mono); font-size: 1.2rem; font-weight: 500; }
.timeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 16px 0 12px; }
.step { font-size: 12px; text-align: center; padding-top: 10px; position: relative; color: var(--muted); }
.step::before { content: ''; display: block; height: 6px; border-radius: 3px; background: var(--border); margin-bottom: 8px; }
.step.done { color: var(--text); }
.step.done::before { background: var(--accent); }
.step.now { color: var(--accent); font-weight: 600; }
.step.now::before { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.step.bad::before { background: var(--red); }
.inv-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inv-actions .btn { font-size: 13px; padding: 7px 12px; }
.empty { color: var(--muted); font-size: 14px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.compare > div { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; font-size: 13px; color: var(--muted); }
.c-head { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
.c-head.today { color: var(--red); }
.c-head.onhub { color: var(--accent); }
.form .grid2, .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.drop { border: 1.5px dashed var(--border); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); font-size: 13px; background: var(--surface-2); }
.drop.small { padding: 12px; }
.notice { margin-top: 12px; font-size: 14px; }
.notice.ok { background: var(--accent-soft); border-radius: var(--radius); padding: 12px 14px; }
.notice.ok b { color: var(--accent); }
.cases td:first-child { font-family: var(--mono); font-size: 12.5px; }
.st { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.st.green { color: var(--green); background: rgba(47,125,50,.12); }
.st.blue { color: var(--accent); background: var(--accent-soft); }
.st.amber { color: var(--amber); background: rgba(178,106,0,.12); }
.st.red { color: var(--red); background: rgba(179,38,30,.12); }
.newcase { display: grid; grid-template-columns: auto 1fr 2fr auto; gap: 8px; align-items: center; margin-top: 14px; }
.newcase label { font-size: 13px; color: var(--muted); }
.newcase select, .newcase input { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; font-family: var(--mono); font-size: 13px; }

/* assumptions */
.method { padding-left: 18px; font-size: 14px; color: var(--muted); }
.method li { margin: 6px 0; }
.method b { color: var(--text); }
.todo { list-style: none; padding: 0; margin: 0; }
.todo li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; background: var(--yellow); border-radius: var(--radius); margin: 6px 0; font-size: 13.5px; }
.who { font-weight: 600; white-space: nowrap; min-width: 120px; }
.src td:first-child { width: 170px; font-weight: 500; vertical-align: top; }
.src td { font-size: 13px; color: var(--muted); }

.foot { text-align: center; font-size: 12px; color: var(--faint); padding: 20px; }

@media (max-width: 1024px) {
  .top { grid-template-columns: 1fr auto; }
  .tabs { grid-column: 1 / -1; justify-self: start; overflow-x: auto; max-width: 100%; }
  .layout { grid-template-columns: 1fr; }
  .inputs { position: static; max-height: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .cards2 { grid-template-columns: 1fr; }
  .hub { grid-template-columns: 1fr; }
  .hub-nav { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); }
  .hub-user { width: 100%; padding-bottom: 8px; }
  .hub-foot { display: none; }
}
@media (max-width: 640px) {
  .top, .view { padding-left: 16px; padding-right: 16px; }
  .kpis, .compare, .grid2, .form .grid2 { grid-template-columns: 1fr; }
  .cor-row { grid-template-columns: 1fr; gap: 4px; }
  .cor-axis { margin-left: 0; }
  .newcase { grid-template-columns: 1fr; }
  .hub-main { padding: 18px 16px; }
  h1 { font-size: 1.25rem; }
}
@media print {
  .top, .inputs, .actions, .foot { display: none !important; }
  .layout { grid-template-columns: 1fr; }
  .view { padding: 0; }
  body { background: #fff; }
}

/* auth, cases */
.user { display: flex; gap: 8px; align-items: center; }
.badge { font-size: 11px; color: var(--muted); background: var(--surface-2); padding: 3px 8px; border-radius: 999px; font-family: var(--mono); }
.btn.small { font-size: 13px; padding: 6px 12px; }
.count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; text-align: center; margin-left: 2px; }
.count:empty { display: none; }
.casebar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; box-shadow: var(--shadow); }
.cb-info { display: flex; gap: 8px; align-items: baseline; font-size: 14px; }
.cb-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
#cbName { font-weight: 600; }
.dirty { color: var(--amber); font-size: 13px; }
.cb-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.list-head { display: flex; gap: 10px; margin-bottom: 10px; }
.list-head input { flex: 1; font: inherit; font-size: 14px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.caselist td { vertical-align: top; }
.caselist td.desc { color: var(--muted); font-size: 13px; max-width: 320px; }
.caselist td.ver { font-family: var(--mono); font-size: 12.5px; }
.caselist .row-actions { display: flex; gap: 4px; justify-content: flex-end; white-space: nowrap; }
.caselist .row-actions button { border: 1px solid var(--border); background: transparent; color: var(--accent); font: inherit; font-size: 12.5px; padding: 4px 8px; border-radius: var(--radius); cursor: pointer; }
.caselist .row-actions button:hover { background: var(--accent-soft); }
.caselist .row-actions button.danger { color: var(--red); }
.caselist tr.current td { background: var(--accent-soft); }
.login { position: fixed; inset: 0; background: var(--bg); display: grid; place-items: center; z-index: 100; padding: 20px; }
.login[hidden] { display: none; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 32px; width: 100%; max-width: 400px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; color: var(--accent); }
.login-card h2, .login-card p { color: var(--text); }
.login-card p { color: var(--muted); font-size: 14px; }
.login-card input { font: inherit; font-size: 15px; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.login-card input:focus { outline: 2px solid var(--accent); }
.logo.big { width: 56px; height: 56px; }
.login-msg { font-size: 13px; color: var(--red); min-height: 18px; }
dialog { border: 1px solid var(--border); border-radius: 14px; padding: 0; background: var(--surface); color: var(--text); width: min(520px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(20,33,61,.45); }
.dlg { padding: 24px; }
.dlg h2 { margin-bottom: 8px; }
.dlg .field input, .dlg textarea { width: 100%; font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.dlg .field input[type=text] { font-family: var(--font); }
.dlg textarea { resize: vertical; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 13.5px; z-index: 50; box-shadow: var(--shadow); transition: opacity .3s; }
.toast.hide { opacity: 0; }
@media (max-width: 640px) { .user { display: none; } .casebar { flex-direction: column; align-items: flex-start; } }
@media print { .casebar, .login, .user { display: none !important; } }
/* overflow safety */
.layout > *, .results, .hub-main, .card { min-width: 0; }
.table-card table, .caselist, .cases, .src { display: block; overflow-x: auto; }
.table-card table thead, .table-card table tbody, .caselist thead, .caselist tbody, .cases thead, .cases tbody, .src tbody { display: table; width: 100%; }

/* lever editor */
.lever { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-top: 10px; background: var(--surface); }
.lever.editing { border-color: var(--accent); background: #fbfbfa; }
.lv-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.lv-dot { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.lv-name { font-size: 13.5px; font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-tools button, .lv-actions button { border: 1px solid var(--border-strong); background: var(--surface); color: var(--accent); font: inherit; font-size: 12px; padding: 3px 9px; border-radius: var(--radius); cursor: pointer; }
.lv-tools button:hover, .lv-actions button:hover { background: var(--accent-soft); }
.lv-actions button:disabled { opacity: .45; cursor: default; }
.lv-actions button.danger { color: var(--red); border-color: var(--border); }
.lv-desc { margin-top: 6px; }
.lv-edit { margin-top: 10px; display: grid; gap: 4px; }
.lv-edit label { font-size: 12px; color: var(--muted); margin-top: 6px; }
.lv-edit input, .lv-edit textarea, .lv-edit select { width: 100%; font: inherit; font-size: 13px; padding: 7px 9px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.lv-edit textarea { resize: vertical; }
.lv-edit .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.lv-edit .mini { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.lv-actions { display: flex; gap: 6px; margin-top: 8px; }
.btn.ghost.small { font-size: 13px; padding: 7px 12px; margin-top: 10px; }
.hint { font-size: 12.5px; color: var(--muted); }
/* v3: secondary hub link, scenario rename, case settings, compare */
.tab.minor { font-size: 12.5px; color: var(--muted); padding: 6px 0; border-bottom-width: 1px; }
.tab.minor.active { color: var(--accent); border-bottom-color: var(--accent); }
.sc-head { display: flex; justify-content: space-between; align-items: center; }
.linkbtn { border: 0; background: none; color: var(--accent); font: inherit; font-size: 12px; cursor: pointer; padding: 0; }
.linkbtn:hover { text-decoration: underline; }
.sc-rename { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 6px; }
.sc-rename input { width: 100%; font: inherit; font-size: 12.5px; padding: 6px 7px; border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.field.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field.two label { font-size: 12.5px; }
.cb-org { color: var(--muted); font-size: 13px; margin-left: 6px; }
.caselist th:first-child, .caselist td:first-child { width: 28px; padding-right: 0; }
.cmp-pick { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
#cmpHint { margin-top: 10px; }
table.cmp { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.cmp th, table.cmp td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.cmp th.num, table.cmp td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.cmp tr.total td { font-weight: 500; background: var(--surface-2); }
table.cmp tr.sect td { padding-top: 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 0; }
table.cmp td.delta { color: var(--accent); }
.faint { color: var(--faint); }
.foot-link { margin-top: 20px; font-size: 13px; color: var(--muted); }
.list-head h3 { flex: 1; margin: 0; }

/* calculation schemes */
.card.span2 { grid-column: 1 / -1; }
.schemes { display: grid; gap: 12px; margin-top: 10px; }
.scheme { display: grid; grid-template-columns: 28px 1fr; gap: 10px; font-size: 13.5px; }
.s-no { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; }
.formula { margin: 6px 0 4px; padding: 8px 12px; background: var(--surface-2); border-left: 3px solid var(--accent); font-size: 13.5px; line-height: 1.7; font-variant-numeric: tabular-nums; overflow-x: auto; }
.formula sub { font-size: 10px; }
.worked { margin: 8px 0 0; padding-left: 20px; font-size: 13.5px; }
.worked li { margin: 6px 0; }
.worked b { font-variant-numeric: tabular-nums; }

/* accounts & admin */
.user-form { display: grid; grid-template-columns: 2fr 2fr 1fr auto; gap: 8px; margin: 10px 0 14px; }
.user-form input, .user-form select { font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); min-width: 0; }
.pw-reveal { display: grid; grid-template-columns: 1fr auto auto auto; gap: 12px; align-items: center; padding: 12px 14px; margin-bottom: 14px; background: var(--accent-soft); border: 1px solid var(--border-strong); border-radius: var(--radius); font-size: 13.5px; }
.pw-reveal code { font-family: var(--mono); font-size: 16px; font-weight: 700; letter-spacing: .04em; background: var(--surface); padding: 6px 10px; border-radius: var(--radius); }
.pw-reveal .btn.small { margin: 0; }
#userTable td, #logTable td { font-size: 13px; }
#userTable .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
#userTable .acts .btn { margin: 0; padding: 4px 8px; font-size: 12px; }
.tag { display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tag.ok { background: #e3f1e6; color: #1f6b3a; }
.tag.off { background: #f8e1e1; color: #a12c2c; }
.tag.warn { background: #fff1d6; color: #8a5a00; }
.tag.admin { background: var(--accent-soft); color: var(--accent); }
.hint { font-size: 13px; color: var(--muted); }
@media (max-width: 760px) { .user-form { grid-template-columns: 1fr 1fr; } .pw-reveal { grid-template-columns: 1fr; } }
.tablewrap { overflow-x: auto; }
.tablewrap th, .tablewrap td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; white-space: nowrap; }
.tablewrap th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
#btnAdmin.active { background: var(--accent-active); }
[hidden] { display: none !important; }
.callout { background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 12px 14px; font-size: 14px; color: var(--text); line-height: 1.5; }
.callout i { font-style: normal; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 2px; }

/* v4 – two-number model */
.scope-note { margin-top: 12px; padding: 10px 12px; background: var(--surface-2); border-left: 3px solid var(--border-strong); border-radius: var(--radius); font-size: 12.5px; color: var(--muted); }
.scope-note b { color: var(--text); }
.field.dial label { font-weight: 500; }
.range.wide { grid-template-columns: 1fr 64px; }
.field.dial small b { color: var(--text); }
details.expert { border-top: 1px dashed var(--border); margin-top: 14px; padding-bottom: 0; }
details.expert summary { font-size: 13px; color: var(--accent); font-weight: 500; }
details.expert .tablewrap { margin: 6px -6px 8px; }
table.expert-t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.expert-t th, table.expert-t td { padding: 5px 2px; border-bottom: 1px solid var(--border); text-align: left; white-space: normal; vertical-align: middle; }
table.expert-t td.num input::-webkit-outer-spin-button, table.expert-t td.num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
table.expert-t th { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table.expert-t th:not(:first-child), table.expert-t td.num { text-align: right; }
table.expert-t td:first-child { color: var(--muted); font-size: 11.5px; line-height: 1.3; min-width: 92px; padding-right: 4px; } table.expert-t td:first-child b { color: var(--text); font-weight: 500; }
table.expert-t tr.derived td:first-child { color: var(--muted); font-size: 12px; }
table.expert-t td.num input { width: 46px; font: inherit; font-family: var(--mono); font-size: 12px; padding: 4px 3px; -moz-appearance: textfield; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); text-align: right; }
table.expert-t tr.derived td.num input { color: var(--muted); border-style: dashed; }
table.expert-t td.num input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.flow-card h3 { margin-bottom: 12px; }
.flow { display: grid; grid-template-columns: 1fr 22px 1fr 22px 1fr 22px 1fr 1.15fr; gap: 8px; align-items: stretch; }
.fl-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 12px 10px; background: var(--surface-2); display: flex; flex-direction: column; min-width: 0; }
.fl-box.lever { background: var(--surface); }
.fl-box.result { background: var(--accent); color: #fff; border-color: var(--accent); }
.fl-box.result .fl-k, .fl-box.result .fl-s { color: rgba(255,255,255,.85); }
.fl-box.result .fl-s b { color: #fff; }
.fl-k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.fl-v { font-size: 1.55rem; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 4px 0 4px; }
.fl-s { font-size: 12px; color: var(--muted); line-height: 1.45; margin-top: auto; }
.fl-s b { color: var(--text); }
.fl-arrow { align-self: center; text-align: center; color: var(--faint); font-size: 20px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin-right: 4px; }
@media (max-width: 1024px) { .flow { grid-template-columns: 1fr 1fr; } .fl-arrow { display: none; } .fl-box.result { grid-column: 1 / -1; } }
@media (max-width: 640px) { .flow { grid-template-columns: 1fr; } }
@media print { .flow { grid-template-columns: 1fr 22px 1fr 22px 1fr 22px 1fr 1.15fr; } }
