:root {
  /* Layout: fixed left nav, one working view at a time; summary on top, detail below. */
  --bg: #f3f5f7; --panel: #ffffff; --ink: #1d2733; --muted: #66727f; --line: #dde3e9;
  --accent: #0e6ba8; --accent-soft: #e3f0f9;
  --hot: #d9480f; --hot-soft: #fff0e6; --good: #2b8a3e; --good-soft: #e6f4ea; --warn: #b26a00; --warn-soft: #fff6e0; --bad: #c92a2a; --bad-soft: #fdecec;
  --display: "Barlow Semi Condensed", "Arial Narrow", Arial, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #11171d; --panel: #19212a; --ink: #e5ebf0; --muted: #94a1ad; --line: #2c3742;
  --accent: #4aa3df; --accent-soft: #17344a; --hot: #ff8a4c; --hot-soft: #3a2216; --good: #63c274; --good-soft: #173022;
  --warn: #f0b44c; --warn-soft: #362a12; --bad: #ff7676; --bad-soft: #3a1b1b; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #11171d; --panel: #19212a; --ink: #e5ebf0; --muted: #94a1ad; --line: #2c3742;
  --accent: #4aa3df; --accent-soft: #17344a; --hot: #ff8a4c; --hot-soft: #3a2216; --good: #63c274; --good-soft: #173022;
  --warn: #f0b44c; --warn-soft: #362a12; --bad: #ff7676; --bad-soft: #3a1b1b; color-scheme: dark; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--body); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; text-wrap: balance; letter-spacing: .01em; }
h1 { font-size: 24px; } h2 { font-size: 19px; } h3 { font-size: 16px; }
.app { display: grid; grid-template-columns: 210px 1fr; height: 100%; }
nav { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 14px 10px; gap: 2px; overflow: auto; }
.brand { font-family: var(--display); font-size: 20px; font-weight: 700; padding: 4px 8px 2px; }
.brand small { display: block; font-family: var(--body); font-size: 11px; font-weight: 500; color: var(--muted); }
nav a { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; }
nav a:hover { background: var(--accent-soft); }
nav a.on { background: var(--accent); color: #fff; }
nav a .n { font-size: 12px; background: var(--hot); color: #fff; border-radius: 10px; padding: 0 7px; }
nav .sep { height: 1px; background: var(--line); margin: 8px 4px; }
main { overflow: auto; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 5; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; padding: 10px 20px; flex-wrap: wrap; }
.top .grow { flex: 1; }
.live { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); display: inline-block; }
.live.off i { background: var(--bad); } .live.off { color: var(--bad); font-weight: 600; }
.view { padding: 18px 20px 40px; display: flex; flex-direction: column; gap: 16px; max-width: 1400px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.card > h2, .card > h3 { margin-bottom: 10px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.cols { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.cols-3 { display: grid; gap: 16px; grid-template-columns: 330px 1fr; }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
.tile b { display: block; font: 600 28px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: 12px; }
.tile.hot b { color: var(--hot); } .tile.bad b { color: var(--bad); } .tile.good b { color: var(--good); }
label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 600; color: var(--muted); }
input, select, textarea { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; min-height: 34px; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
select[multiple] { min-height: 90px; }
textarea { min-height: 60px; resize: vertical; width: 100%; }
.f { display: grid; gap: 10px 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.f .w2 { grid-column: span 2; } .f .wall { grid-column: 1 / -1; }
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 7px 14px; cursor: pointer; font-weight: 600; }
.btn:hover { border-color: var(--accent); }
.btn.pri { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.go { background: var(--good); border-color: var(--good); color: #fff; }
.btn.hotb { background: var(--hot-soft); border-color: var(--hot); color: var(--hot); }
.btn.sm { padding: 3px 9px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; position: sticky; top: 0; background: var(--panel); }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--accent-soft); }
.tw { overflow-x: auto; max-height: 62vh; }
.chip { display: inline-block; border-radius: 10px; padding: 0 8px; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent); white-space: nowrap; margin: 1px 2px 1px 0; }
.chip.hot { background: var(--hot-soft); color: var(--hot); } .chip.good { background: var(--good-soft); color: var(--good); }
.chip.warn { background: var(--warn-soft); color: var(--warn); } .chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.grey { background: var(--bg); color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 12px; }
.bar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; min-width: 90px; }
.bar i { display: block; height: 100%; background: var(--accent); }
.msg { border-radius: 6px; padding: 8px 12px; font-weight: 600; }
.msg.ok { background: var(--good-soft); color: var(--good); } .msg.bad { background: var(--bad-soft); color: var(--bad); } .msg.warn { background: var(--warn-soft); color: var(--warn); }
.msg ul { margin: 4px 0 0 18px; padding: 0; font-weight: 400; }
.queue { display: flex; flex-direction: column; max-height: 70vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.qi { padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; display: grid; gap: 2px; }
.chip.first { background: #e3efff; color: #0b4f9c; }
.chip.fup { background: #efe8fb; color: #5b3a99; }
.qh { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; gap: 8px; padding: 6px 12px; background: #eef2f6; border-bottom: 1px solid var(--line); font-size: 13px; }
.callf { align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.callf .lbl { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.campPick { position: relative; }
.campPick summary { cursor: pointer; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; background: var(--panel); min-width: 200px; list-style: none; }
.campPick summary::after { content: ' ▾'; color: #888; }
.cpBox { position: absolute; z-index: 20; top: 100%; left: 0; margin-top: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px; width: min(420px, 90vw); max-height: 50vh; overflow: auto; box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.cpRow { display: flex !important; flex-direction: row !important; flex-wrap: wrap; gap: 6px; align-items: center; padding: 5px 2px; font-weight: normal; color: inherit; font-size: 14px; border-bottom: 1px solid var(--line); }
.cpRow input { width: auto; margin: 0; }
.qi:hover, .qi.sel { background: var(--accent-soft); }
.qi .t { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: var(--panel); border-radius: 16px; padding: 4px 12px; cursor: pointer; font-size: 13px; }
.tabs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.hist { max-height: 210px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; background: var(--bg); font-size: 13px; }
.hist div { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.hist div:first-child { font-weight: 600; }
.kv { display: grid; grid-template-columns: 120px 1fr 120px 1fr; gap: 3px 10px; font-size: 13px; }
.kv span:nth-child(odd) { color: var(--muted); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; font-weight: 400; color: var(--ink); }
.checks label { flex-direction: row; align-items: center; gap: 5px; font-weight: 400; color: var(--ink); font-size: 13px; }
.checks input { min-height: 0; }
.flame { cursor: pointer; background: none; border: 0; font-size: 16px; padding: 0 4px; filter: grayscale(1); opacity: .35; }
.flame.on { filter: none; opacity: 1; }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 6px; font-weight: 600; z-index: 50; max-width: 420px; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 16px; }
.modal { background: var(--panel); border-radius: 10px; padding: 18px; max-width: 760px; width: 100%; max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.lists { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.li { display: flex; gap: 6px; align-items: center; padding: 3px 0; }
.li input[type=text] { flex: 1; }
.li.off input[type=text] { text-decoration: line-through; color: var(--muted); }
.gaps { display: flex; flex-wrap: wrap; gap: 4px; }
table.eye th[scope=row] { font-weight: 600; color: var(--ink); white-space: normal; position: static; }
table.eye td { min-width: 150px; } table.eye input, table.eye select { width: 100%; }
details > summary { cursor: pointer; list-style: revert; padding: 4px 0; }

.rxgrid { display: grid; grid-template-columns: 1fr 190px; gap: 16px; align-items: start; }
.rxnav { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.rxnav .sep { height: 1px; background: var(--line); margin: 4px 0; }
.navb { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 6px; text-align: left; border: 1px solid transparent; background: none; border-radius: 6px; padding: 7px 8px; cursor: pointer; font-weight: 600; }
.navb:hover { background: var(--accent-soft); }
.navb.on { background: var(--accent); color: #fff; }
.navb .k { display: inline-flex; justify-content: center; align-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); color: var(--ink); font-size: 12px; }
.navb.on .k { background: #fff; color: var(--accent); }
.st { font-size: 12px; }
.st.ok { color: var(--good); } .st.bad { color: #fff; background: var(--bad); border-radius: 10px; padding: 0 6px; } .st.part { color: var(--muted); }
.navb.on .st.ok, .navb.on .st.part { color: #fff; }
.errjump { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; text-align: left; }
.rxsec { scroll-margin-top: 70px; }
@media (max-width: 1100px) { .rxgrid { grid-template-columns: 1fr; } .rxnav { order: -1; top: 52px; z-index: 4; flex-direction: row; flex-wrap: wrap; } .rxnav > b, .rxnav p, .rxnav .sep, .rxnav .row { display: none; } .navb { grid-template-columns: auto auto auto; } }
fieldset.finset { border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; margin: 8px 0 0; min-width: 0; }
fieldset.finset:disabled { opacity: .45; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
table.eye td { min-width: 110px; }
.paper { background: #fff; color: #111; border: 1px solid #ccc; margin: 0 auto; padding: 14px 18px; font: 12px/1.4 var(--body); }
.paper.a5 { max-width: 560px; } .paper.a4 { max-width: 760px; }
.phead { text-align: center; border-bottom: 2px solid #111; padding-bottom: 6px; margin-bottom: 6px; } .phead b { font: 700 17px var(--display); }
.pmeta { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 11px; margin-bottom: 6px; }
.pb { border-top: 1px solid #ddd; padding: 5px 0; } .ph { font-weight: 700; text-transform: uppercase; font-size: 10px; letter-spacing: .05em; color: #444; margin-bottom: 2px; }
table.pt { width: 100%; table-layout: fixed; border-collapse: collapse; } table.pt th, table.pt td { border: 1px solid #bbb; padding: 2px 5px; font-size: 11px; position: static; background: none; color: #111; white-space: normal; } table.pt tr > :first-child { width: 34px; }
.pm { margin: 2px 0 0 18px; padding: 0; } .psign { display: flex; justify-content: space-between; margin-top: 14px; } .pfoot { margin-top: 8px; font-size: 10px; color: #555; text-align: center; }
@media print { body * { visibility: hidden; } #printArea, #printArea * { visibility: visible; } #printArea { position: absolute; left: 0; top: 0; width: 100%; } .paper { border: 0; } }
.invalid { border-color: var(--bad) !important; background: var(--bad-soft) !important; outline-color: var(--bad); }
.ferr { color: var(--bad); font-size: 11px; font-weight: 600; margin-top: 2px; }
.lockbar { background: var(--warn-soft); color: var(--warn); border-radius: 6px; padding: 6px 10px; font-weight: 600; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; height: auto; }
  nav { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  nav .sep, .brand small { display: none; }
  .cols, .cols-3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 110px 1fr; }
  .f .w2 { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- added for the live app ---- */
.login { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login .card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; }
.login h1 { font-size: 26px; } .login p { margin: 0; }
.login .pin { font-size: 22px; letter-spacing: .3em; text-align: center; }
.login .btn { padding: 10px 14px; font-size: 15px; }
.busy { opacity: .6; pointer-events: none; }
.conflict { background: var(--bad-soft); color: var(--bad); border-radius: 6px; padding: 6px 10px; font-weight: 600; }
.diff { font-size: 12px; white-space: pre-wrap; word-break: break-word; background: var(--bg); border-radius: 6px; padding: 6px 8px; max-height: 260px; overflow: auto; }
.offline-bar { background: var(--bad); color: #fff; text-align: center; padding: 4px 8px; font-weight: 600; font-size: 13px; }
.alert-bar { background: var(--warn-soft); color: var(--warn); text-align: center; padding: 6px 12px; font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--warn); }
.alert-bar a { color: inherit; text-decoration: underline; }
.who { font-size: 13px; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
@media (max-width: 900px) { .top { padding: 8px 12px; } .view { padding: 14px 12px 40px; } }

/* ---- phone and tablet ---- */
@media (max-width: 900px) {
  .app { display: flex; flex-direction: column; min-height: 100%; }
  nav { position: sticky; top: 0; z-index: 10; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; padding: 6px 8px; gap: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav .brand { font-size: 17px; white-space: nowrap; padding: 6px 6px; }
  nav a { white-space: nowrap; flex: 0 0 auto; padding: 8px 12px; }
  main { overflow: visible; }
  .top { position: static; }
  .rxnav { top: 50px; }
  .queue { max-height: 45vh; }
  .modal-bg { padding: 0; align-items: stretch; }
  .modal { max-width: none; max-height: none; height: 100%; border-radius: 0; }
}
@media (max-width: 600px) {
  body { font-size: 15px; }
  input, select, textarea { font-size: 16px; min-height: 42px; }   /* 16px stops phones zooming in on tap */
  select[multiple] { min-height: 130px; }
  .btn { padding: 9px 14px; min-height: 40px; }
  .btn.sm { padding: 6px 10px; min-height: 34px; font-size: 13px; }
  .f { grid-template-columns: 1fr 1fr; }
  .f .w2 { grid-column: 1 / -1; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile b { font-size: 24px; }
  .kv { grid-template-columns: 100px 1fr; }
  .card { padding: 12px; }
  h1 { font-size: 21px; }
  .who { display: none; }
  .hide-sm { display: none; }
  table.eye td { min-width: 92px; }
  .tabs button { padding: 7px 12px; }
  .qi { padding: 10px 12px; }
  .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .checks label { font-size: 14px; padding: 3px 0; }
  .checks input[type=checkbox] { width: 20px; height: 20px; }
}
@media (max-width: 380px) { .f { grid-template-columns: 1fr; } }
@media (hover: none) { tr.click:hover td { background: none; } }
@media print { nav, .top, #offline { display: none !important; } }
/* keep everything inside the screen width */
main, .view, .card, .rxgrid > *, .cols > *, .cols-3 > * { min-width: 0; }
@media (max-width: 1100px) { .rxgrid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  html, body { height: auto; }
  .cols, .cols-3 { grid-template-columns: minmax(0, 1fr); }
  .view { max-width: 100vw; }
  .rxnav { position: sticky; }
}
.f > * { min-width: 0; }
.f input:not([type=checkbox]):not([type=radio]), .f select, .f textarea { width: 100%; }
input, select, textarea { max-width: 100%; }
.li { flex-wrap: wrap; } .li input[type=text] { min-width: 0; flex: 1 1 140px; }
.checks label { min-width: 0; }
@media (max-width: 900px) {
  .rxnav { flex-wrap: nowrap; overflow-x: auto; padding: 6px; gap: 2px; top: 50px; scrollbar-width: none; }
  .rxnav::-webkit-scrollbar { display: none; }
  .navb { flex: 0 0 auto; padding: 5px 8px; font-size: 13px; white-space: nowrap; }
  .navb .k { width: 20px; height: 20px; font-size: 11px; }
  #navGaps { display: none; }
}

/* Sign-in name picker (type to search, arrows and Enter, or open the full list) */
.login .combo { position: relative; }
.login .combo input { width: 100%; padding-right: 42px; }
.login .combo input.ok { border-color: var(--good, #2e7d32); }
.login .ctog { position: absolute; right: 0; top: 0; height: 100%; width: 40px; border: 0; background: transparent; font-size: 16px; cursor: pointer; color: inherit; }
.login .cbox { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); max-height: 240px; overflow: auto; margin: 0; padding: 4px; list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.login .cbox li { padding: 10px; border-radius: 6px; cursor: pointer; font-size: 15px; }
.login .cbox li.on, .login .cbox li:hover { background: var(--accent, #1d5fa8); color: #fff; }
.login .cbox li.none { color: var(--muted, #777); cursor: default; }
.login .cbox li.none:hover { background: transparent; color: var(--muted, #777); }

/* Lists page in sections */
.lgroup { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 10px 0; }
.lgroup > summary { cursor: pointer; list-style: revert; }
.lgroup > summary h2 { font-size: 17px; }
.lgroup[open] > summary { margin-bottom: 10px; }
.lgroup .lists { margin-top: 4px; }

/* Lead outcome blocks in the call form */
.outb { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 4px 0; }
.outb legend { font-weight: 600; padding: 0 4px; }
.outb.grey { background: var(--accent-soft); color: var(--muted, #666); }
.li .lie { max-width: 220px; }

/* Checkbox next to its text */
label.row { flex-direction: row; align-items: center; }
label.row > input[type=checkbox] { min-height: 0; width: 18px; height: 18px; margin: 0; }
label.row { flex-wrap: nowrap; }
.f .outb, .f > .wall { grid-column: 1 / -1; }
#rForm .outb { min-width: min(520px, 100%); }

/* Match EMR arrivals */
.xPick { width: 100%; max-width: 440px; }

/* ---------- Dashboard charts: categorical palette (validated light + dark) ---------- */
:root { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948; --s-other: #8a8f98; --s-none: #c9ced6; --s-uncl: #e3e6ea; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767; --s-other: #7d838c; --s-none: #4a525c; --s-uncl: #343c45; } }
:root[data-theme="dark"] { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767; --s-other: #7d838c; --s-none: #4a525c; --s-uncl: #343c45; }
.scopebar { position: sticky; top: 0; z-index: 5; }
.scopeline { margin: 4px 0 10px; color: var(--muted); }
.cpick { position: relative; }
.cpick > summary { list-style: none; cursor: pointer; }
.cpick > summary::-webkit-details-marker { display: none; }
.cpbox { position: absolute; z-index: 20; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 4px; max-height: 340px; overflow: auto; min-width: 320px; box-shadow: 0 6px 24px rgba(0,0,0,.12); }
.cpbox label, .cmopts label { font-weight: 500; color: var(--ink); padding: 3px 0; gap: 8px; }
.cmopts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2px 14px; }
.expb { display: flex; gap: 6px; flex-wrap: wrap; }
.dsec h2 { margin-bottom: 8px; }
.hb { display: grid; gap: 6px; }
.hbr { display: grid; grid-template-columns: minmax(120px, 230px) minmax(80px, 1fr) 54px minmax(0, 200px); gap: 10px; align-items: center; }
.hbl { font-size: 13px; }
.hbt { background: var(--line); border-radius: 4px; height: 14px; overflow: hidden; }
.hbt i { display: block; height: 100%; background: var(--s1); border-radius: 0 4px 4px 0; }
.mix { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: center; margin-bottom: 10px; }
.legend td { padding: 3px 10px 3px 0; border: 0; font-size: 13px; }
.legend.inline td { display: inline-block; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; }
.hatch { background-image: repeating-linear-gradient(45deg, transparent 0 3px, var(--panel) 3px 5px) !important; }
tr.sect td { background: var(--accent-soft); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
td.cbest { background: var(--good-soft); color: var(--good); font-weight: 600; }
td.cworst { background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.stk { display: grid; gap: 8px; margin-bottom: 8px; }
.stkr { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px; align-items: center; }
.stkb { display: flex; height: 22px; gap: 2px; }
.stkb i { display: block; height: 100%; min-width: 2px; }
.stkb i:first-child { border-radius: 4px 0 0 4px; } .stkb i:last-child { border-radius: 0 4px 4px 0; }
.tile .small { display: block; font-weight: 400; }
@media (max-width: 700px) { .mix { grid-template-columns: 1fr; justify-items: center; } .hbr { grid-template-columns: minmax(0, 1fr) 50px; } .hbr .hbt { grid-column: 1 / -1; grid-row: 2; } .hbr .small { grid-column: 1 / -1; } .stkr { grid-template-columns: 1fr; } .cpbox { min-width: 0; width: calc(100vw - 48px); } }
@media print { .no-print { display: none !important; } .printdash .card { break-inside: avoid; border: 1px solid #ccc; } .printdash { font-size: 12px; color: #000; background: #fff; } .printdash svg { max-width: 220px; } }
.printdash { display: none; }
@media print { .printdash { display: block; } }

/* Admin hub and permissions */
.ahub { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ahub .card { margin: 0; }
.alink { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); border: 1px solid transparent; }
.alink:hover, .alink:focus-visible { background: var(--accent-soft); border-color: var(--line); }
.pgrid td, .pgrid th { text-align: center; } .pgrid td:first-child, .pgrid th:first-child { text-align: left; }
.pgrid input { width: 18px; height: 18px; min-height: 0; }

/* Build 13: list locks, long lists, upload, searchable picker */
.li .lk { width: 1.4em; flex: 0 0 1.4em; text-align: center; cursor: help; opacity: .55; }
.li .lk.on { opacity: 1; }
.li.lmore, .li.lhide { display: none; }
.li .lics { max-width: 260px; }
.li .lil { max-width: 130px; }
.li input.liv:disabled { background: var(--panel); color: inherit; opacity: .9; }
.pick { position: relative; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: var(--panel); }
.pick .pchips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.pick .pchip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; white-space: normal; }
.pick .px { border: 0; background: none; cursor: pointer; font-size: 1.1em; line-height: 1; padding: 0 2px; color: inherit; }
.pick .pin { width: 100%; box-sizing: border-box; }
.pick .plist { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; max-height: 260px; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.pick .pop { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 9px; cursor: pointer; color: inherit; font: inherit; }
.pick .pop.on, .pick .pop:hover { background: var(--hl, rgba(30,100,200,.12)); }
button.lk { border: 1px solid transparent; background: none; border-radius: 6px; padding: 2px; cursor: pointer; font-size: 1em; }
button.lk:hover, button.lk:focus-visible { border-color: var(--line); opacity: 1; }

/* Sign in: Roster look (same tokens and shapes as Roster v3, scoped to the login screen) */
html.rlogin body { background: #F2F2F7; }
.login.rv {
  --rv-bg: #F2F2F7; --rv-surface: #FFFFFF; --rv-fill: rgba(118,118,128,.12); --rv-ink: #000; --rv-muted: rgba(60,60,67,.62); --rv-ink3: rgba(60,60,67,.32);
  --rv-sep: rgba(60,60,67,.22); --rv-tint: #007AFF; --rv-tint-text: #0062CC; --rv-tint-bg: rgba(0,122,255,.11); --rv-danger-text: #C4140A; --rv-danger-bg: rgba(255,59,48,.11);
  --rv-shadow: 0 10px 40px rgba(0,0,0,.16), 0 2px 6px rgba(0,0,0,.06);
  display: block; min-height: 0; max-width: 440px; margin: 0 auto; padding: calc(7vh + env(safe-area-inset-top, 0px)) 16px calc(28px + env(safe-area-inset-bottom, 0px)); text-align: center;
  font: 400 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; color: var(--rv-ink); -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) { html.rlogin:not([data-theme="light"]) body { background: #000; }
  html:not([data-theme="light"]) .login.rv { --rv-bg: #000; --rv-surface: #1C1C1E; --rv-fill: rgba(118,118,128,.24); --rv-ink: #fff; --rv-muted: rgba(235,235,245,.6); --rv-ink3: rgba(235,235,245,.3); --rv-sep: rgba(84,84,88,.65); --rv-tint: #0A84FF; --rv-tint-text: #4BA3FF; --rv-tint-bg: rgba(10,132,255,.2); --rv-danger-text: #FF6961; --rv-danger-bg: rgba(255,69,58,.17); --rv-shadow: 0 12px 40px rgba(0,0,0,.6); } }
html.rlogin[data-theme="dark"] body { background: #000; }
:root[data-theme="dark"] .login.rv { --rv-bg: #000; --rv-surface: #1C1C1E; --rv-fill: rgba(118,118,128,.24); --rv-ink: #fff; --rv-muted: rgba(235,235,245,.6); --rv-ink3: rgba(235,235,245,.3); --rv-sep: rgba(84,84,88,.65); --rv-tint: #0A84FF; --rv-tint-text: #4BA3FF; --rv-tint-bg: rgba(10,132,255,.2); --rv-danger-text: #FF6961; --rv-danger-bg: rgba(255,69,58,.17); --rv-shadow: 0 12px 40px rgba(0,0,0,.6); }
.login.rv .appicon { width: 84px; height: 84px; border-radius: 20px; margin: 0 auto 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(160deg, #3D9BFF, #0062E0); box-shadow: 0 2px 6px rgba(0,98,224,.35); }
.login.rv .appicon svg { width: 46px; height: 46px; }
.login.rv h1 { font-size: 1.875rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; margin: 0; color: var(--rv-ink); }
.login.rv .lsub { color: var(--rv-muted); margin: 4px 0 0; font-size: 15px; }
.login.rv .card { text-align: left; margin-top: 20px; max-width: none; background: var(--rv-surface); border: 0; border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: none; }
.login.rv .lhint { margin: 0; color: var(--rv-muted); font-size: 14px; }
.login.rv .lbl { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--rv-muted); margin: 0 0 6px 2px; }
.login.rv input { width: 100%; background: var(--rv-fill); border: 1px solid transparent; border-radius: 10px; padding: 9px 12px; min-height: 44px; font: inherit; color: var(--rv-ink); box-sizing: border-box; }
.login.rv input::placeholder { color: var(--rv-ink3); }
.login.rv input:focus { outline: none; background: var(--rv-surface); box-shadow: 0 0 0 2px var(--rv-tint); }
.login.rv .combo input.ok { border-color: transparent; box-shadow: inset 0 0 0 1.5px #34C759; }
.login.rv .combo input.ok:focus { box-shadow: 0 0 0 2px var(--rv-tint); }
.login.rv .pin { font-size: 22px; letter-spacing: .3em; text-align: center; }
.login.rv .ctog { color: var(--rv-muted); }
.login.rv .cbox { background: var(--rv-surface); border: 0; border-radius: 14px; box-shadow: var(--rv-shadow); padding: 6px; }
.login.rv .cbox li { border-radius: 10px; padding: 11px 12px; color: var(--rv-ink); }
.login.rv .cbox li.on, .login.rv .cbox li:hover { background: var(--rv-tint-bg); color: var(--rv-ink); }
.login.rv .cbox li.none, .login.rv .cbox li.none:hover { color: var(--rv-muted); background: transparent; }
.login.rv .cta { width: 100%; min-height: 48px; margin-top: 4px; padding: 12px 20px; border: 0; border-radius: 14px; background: var(--rv-tint); color: #fff; font: 600 17px/1.2 inherit; font-family: inherit; letter-spacing: -.01em; cursor: pointer; transition: transform 160ms cubic-bezier(.2,.8,.2,1), opacity 160ms; }
.login.rv .cta:active:not(:disabled) { transform: scale(.97); opacity: .82; }
.login.rv .cta:disabled { opacity: .38; }
.login.rv .msg.bad { background: var(--rv-danger-bg); color: var(--rv-danger-text); border: 0; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.login.rv .foot { margin-top: 12px; color: var(--rv-muted); font-size: 14px; display: flex; justify-content: center; flex-wrap: wrap; }
.login.rv .foot a { color: var(--rv-tint-text); text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .login.rv .cta { transition: none; } }
html.rlogin #app, html.rlogin #boot { display: none !important; }
.login.rv .f { display: block; min-width: 0; }
.login.rv h1 { font-family: inherit; }
.login.rv .combo input { padding-right: 42px; }
