/* BenchLogic brand (docs/BRANDING.md). Pages load this file, then static/css/brand_tokens.css, which defines the
   same brand tokens and wins when present. The values repeated here are fallbacks, so the pages keep their
   look even if brand_tokens.css is missing. The app's own variable names below are mapped onto the brand tokens. */
:root {
  /* Interface scale: everything ~10% larger than the original design (see body). */
  --ui-zoom: 1.1;
  /* Brand tokens (fallbacks; brand_tokens.css is the source of truth) */
  --bg-obsidian: #12151a;
  --bg-surface: #1a1f26;
  --bg-card: #202730;
  --border-slate: #2b3542;
  --bench-steel: #3e4550;
  --accent-cobalt: #2563eb;
  --accent-cobalt-hover: #1d4ed8;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-emerald-hover: #059669;
  --accent-amber: #f59e0b;
  --text-primary: #ffffff;
  --text-muted: #94a3b8;
  --text-faded: #64748b;
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.7), 0 2px 4px -1px rgba(0, 0, 0, 0.5);
  --font-mono: 'JetBrains Mono', Consolas, 'Courier New', monospace;
  /* The app's names, on the brand: obsidian page, surface panels, cobalt for active items and buttons,
     cyan for headings and progress, emerald for success. */
  --bg-main: var(--bg-obsidian);
  --text-on-page: var(--text-muted);   /* text sitting directly on the page, e.g. footers */
  /* Panels are slightly see-through and frosted, so the lab's logo in the background shows through softly. */
  --bg-panel: rgba(26, 31, 38, 0.80);
  --bg-card-sub: #262e39;
  --bg-input: var(--bg-obsidian);
  --border-color: var(--border-slate);
  --brand-navy: var(--accent-cobalt);  /* case-page and print-sheet headers */
  --border-focus: var(--accent-cobalt);
  --accent-blue: var(--accent-cobalt);
  --accent-teal: var(--accent-cyan);
  --accent-green: var(--accent-emerald);
  --accent-yellow: var(--accent-amber);
  --accent-purple: #9b59b6;
  --accent-pink: #e84393;
  --accent-orange: #e67e22;
  --accent-gray: #7f8c8d;
  --accent-lime: #84cc16;
  --accent-violet: #c084fc;
  --text-main: var(--text-primary);
  --page-pad: clamp(10px, 1.5vw, 24px);
  --radius-card: 12px;
  /* Native controls (date pickers, dropdown lists, scrollbars, checkboxes) in their dark versions. */
  color-scheme: dark;
}
::selection { background: rgba(37, 99, 235, 0.45); color: #fff; }
/* Keyboard focus: one clear ring everywhere (mouse clicks don't show it). */
:focus-visible { outline: 2px solid var(--accent-cobalt); outline-offset: 2px; }
a { color: var(--accent-cyan); }
* { box-sizing: border-box; }
body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  margin: 0;
  padding: var(--page-pad);
  /* Everything ~10% larger than the original design -- text, panels, buttons, dialogs --
     for easier reading (same effect as browser zoom 110%, but the default for everyone).
     Never applied to printing, so labels and case sheets keep their exact sizes.
     min-height is divided by the zoom so a short page is exactly one window tall, not 110%. */
  zoom: var(--ui-zoom);
  min-height: calc(100vh / var(--ui-zoom));
  /* A column, so the shared footer (templates/_footer.html) sits at the very bottom:
     at the window's bottom edge on short pages, after the content on long ones. */
  display: flex;
  flex-direction: column;
}
/* Intake page, Case Administration panel: title on its own line, navigation links on a
   row beneath it (they used to share one crowded line). */
.admin-card-header { border-bottom: 1px solid var(--border-color); padding-bottom: 10px; margin-bottom: 8px; }
.admin-card-header h2 { border: none; margin: 0; padding: 0; white-space: nowrap; }
.admin-card-nav { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 8px; }
.admin-card-nav a { font-size: 11.5px; font-weight: 600; color: var(--accent-cyan); text-decoration: none; white-space: nowrap; }
.admin-card-nav a:hover { text-decoration: underline; }

/* "Where is this case?" prompt when marking a case Complete (static/js/status.js). */
.location-dialog { background: var(--bg-card); color: var(--text-main); border: 1px solid var(--border-color); border-radius: 8px; padding: 22px 24px; width: min(440px, 90vw); box-shadow: 0 12px 40px rgba(0,0,0,0.5); }
.location-dialog::backdrop { background: rgba(10, 12, 16, 0.55); }
.location-dialog h3 { margin: 0 0 6px; font-size: 16px; }
.location-dialog p { margin: 0 0 14px; font-size: 12.5px; color: var(--text-muted); }
.location-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.location-dialog-actions button { padding: 8px 16px; border-radius: 4px; font-weight: 700; font-size: 13px; cursor: pointer; border: 1px solid var(--border-color); }
.location-cancel { background: var(--bg-card-sub); color: var(--text-main); }
.location-ok { background: var(--accent-cobalt); color: #fff; border-color: var(--accent-cobalt) !important; }
.location-keep { background: var(--bg-card-sub); color: var(--accent-cyan); }
.location-dialog input[type="date"] { color-scheme: dark; }
.location-dialog .return-reasons { display: grid; gap: 6px; margin-bottom: 12px; font-size: 13px; }
.location-dialog .return-reasons label { display: flex; gap: 8px; align-items: center; margin: 0; font-size: 13px; font-weight: 400; color: var(--text-main); text-transform: none; letter-spacing: 0; }
.location-dialog .return-reasons input { width: auto; margin: 0; }
.location-dialog textarea { width: 100%; box-sizing: border-box; margin-top: 4px; }
.location-dialog .return-dialog-error { color: #e74c3c; margin: 10px 0 0; }
/* Tags in case lists: at an outside lab (W10), returned to / resubmitted by the practice (W11). */
.out-tag, .resub-tag { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.3px; vertical-align: middle; }
.out-tag { background: #3d2a4a; color: #bb8fce; }
.resub-tag { background: #1f3a4a; color: #61d4ff; }
.exo-tag { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.3px; vertical-align: middle; background: #2a3b2a; color: #8fd18f; }
/* Returned cases (W12): header badge, New Case popup, Case History section. */
.appbar-returned { margin-left: 8px; padding: 3px 10px; border-radius: 12px; background: #4a2f5a; color: #e0a8ff;
  font-size: 11.5px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.appbar-returned:hover { background: #5c3a70; }
.returned-popup { position: fixed; right: 16px; bottom: 16px; z-index: 50; width: min(380px, calc(100vw - 32px));
  background: var(--bg-card); border: 1px solid #c084fc; border-radius: 8px; padding: 14px 16px; box-shadow: 0 12px 40px rgba(0,0,0,0.5); }
.returned-popup h3 { margin: 0 24px 6px 0; font-size: 14px; color: #e0a8ff; }
.returned-popup ul { margin: 6px 0 10px; padding-left: 18px; font-size: 12.5px; max-height: 40vh; overflow: auto; }
.returned-popup li { margin-bottom: 4px; }
.returned-popup-close { position: absolute; top: 8px; right: 10px; background: none; border: none; color: var(--text-muted);
  font-size: 18px; cursor: pointer; line-height: 1; }
.returned-popup a { color: var(--accent-cyan); }
.returned-section { margin-top: 16px; border: 1px solid #c084fc; border-radius: 8px; }
.returned-section > summary { cursor: pointer; padding: 10px 14px; font-weight: 700; color: #e0a8ff; }
.returned-case { border-top: 1px solid var(--border-color); }
.returned-case > summary { cursor: pointer; padding: 9px 14px; font-size: 13px; list-style-position: inside; }
.returned-case-body { padding: 4px 14px 12px 28px; font-size: 12.5px; }
.returned-case-body p { margin: 4px 0; }

.page-footer {
  margin-top: auto;
  padding: 18px 0 4px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-on-page);
}
.page-footer-version { color: var(--accent-cyan); font-weight: 700; font-family: var(--font-mono); }
/* BenchLogic product mark in the shared footer (static/img/icon-192.png when present, else the name). */
.page-footer-brand { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; color: var(--text-primary); font-weight: 700; }
/* The monogram has a white background: shown as a small rounded tile, like an app icon. */
.page-footer-brand img { height: 20px; width: 20px; display: block; border-radius: 4px; }
.page-footer-env { text-transform: capitalize; }

/* Frosted panels (page-level .card rules supply the background). */
.card, .confirm-card {
  -webkit-backdrop-filter: blur(6px) saturate(115%);
  backdrop-filter: blur(6px) saturate(115%);
}

/* The lab's logo as a faint watermark behind every page (templates/_appbar.html). Behind everything, fixed in
   place, never clickable. A logo with a transparent background becomes a soft white silhouette; one with a solid
   background (JPG, flat PNG) is inverted and screen-blended, so its white background disappears on the dark page. */
.lab-backdrop {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-repeat: no-repeat; background-position: center 56%; background-size: min(64vw, 860px) auto;
}
.lab-backdrop--transparent { filter: brightness(0) invert(1); opacity: 0.13; }
.lab-backdrop--opaque { filter: grayscale(1) invert(1); mix-blend-mode: screen; opacity: 0.16; }

/* App bar (templates/_appbar.html): full width across the top of every page, staying in view while scrolling.
   A thin cobalt -> cyan -> emerald line along the top edge echoes the logo's B -> L. */
.appbar {
  position: sticky; top: 0; z-index: 50; align-self: stretch;
  display: flex; align-items: center; gap: clamp(12px, 2vw, 32px);
  height: 58px; padding: 0 clamp(14px, 2vw, 28px);
  margin: calc(-1 * var(--page-pad)) calc(-1 * var(--page-pad)) var(--page-pad);
  background: rgba(18, 21, 26, 0.94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-slate);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.appbar::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent-cobalt), var(--accent-cyan) 50%, var(--accent-emerald));
}
.appbar-brand { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; }
.appbar-brand img { height: 36px; width: auto; display: block; }
.appbar-brand-text { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; color: var(--text-primary); }
.appbar-nav { display: flex; align-self: stretch; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.appbar-tab {
  display: flex; align-items: center; padding: 3px 14px 0; white-space: nowrap;
  color: var(--text-muted); font-size: 13.5px; font-weight: 600; text-decoration: none;
  border-bottom: 2px solid transparent; transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}
.appbar-tab:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.03); }
.appbar-tab.active { color: var(--text-primary); border-bottom-color: var(--accent-cobalt); }
.appbar-lab {
  margin-left: auto; flex-shrink: 1; min-width: 0; max-width: 32ch;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 6px 12px; border: 1px solid var(--border-slate); border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: var(--text-muted); background: var(--bg-surface);
}
@media (max-width: 860px) {
  .appbar-lab { display: none; }
  .appbar-brand img { height: 28px; }
  .appbar-tab { padding: 3px 10px 0; }
}

@media print {
  .appbar, .lab-backdrop { display: none; }
  body { zoom: 1 !important; display: block; min-height: 0; }
  .page-footer { display: none; }
  .card, .confirm-card { -webkit-backdrop-filter: none; backdrop-filter: none; }
  body { background: #fff !important; }
}

/* Responsive Fluid Layout */
.container {
  width: 100%;
  max-width: 1850px;
  margin: 0 auto;
  display: grid;
  /* Case Administration panel ~15% wider than originally (350 -> 400px) for its links and
     form fields; Restoration Setup takes the rest. */
  grid-template-columns: minmax(320px, 400px) 1fr;
  gap: clamp(12px, 1.5vw, 24px);
  align-items: start;
}
@media (max-width: 980px) {
  .container { grid-template-columns: 1fr; }
}

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: clamp(14px, 1.5vw, 22px);
  box-shadow: var(--shadow-md);
}
h2 { margin-top: 0; color: var(--text-main); font-weight: 600; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; font-size: clamp(15px, 1.2vw, 18px); }
h3 { margin: 15px 0 8px 0; font-size: 13px; text-transform: uppercase; color: var(--accent-teal); letter-spacing: 0.5px; }
label { font-size: 11px; font-weight: 600; color: var(--text-muted); display: block; margin-top: 10px; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
input, select, textarea { width: 100%; padding: 8px 10px; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: 4px; color: var(--text-main); font-size: 13px; }
input:focus, select:focus, textarea:focus { border-color: var(--border-focus); outline: none; }
/* Form controls in the page font (browsers default textareas and date fields to their own fonts). */
input, select, textarea, button { font-family: inherit; }
/* Tick boxes and radio buttons: native size (never stretched to the 100% input width), sitting on the line of
   their text. Labels that hold one read as plain sentence text, not as the small caps field captions. */
input[type="checkbox"], input[type="radio"] { width: auto; flex: none; margin: 0; padding: 0; vertical-align: -2px; }
label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) {
  text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12.5px; color: var(--text-main); cursor: pointer;
}
td > input[type="checkbox"] { vertical-align: middle; }
/* Date fields: type the date, or click the calendar button to pick it from a calendar. The button is drawn by the
   browser; make it big enough to see and click on the dark theme. */
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer; opacity: 1; width: 18px; height: 18px; padding: 3px; margin-left: 4px; border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.10);
}
input[type="date"]::-webkit-calendar-picker-indicator:hover { background-color: rgba(255, 255, 255, 0.22); }
/* Data tables (.tabular-data, brand_tokens.css): figures line up (tabular-nums) in the UI font. The brand's
   monospace stays on short identifiers (.case-id, .tooth-index); on whole tables it made names and dates wrap. */
table.tabular-data { font-family: inherit; font-variant-numeric: tabular-nums; }

/* Arch & High-Density Vector Odontogram */
.arch-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 8px 0;
  gap: 2px;
}
.arch-label { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

.tooth-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease-in-out, filter 0.15s ease;
  flex: 1 1 0;
  min-width: 36px;
  max-width: 58px;
  padding: 2px 1px;
  z-index: 2;
}
.tooth-item:hover { 
  transform: translateY(-3px); 
  filter: brightness(1.12);
}

.tooth-svg-wrap {
  width: 100%;
  aspect-ratio: 40 / 52;
  position: relative;
}
.tooth-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
/* Maxillary (upper) arch is rotated 180deg so its teeth visually point down
   into occlusion with the mandibular arch below. Only the tooth graphic
   rotates -- the tooth number label is a sibling element and stays upright. */
#upperArch .tooth-svg {
  transform: rotate(180deg);
}

.tooth-shape {
  fill: #ffffff;
  stroke: #94a3b8;
  stroke-width: 1.8;
  stroke-linejoin: round;
  transition: all 0.2s ease;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}
.tooth-groove {
  fill: none;
  stroke: #94a3b8;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s ease;
}

.tooth-num {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(10px, 1vw, 13.5px);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;  /* aligned digits; a monospace font wouldn't fit inside the teeth */
  color: #0f172a;
  /* A light halo keeps two-digit numbers readable where they reach past a narrow tooth onto the dark page
     (restoration types set their own white text with a dark shadow). */
  text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff;
  white-space: nowrap;
  pointer-events: none;
  transition: color 0.2s ease;
}
.tooth-badge {
  font-size: clamp(7.5px, 0.7vw, 10px);
  font-weight: 700;
  height: 15px;
  line-height: 15px;
  margin-top: 2px;
  text-transform: uppercase;
  text-align: center;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Selected state */
.tooth-item.selected .tooth-shape {
  stroke: var(--accent-cobalt) !important;
  stroke-width: 2.8;
  filter: drop-shadow(0 0 8px rgba(37, 99, 235, 0.85));
}

/* Responsive Horizontal Connector Bars */
.connector-bar {
  flex: 0 1 10px;
  min-width: 2px;
  height: clamp(3px, 0.4vw, 5px);
  background: var(--border-slate);
  margin-bottom: clamp(12px, 1.4vw, 18px);
  z-index: 1;
  border-radius: 2px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.connector-bar.active {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.9);
}

/* Restoration Type Color Encodings -- fixed values (not theme variables): they identify restoration
   types on the tooth chart, so a UI theme change must never change them. */
.type-AnatomicCrown .tooth-shape { fill: #1b4d3e !important; stroke: #2ecc71 !important; }
.type-AnatomicCrown .tooth-groove { stroke: #2ecc71aa !important; }
.type-AnatomicCrown .tooth-num { color: #ffffff !important; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.type-AnatomicCrown .tooth-badge { color: #2ecc71; }

.type-AnatomicPontic .tooth-shape { fill: #5a4a1b !important; stroke: #f1c40f !important; }
.type-AnatomicPontic .tooth-groove { stroke: #f1c40faa !important; }
.type-AnatomicPontic .tooth-num { color: #ffffff !important; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.type-AnatomicPontic .tooth-badge { color: #f1c40f; }

.type-Inlay .tooth-shape, .type-Veneer .tooth-shape { fill: #17424d !important; stroke: #00d2c4 !important; }
.type-Inlay .tooth-groove, .type-Veneer .tooth-groove { stroke: #00d2c4aa !important; }
.type-Inlay .tooth-num, .type-Veneer .tooth-num { color: #ffffff !important; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.type-Inlay .tooth-badge, .type-Veneer .tooth-badge { color: #00d2c4; }

.type-DiagnosticWaxup .tooth-shape { fill: #164e63 !important; stroke: #38bdf8 !important; }
.type-DiagnosticWaxup .tooth-groove { stroke: #38bdf8aa !important; }
.type-DiagnosticWaxup .tooth-num { color: #ffffff !important; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.type-DiagnosticWaxup .tooth-badge { color: #38bdf8; }
.type-AestheticMockup .tooth-shape { fill: #3b2f5c !important; stroke: #c4b5fd !important; }
.type-AestheticMockup .tooth-groove { stroke: #c4b5fdaa !important; }
.type-AestheticMockup .tooth-num { color: #ffffff !important; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.type-AestheticMockup .tooth-badge { color: #c4b5fd; }
.type-AnatomicWaxup .tooth-shape { fill: #0f4c3a !important; stroke: #5eead4 !important; }
.type-AnatomicWaxup .tooth-groove { stroke: #5eead4aa !important; }
.type-AnatomicWaxup .tooth-num { color: #ffffff !important; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.type-AnatomicWaxup .tooth-badge { color: #5eead4; }

/* exocad per-tooth option toggles (Implant-based, Design digitally, Gingiva design...).
   Sized for touchscreens such as a CEREC acquisition unit: >= 48px tall, one tap each,
   no typing; the on-state is unmistakable (filled + check mark). */
.opt-toggles { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.opt-toggle {
  min-height: 48px; min-width: 120px; padding: 10px 18px; border-radius: 24px;
  border: 2px solid var(--border-color); background: var(--bg-card-sub); color: var(--text-main);
  font-size: 16px; font-weight: 600; cursor: pointer; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.opt-toggle::before { content: "\25CB  "; color: var(--text-muted); }          /* ○ */
.opt-toggle[aria-pressed="true"] { background: var(--accent-cobalt); border-color: var(--accent-cobalt); color: #fff; }
.opt-toggle[aria-pressed="true"]::before { content: "\2713  "; color: #fff; } /* ✓ */
.opt-toggle:focus-visible { outline: 3px solid var(--accent-cyan); outline-offset: 2px; }

.type-EggshellProvisional .tooth-shape { fill: #365314 !important; stroke: #84cc16 !important; }
.type-EggshellProvisional .tooth-groove { stroke: #84cc16aa !important; }
.type-EggshellProvisional .tooth-num { color: #ffffff !important; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.type-EggshellProvisional .tooth-badge { color: #84cc16; }

.type-CustomAbutmentWithCrown .tooth-shape { fill: #381f47 !important; stroke: #9b59b6 !important; }
.type-CustomAbutmentWithCrown .tooth-groove { stroke: #9b59b6aa !important; }
.type-CustomAbutmentWithCrown .tooth-num { color: #ffffff !important; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.type-CustomAbutmentWithCrown .tooth-badge { color: #9b59b6; }

.type-ScrewRetainedCrown .tooth-shape { fill: #2c1a4d !important; stroke: #a29bfe !important; }
.type-ScrewRetainedCrown .tooth-groove { stroke: #a29bfeaa !important; }
.type-ScrewRetainedCrown .tooth-num { color: #ffffff !important; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.type-ScrewRetainedCrown .tooth-badge { color: #a29bfe; }

.type-FixedHybridProvisional .tooth-shape { fill: #4c1d95 !important; stroke: #c084fc !important; }
.type-FixedHybridProvisional .tooth-groove { stroke: #c084fcaa !important; }
.type-FixedHybridProvisional .tooth-num { color: #ffffff !important; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.type-FixedHybridProvisional .tooth-badge { color: #c084fc; }

.type-VerificationJig .tooth-shape { fill: #1e293b !important; stroke: #94a3b8 !important; }
.type-VerificationJig .tooth-groove { stroke: #94a3b8aa !important; }
.type-VerificationJig .tooth-num { color: #ffffff !important; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.type-VerificationJig .tooth-badge { color: #cbd5e1; }

.type-SurgicalGuide .tooth-shape { fill: #042f2e !important; stroke: #14b8a6 !important; }
.type-SurgicalGuide .tooth-groove { stroke: #14b8a6aa !important; }
.type-SurgicalGuide .tooth-num { color: #ffffff !important; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.type-SurgicalGuide .tooth-badge { color: #14b8a6; }

.type-BiteSplint .tooth-shape { fill: #15385b !important; stroke: #0088ff !important; }
.type-BiteSplint .tooth-groove { stroke: #0088ffaa !important; }
.type-BiteSplint .tooth-num { color: #ffffff !important; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.type-BiteSplint .tooth-badge { color: #0088ff; }

.type-AnteriorDeprogrammer .tooth-shape { fill: #0c4a6e !important; stroke: #0284c7 !important; }
.type-AnteriorDeprogrammer .tooth-groove { stroke: #0284c7aa !important; }
.type-AnteriorDeprogrammer .tooth-num { color: #ffffff !important; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.type-AnteriorDeprogrammer .tooth-badge { color: #7f8c8d; }

.type-FlipperPartial .tooth-shape { fill: #542f13 !important; stroke: #e67e22 !important; }
.type-FlipperPartial .tooth-groove { stroke: #e67e22aa !important; }
.type-FlipperPartial .tooth-num { color: #ffffff !important; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.type-FlipperPartial .tooth-badge { color: #e67e22; }

.type-FullDenture .tooth-shape { fill: #5c1d41 !important; stroke: #e84393 !important; }
.type-FullDenture .tooth-groove { stroke: #e84393aa !important; }
.type-FullDenture .tooth-num { color: #ffffff !important; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.type-FullDenture .tooth-badge { color: #e84393; }

.type-Antagonist .tooth-shape { fill: #333842 !important; stroke: #7f8c8d !important; }
.type-Antagonist .tooth-groove { stroke: #7f8c8daa !important; }
.type-Antagonist .tooth-num { color: #ffffff !important; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.type-Antagonist .tooth-badge { color: #7f8c8d; }
.type-StudyModel .tooth-shape { fill: #334155 !important; stroke: #94a3b8 !important; }
.type-StudyModel .tooth-groove { stroke: #94a3b8aa !important; }
.type-StudyModel .tooth-num { color: #ffffff !important; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.type-StudyModel .tooth-badge { color: #cbd5e1; }
.type-EssixRetainer .tooth-shape { fill: #0e3a4a !important; stroke: #22d3ee !important; }
.type-EssixRetainer .tooth-groove { stroke: #22d3eeaa !important; }
.type-EssixRetainer .tooth-num { color: #ffffff !important; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.type-EssixRetainer .tooth-badge { color: #67e8f9; }
.modal-hint { font-size: 11.5px; color: var(--text-muted); margin: 6px 0 0; }

/* Action bar */
.chart-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.btn-toggle-multi { background: var(--bg-card-sub); border: 1px solid var(--border-color); color: var(--text-main); padding: 5px 10px; border-radius: 4px; font-size: 11px; cursor: pointer; font-weight: 600; }
.btn-toggle-multi.active { background: var(--accent-cobalt); color: #fff; border-color: var(--accent-cobalt); }
.btn-batch-config { background: var(--accent-blue); border: none; color: #fff; padding: 5px 12px; border-radius: 4px; font-size: 11px; cursor: pointer; font-weight: bold; }

/* Live Case Summary Table */
.summary-section { margin-top: 20px; border-top: 1px solid var(--border-color); padding-top: 12px; }
.summary-table-wrap { width: 100%; overflow-x: auto; }
.summary-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 480px; }
.summary-table th { text-align: left; padding: 7px 10px; background: var(--bg-obsidian); color: var(--text-muted); text-transform: uppercase; font-size: 10.5px; border-bottom: 1px solid var(--border-color); }
.summary-table td { padding: 8px 10px; border-bottom: 1px solid var(--border-slate); vertical-align: middle; }
.badge-tag { display: inline-block; padding: 2px 7px; border-radius: 3px; font-weight: 700; font-size: 10.5px; text-transform: uppercase; }
.action-btn-mini { background: none; border: 1px solid var(--bench-steel); color: var(--text-muted); padding: 3px 8px; border-radius: 3px; font-size: 10.5px; cursor: pointer; margin-right: 4px; }
.action-btn-mini:hover { border-color: var(--accent-blue); color: #fff; }
.action-btn-delete:hover { border-color: #e74c3c; color: #e74c3c; }

/* Modal Backdrop */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 15px;
}
.modal-backdrop.open { display: flex; }
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 580px;
  max-width: 100%;
  box-shadow: 0 10px 35px rgba(0,0,0,0.6);
  overflow: hidden;
  animation: modalFadeIn 0.15s ease-out;
}
@keyframes modalFadeIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

.modal-header { background: var(--bg-surface); padding: 12px 18px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; font-size: 15px; color: var(--text-main); text-transform: none; }
.modal-close-btn { background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; line-height: 1; }
.modal-close-btn:hover { color: #fff; }
.modal-body { padding: 18px; }
.modal-footer { background: var(--bg-surface); padding: 10px 18px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 8px; }

.btn-cancel { background: var(--bg-card-sub); border: 1px solid var(--border-color); color: var(--text-primary); padding: 7px 14px; border-radius: 4px; font-weight: 600; cursor: pointer; font-size: 12.5px; }
.btn-save { background: var(--accent-blue); border: none; color: #fff; padding: 7px 18px; border-radius: 4px; font-weight: 700; cursor: pointer; font-size: 12.5px; }
.btn-save:hover { background: var(--accent-cobalt-hover); }

.drop-zone { border: 2px dashed var(--border-color); border-radius: 6px; padding: 14px; text-align: center; cursor: pointer; background: var(--bg-input); }
.drop-zone:hover { border-color: var(--accent-blue); }
.drop-zone.drop-zone--active { border-color: var(--accent-cobalt); background: rgba(37, 99, 235, 0.08); }
.drop-zone.drop-zone--error { border-color: #ff6b6b; background: rgba(255, 107, 107, 0.08); }
.field-error-msg { color: #ff6b6b; font-size: 11.5px; font-weight: 600; margin-top: 4px; }
.btn-submit-main { background: var(--accent-blue); color: white; border: none; padding: 13px 18px; border-radius: 4px; font-weight: bold; font-size: 14px; cursor: pointer; width: 100%; margin-top: 15px; }
.btn-submit-main:hover { background: var(--accent-cobalt-hover); }
/* "Submitted By" beside every Submit button (templates/_submitted_by.html). */
.submitted-by { display: flex; align-items: center; gap: 10px; margin-top: 15px; }
.submitted-by label { margin: 0; font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.submitted-by select { flex: 1; min-width: 0; }
.submitted-by + .btn-submit-main, .submitted-by + .btn-save, .submitted-by + .btn-add-files { margin-top: 10px; }
/* Case Notes log and Admin -> Staff. */
.case-note-list { list-style: none; margin: 12px 0 0; padding: 0; }
.case-note-list li { border-left: 3px solid var(--accent-cyan); padding: 4px 0 4px 10px; margin-bottom: 10px; }
.case-note-meta { font-size: 11.5px; color: var(--text-muted); }
.case-note-body { white-space: pre-wrap; font-size: 13px; color: var(--text-main); }
.staff-off td { opacity: 0.55; }

.checkbox-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12.5px; color: var(--text-main); cursor: pointer; }
.checkbox-row input[type="checkbox"] { width: auto; margin: 0; }
/* Intake: "Insert template" above the Clinical Notes. */
.template-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; min-height: 18px; }
.template-bar select { width: auto; max-width: 100%; padding: 5px 8px; font-size: 12.5px; }
.template-hint { font-size: 11px; color: var(--text-muted); }
/* Intake: physical items sent with the case. */
.physical-items { margin: 12px 0 0; padding: 0 12px; border: 1px solid var(--border-color); border-radius: 6px; }
.physical-items[open] { padding-bottom: 12px; }
.physical-items summary { cursor: pointer; padding: 9px 0; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.physical-items summary:hover { color: var(--text-main); }
.physical-count { margin-left: 6px; text-transform: none; letter-spacing: 0; color: var(--accent-cyan); }
.physical-items .legend-hint { text-transform: none; letter-spacing: 0; font-weight: 400; }
.physical-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 12px; }
.physical-grid .checkbox-row { margin-top: 8px; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12.5px; color: var(--text-main); }
.physical-grid small { color: var(--text-muted); }
.physical-items input[type="text"] { margin-top: 10px; }
.physical-edit { margin-bottom: 18px; }
.physical-edit summary { cursor: pointer; font-size: 12.5px; color: var(--accent-cyan); }
.physical-edit input[type="text"] { margin-top: 10px; }
.physical-edit .btn-save { margin-top: 10px; }

/* ---- Case status colors (used by cases_list.html, case_detail.html and calendar.html;
   class suffix comes from the status_slug template filter) ----
   gray = unreviewed, silver = accepted, blue = in-process, yellow = on hold,
   purple = shipped, teal = received, emerald (brand success) = complete, periwinkle = delivered, red = rejected */
.status-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; border: 1px solid transparent; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.status-unreviewed { background:#2a3242; color:#9aa5b8; border-color:#4a5568; }
.status-accepted   { background:#3b4557; color:#d5dde8; border-color:#a9b6c8; }
.status-in-process { background:#0c3a6e; color:#5dade2; border-color:#3498db; }
.status-on-hold    { background:#5a4a1b; color:#f1c40f; border-color:#f1c40f; }
.status-needs-info { background:#4a2f5a; color:#e0a8ff; border-color:#c084fc; }
.status-shipped    { background:#381f47; color:#bb8fce; border-color:#9b59b6; }
.status-received   { background:#17424d; color:#00d2c4; border-color:#00d2c4; }
.status-complete   { background:#0d3b2e; color:#10b981; border-color:#10b981; }
.status-delivered  { background:#1f2a4d; color:#a5b8f0; border-color:#6b82d6; }
.status-rejected   { background:#5c1f1f; color:#ff6b5e; border-color:#e74c3c; }
select option.status-unreviewed, select option.status-accepted, select option.status-in-process, select option.status-on-hold, select option.status-needs-info,
select option.status-shipped, select option.status-received, select option.status-complete, select option.status-delivered, select option.status-rejected { background:#10131a; }
select option.status-unreviewed { color:#9aa5b8; }
select option.status-accepted   { color:#d5dde8; }
select option.status-in-process { color:#5dade2; }
select option.status-on-hold    { color:#f1c40f; }
select option.status-needs-info { color:#e0a8ff; }
select option.status-shipped    { color:#bb8fce; }
select option.status-received   { color:#00d2c4; }
select option.status-complete   { color:#10b981; }
select option.status-delivered  { color:#a5b8f0; }
select option.status-rejected   { color:#ff6b5e; }
@media print { .status-badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
/* Status dropdown (case list, Case Details; console only). Background/text/border colors come from .status-*. */
.status-select {
  border: 1px solid;
  padding: 5px 8px; border-radius: 4px; font-size: 12.5px; cursor: pointer;
  font-weight: 700; border-left-width: 4px; width: auto;
}
.status-select:focus { outline: 2px solid var(--accent-blue); outline-offset: 1px; }

/* Backup wizard (/admin/backup, /admin/backup/restore) */
.backup-page { max-width: 900px; margin: 20px auto; display: flex; flex-direction: column; gap: 18px; width: 100%; }
.backup-page .card { padding: clamp(16px, 2vw, 24px); }
.backup-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.backup-head h2 { border: none; padding: 0; margin: 0; font-size: 20px; }
.backup-head p, .backup-note { color: var(--text-muted); font-size: 12.5px; margin: 4px 0 0 0; }
.backup-links { display: flex; gap: 8px; flex-wrap: wrap; }
.backup-links a { background: var(--bg-card-sub); border: 1px solid var(--border-color); color: var(--accent-cyan); text-decoration: none; padding: 8px 14px; border-radius: 4px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.backup-list { list-style: none; margin: 6px 0; padding: 0; font-size: 13px; }
.backup-list li { padding: 5px 0; border-bottom: 1px solid var(--border-color); overflow-wrap: anywhere; }
.backup-list label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.backup-list input[type=checkbox] { width: auto; margin-top: 3px; }
.backup-path { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-main); overflow-wrap: anywhere; }
.backup-muted { color: var(--text-muted); }
.backup-msg { border-radius: 6px; padding: 10px 14px; font-size: 13px; margin: 0 0 10px 0; }
.backup-msg.error { background: rgba(231, 76, 60, 0.15); border: 1px solid #e74c3c; }
.backup-msg.warn { background: rgba(245, 158, 11, 0.12); border: 1px solid var(--accent-amber); }
.backup-msg.ok { background: rgba(16, 185, 129, 0.12); border: 1px solid var(--accent-emerald); }
.backup-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.backup-actions button { padding: 9px 18px; border-radius: 4px; font-weight: 700; font-size: 13px; cursor: pointer; border: 1px solid var(--border-color); background: var(--accent-blue); color: #fff; }
.backup-actions button.secondary { background: var(--bg-card-sub); color: var(--text-main); }
.backup-progress { height: 10px; background: var(--bg-input); border-radius: 5px; overflow: hidden; margin: 10px 0 6px; }
.backup-progress > div { height: 100%; background: var(--accent-teal); width: 0; transition: width 0.4s ease; }
.backup-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.backup-table th, .backup-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border-color); vertical-align: top; overflow-wrap: anywhere; }
.backup-table th { color: var(--text-muted); font-weight: 600; }
.backup-steps { margin: 0; padding-left: 22px; font-size: 13px; }
.backup-steps > li { margin-bottom: 14px; }
.backup-steps code { display: block; margin-top: 4px; padding: 6px 8px; background: var(--bg-input); border-radius: 4px; font-size: 12px; overflow-wrap: anywhere; white-space: pre-wrap; }

/* Tooth numbering switch on the intake form (Universal / FDI / Palmer): one segmented
   control, touch-sized like the exocad option toggles. */
.numbering-switch { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.numbering-switch-label { color: var(--text-muted); font-size: 13px; font-weight: 600; margin-right: 4px; }
.numbering-switch button {
  min-height: 44px; min-width: 96px; padding: 8px 16px; border-radius: 22px;
  border: 2px solid var(--border-color); background: var(--bg-card-sub); color: var(--text-main);
  font-size: 15px; font-weight: 700; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.numbering-switch button[aria-pressed="true"] { background: var(--accent-blue); border-color: var(--accent-blue); color: #fff; }
.numbering-switch button:focus-visible { outline: 3px solid var(--accent-cyan); outline-offset: 2px; }
/* Shade-guide switch in the tooth dialog (same big buttons as the numbering switch). */
.shade-guide-switch { margin: 8px 0 4px; }
.exocad-hint { display: block; margin-top: 4px; color: var(--text-muted); font-size: 12.5px; }
.shade-sources { margin: 0 0 10px; font-size: 12.5px; color: var(--text-muted); }
.shade-sources summary { cursor: pointer; padding: 6px 0; }
.shade-sources ul { margin: 4px 0 0 18px; padding: 0; }
.shade-sources a { color: var(--accent-cyan); }

/* Shade zones: tooth drawing (rows of 80px = the drawing's thirds) with a list beside each zone. */
.shade-zones { display: grid; grid-template-columns: auto 1fr; grid-template-rows: repeat(3, 80px); margin: 4px 0 14px; }
.shade-zones .zone-tooth { grid-column: 1; grid-row: 1 / 4; height: 240px; width: auto; }
.zone-row { grid-column: 2; display: flex; flex-direction: column; justify-content: center; padding-left: 14px; min-width: 0; }
.zone-row + .zone-row { border-top: 1.5px dashed var(--accent-yellow); }
.zone-row label { margin: 0 0 4px; }
.zone-row.active label { color: var(--accent-yellow); }
.zone-row select { min-height: 48px; font-size: 16px; }
.zone-body-slot { display: flex; align-items: center; gap: 10px; }
.zone-body-slot select { flex: 1; min-width: 0; }
.zone-body-slot .exocad-hint { margin: 0; white-space: nowrap; }
.zone-exocad-tag { font-weight: normal; color: var(--text-muted); }
.zone-line { stroke: var(--accent-yellow); stroke-width: 1.5; stroke-dasharray: 6 4; }
.zone-hit { fill: transparent; cursor: pointer; }
/* The zone being set keeps its true colors; the other two are dimmed (a tint would read as a shade). */
.zone-mark { fill: #000; fill-opacity: 0; transition: fill-opacity 0.15s; }
.zone-mark.dim { fill-opacity: 0.3; }

/* Gum shade: basic shades as buttons, other systems behind "More shades". */
.gum-shade { margin-top: 14px; }
.gum-guide-name { font-weight: normal; color: var(--text-muted); }
.gum-more { display: inline-block; margin: 8px 0 4px; min-height: 44px; padding: 8px 16px; border-radius: 22px;
  background: transparent; border: 1px dashed var(--border-color); color: var(--accent-cyan); font-size: 14px; font-weight: 600; cursor: pointer; }
.gum-more:focus-visible { outline: 3px solid var(--accent-cyan); outline-offset: 2px; }
.gum-guides { margin: 4px 0 10px; }
.gum-guides[hidden] { display: none; }

/* ---- Light theme (Admin -> Lab & Appearance, or PORTAL_THEME=light; <html data-theme="light">) ----------------
   The pale page of the original single-lab portal under white, translucent panels and dialogs, on the BenchLogic
   accents. Only the colour tokens change; the app bar stays dark (it carries the white wordmark), and printouts
   are unaffected (they set their own colours). */
:root[data-theme="light"] {
  color-scheme: light;
  --bg-obsidian: #f4f6f9;
  --bg-surface: #ffffff;
  --bg-main: #d3d7de;
  --bg-panel: rgba(255, 255, 255, 0.80);
  --bg-card: rgba(255, 255, 255, 0.96);
  --bg-card-sub: #eef1f5;
  --bg-input: #ffffff;
  --border-slate: #c3cad5;
  --bench-steel: #dde3ea;
  --text-primary: #161b22;
  --text-muted: #4f5d70;
  --text-faded: #6b7788;
  --text-on-page: #2a303b;
  /* Cyan headings and links darkened so they read on white; cobalt and emerald stay. */
  --accent-cyan: #0e7490;
  --shadow-md: 0 4px 10px -2px rgba(30, 41, 59, 0.18), 0 2px 4px -1px rgba(30, 41, 59, 0.10);
}
:root[data-theme="light"] ::selection { background: rgba(37, 99, 235, 0.25); color: inherit; }
:root[data-theme="light"] .appbar {
  --text-primary: #ffffff; --text-muted: #94a3b8; --border-slate: #2b3542; --bg-surface: #1a1f26;
  --accent-cyan: #06b6d4;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
}
:root[data-theme="light"] .lab-backdrop--transparent { filter: brightness(0); opacity: 0.08; }
:root[data-theme="light"] .lab-backdrop--opaque { filter: grayscale(1); mix-blend-mode: multiply; opacity: 0.10; }
:root[data-theme="light"] .location-dialog,
:root[data-theme="light"] .returned-popup { box-shadow: 0 12px 40px rgba(15, 23, 42, 0.25); }
:root[data-theme="light"] .location-dialog input[type="date"] { color-scheme: light; }
:root[data-theme="light"] .appbar-tab:hover { background: rgba(255, 255, 255, 0.06); }

/* Next step: the intake form locked to an existing patient. */
.next-step-summary { background: var(--bg-card-sub); border: 1px solid var(--border-color); border-radius: 6px; padding: 12px 14px; margin-bottom: 12px; font-size: 13px; color: var(--text-muted); }
.next-step-summary b { color: var(--text-main); }
.next-step-summary a { color: var(--accent-cyan); }
.next-step-summary > div { margin-top: 6px; }
.next-step-hint { font-size: 12px; }

/* Work products: the "What is being made?" choice on the intake forms and its Admin list. */
.work-product-hint { font-size: 11px; color: var(--text-muted); margin: -2px 0 8px 0; }
.wp-token { font-family: Consolas, monospace; font-size: 11.5px; color: var(--text-muted); }
.wp-hidden td { opacity: 0.55; }
.wp-group-row td { background: var(--bg-card-sub); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.4px; }
.wp-edit summary { cursor: pointer; color: var(--accent-cyan); font-size: 12px; }
.wp-suggest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 12px; margin: 8px 0; text-align: left; }
.wp-suggest-grid label { font-size: 12px; font-weight: 400; display: flex; gap: 6px; align-items: center; margin: 0; }
.wp-suggest-grid input { width: auto; margin: 0; }
.wp-workflows { columns: 2; column-gap: 28px; font-size: 12.5px; }
.wp-workflows li { break-inside: avoid; margin-bottom: 6px; }
@media (max-width: 900px) { .wp-workflows { columns: 1; } }
label .legend-hint { text-transform: none; letter-spacing: 0; font-weight: 400; }

/* Upload progress overlay for the case entry form (static/js/submit_progress.js) */
.upload-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); display: flex; align-items: center; justify-content: center; z-index: 10000; }
.upload-box { background: var(--card-bg, #fff); color: var(--text-main, #1e293b); padding: 26px 30px; border-radius: 8px; width: min(440px, 90vw); box-shadow: 0 10px 40px rgba(0,0,0,.35); text-align: center; }
.upload-box h2 { margin: 0 0 16px; font-size: 17px; }
.upload-bar { height: 14px; background: rgba(127,127,127,.25); border-radius: 7px; overflow: hidden; }
.upload-bar-fill { height: 100%; width: 0; background: var(--accent-blue, #2563eb); transition: width .2s; }
.upload-detail { margin: 10px 0 4px; font-size: 13px; }
.upload-warn { margin: 6px 0 0; font-size: 12px; color: var(--text-muted, #64748b); }
.upload-error { margin: 0 0 14px; font-size: 13px; color: #b91c1c; }
.upload-retry { background: var(--accent-blue, #2563eb); color: #fff; border: none; border-radius: 4px; padding: 9px 16px; font-weight: bold; cursor: pointer; }
