/* Camfil LIMS — Option A · Clear Current. Local Windows fonts and assets only. */
:root {
  --brand: #008457;
  --brand-hover: #006b46;
  --g900: #20332c;
  --g800: #20332c;
  --g700: #006b46;
  --g600: #006b46;
  --g500: #006b46;
  --g400: #596b63;
  --g300: #596b63;
  --g200: #a9bfb2;
  --g100: #dbe4df;
  --g50: #e1ece5;
  --g25: #f2f6f3;
  --bg: #f5f8f6;
  --nav: #e9f3ed;
  --surface: #ffffff;
  --surface-2: #f2f6f3;
  --line: #dbe4df;
  --line-soft: #e8eeea;
  --text: #20332c;
  --text-2: #405a4e;
  --muted: #596b63;
  --red: #b43d32;
  --red-bg: #fff0ed;
  --amber: #865600;
  --amber-bg: #fff4d9;
  --ok: #006b46;
  --ok-bg: #e7f5ed;
  --slate: #596b63;
  --slate-bg: #f2f6f3;
  --received: #6c91a4;
  --lab-PARTICLE: #008457;
  --lab-ANALYTICAL: #296e96;
  --lab-MOLECULAR: #74618d;
  --radius: 12px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px #234b3504;
  --shadow: 0 2px 5px #234b3504;
  --shadow-lg: 0 12px 36px #20332c24;
  /* the theme engine in app.js replaces every colour above and below from one chosen colour (Appearance); these are
     the starting values (Camfil green, light) for the moment before it runs */
  --brand-fg: #ffffff;
  --brand-line: #c9ddd0;
  --fill: #008457;
  --fill-hover: #006b46;
  --hover: #dcece2;
  --count-bg: #ffffffb3;
  --tint: #e9f5ef;
  --select: #edf3fa;
  --focus: rgba(0,132,87,.14);
  --focus-ring: #296e96;
  --knob: #ffffff;
  --surface-solid: #ffffff;
  --red-line: #f0cdc5;
  --amber-line: #f1dcb1;
  --ok-line: #bfe3d2;
  --toast-bg: #20332c;
  --toast-fg: #ffffff;
  --toast-icon: #c7ebd8;
  --veil: rgba(7,18,13,.36);
  --glass-line: #dbe4df;
  --art1: transparent; --art2: transparent; --art3: transparent; --art-op: 0; --sweep: none; --sweep-op: 0;
  --font: "Segoe UI Variable Text", "Segoe UI", sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", sans-serif;
  --sidebar: 208px;
  --panel: 366px;
  --page-pad: 24px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-hover); text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -.01em; }
.num, td.num, .tabular { font-variant-numeric: tabular-nums; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }
::selection { background: var(--g100); }

/* ---------- Login ---------- */
.login { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-brand {
  position: relative; overflow: hidden; padding: 56px 64px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--nav); color: var(--text); border-right: 1px solid var(--line);
}
.login-brand img { width: 220px; }
.speed { display: none; position: absolute; right: -40px; top: 34%; width: 72%; opacity: .16; }
.speed span { display: block; height: 16px; margin: 0 0 14px auto; background: #fff; clip-path: polygon(6% 0, 100% 0, 96% 100%, 0 100%); }
.speed span:nth-child(1) { width: 100%; }
.speed span:nth-child(2) { width: 82%; }
.speed span:nth-child(3) { width: 66%; }
.speed span:nth-child(4) { width: 52%; }
.speed span:nth-child(5) { width: 40%; }
.login-brand h1 { font-size: 40px; line-height: 1.12; font-weight: 600; max-width: 520px; margin-top: 18px; }
.login-brand p { color: var(--muted); font-size: 16px; max-width: 460px; margin: 16px 0 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 11.5px; font-weight: 600; color: var(--g300); }
.login-labs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }
.login-labs span { border: 1px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 99px; font-size: 13px; color: var(--text-2); }
.login-foot { font-size: 12.5px; color: var(--g300); display: flex; gap: 22px; }
.login-form-wrap { display: grid; place-items: center; padding: 40px; background: var(--surface); }
.login-form { width: 100%; max-width: 380px; }
.login-form img { width: 128px; margin-bottom: 36px; }
.login-form h2 { font-size: 26px; font-weight: 600; }
.login-form .sub { color: var(--muted); margin: 6px 0 28px; }
.login-form .field { margin-bottom: 16px; }
.login-form .btn { width: 100%; justify-content: center; height: 46px; font-size: 15px; margin-top: 8px; }
.login-err { background: var(--red-bg); color: var(--red); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; margin-bottom: 14px; display: none; }
.login-err.show { display: block; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--nav); color: var(--text-2); display: flex; flex-direction: column; padding: 0 14px; border-right: 1px solid var(--line); }
.sb-logo { height: 80px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 10px; }
.sb-logo img { width: 108px; display: block; }
.sb-tag { border-left: 1px solid var(--brand-line); padding-left: 10px; font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--brand-hover); }
.sb-section { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; padding: 17px 10px 8px; }
.nav { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 8px 10px; margin: 1px 0; border-radius: 8px; color: var(--text-2); font-weight: 500; }
.nav:hover { background: var(--hover); }
.nav.active { background: var(--fill); color: var(--brand-fg); }
.nav .grow { flex: 1; min-width: 0; }
.nav.locked { opacity: .6; cursor: not-allowed; }
.nav .count { font-size: 12px; background: var(--count-bg); border-radius: 5px; min-width: 23px; text-align: center; color: var(--brand-hover); padding: 1px 4px; }
.nav .count.alert { color: var(--red); background: var(--red-bg); }
.role-tag { font-size: 11px; padding: 1px 4px; border-radius: 4px; border: 1px solid currentColor; }
.lab-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sb-spacer { flex: 1; }
.sb-foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--brand-line); padding: 18px 6px; margin-top: 18px; font-size: 12px; }
.sb-foot span { display: block; color: var(--muted); }
.sb-user { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 4px; border-radius: 7px; cursor: pointer; flex: none; }
.sb-user:hover { background: var(--g25); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 12px; background: var(--g50); border: 1px solid var(--brand-line); color: var(--brand-hover); flex: none; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.sb-user .who { max-width: 150px; text-align: left; font-size: 13px; }
.sb-user .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: 64px; display: flex; align-items: center; gap: 16px; padding: 0 var(--page-pad); background: var(--surface); border-bottom: 1px solid var(--line); }
.location { display: flex; align-items: center; gap: 10px; font-size: 13px; min-width: 0; }
.location .crumb { color: var(--muted); white-space: nowrap; }
.location .crumb:not(:empty)::after { content: '/'; margin-left: 10px; color: var(--g200); }
#title { font-weight: 600; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.search { position: relative; width: 310px; min-width: 160px; }
.search input { width: 100%; height: 36px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface-2); padding: 0 64px 0 34px; font-size: 13px; }
.search input:focus { border-color: var(--brand); }
.search > svg { position: absolute; left: 11px; top: 10px; color: var(--muted); }
.search kbd { position: absolute; right: 9px; top: 8px; font: 11px var(--font); color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 1px 4px; background: var(--surface); }

.search-results { position: absolute; top: 46px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; display: none; max-height: 420px; overflow-y: auto; }
.search-results.show { display: block; }
.sr-item { display: flex; gap: 10px; align-items: center; padding: 10px 14px; cursor: pointer; border: 0; border-bottom: 1px solid var(--line-soft); background: var(--surface); text-align: left; width: 100%; }
.sr-item:hover, .sr-item.hl { background: var(--g25); }
.sr-item .t { flex: 1; min-width: 0; }
.sr-item .t b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-item .t span { font-size: 12px; color: var(--muted); }
.sr-empty { padding: 16px; color: var(--muted); text-align: center; }
.today-chip { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }

.view { padding: 22px var(--page-pad) 40px; width: 100%; }
.trial-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px var(--page-pad); font-size: 13px; background: var(--g25); border-bottom: 1px solid var(--line); color: var(--g500); }
.trial-bar.soon { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber); }
.trial-bar .btn { margin-left: auto; }
.trial-end { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--surface-2); }
.trial-end .card { max-width: 520px; padding: 36px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.trial-end img { height: 34px; margin-bottom: 8px; }
.trial-end p { margin: 0; line-height: 1.55; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 28px; font-weight: 600; letter-spacing: -.6px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .spacer { flex: 1; }
.page-head > div:first-child { min-width: 0; }
.page-head > .lc-ico { flex: none !important; }

/* ---------- Buttons & form controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 7px; border: 1px solid transparent; font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--fill); color: var(--brand-fg); border-color: transparent; }
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary { background: var(--surface); border-color: var(--line); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--g200); background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--g25); }
.btn-danger { background: var(--surface); border-color: var(--red-line); color: var(--red); }
.btn-danger:hover { background: var(--red-bg); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--g25); color: var(--text); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field label .req { color: var(--red); margin-left: 2px; }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; height: 40px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface);
  padding: 0 12px; outline: none; transition: border .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--focus); }
.input[readonly], .input:disabled { background: var(--surface-2); color: var(--text-2); }
.input-group { display: flex; align-items: center; }
.input-group .input { border-radius: 10px 0 0 10px; }
.input-group .suffix { white-space: nowrap; height: 40px; display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line); border-left: 0; border-radius: 0 10px 10px 0; background: var(--surface-2); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.span-2 { grid-column: span 2; }

.segmented { display: inline-flex; background: var(--g25); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button { border: 0; background: transparent; padding: 6px 13px; border-radius: 7px; font-weight: 600; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(7,18,13,.12); }
.segmented button.on.urgent { color: var(--red); }

.switch { position: relative; width: 38px; height: 22px; display: inline-block; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--g100); border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--knob); box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(16px); }

.check { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; transition: background .12s; }
.check:hover { background: var(--g25); }
.check input { appearance: none; width: 18px; height: 18px; border: 1.5px solid var(--g200); border-radius: 5px; margin: 1px 0 0; flex: none; display: grid; place-items: center; cursor: pointer; transition: .12s; background: var(--surface-solid); }
.check input:checked { background: var(--brand); border-color: var(--brand); }
.check input:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--brand-fg); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.check .t { flex: 1; }
.check .lt { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Cards ---------- */
.card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 0; flex-wrap: wrap; }
.card-head h3 { font-size: 16px; font-weight: 600; }
.card-head .sub { font-size: 12.5px; color: var(--muted); }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px 20px 20px; }
.grid-dash { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.grid-dash > *, .row-2-1 > *, .row-1-1 > *, .row-tiles > * { min-width: 0; }
.row-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.row-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.row-1-1 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; }
.row-labs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

.tile { padding: 12px 15px; position: relative; text-align: left; }
.tile .k { font-size: 13px; color: var(--muted); font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.tile .v { display: block; font-family: var(--font-display); font-size: 29px; font-weight: 600; letter-spacing: -.4px; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.tile .v small { font-size: 15px; font-weight: 500; }
.tile .d { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.tile .ico { display: inline-grid; }
.tile.red { background: var(--red-bg); border-color: var(--red-line); }
.tile.red .v { color: var(--red); }
.tile.amber { background: var(--amber-bg); border-color: var(--amber-line); }
.tile.amber .v { color: var(--amber); }
.tile.hero { background: var(--fill); color: var(--brand-fg); border-color: transparent; }
.tile.hero .k, .tile.hero .d { color: var(--brand-fg); }
.tile.clickable { cursor: pointer; }
.tile.clickable:hover { border-color: var(--g200); }
.tile-main { display: block; width: 100%; color: inherit; }
.tile-main, button.d { border: 0; padding: 0; background: none; text-align: left; cursor: pointer; }
.greet h2 { font-size: 28px; font-weight: 600; }
.greet p { color: var(--muted); margin: 5px 0 0; font-size: 13px; }
.grid-dash > .page-head { margin-bottom: 2px; }
.dash-work { display: grid; grid-template-columns: 1.52fr 1fr; gap: 14px; }
.dash-insights { display: grid; grid-template-columns: 1.2fr .85fr 1fr; gap: 14px; }
.dash-work > *, .dash-insights > * { min-width: 0; }
.dashboard .card-head { padding: 14px 16px 10px; gap: 6px; }
.dashboard .card-body { padding: 0 16px 14px; }
.dashboard .legend { flex-wrap: wrap; gap: 12px; }
.throughput .card-head { align-items: flex-start; }
.throughput .legend { flex-basis: 100%; }
.throughput .chart { min-height: 120px; }
.status-strip { display: flex; height: 12px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--g25); margin: 2px 0 12px; }
.status-strip button { border: 0; padding: 0; min-width: 2px; cursor: pointer; }
.status-legend { display: grid; gap: 8px; }
.status-legend button { display: grid; grid-template-columns: 8px 1fr auto 36px; gap: 8px; align-items: center; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
.status-legend i { width: 8px; height: 8px; border-radius: 2px; }
.status-legend .muted { text-align: right; }
.status-total { margin-top: 10px; color: var(--brand-hover); font-size: 12px; }
.attention-list { display: grid; }
.attention-row { display: flex; align-items: center; gap: 8px; padding: 10px 0 !important; border-top: 1px solid var(--line) !important; width: 100%; }
.attention-row > span:first-of-type { flex: 1; min-width: 0; }
.attention-row b, .attention-row small { display: block; }
.attention-row b { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.attention-row small { color: var(--muted); font-size: 12px; }
.attention-row .days { font-size: 12px; }
.attention-more { margin-top: 4px; color: var(--muted); font-size: 12px; }
.attention-more summary { cursor: pointer; }
.recent-activity { border-top: 1px solid var(--line); color: var(--muted); padding: 10px 0; font-size: 12px; }
.recent-activity > summary { display: flex; gap: 16px; align-items: center; cursor: pointer; }
.recent-activity > summary::before { content: '›'; }
.recent-activity[open] > summary::before { content: '⌄'; }
.recent-activity > summary span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-activity .feed { margin-top: 10px; }
/* Laboratory identity is a top rule; interior counts use dividers and space. */
.lab-card { padding: 12px 15px 14px; display: flex; flex-direction: column; gap: 10px; border-top: 3px solid var(--lab-color, var(--brand)); }
.lc-head { display: flex; align-items: center; gap: 8px; }
.lc-ico { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: color-mix(in srgb, var(--lab-color) 14%, var(--surface-solid)); color: var(--lab-color); flex: none; }
.lab-card h3 { font-size: 16px; font-weight: 600; }
.lc-stats { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.lc-stat { display: inline-flex; gap: 4px; align-items: baseline; font-size: 12px; }
.lc-stat span { color: var(--muted); }
.lc-stat b { font-weight: 600; font-variant-numeric: tabular-nums; }
.lc-stat.red b { color: var(--red); }
.lc-stat.amber b { color: var(--amber); }
[data-dd], [data-d] { cursor: pointer; }
.dd-link:hover { text-decoration: underline; }
.tbl th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.tbl th.sortable:hover { color: var(--text); }
.feed-item[data-job]:hover { background: var(--g25); }
.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; }
.pl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.pl-head .red { font-size: 11px; }
.pl-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--g25); gap: 2px; }
.pl-bar button { display: block; height: 100%; padding: 0; border: 0; min-width: 2px; }
.pl-legend { display: flex; justify-content: space-between; gap: 4px; margin-top: 7px; }
.pl-legend button { min-width: 0; text-align: center; flex: 1; }
.pl-legend b { display: block; font-size: 16px; font-weight: 600; }
.pl-legend span { display: block; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }

/* charts */
.chart { width: 100%; display: block; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--muted); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; }
.donut-wrap svg { flex: none; }
.donut-legend { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 150px; }
.donut-legend div { display: flex; align-items: center; gap: 9px; font-size: 13px; white-space: nowrap; }
.donut-legend div b { margin-left: auto; font-variant-numeric: tabular-nums; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; }

/* activity */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.feed-item:last-child { border-bottom: 0; }
.feed-item .dot { width: 30px; height: 30px; border-radius: 9px; background: var(--g25); color: var(--g500); display: grid; place-items: center; flex: none; }
.feed-item .t { font-size: 13px; min-width: 0; }
.feed-item .t b { font-weight: 600; }
.feed-item .t .m { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-size: 12px; text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 650; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; white-space: nowrap; }
.tbl td.wrap { white-space: normal; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover { background: var(--g25); }
.tbl .strong { font-weight: 600; }
.tbl .sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.lt-tbl td, .lt-tbl th { white-space: nowrap; vertical-align: top; }
.lt-tbl th .sub { font-weight: 400; text-transform: none; letter-spacing: 0; }
.lt-tbl .input-group { width: 108px; }
.lt-tbl .input-group .input { min-width: 0; width: 100%; }
.lt-cell b { font-size: 15px; font-variant-numeric: tabular-nums; }
.lt-bad { color: var(--red); font-weight: 600; }
.lt-flag { display: inline-block; padding: 1px 7px; border-radius: 99px; font-size: 11.5px; background: var(--g25); color: var(--g500); }
.lt-flag.ok { background: var(--ok-bg); color: var(--ok); }
.lt-flag.err { background: var(--red-bg); color: var(--red); }
.lt-flag.warn { background: var(--amber-bg); color: var(--amber); }
.lt-tbl tr.lt-changed td { background: color-mix(in srgb, var(--amber-bg) 60%, transparent); }
.tbl .ellip { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl th:first-child, .tbl td:first-child { padding-left: 20px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 20px; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 36px; height: 36px; color: var(--g200); margin-bottom: 8px; }

/* pills & badges */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.overdue, .pill.late { background: var(--red-bg); color: var(--red); }
.pill.due_soon { background: var(--amber-bg); color: var(--amber); }
.pill.on_track { background: var(--ok-bg); color: var(--ok); }
.pill.on_time { background: var(--ok-bg); color: var(--ok); }
.pill.cancelled { background: var(--slate-bg); color: var(--slate); }
.pill.waived { background: var(--ok-bg); color: var(--ok); border: 1px dashed var(--ok-line); }
.callout.waived { background: var(--ok-bg); border-color: var(--ok-line); color: var(--text-2); }
.waiver-reason { margin-top: 6px; padding: 7px 10px; background: var(--surface-solid); border-left: 3px solid var(--ok-line); border-radius: 6px; font-style: italic; color: var(--text); }
.badge { border: 0; display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; padding: 2px 8px; border-radius: 6px; background: var(--g25); color: var(--g500); white-space: nowrap; }
.badge.lab { background: color-mix(in srgb, var(--lab-color) 15%, var(--surface-solid)); color: var(--lab-color); }
.badge.urgent { background: var(--red-bg); color: var(--red); }
.badge.edit, .badge.chemist { background: var(--ok-bg); color: var(--ok); }
.badge.tech { background: var(--ok-bg); color: var(--ok); }
.badge.view { background: color-mix(in srgb, var(--lab-ANALYTICAL) 15%, var(--surface-solid)); color: var(--lab-ANALYTICAL); }
.badge.none { background: var(--slate-bg); color: var(--slate); }
.badge.muted { background: var(--slate-bg); color: var(--slate); }
.days { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }
.days.overdue { color: var(--red); }
.days.due_soon { color: var(--amber); }
.days.done { color: var(--muted); font-weight: 500; }

/* mini stepper */
.steps { display: flex; gap: 3px; align-items: center; }
.steps i { width: 18px; height: 6px; border-radius: 99px; background: var(--g50); display: block; }
.steps i.done { background: var(--brand); }
.steps i.cur { background: var(--brand); opacity: .35; box-shadow: 0 0 0 2px var(--focus); }
.steps-label { font-size: 12px; color: var(--text-2); margin-top: 5px; white-space: nowrap; }

/* toolbar */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.toolbar .search-sm { position: relative; }
.toolbar .search-sm input { height: 36px; width: 260px; padding-left: 34px; }
.toolbar .search-sm svg { position: absolute; left: 11px; top: 10px; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 12px; }
.tab { border: 0; background: transparent; padding: 14px 12px 12px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; gap: 8px; align-items: center; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--brand-hover); border-color: var(--brand); background: var(--ok-bg); }
.tab .n { font-size: 11px; background: var(--g25); color: var(--g500); padding: 1px 7px; border-radius: 99px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { white-space: nowrap; height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 12.5px; cursor: pointer; color: var(--text-2); }
.chip:hover { border-color: var(--g200); }
.chip.on { background: var(--tint); border-color: var(--brand-line); color: var(--brand-hover); }
.chip b { font-variant-numeric: tabular-nums; font-weight: 650; opacity: .8; }
.chip .d { width: 7px; height: 7px; border-radius: 50%; }

/* board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; padding: 16px; overflow-x: auto; background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.col { background: var(--g25); border-radius: 12px; padding: 10px; min-height: 200px; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 650; font-size: 13px; }
.col-head .n { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 12px; margin-bottom: 9px; cursor: pointer; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s; border-left: 3px solid var(--kc, var(--g100)); }
.kcard:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kcard .top { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.kcard .nm { font-weight: 600; margin: 6px 0 8px; font-size: 13px; }
.kcard .bot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.kcard.overdue { --kc: var(--red); }
.kcard.due_soon { --kc: var(--amber); }
.kcard.on_track { --kc: var(--brand); }
.kcard { display: block; width: 100%; text-align: left; }
.kcard .nm { display: block; }

/* bulk actions, risk, holds, forecast */
.check.bare { padding: 0; display: inline-flex; }
.check.bare:hover { background: none; }
.tbl tr.selected td { background: var(--select); }
.bulkbar .bulk-why { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--amber); }
.bulkbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; background: var(--ok-bg); color: var(--brand-hover); position: sticky; top: 64px; z-index: 4; }
.bulkbar .muted { color: var(--muted); font-size: 12.5px; }
.bulkbar .spacer { flex: 1; }
.bulkbar .btn-secondary { background: var(--surface); border-color: var(--brand-line); color: var(--brand-hover); box-shadow: none; }
.bulkbar .btn-ghost { color: var(--brand-hover); }
.hold { color: var(--amber); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.risk-likely_late { color: var(--red); font-weight: 600; }
.risk-at_risk { color: var(--amber); font-weight: 600; }
.fc { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--line); }
.fc.likely_late { border-color: var(--red-line); background: var(--red-bg); }
.fc.at_risk { border-color: var(--amber-line); background: var(--amber-bg); }
.fc.ok { border-color: var(--ok-line); background: var(--ok-bg); }
.link-btn { border: 0; background: none; color: var(--brand-hover); font-weight: 650; cursor: pointer; padding: 0 2px; text-decoration: underline; }
.batch-prev { margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; max-height: 260px; overflow: auto; }
.batch-prev .tbl td, .batch-prev .tbl th { padding: 6px 8px; font-size: 12.5px; }
.delay-item { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; }
.delay-item.ongoing { border-color: var(--amber-line); background: var(--amber-bg); }
.delay-item .t { flex: 1; font-size: 13px; }
.delay-item .t .m { font-size: 12px; color: var(--muted); margin-top: 2px; }

.bneck { display: flex; flex-direction: column; gap: 14px; }
.bn-row { display: grid; grid-template-columns: 170px 1fr; gap: 14px; align-items: center; }
.bn-label { display: flex; flex-direction: column; font-size: 13px; }
.bn-label .muted { font-size: 12px; }
.bn-bar { display: flex; height: 30px; border-radius: 8px; overflow: hidden; gap: 2px; }
.bn-seg { display: flex; align-items: center; padding: 0 8px; min-width: 3px; cursor: pointer; font-style: normal; transition: filter .12s; }
.bn-seg:hover { filter: brightness(.92); }
.bn-seg span { font-size: 11.5px; font-weight: 650; color: var(--seg-ink, #fff); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0,0,0,.25); }

/* statistics */
.stats-filters { display: flex; align-items: center; gap: 20px; padding: 12px 18px; flex-wrap: wrap; position: sticky; top: 76px; z-index: 6; }
.stats-filters .sf { display: flex; align-items: center; gap: 8px; }
.stats-filters .spacer { flex: 1; }
.tile .d .delta { font-weight: 600; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--red); }
.tile.hero .delta.up, .tile.hero .delta.down, .tile.hero .delta .muted { color: var(--brand-fg); }
.chart .bar, .chart .dot { cursor: pointer; transition: opacity .12s; }
.chart .bar:hover { opacity: .78; }
.chart .dot:hover { r: 7; }
.quarters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qcard { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 9px; transition: border-color .15s, box-shadow .15s; }
.qcard:hover { border-color: var(--g200); box-shadow: var(--shadow); }
.qrate { font-family: var(--font-display); font-size: 22px; font-weight: 650; color: var(--ok); }
.qrate.bad, .mbar .bad { color: var(--red); }
.qbar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--g25); }
.qbar i { display: block; height: 100%; }
.qnums { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.qnums b { color: var(--text); }
.mbars { display: flex; flex-direction: column; gap: 14px; }
.mbar { display: flex; flex-direction: column; gap: 6px; cursor: pointer; padding: 6px 8px; margin: -6px -8px; border-radius: 10px; }
.mbar:hover { background: var(--g25); }
.ktable td, .ktable th, .matrix td, .matrix th { padding: 9px 10px; }
.ktable td.num, .matrix td.num { text-align: right; }
.ktable th.num, .matrix th.num { text-align: right; }
td.cellx { cursor: pointer; font-weight: 600; border-radius: 6px; transition: box-shadow .12s; }
td.cellx:hover { box-shadow: inset 0 0 0 2px var(--brand); }
td.cellx.ok { color: var(--ok); }
td.cellx.bad { color: var(--red); }
td.cellx.warn { color: var(--amber); }
td.zero { color: var(--muted); }  /* quieter than real numbers, still readable */
tr.tot td { border-top: 1px solid var(--line); background: var(--surface-2); }
.rchip { display: inline-block; min-width: 42px; padding: 2px 6px; border-radius: 6px; font-weight: 650; font-size: 12px; text-align: center; }
.rchip.ok { background: var(--ok-bg); color: var(--ok); }
.rchip.mid { background: var(--amber-bg); color: var(--amber); }
.rchip.bad { background: var(--red-bg); color: var(--red); }
.matrix td.heat { border: 2px solid var(--surface-solid); }
.modal.xwide { width: min(1080px, calc(100vw - 32px)); }
.drill-wrap { max-height: 56vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.drill-wrap .tbl th { z-index: 1; }
#tip { position: fixed; z-index: 90; pointer-events: none; background: var(--toast-bg); color: var(--toast-fg); font-size: 12px; font-weight: 500; padding: 6px 10px; border-radius: 8px; box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .1s; max-width: 320px; }

/* rig schedule */
.sched-mode #mtabs, .sched-mode #kchips, .sched-mode .search-sm, .sched-mode #scope { display: none; }
.sched-mode .toolbar { justify-content: flex-end; }
#vmode button { display: inline-flex; align-items: center; gap: 6px; }
.sched-bar { display: flex; align-items: center; gap: 18px; padding: 14px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: var(--surface-2); }
.sched-bar .spacer { flex: 1; }
.sched-stats { display: flex; gap: 18px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.sched-stats .warn { color: var(--red); display: inline-flex; align-items: center; gap: 5px; }
.sched-tbl td { vertical-align: middle; }
.sched-tbl .pos { font-weight: 700; color: var(--g500); font-size: 15px; width: 36px; }
.sched-tbl .grip { color: var(--g200); cursor: grab; padding-right: 0; }
.sched-tbl tr[draggable="false"] .grip { cursor: default; }
.sched-tbl tr.dragging { opacity: .35; background: var(--g25); }
.sched-tbl tr.late .pos { color: var(--red); }
.sched-tbl .days-in { width: 64px; height: 32px; padding: 0 8px; }
.sched-tbl .moves { white-space: nowrap; padding-left: 0; }
.sched-tbl .moves .icon-btn { width: 28px; height: 28px; display: inline-grid; }
th.gantt, td.gantt { width: 34%; min-width: 260px; }
.g-head { position: relative; height: 14px; }
.g-head span { position: absolute; transform: translateX(-2px); font-size: 10.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--muted); white-space: nowrap; }
.g-track { position: relative; height: 12px; background: repeating-linear-gradient(90deg, var(--g25) 0 1px, transparent 1px 100%) , var(--surface-2); border-radius: 99px; border: 1px solid var(--line-soft); }
.g-bar { position: absolute; top: 1px; bottom: 1px; background: var(--brand); border-radius: 99px; min-width: 6px; }
tr.late .g-bar { background: var(--red); }
.g-due { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--red); border-radius: 2px; }
.g-due::after { content: ""; position: absolute; top: -3px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.sched-after { padding: 14px 20px 18px; border-top: 1px solid var(--line); }

/* ---------- Drawer ---------- */
.overlay { position: fixed; inset: 0; background: var(--veil); backdrop-filter: blur(2px); z-index: 64; animation: fade .18s ease; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: var(--surface); z-index: 65; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .22s cubic-bezier(.2,.8,.2,1); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.drawer-head { padding: 20px 24px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.drawer-head .row1 { display: flex; align-items: center; gap: 8px; }
.drawer-head .row1 .spacer { flex: 1; }
.drawer-head h3 { font-size: 21px; margin: 10px 0 4px; font-weight: 650; }
.drawer-head .meta { color: var(--muted); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px 32px; display: flex; flex-direction: column; gap: 22px; }
.drawer-body > * { flex-shrink: 0; }
.sec-title { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.sec-title .spacer { flex: 1; }
.kpi-box { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.kpi-box > div { padding: 12px 14px; border-right: 1px solid var(--line); }
.kpi-box > div:last-child { border-right: 0; }
.kpi-box span { font-size: 11.5px; color: var(--muted); font-weight: 600; display: block; }
.kpi-box .kpi-sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; font-weight: 500; }
.kpi-box b { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; display: block; margin-top: 3px; }
.kpi-box.overdue { border-color: var(--red-line); background: var(--surface); }
.kpi-box.due_soon { border-color: var(--amber-line); background: var(--surface); }

.timeline { display: flex; flex-direction: column; }
.tl { display: grid; grid-template-columns: 28px 1fr; gap: 12px; position: relative; padding-bottom: 16px; }
.tl:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--g50); }
.tl.done:not(:last-child)::before { background: var(--brand); }
.tl .c { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--g100); background: var(--surface-solid); color: var(--g300); font-size: 12px; font-weight: 700; z-index: 1; }
.tl.done .c { background: var(--brand); border-color: var(--brand); color: var(--brand-fg); }
.tl.cur .c { border-color: var(--brand); color: var(--brand-hover); box-shadow: 0 0 0 5px var(--focus); }
.tl .b { padding-top: 3px; }
.tl .b b { font-weight: 600; }
.tl .b .m { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tl .b .note { font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 8px; padding: 6px 9px; margin-top: 6px; }
.tl .act { margin-top: 10px; display: flex; gap: 8px; align-items: center; }
.tl .act .input { height: 34px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: var(--g25); border: 1px solid var(--line-soft); padding: 4px 10px; border-radius: 8px; font-size: 12.5px; }
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 11px; background: var(--g25); color: var(--text-2); font-size: 13px; border: 1px solid var(--line-soft); }
.callout.warn { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber); }
.callout.err { background: var(--red-bg); border-color: var(--red-line); color: var(--red); }

/* ---------- Modal ---------- */
.modal { position: fixed; z-index: 61; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); animation: pop .2s cubic-bezier(.2,.8,.2,1); }
.modal.wide { width: min(720px, calc(100vw - 32px)); }
.overlay.m { z-index: 60; }
.overlay.m.top { z-index: 66; }  /* a dialog opened from a job panel goes above the panel */
.modal.top { z-index: 67; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }
.modal-head { padding: 22px 24px 4px; display: flex; align-items: center; }
.modal-head h3 { font-size: 18px; flex: 1; }
.modal-body { padding: 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 14px 24px 22px; display: flex; justify-content: flex-end; gap: 10px; }
.success-mark { width: 56px; height: 56px; border-radius: 16px; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; }
.success-mark svg { width: 28px; height: 28px; stroke-width: 2.4; }

.perm-grid { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; align-items: center; }

/* ---------- Register ---------- */
.reg { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 18px; align-items: start; }
.lab-group { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.lab-group:last-child { margin-bottom: 0; }
.lg-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: color-mix(in srgb, var(--lab-color) 8%, var(--surface-solid)); border-bottom: 1px solid var(--line); font-weight: 650; }
.lg-head .ico { color: var(--lab-color); display: grid; }
.lg-head .spacer { flex: 1; }
.lg-method { padding: 8px 8px 6px; border-bottom: 1px solid var(--line-soft); }
.lg-method:last-child { border-bottom: 0; }
.lg-method .mt { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 4px 10px; }
.routing { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.route-card { border: 1px solid var(--line); border-radius: 13px; padding: 16px; border-top: 3px solid var(--lab-color); background: var(--surface); display: flex; flex-direction: column; gap: 12px; }
.route-card .rc-head { display: flex; align-items: center; gap: 10px; }
.route-card .rc-head h4 { font-size: 15px; }
.route-card .rc-tests { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 4px; margin: -4px -6px 0; }
.route-card .rc-tests .check { padding: 6px; }
.test-set { border: 1px dashed var(--line); border-radius: 14px; padding: 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 12px; }
.test-set .ts-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ts-letter { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--brand); color: var(--brand-fg); font-weight: 700; }
.test-set .set-add { width: auto; max-width: 340px; }
.batch-scroll { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.batch-scroll .tbl td.center, .batch-scroll .tbl th.center { text-align: center; }
.tbl tr.row-warn td { background: var(--red-bg); }
.route-card .due { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 12px; }
.route-card .due b { font-size: 15px; font-family: var(--font-display); }
.route-card .due span { font-size: 12px; color: var(--muted); display: block; }
.reg-footer { position: sticky; bottom: 0; margin: 18px calc(-1 * var(--page-pad)) -40px; padding: 14px var(--page-pad); background: var(--surface); border-top: 1px solid var(--line); display: flex; align-items: center; gap: 16px; z-index: 5; }
.reg-footer .sum { flex: 1; color: var(--text-2); }
.reg-footer .sum b { color: var(--text); }

/* holidays */
.hol-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.hol { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.hol .cal { width: 44px; text-align: center; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); flex: none; }
.hol .cal span { display: block; background: var(--brand); color: var(--brand-fg); font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 1px 0; }
.hol .cal b { display: block; font-size: 17px; padding: 2px 0; font-family: var(--font-display); }
.hol .t { flex: 1; min-width: 0; }
.hol .t b { display: block; font-weight: 600; font-size: 13px; }
.hol .t span { font-size: 12px; color: var(--muted); }
.hol.past { opacity: .55; }

/* toasts */
#toasts { position: fixed; bottom: 22px; right: 22px; z-index: 80; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--toast-bg); color: var(--toast-fg); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: center; font-weight: 500; animation: slide .2s ease; max-width: 420px; }
.toast.err { background: var(--red); }
.toast svg { color: var(--toast-icon); }
.toast.err svg { color: var(--toast-fg); }

.menu { position: fixed; z-index: 70; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 210px; animation: fade .12s; }
.menu button { width: 100%; border: 0; background: none; display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--g25); }

.loading { padding: 60px; display: grid; place-items: center; color: var(--muted); }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--g50); border-top-color: var(--brand); animation: spin .8s linear infinite; }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; display: inline-block; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.muted { color: var(--muted); }
.mt-0 { margin-top: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.right { text-align: right; }
.mono { font-family: Consolas, monospace; font-size: 13px; }
.link { color: var(--brand-hover); font-weight: 600; cursor: pointer; }
.link:hover { text-decoration: underline; }
.hidden { display: none !important; }

.nav-toggle, .nav-backdrop { display: none; }

/* ---------- Dashboard: Next up and rig queues ---------- */
.nu-list { border-top: 1px solid var(--line-soft); }
.nu-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background .1s; }
.nu-row:last-child { border-bottom: 0; }
.nu-row:hover { background: var(--g25); }
.nu-name { min-width: 0; display: flex; flex-direction: column; }
.nu-name b { font-weight: 600; display: block; overflow-wrap: anywhere; font-size: 15px; }
.nu-name .sub { font-size: 12px; color: var(--muted); }
.nu-stage { font-size: 13px; color: var(--text-2); }
.nu-act { justify-self: end; }
.rigs-now { display: flex; flex-direction: column; padding-top: 4px; padding-bottom: 8px; }
.rig-now { display: flex; flex-direction: column; gap: 2px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.rig-now:last-child { border-bottom: 0; }
.rn-top { display: flex; align-items: center; gap: 8px; }
.rn-top .spacer { flex: 1; }
.rn-name { font-weight: 600; font-size: 13.5px; color: var(--text); cursor: pointer; }
.rn-name:hover { color: var(--brand-hover); text-decoration: underline; }
.rn-job { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; min-width: 0; width: 100%; }
.rn-job > span { min-width: 0; overflow-wrap: anywhere; }
.rn-job small { font-size: 12px; color: var(--muted); white-space: nowrap; }
.rn-late { white-space: nowrap; }
.rn-job .ellip { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rn-job:hover .ellip { text-decoration: underline; }
.rn-job .muted { font-size: 12px; }
.rn-late { font-size: 12.5px; color: var(--red); font-weight: 600; }
.dd-link.red { color: var(--red); }

/* ---------- Lab worklist: stage strip (open jobs at each stage; click to filter) ---------- */
.stage-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.seg-f { border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 14px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-sm); transition: border-color .15s, background .15s; }
.seg-f:hover { border-color: var(--g200); }
.seg-f .s-n { font-size: 13px; color: var(--muted); font-weight: 600; }
.seg-f .s-v { font-family: var(--font-display); font-size: 21px; font-weight: 650; font-variant-numeric: tabular-nums; }
.seg-f .s-l { font-size: 12px; color: var(--red); font-weight: 600; margin-left: 6px; }
.seg-f.on { background: var(--ok-bg); border-color: var(--brand); color: var(--brand-hover); box-shadow: inset 0 -2px var(--brand); }
.seg-f.on .s-n { color: var(--brand-hover); }
.seg-f.on .s-l { color: var(--red); }
.seg-f.zero .s-v { color: var(--muted); }
.seg-f.on.zero .s-v { color: var(--muted); }
.tbl tbody tr.current td { background: var(--tint); }
.tbl tbody tr.current td:first-child { box-shadow: inset 3px 0 0 var(--brand); }

/* ---------- Job panel: next step first, folding sections ---------- */
.job-actions { display: flex; flex-direction: column; gap: 8px; }
.job-actions .main-act { height: 42px; font-size: 14px; width: 100%; justify-content: center; }
.job-actions .row2 { display: flex; gap: 8px; }
.secs { display: flex; flex-direction: column; border-bottom: 1px solid var(--line-soft); }
details.sec { border-top: 1px solid var(--line-soft); }
details.sec > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 12px 0; cursor: pointer; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary:hover { color: var(--text); }
details.sec > summary .note { color: var(--g300); font-weight: 600; font-size: 12px; letter-spacing: 0; text-transform: none; }
details.sec > summary .spacer { flex: 1; }
details.sec > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-right: 4px; }
details.sec[open] > summary::after { transform: rotate(45deg); }
details.sec > .sec-body { padding: 2px 0 16px; display: flex; flex-direction: column; gap: 12px; }
.sib-row { justify-content: space-between; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.danger-zone { padding-top: 4px; }
.drawer-head .meta span { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Clear Current: work surfaces, panel and responsive frame ---------- */
.plain { border: 0; background: none; padding: 0; color: inherit; text-align: left; cursor: pointer; }
.plain:hover { color: var(--brand-hover); }
.qcard { background: var(--surface); text-align: left; }
.qcard > span { width: 100%; }
.bn-seg { border: 0; }
.mbar.plain { padding: 6px 8px; }
.tbl td.cellx { padding: 0; }
.cell-button { width: 100%; padding: 9px 10px; text-align: right; font-weight: 600; }
.cell-button:hover { color: inherit; background: var(--hover); }
button { font: inherit; }
button, a, input, select, textarea, summary, [tabindex] { outline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus-ring) !important; }
.switch input:focus-visible + span { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.card-head > *, .row > *, .grid-2 > *, .grid-3 > * { min-width: 0; }
.kv dd { overflow-wrap: anywhere; }
.legend { flex-wrap: wrap; }
.tabs { overflow-x: auto; }
.tab { white-space: nowrap; }
.list-tools .search-sm { flex: 1; max-width: 400px; min-width: 210px; }
.list-tools .search-sm input { width: 100%; }
.list-filters { background: var(--surface-2); gap: 12px; }
.sched-mode .list-filters { display: none; }
.work-table td { height: 64px; }
.work-table .job-cell { width: 155px; }
.work-table .sample-cell { min-width: 160px; white-space: normal; overflow-wrap: anywhere; }
.work-table .kpi-cell { min-width: 185px; white-space: normal; }
.kpi-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; }
.work-table .pill { padding: 0; height: auto; background: transparent; font-size: 12px; }
.work-table .pill.waived { padding: 2px 6px; }
.work-table .pill::before { display: none; }
.work-table .days { font-size: 12px; }
.work-table .steps { margin-top: 6px; }
.steps-label { font-size: 13px; margin: 0 0 4px; }
.steps-wrap { display: flex; flex-direction: column-reverse; }
.job-open { color: var(--brand-hover); font-weight: 600; }
.job-open:hover { text-decoration: underline; }
.work-scroll { max-height: calc(100vh - 345px); min-height: 120px; overflow: auto; }
.work-scroll th { z-index: 2; }
.mywork-table td { height: 66px; }
.mywork-table .sample-cell { white-space: normal; min-width: 190px; }
.mywork-table .job-cell { min-width: 165px; }
.mywork-table .sub { white-space: normal; }
.sample-table td { height: 66px; }
.sample-table .sample-cell { min-width: 220px; white-space: normal; }
.sample-table .badge { white-space: normal; text-align: left; }
.sample-table .badge.link { padding: 6px 8px; }
.section-no { display: inline-grid; place-items: center; width: 25px; height: 25px; margin-right: 8px; background: var(--ok-bg); color: var(--brand-hover); border: 1px solid var(--brand-line); border-radius: 50%; font-size: 13px; }
.lg-method .mt, .sec-title { font-size: 13px; letter-spacing: 0; text-transform: none; font-weight: 600; }
.test-set { border-radius: 10px; background: var(--surface-2); }
.route-card { border-radius: 10px; }
.stats-filters { top: 74px; }
.chart text { font-size: 12px; }
.chart-values { margin-top: 10px; font-size: 12px; color: var(--muted); }
.chart-values summary { cursor: pointer; }
.chart-values > div { display: flex; flex-wrap: wrap; gap: 6px; max-height: 180px; overflow: auto; margin-top: 8px; }
.chart-values button { font-size: 12px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); cursor: pointer; }
.chart-values button:hover { color: var(--brand-hover); border-color: var(--brand); }
.feed-item { width: 100%; text-align: left; }
.feed-item .m { display: block; }
.drawer { border-left: 1px solid var(--line); }
.drawer-head { padding: 14px 18px; position: relative; }
.drawer-head .row1 { flex-wrap: wrap; gap: 6px; padding-right: 28px; }
.drawer-head .row1 > button[data-close] { position: absolute; right: 10px; top: 10px; }
.drawer-head h3 { font-size: 22px; font-weight: 600; overflow-wrap: anywhere; }
.drawer-head .meta { gap: 5px 12px; font-size: 12px; overflow-wrap: anywhere; }
.drawer-head .meta span { max-width: 100%; }
.drawer-head .meta span:nth-child(-n+2) { font-family: Consolas, monospace; font-size: 13px; }
.drawer-body { padding: 16px 18px 24px; gap: 18px; }
.drawer-body .grid-2 { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.drawer-body .span-2 { grid-column: auto; }
.drawer-body .row, .drawer-body .row2 { flex-wrap: wrap; }
.drawer-body .kv { grid-template-columns: 100px minmax(0, 1fr); gap: 8px 12px; }
.drawer-body dd { overflow-wrap: anywhere; }
.delay-item .t { min-width: 0; overflow-wrap: anywhere; }
.drawer-body .input-group .input { min-width: 0; }
.job-actions .row2 { justify-content: flex-end; }
#undo { background: transparent; border: 0; box-shadow: none; color: var(--muted); padding-right: 0; }
.kpi-box { grid-template-columns: repeat(2, minmax(0, 1fr)); border: 0; border-radius: 0; border-bottom: 1px solid var(--line); padding-bottom: 14px; gap: 14px 12px; }
.kpi-box > div { padding: 0; border: 0; }
.kpi-box span { font-size: 12px; font-weight: 400; }
.kpi-box b { font-size: 13px; font-weight: 600; }
.kpi-box.overdue .dl { color: var(--red); }
.kpi-box.due_soon .dl { color: var(--amber); }
.timeline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
.tl { grid-template-columns: 23px minmax(0, 1fr); gap: 7px; padding: 0; }
.tl:not(:last-child)::before { display: none; }
.tl .c { width: 23px; height: 23px; border-width: 1px; font-size: 11px; }
.tl .b { padding-top: 1px; min-width: 0; overflow-wrap: anywhere; }
.tl .b b { font-size: 13px; }
.tl .b .m { font-size: 11px; }
.tl .b .note { font-size: 12px; padding: 4px 6px; }
details.sec > summary { font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text); }
details.sec > summary .note { font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
.sib-row { padding: 8px; gap: 6px; }
.drawer.busy .drawer-body { opacity: .5; pointer-events: none; }
@media (min-width: 1366px) {
  .drawer.docked { width: var(--panel); top: var(--dock-top, 78px); right: 14px; bottom: 14px; z-index: 15; animation: none; border: 1px solid var(--brand-line); border-radius: 12px; box-shadow: var(--shadow); }
  .drawer.docked .drawer-head { border-radius: 12px 12px 0 0; }
  body.dock-open .view { padding-right: calc(var(--panel) + 28px); }
  body.dock-open .work-table .c-opt { display: none; } /* available in Job details / Tests requested / Sample */
  body.dock-open .work-table th, body.dock-open .work-table td { padding-left: 10px; padding-right: 10px; }
  body.dock-open .work-table .sample-cell { min-width: 160px; }
  body.dock-open .work-table .job-cell { width: 140px; }
  body.dock-open .work-table .kpi-cell { min-width: 175px; }
}
@media (min-width: 1600px) {
  :root { --page-pad: 34px; --panel: 400px; }
  .search { width: 360px; }
}
@media (max-width: 1380px) {
  :root { --page-pad: 20px; }
  .topbar { gap: 12px; }
  .search { width: 270px; }
  .sb-user .who { display: none; }
  .location { font-size: 12px; }
  .nu-row { gap: 8px; }
  .nu-act .btn { white-space: normal; height: auto; min-height: 32px; padding: 6px 10px; }
}
@media (max-width: 1180px) {
  .row-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .row-labs, .dash-insights { grid-template-columns: 1fr 1fr; }
  .row-labs > :last-child, .dash-insights > :last-child { grid-column: 1 / -1; }
  .dash-work, .row-2-1, .row-1-1, .reg { grid-template-columns: minmax(0, 1fr); }
  .location .crumb { display: none; }
  .sb-user .who { display: none; }
  .search { flex: 1; width: auto; }
}
@media (max-width: 900px) {
  :root { --page-pad: 16px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .nav-toggle { display: grid; flex: none; margin-left: -6px; }
  .shell.nav-open .sidebar { display: flex; position: fixed; left: 0; top: 0; bottom: 0; width: min(280px, 86vw); z-index: 50; box-shadow: var(--shadow-lg); }
  .shell.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 49; background: var(--veil); }
  .topbar { flex-wrap: wrap; height: auto; min-height: 64px; padding: 10px 16px; gap: 8px; }
  .topbar .search { order: 10; flex: 1 0 100%; width: auto; }
  .search input { padding-right: 60px; }
  .location { flex: 1; }
  .topbar .spacer { display: none; }
  .topbar .btn-primary { padding: 0 10px; }
  .sb-user { gap: 3px; }
  .view { padding-top: 18px; }
  .page-head h2 { font-size: 27px; }
  .page-head { gap: 10px; }
  .bulkbar, .stats-filters { position: static; }
  .work-scroll { max-height: 65vh; }
  .login { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-form-wrap { padding: 24px; }
  .trial-bar { padding: 8px 16px; }
  .trial-end .card { padding: 24px; }
  .reg-footer { flex-wrap: wrap; gap: 10px; }
  .reg-footer .sum { min-width: 160px; }
  .stats-filters .sf { flex-wrap: wrap; }
}
@media (max-width: 600px) {
  .row-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .row-labs, .dash-insights, .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .row-labs > :last-child, .dash-insights > :last-child { grid-column: auto; }
  .routing { grid-template-columns: minmax(0, 1fr); }
  .nu-row { grid-template-columns: minmax(0, 1fr) auto; }
  .nu-act { grid-column: 1 / -1; justify-self: start; }
  .topbar #title { max-width: 100px; overflow: hidden; text-overflow: ellipsis; }
  .card-body, .card-head { padding-left: 14px; padding-right: 14px; }
  .modal-body, .modal-head, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .toolbar .search-sm, .toolbar .search-sm input { width: 100%; }
  .toolbar .segmented { flex-wrap: wrap; }
  .trial-end { padding: 12px; }
  #toasts { left: 12px; right: 12px; }
  .toast { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Theme: background gradient, glass, Appearance panel ---------- */
#app { position: relative; z-index: 1; }
/* soft background behind the glass, from Appearance → Background gradient: glow = soft pools of colour, sweep = one
   smooth band across the page, aurora = both, flowing from the main colour into the second colour */
.bg-art { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-art i { position: absolute; border-radius: 50%; filter: blur(80px); opacity: var(--art-op); }
.bg-art i:nth-child(2) { width: 52vw; height: 52vw; left: -12vw; top: -18vw; background: var(--art1); }
.bg-art i:nth-child(3) { width: 46vw; height: 46vw; right: -10vw; top: 18vh; background: var(--art2); }
.bg-art i:nth-child(4) { width: 38vw; height: 38vw; left: 30vw; bottom: -20vw; background: var(--art3); }
.bg-art .sweep { position: absolute; inset: 0; background: var(--sweep); opacity: var(--sweep-op); }
html[data-grad="none"] .bg-art, html:not([data-grad]) .bg-art { display: none; }
html[data-grad="glow"] .bg-art .sweep { display: none; }
html[data-grad="sweep"] .bg-art i { display: none; }
html[data-grad="aurora"] .bg-art i { filter: blur(110px); }
/* see-through backgrounds so the colour behind shows (light or dark) */
.trial-end, .login-form-wrap { background: transparent; }
.login-brand { background: var(--nav); }
/* glass: frosted frame, side menu, top bar, cards and dialogs; tables and forms stay near-solid (--surface-solid) */
html[data-glass="on"] .sidebar, html[data-glass="on"] .topbar { background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%); }
html[data-glass="on"] .card, html[data-glass="on"] .login-brand { -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); }
html[data-glass="on"] .modal, html[data-glass="on"] .drawer, html[data-glass="on"] .menu, html[data-glass="on"] .search-results {
  background: var(--panel-bg); -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%); }
html[data-glass="on"] .card { border-color: var(--glass-line); }
.tbl, .input, .work-table, .kanban .kcard { background-color: var(--surface-solid); }
.btn-primary:hover, .tile.hero:hover { background: var(--fill-hover); }
@media (prefers-reduced-transparency: reduce) {
  html[data-glass="on"] .sidebar, html[data-glass="on"] .topbar, html[data-glass="on"] .card, html[data-glass="on"] .modal,
  html[data-glass="on"] .drawer, html[data-glass="on"] .menu, html[data-glass="on"] .search-results, html[data-glass="on"] .login-brand { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* Appearance panel (from your name, top right) */
.ap-veil { position: fixed; inset: 0; z-index: 80; background: var(--veil); animation: fade .15s; }
.ap-sheet { position: fixed; z-index: 81; top: 12px; right: 12px; bottom: 12px; width: min(430px, calc(100vw - 24px)); border-radius: 18px; display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel-bg); border: 1px solid var(--glass-line); box-shadow: var(--shadow-lg); animation: slide .22s cubic-bezier(.2,.8,.2,1); }
html[data-glass="on"] .ap-sheet { -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%); }
.ap-head { display: flex; align-items: center; padding: 18px 20px 6px; }
.ap-head h3 { flex: 1; font-size: 18px; }
.ap-tabs { display: flex; gap: 4px; margin: 6px 20px 0; padding: 3px; border-radius: 12px; background: var(--surface-2); }
.ap-tabs button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.ap-tabs button.on { background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow-sm); }
.ap-body { padding: 14px 20px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; flex: 1; }
.ap-note { font-size: 12.5px; color: var(--muted); background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.ap-fl { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.ap-sub { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 12px 0 6px; }
.ap-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ap-choices.four { grid-template-columns: repeat(4, 1fr); }
.ap-choices button { border: 1px solid var(--line); background: var(--surface-solid); border-radius: 12px; padding: 9px 4px 7px; cursor: pointer; font-weight: 600; font-size: 12.5px; color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ap-choices button .pv { width: 100%; max-width: 70px; height: 30px; border-radius: 8px; border: 1px solid var(--line); }
.ap-choices button.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus); }
.ap-picker { display: grid; grid-template-columns: 60px 1fr; gap: 12px; align-items: center; }
.ap-picker input[type=color] { width: 60px; height: 60px; border: 1px solid var(--line); border-radius: 14px; padding: 4px; background: var(--surface-solid); cursor: pointer; }
.ap-rgb { display: grid; grid-template-columns: repeat(3, 1fr) 1.4fr; gap: 8px; }
.ap-rgb.three { grid-template-columns: repeat(3, 1fr); }
.ap-rgb label { font-size: 11.5px; font-weight: 700; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.ap-rgb input { width: 100%; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-solid); color: var(--text); padding: 0 8px; outline: none; font-variant-numeric: tabular-nums; }
.ap-rgb input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus); }
.ap-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ap-presets button { width: 30px; height: 30px; border-radius: 10px; border: 2px solid var(--surface-solid); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.ap-presets button.on { box-shadow: 0 0 0 2px var(--text); }
.ap-swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-top: 12px; border-radius: 10px; overflow: hidden; }
.ap-swatches i { height: 20px; }
.ap-check { font-size: 12.5px; margin-top: 10px; color: var(--ok); font-weight: 600; }
.ap-check.warn { color: var(--amber); }
.ap-range { display: flex; align-items: center; gap: 12px; }
.ap-range input[type=range] { flex: 1; accent-color: var(--brand); }
.ap-range output { width: 44px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; }
.ap-toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; margin-top: 12px; }
.ap-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ap-toggle .sw { width: 44px; height: 26px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); position: relative; flex: none; transition: background .2s; }
.ap-toggle .sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--knob); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.ap-toggle input:checked + .sw { background: var(--brand); border-color: transparent; }
.ap-toggle input:checked + .sw::after { transform: translateX(18px); }
.ap-toggle input:focus-visible + .sw { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.ap-toggle .tx b { display: block; font-weight: 600; }
.ap-toggle .tx span { font-size: 12.5px; color: var(--muted); }
.ap-second { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; margin-top: 10px; }
.ap-second input[type=color] { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 3px; background: var(--surface-solid); cursor: pointer; }
.ap-gpresets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ap-gpresets button { height: 26px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-solid); color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.ap-gpresets button i { width: 26px; height: 10px; border-radius: 99px; }
.ap-off { opacity: .45; pointer-events: none; }
.ap-foot { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.ap-foot .spacer { flex: 1; }
