:root {
  --ink: #182e49;
  --secondary-ink: #4a6179;
  --paper: #fbfcfe;
  --surface: #f4f7fb;
  --line: #cbd7e4;
  --accent: #315e92;
  --mast: #23436d;
  --key-radius: 8px;
  --main-key: linear-gradient(177deg, #4974a6, #355f91 38%, #2e5381 84%, #426a99);
  --light-key: linear-gradient(165deg, #f1f7fe, #d5e5f6 67%, #e1edf9);
  --key-depth: inset 0 1px 1px #d8eaff7a, inset 0 -2px 2px #19385743, 0 2px 4px -3px #213f63a1;
  --light-depth: inset 0 1px 1px white, inset 0 -1px 1px #86a3c34d, 0 2px 4px -3px #253f6255;
  background: var(--surface);
  color: var(--ink);
  color-scheme: light;
}
body { background: var(--surface); color: var(--ink); }
.masthead { display: flex; align-items: center; gap: 12px; }
.masthead img { flex: none; width: 36px; height: 36px; border: 1px solid #c4daf188; border-radius: 7px; }
.masthead .program-title { margin: 0; font-size: clamp(24px, 5.7vw, 30px); font-weight: 650; line-height: 1.25; letter-spacing: .01em; }
.workspace-caption { margin: 5px 0 0; font-size: 14px; color: #dce9f7; }
.login-brand { background: var(--mast); color: #f6faff; }
body :is(.primary, .secondary) {
  border-radius: var(--key-radius);
  border: 1px solid #294d76;
  color: #f8fbff;
  background: var(--main-key);
  box-shadow: var(--key-depth);
}
body :is(.ghost, .photo-capture, .download-link), #page-operator .ghost {
  border: 1px solid #a9bfd5;
  border-radius: var(--key-radius);
  background: var(--light-key);
  color: #244c76;
  box-shadow: var(--light-depth);
}
body :is(.primary, .secondary, .ghost, .photo-capture, .download-link):hover:not(:disabled) { filter: brightness(.97); }
body :is(.primary, .secondary, .ghost, .photo-capture):active:not(:disabled) { filter: brightness(.92); }
body :is(input:not([type="checkbox"], [type="radio"], [type="file"]), select, textarea) {
  color: var(--ink); background-color: #f4f8fc; border-color: #b8cada; border-radius: 7px;
}
body :is(input[type="checkbox"], input[type="radio"]) { accent-color: var(--accent); }
body :is(button, a, summary, input, select, textarea):focus-visible {
  outline: 3px solid #477bae; outline-offset: 2px;
}
.glass-slides {
  position: absolute; inset: 0 0 0 46%; overflow: hidden; pointer-events: none;
  background-image: linear-gradient(90deg, #daeaff24 1px, transparent 1px), linear-gradient(#daeaff20 1px, transparent 1px);
  background-size: 17px 17px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 54%);
  mask-image: linear-gradient(90deg, transparent, #000 54%);
}
.glass-slides::before, .glass-slides::after {
  content: ""; position: absolute; right: -32px; top: 42%; width: 160px; height: 46px;
  border: 1px solid #d0e1fa75; border-radius: 4px;
  background: linear-gradient(92deg, #d2e4fb3d 16%, #aac9ee18 16%, #dceaff29);
  box-shadow: inset 1px 1px 0 #e0eeff70, inset -1px -1px 0 #7598bf80, 1px 2px 0 #98b5d58c;
  transform: rotate(-37deg);
}
.glass-slides::before { right: -19px; top: 23%; width: 134px; opacity: .65; transform: rotate(-62deg); }

.mobile-ui main {
  --gutter: 20px;
  max-width: 540px; min-height: 100vh; min-height: 100dvh;
  padding: 0 var(--gutter) calc(104px + env(safe-area-inset-bottom));
}
.mobile-ui.locked main { padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom)); }
.mobile-ui .app-title { margin: 0 calc(-1 * var(--gutter)) 20px; color: #f7faff; }
.mobile-mast {
  padding: max(12px, env(safe-area-inset-top)) var(--gutter) 12px;
  background: var(--mast); min-height: 62px;
}
.mobile-mast .home-context {
  display: grid; justify-items: end; gap: 2px; margin: 0 0 0 auto; min-width: 0;
  font-size: 12px; line-height: 1.4; color: #e2eefb; text-align: right; overflow-wrap: anywhere;
}
.mobile-mast .home-context[hidden] { display: none; }
.mobile-mast .home-context strong { color: white; }
.mobile-mast .program-title { flex: none; }
.workspace-banner {
  position: relative; isolation: isolate; overflow: hidden;
  padding: 12px var(--gutter) 20px;
  background: linear-gradient(112deg, #294d7c 6%, #345f95 66%, #416fa4);
}
.workspace-banner > :not(.glass-slides) { position: relative; }
.workspace-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.workspace-tools .app-date { color: #e3edfa; margin: 0; font-size: 13px; }
.workspace-banner .scan-trigger {
  display: inline-flex; align-items: center; gap: 7px; width: auto; min-height: 44px; margin: 0; padding: 0 16px;
  border: 1px solid #b2cce39e; color: white; background: linear-gradient(158deg, #d5e6fb3d, #5379a77d 58%, #b4cde848);
  box-shadow: inset 0 1px 2px #e7f2ff68, inset 0 -1px 2px #96bae778, 0 2px 4px #1e416433;
}
.workspace-tools .scan-trigger[hidden] { display: none; }
.workspace-tools .scan-trigger svg { width: 19px; height: 19px; }
#appPageTitle { margin: 6px 0 8px; font-size: 23px; line-height: 1.25; font-weight: 600; }
.workspace-banner .summary {
  display: flex; align-items: center; gap: 16px; margin: 0; padding: 0;
  border: 0; border-radius: 0; background: transparent;
}
.workspace-banner .metric {
  display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap; width: auto; min-height: 44px; margin: 0;
  padding: 0; color: white; border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
.workspace-banner .metric:first-child { align-content: center; }
.workspace-banner .metric strong { font-size: 48px; font-weight: 550; line-height: 1; font-variant-numeric: tabular-nums; }
.workspace-banner .metric :is(span, small) { display: inline; font-size: 13px; font-weight: 500; margin: 0; color: #edf5ff; }
.workspace-banner .metric:nth-child(2) {
  align-content: center; align-items: baseline; align-self: center; gap: 4px; min-height: 32px;
  border-left: 1px solid #c1d7ed99; padding-left: 16px;
}
.workspace-banner .metric:nth-child(2) strong { font-size: 19px; font-weight: 600; }
.mobile-ui .app-page > section { border-color: var(--line); background: var(--paper); border-radius: 10px; }
.mobile-ui .app-page > section > h2, .instrument-browser-heading h2, .safety-area-bar h2 {
  border-left: 3px solid #4777a9; padding-left: 9px; font-size: 18px;
}
.mobile-ui .instrument-browser-heading { margin: 16px 0 8px; }
.mobile-ui .instrument-browser-heading h2 { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; width: 100%; }
.mobile-ui .instrument-list { border-inline: 0; border-radius: 0; border-block: 1px solid var(--line); background: transparent; }
.mobile-ui .instrument-row { min-height: 72px; background: transparent; padding: 12px 2px; gap: 10px; }
.mobile-ui .instrument-row::before { content: none; }
.mobile-ui .instrument-row + .instrument-row { border-color: var(--line); }
.mobile-ui .instrument-row:hover, .mobile-ui .instrument-row:active { background: #e5eef7; }
.mobile-ui .instrument-row strong { color: var(--ink); font-size: 16px; }
.mobile-ui .instrument-row small { color: var(--secondary-ink); font-variant-numeric: tabular-nums; }
.mobile-ui .instrument-row-status { color: #35567a; }
.mobile-ui .instrument-picker summary { min-height: 44px; padding: 12px 0; }
.mobile-ui .tabs, .workbench-actions {
  position: fixed; left: 0; right: 0; margin-inline: auto; width: min(calc(100% - 20px), 520px);
}
.mobile-ui .tabs {
  z-index: 5; isolation: isolate; bottom: 0; padding: 6px 6px calc(14px + env(safe-area-inset-bottom)); gap: 2px;
  border: 0; background: transparent; box-shadow: none;
}
.mobile-ui .tabs::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none; inset: 0 0 calc(8px + env(safe-area-inset-bottom));
  border: 1px solid #afc3d8; border-radius: 12px; background: #e3edf9ee;
  box-shadow: inset 0 1px 1px #ffffffed, 0 3px 8px #203e5d24;
}
.mobile-ui .tabs button { display: flex; flex-direction: column; gap: 3px; align-items: center; color: #405b76; font-size: 12px; min-height: 48px; border: 1px solid transparent; }
.mobile-ui .tabs button.active { background: var(--light-key); border-color: #acc1d9; color: #234d79; box-shadow: var(--light-depth); }
.mobile-ui .workbench-actions { z-index: 4; bottom: calc(76px + env(safe-area-inset-bottom)); padding: 0 4px; }
.workbench-actions:has(#quickSubmitButton.hidden) { display: none; }
.mobile-ui .workbench-actions .quick-submit-hint { margin: 0 0 4px; padding: 3px 8px; color: #435a71; background: #f4f7fbf7; }
.mobile-ui #quickSubmitButton { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; min-height: 48px; }
.mobile-ui #quickSubmitButton svg { width: 18px; height: 18px; }
.mobile-ui main:has(#page-scan.active #quickSubmitButton:not(.hidden)) { padding-bottom: calc(180px + env(safe-area-inset-bottom)); }
.mobile-ui .login-shell { max-width: 420px; }
.mobile-ui .login-brand { padding: 23px 22px; border-radius: 10px 10px 0 0; background: linear-gradient(112deg, var(--mast), #365f8f); }
.mobile-ui .login-shell section { padding: 22px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; background: var(--paper); }
.mobile-ui .login-shell section > h2 { margin-bottom: 20px; }
.mobile-ui :is(.lab-maintenance-item, .maintenance-item) { border-color: var(--line); background: #fff; border-radius: 8px; }
.mobile-ui .lab-maintenance-list { gap: 16px; margin: 16px 0; }
.environment-shortcuts { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin-top: 8px; border: 1px solid var(--line); border-radius: 9px; background: #e6eff8; }
.environment-shortcuts button { flex: 1 1 auto; min-height: 44px; padding: 4px 8px; border-radius: 6px; font-size: 13px; color: #305477; background: #f5f9fd; }
.lab-maintenance-item:focus-visible { outline: 2px solid #477bae; outline-offset: 2px; }
.lab-maintenance-item { scroll-margin-top: 12px; }
.mobile-ui .lab-maintenance-item { padding: 15px; }
.mobile-ui .lab-maintenance-item h3 { font-size: 17px; color: #213d5c; }
.mobile-ui .lab-maintenance-fields { margin-top: 14px; }
.mobile-ui .lab-maintenance-fields > label:not(.lab-check) { color: #233e5b; font-weight: 650; }
.mobile-ui .unit-field input { font-variant-numeric: tabular-nums; }
.mobile-ui .safety-area-bar h2 { margin-top: 4px; }
.mobile-ui #safetySummary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; padding: 9px 12px; margin: 8px 0 12px; background: #e1ecf8; color: #345372; border: 0; border-radius: 7px; font-size: 13px; }
.mobile-ui #safetySummary strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.mobile-ui #safetyQuestions article { margin-top: 12px; border-color: var(--line); }
.mobile-ui #safetyQuestions summary { background: #e8f0f9; color: #25496e; }
.mobile-ui #safetyQuestions details[open] > summary { border-bottom: 1px solid var(--line); }
.mobile-ui #safetyQuestions fieldset { background: #fff; }
.mobile-ui #safetyQuestions fieldset:disabled { background: var(--surface); }
.mobile-ui .reminders-panel .date { color: var(--ink); }
.mobile-ui button.page-back { min-height: 44px; }
.mobile-ui dialog:not(.temperature-keypad) {
  color: var(--ink); border: 1px solid #afc5db; border-radius: 12px;
  background: #f1f6fdf7; box-shadow: inset 0 1px 0 white, 0 12px 36px #152b4430;
}
.mobile-ui dialog::backdrop { background: #15294366; }
.mobile-ui .temperature-keypad { background: #edf4fb; }
.mobile-ui .temperature-keypad-grid .primary { background: var(--main-key); }

.admin-ui .app { max-width: 1480px; }
.admin-ui .topbar, .admin-ui .login-brand {
  position: relative; isolation: isolate; overflow: hidden;
  background: linear-gradient(110deg, #23436d, #335d8c); color: #f6faff;
}
.admin-ui .topbar { border: 1px solid #315578; border-radius: 10px; padding: 21px 24px; margin-bottom: 20px; }
.admin-ui .topbar .glass-slides { left: 31%; right: 27%; opacity: .7; }
.admin-ui .topbar :is(.masthead, .identity) { position: relative; }
.admin-ui .topbar .identity { color: #edf5ff; }
.admin-ui .masthead img { width: 44px; height: 44px; }
.admin-ui .login-card { padding: 0 24px 24px; border-color: var(--line); border-radius: 10px; overflow: hidden; }
.admin-ui .login-brand { margin: 0 -24px 24px; padding: 22px 24px; }
.admin-ui .sidebar { background: #e7eff8; border-color: #bfd0e1; border-radius: 10px; box-shadow: inset 0 1px 0 white; }
.admin-ui .nav-button { color: #405b76; border: 1px solid transparent; }
.admin-ui .nav-button:hover { background: #f2f7fd; }
.admin-ui .nav-button.active { border-color: #a7bed7; background: var(--light-key); color: #234d79; box-shadow: var(--light-depth); }
.admin-ui .panel { border-color: var(--line); border-radius: 10px; background: var(--paper); }
.admin-ui :is(.toolbar h2, .panel > h2) { border-left: 3px solid #4777a9; padding-left: 10px; color: var(--ink); }
.admin-ui .toolbar { border-color: var(--line); }
.admin-ui .table-wrap, .admin-ui .item { border-color: var(--line); }
.admin-ui th { background: #e9f0f8; color: #35516c; }
.admin-ui .item-button:hover, .admin-ui tbody tr:hover { background: #edf4fa; }
.admin-ui .directory-form, .admin-ui #safetyDeviceSettings { border-color: var(--line); }
.admin-ui :is(.photo-review-detail, .photo-zoom) { border-color: var(--line); }

@supports ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
  .mobile-ui .tabs::before, .mobile-ui .scan-trigger, .mobile-ui dialog[open]:not(.temperature-keypad) {
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
}
@media (max-width: 760px) {
  .admin-ui .topbar { gap: 14px; padding: 16px; }
  .admin-ui .topbar .glass-slides { left: 49%; right: 0; }
}
@media (max-width: 370px) {
  .mobile-ui main { --gutter: 14px; }
  .mobile-mast { gap: 8px; }
  .mobile-mast .program-title { font-size: 23px; }
  .mobile-mast img { width: 30px; height: 30px; }
  .mobile-ui .tabs button { font-size: 11px; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .mobile-ui .tabs::before, .mobile-ui dialog[open] { background: #edf4fb; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .workspace-banner .scan-trigger { background: #365d87; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .glass-slides { display: none; }
}
