/* ===== Oculus DICOM — Apple-style Design System ===== */

/* ── Thin dark scrollbars — entire app ── */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.14) transparent; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.16); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.28); }
::-webkit-scrollbar-corner { background: transparent; }

:root {
  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

  /* Accent — System Blue (Apple) */
  --accent: #0A84FF;
  --accent-hover: #2898FF;
  --accent-soft: rgba(10, 132, 255, 0.16);
  --accent-soft-2: rgba(10, 132, 255, 0.08);

  /* Modality semantic */
  --mod-rx: #64D2FF;       /* cyan */
  --mod-tac: #FF9F0A;      /* orange */
  --mod-eco: #30D158;      /* green */
  --mod-mri: #BF5AF2;      /* purple */
  --mod-pet: #FF375F;      /* pink */
  --mod-mam: #FFD60A;      /* yellow */

  /* Status */
  --success: #30D158;
  --warn: #FF9F0A;
  --danger: #FF453A;

  /* Radii — Apple curvature */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-2xl: 28px;
  --r-full: 999px;

  /* Shadows */
  --shadow-1: 0 1px 2px rgba(0,0,0,0.04), 0 1px 1px rgba(0,0,0,0.04);
  --shadow-2: 0 4px 14px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-3: 0 12px 32px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-popover: 0 24px 80px rgba(0,0,0,0.24), 0 8px 24px rgba(0,0,0,0.12);

  /* Easing */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ── Native form controls siguen el tema (incl. el popup del <select>) ── */
:root, [data-theme="light"] { color-scheme: light; }
[data-theme="dark"]         { color-scheme: dark; }

/* Dropdown <select> con el estilo de la app */
select {
  font-family: var(--font-sans);
  color: var(--text);
  background-color: var(--bg-2);
}
select option {
  background-color: var(--bg-2);
  color: var(--text);
}
[data-theme="dark"] select option {
  background-color: #1c1c1e;
  color: #f5f5f7;
}

/* Light theme (default) */
:root,
[data-theme="light"] {
  --bg: #F5F5F7;
  --bg-2: #FFFFFF;
  --surface: rgba(255,255,255,0.72);
  --surface-solid: #FFFFFF;
  --surface-2: #FAFAFA;
  --elevated: #FFFFFF;
  --hover: rgba(0,0,0,0.04);
  --pressed: rgba(0,0,0,0.08);
  --selected: rgba(10,132,255,0.10);
  --border: rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.14);
  --divider: rgba(0,0,0,0.06);

  --text: #1d1d1f;
  --text-secondary: #515154;
  --text-tertiary: #86868b;
  --text-quaternary: #a1a1a6;
  --text-inverse: #ffffff;

  --vibrancy-bg: rgba(246, 246, 248, 0.72);
  --window-chrome: #E8E8EB;
  --titlebar-bg: rgba(245,245,247,0.85);

  --canvas-bg: #1a1a1c;   /* viewer canvas stays dark in light mode */
  --canvas-bg-2: #0a0a0c;

  --accent: #007AFF;
  --accent-hover: #0066D6;
  --accent-soft: rgba(0,122,255,0.12);
  --accent-soft-2: rgba(0,122,255,0.06);
}

[data-theme="dark"] {
  --bg: #0b0b0d;
  --bg-2: #131316;
  --surface: rgba(28, 28, 30, 0.72);
  --surface-solid: #1c1c1e;
  --surface-2: #1c1c1e;
  --elevated: #2c2c2e;
  --hover: rgba(255,255,255,0.06);
  --pressed: rgba(255,255,255,0.10);
  --selected: rgba(10,132,255,0.18);
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);
  --divider: rgba(255,255,255,0.06);

  --text: #f5f5f7;
  --text-secondary: #c7c7cc;
  --text-tertiary: #8e8e93;
  --text-quaternary: #636366;
  --text-inverse: #1d1d1f;

  --vibrancy-bg: rgba(28, 28, 30, 0.62);
  --window-chrome: #1a1a1c;
  --titlebar-bg: rgba(22,22,24,0.85);

  --canvas-bg: #060608;
  --canvas-bg-2: #000000;

  --accent: #0A84FF;
  --accent-hover: #2898FF;
  --accent-soft: rgba(10,132,255,0.18);
  --accent-soft-2: rgba(10,132,255,0.08);
}

/* visionOS variant — glass dominant */
[data-style="vision"] {
  --surface: rgba(255,255,255,0.08);
  --vibrancy-bg: rgba(20,20,22,0.42);
  --border: rgba(255,255,255,0.12);
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
}
[data-style="vision"][data-theme="light"] {
  --surface: rgba(255,255,255,0.55);
  --vibrancy-bg: rgba(255,255,255,0.55);
  --border: rgba(0,0,0,0.08);
}

/* iPadOS dense variant */
[data-style="ipados"] {
  --r-md: 10px;
  --r-lg: 12px;
}

/* ===== Reset / base ===== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01", "ss03";
  letter-spacing: -0.005em;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: transparent; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }

/* ===== Window chrome ===== */
.window {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

.titlebar {
  height: 44px;
  flex: 0 0 44px;
  display: flex; align-items: center;
  padding: 0 16px;
  gap: 16px;
  background: var(--titlebar-bg);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 50;
  user-select: none;
  white-space: nowrap;
  overflow: visible;
}

.traffic {
  display: flex; gap: 8px; align-items: center;
}
.traffic .dot {
  width: 12px; height: 12px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  transition: transform 120ms var(--ease-out);
}
.traffic .dot.close { background: #FF5F57; }
.traffic .dot.min { background: #FEBC2E; }
.traffic .dot.max { background: #28C840; }
.traffic:hover .dot svg { opacity: 1; }
.traffic .dot svg { opacity: 0; transition: opacity 100ms; }

.brand {
  display: flex; align-items: center; gap: 10px;
  margin-left: 4px;
}
.brand-name {
  font-weight: 600; font-size: 14px; letter-spacing: -0.01em;
  color: var(--text);
}
.brand-sub {
  font-size: 10px; font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Segmented control (Apple) */
.segmented {
  display: inline-flex;
  padding: 2px;
  background: var(--hover);
  border-radius: var(--r-sm);
  gap: 2px;
}
.segmented button {
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: all 120ms var(--ease-out);
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.segmented button:hover:not(.active) { color: var(--text); }
.segmented button.active {
  background: var(--bg-2);
  color: var(--text);
  box-shadow: var(--shadow-1);
}
[data-theme="dark"] .segmented button.active { background: var(--elevated); }

/* Titlebar action buttons */
.tb-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.tb-btn {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  color: var(--text-secondary);
  transition: all 120ms var(--ease-out);
}
.tb-btn:hover { background: var(--hover); color: var(--text); }
.tb-btn.active { background: var(--pressed); color: var(--text); }
.tb-btn.primary {
  background: var(--accent-soft); color: var(--accent);
  width: auto; padding: 0 10px; height: 28px;
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500; font-size: 13px;
}
.tb-btn.primary:hover { background: var(--accent); color: white; }

/* ===== Main layout ===== */
.main {
  flex: 1; display: flex; min-height: 0;
}

/* Sidebar */
.sidebar {
  width: 280px;
  flex: 0 0 280px;
  background: var(--vibrancy-bg);
  backdrop-filter: saturate(180%) blur(40px);
  -webkit-backdrop-filter: saturate(180%) blur(40px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 14px 16px 8px;
}
.sidebar-search {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  background: var(--hover);
  border-radius: var(--r-sm);
  transition: all 120ms var(--ease-out);
}
.sidebar-search:focus-within {
  background: var(--bg-2);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.sidebar-search svg { color: var(--text-tertiary); flex: 0 0 14px; }
.sidebar-search input {
  background: none; border: 0; outline: none;
  flex: 1; min-width: 0;
  font-size: 13px;
  color: var(--text);
}
.sidebar-search input::placeholder { color: var(--text-tertiary); }
.sidebar-search kbd {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-2);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-weight: 500;
}

.sidebar-section {
  padding: 12px 8px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex; justify-content: space-between; align-items: center;
}
.sidebar-section span { padding: 0 8px; }
.sidebar-section .count {
  font-size: 10px; padding: 1px 6px; border-radius: var(--r-full);
  background: var(--hover); color: var(--text-tertiary);
}

.sidebar-scroll {
  flex: 1; overflow-y: auto;
  padding: 0 8px 16px;
}
.sidebar-scroll::-webkit-scrollbar { width: 8px; }
.sidebar-scroll::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: 4px;
  border: 2px solid transparent; background-clip: padding-box;
}

/* Multifunction card (Sonoma-style highlight item) */
.mf-card {
  margin: 4px 8px 12px;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--accent-soft-2) 100%);
  border: 1px solid var(--accent-soft);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 160ms var(--ease-out);
  display: flex; gap: 10px; align-items: flex-start;
}
.mf-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.mf-icon {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  color: white;
  flex: 0 0 32px;
  box-shadow: 0 4px 12px var(--accent-soft);
}
.mf-text { flex: 1; min-width: 0; }
.mf-title { font-weight: 600; font-size: 13px; color: var(--text); margin-bottom: 2px; }
.mf-sub { font-size: 11px; color: var(--text-secondary); line-height: 1.4; }

/* Patient row */
.patient-row {
  display: flex; gap: 10px; align-items: center;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 100ms var(--ease-out);
  position: relative;
}
.patient-row:hover { background: var(--hover); }
.patient-row.active {
  background: var(--selected);
}
.patient-row.active::before {
  content: ''; position: absolute; left: -8px; top: 8px; bottom: 8px;
  width: 3px; background: var(--accent); border-radius: 2px;
}
.patient-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--hover);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 11px;
  color: var(--text-secondary);
  flex: 0 0 30px;
  border: 1px solid var(--border);
}
.patient-row.active .patient-avatar {
  background: var(--accent);
  color: white;
  border-color: transparent;
}
.patient-info { flex: 1; min-width: 0; }
.patient-name {
  font-weight: 500; font-size: 13px;
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.patient-row.active .patient-name { font-weight: 600; }
.patient-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  display: flex; gap: 8px; align-items: center;
}
.patient-meta .dot-sep { width: 2px; height: 2px; background: currentColor; border-radius: 50%; opacity: .6; }

/* Sidebar footer (user) */
.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--divider);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-footer .patient-avatar { background: linear-gradient(135deg, #BF5AF2, #0A84FF); color: white; border: 0; }
.sf-name { font-size: 13px; font-weight: 500; color: var(--text); }
.sf-role { font-size: 11px; color: var(--text-tertiary); }

/* ===== Content area ===== */
.content {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

.content-header {
  padding: 24px 32px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  color: var(--text-tertiary); text-transform: uppercase;
  display: flex; gap: 8px; align-items: center;
}
.eyebrow .pill { padding: 2px 7px; background: var(--success); color: #0a3a14; border-radius: var(--r-full); font-size: 10px; letter-spacing: 0; text-transform: none; font-weight: 600; }
[data-theme="dark"] .eyebrow .pill { background: rgba(48, 209, 88, 0.18); color: var(--success); }

.h1 {
  font-size: 32px; font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
  text-wrap: balance;
}
.h2 {
  font-size: 20px; font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text); margin: 0;
}
.body-meta {
  display: flex; gap: 14px; align-items: center;
  color: var(--text-secondary); font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.body-meta .dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-tertiary); }
.body-meta .insurance {
  font-size: 11px; font-weight: 600;
  padding: 3px 8px;
  background: var(--hover); border-radius: var(--r-full);
  letter-spacing: 0.04em;
}

.content-scroll {
  flex: 1; overflow-y: auto;
  padding: 12px 32px 32px;
}
.content-scroll::-webkit-scrollbar { width: 10px; }
.content-scroll::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: 5px;
  border: 2px solid transparent; background-clip: padding-box;
}

/* Studies section header */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 24px 0 14px;
}
.section-head h3 {
  font-size: 13px; font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin: 0;
  display: flex; align-items: center; gap: 8px;
}
.section-head .count {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--text-quaternary);
}

/* Study card grid */
.studies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.study-card {
  position: relative;
  padding: 18px;
  background: var(--bg-2);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 200ms var(--ease-out);
  display: flex; flex-direction: column; gap: 14px;
  overflow: hidden;
}
.study-card::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--mod-color-soft);
  opacity: 0;
  transition: opacity 200ms;
  pointer-events: none;
}
.study-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-3);
  border-color: var(--mod-color);
}
.study-card:hover::before { opacity: 0.04; }
.study-card:active { transform: translateY(0); }

.study-thumb {
  height: 110px;
  background: var(--canvas-bg);
  border-radius: var(--r-md);
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
}
.study-thumb svg { max-width: 80%; max-height: 80%; }
.study-thumb::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(0,0,0,0.4) 100%);
  pointer-events: none;
}

.modality-chip {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 8px;
  background: var(--mod-color);
  color: #0a0a0c;
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  border-radius: var(--r-xs);
  text-transform: uppercase;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.thumb-meta {
  position: absolute; top: 10px; right: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  z-index: 2;
}

.study-info { display: flex; flex-direction: column; gap: 4px; }
.study-title {
  font-size: 15px; font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.study-meta {
  display: flex; gap: 10px; align-items: center;
  font-size: 12px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.study-meta svg { flex: 0 0 12px; }

.study-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
}
.series-count {
  font-size: 12px; font-weight: 500;
  color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px;
}
.open-arrow {
  width: 28px; height: 28px;
  border-radius: var(--r-full);
  background: var(--hover);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: all 200ms var(--ease-out);
}
.study-card:hover .open-arrow {
  background: var(--accent);
  color: white;
  transform: translateX(2px);
}

/* AI status badge in card */
.ai-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 600;
  padding: 3px 7px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: var(--r-full);
}
.ai-tag.done { background: rgba(48,209,88,0.14); color: var(--success); }
.ai-tag.pending { background: rgba(255,159,10,0.14); color: var(--warn); }
[data-theme="light"] .ai-tag.done { background: rgba(40,180,76,0.14); color: #1f7a3a; }
[data-theme="light"] .ai-tag.pending { background: rgba(220,130,0,0.14); color: #8a4d00; }

/* ===== Status bar (bottom) ===== */
.statusbar {
  flex: 0 0 28px;
  height: 28px;
  background: var(--titlebar-bg);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 16px;
  font-size: 11px;
  color: var(--text-tertiary);
  gap: 16px;
  z-index: 30;
}
.statusbar .sb-right { margin-left: auto; display: flex; gap: 16px; align-items: center; }
.statusbar .live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 var(--success);
  animation: pulse 2s infinite var(--ease-out);
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(48,209,88,0.5); }
  70% { box-shadow: 0 0 0 6px rgba(48,209,88,0); }
  100% { box-shadow: 0 0 0 0 rgba(48,209,88,0); }
}

/* ===== Viewer ===== */
.viewer {
  flex: 1; display: flex; min-height: 0;
  background: var(--canvas-bg);
}

.series-rail {
  width: 200px; flex: 0 0 200px;
  background: var(--vibrancy-bg);
  backdrop-filter: saturate(180%) blur(40px);
  -webkit-backdrop-filter: saturate(180%) blur(40px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden;
}
[data-theme="light"] .series-rail { background: rgba(245,245,247,0.85); }

.rail-head {
  padding: 12px 14px 10px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-tertiary);
  display: flex; align-items: center; justify-content: space-between;
}

.series-list {
  flex: 1; overflow-y: auto;
  padding: 0 10px 10px;
  display: flex; flex-direction: column; gap: 8px;
}

.series-card {
  background: var(--bg-2);
  border-radius: var(--r-md);
  padding: 8px;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 160ms var(--ease-out);
}
.series-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.series-thumb {
  height: 80px; border-radius: var(--r-sm);
  background: var(--canvas-bg-2);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
}
.series-thumb svg { max-width: 70%; max-height: 70%; opacity: 0.85; }
.series-thumb .frames {
  position: absolute; bottom: 4px; right: 4px;
  font-family: var(--font-mono); font-size: 9px;
  color: rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.4);
  padding: 1px 5px; border-radius: 3px;
}
.series-name { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.series-meta { font-size: 10px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }

/* Viewer center stage */
.stage {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--canvas-bg);
  position: relative;
}

.viewer-toolbar {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px;
  padding: 4px;
  background: rgba(28,28,30,0.72);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--r-full);
  z-index: 20;
  box-shadow: var(--shadow-3);
}
.tool-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-full);
  color: rgba(255,255,255,0.78);
  transition: all 140ms var(--ease-out);
  position: relative;
}
.tool-btn:hover {
  background: rgba(255,255,255,0.10);
  color: white;
}
.tool-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 14px rgba(10,132,255,0.4);
}
.tool-divider {
  width: 1px; height: 22px; background: rgba(255,255,255,0.14);
  margin: 0 4px;
}

/* Tooltip */
.tool-btn[data-tip]::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: rgba(28,28,30,0.95);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms var(--ease-out);
  z-index: 100;
}
.tool-btn[data-tip]:hover::after { opacity: 1; }

/* Right floating panel — window/level */
/* .wl-panel eliminado — los sliders W/L ahora viven dentro del dropdown del toolbar */
.wl-row { display: flex; align-items: center; gap: 8px; font-size: 11px; color: rgba(255,255,255,0.8); }
.wl-row .wl-label { width: 18px; display: flex; justify-content: center; color: rgba(255,255,255,0.6); flex-shrink: 0; }
.wl-row .wl-val { width: 38px; text-align: right; font-family: var(--font-mono); font-size: 10px; color: rgba(255,255,255,0.7); flex-shrink: 0; }

input[type="range"].apple {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 4px;
  background: rgba(255,255,255,0.18);
  border-radius: 2px; outline: none;
  cursor: pointer;
}
input[type="range"].apple::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 80ms var(--ease-out);
}
input[type="range"].apple::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"].apple::-moz-range-thumb {
  width: 14px; height: 14px;
  background: white;
  border-radius: 50%;
  border: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ── Full-width viewer toolbar ── */
.vt-header {
  flex-shrink: 0;
  background: rgba(10,10,14,0.98);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
  z-index: 30;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.vt-tools-row {
  display: flex; align-items: center; justify-content: center;
  height: 50px; padding: 0 12px; gap: 1px; overflow-x: auto;
}
/* Group container */
.vt-group {
  display: flex; align-items: center; gap: 1px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px; padding: 3px;
  margin: 0 2px;
}
.vt-tb-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: none; border-radius: 7px;
  background: transparent; color: rgba(255,255,255,0.4);
  cursor: pointer; transition: background 120ms, color 120ms, transform 80ms;
  flex-shrink: 0; position: relative;
}
.vt-tb-btn:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
  transform: scale(1.06);
}
.vt-tb-btn:active { transform: scale(0.94); }
/* Active states — per group color */
.vt-nav.on  {
  background: rgba(10,132,255,0.22);  color: #0A84FF;
  box-shadow: 0 0 0 1px rgba(10,132,255,0.3) inset;
}
.vt-meas.on {
  background: rgba(48,209,88,0.2);   color: #30D158;
  box-shadow: 0 0 0 1px rgba(48,209,88,0.3) inset;
}
.vt-draw.on {
  background: rgba(191,90,242,0.22);  color: #BF5AF2;
  box-shadow: 0 0 0 1px rgba(191,90,242,0.3) inset;
}
.vt-img.on  {
  background: rgba(255,159,10,0.2);  color: #FF9F0A;
  box-shadow: 0 0 0 1px rgba(255,159,10,0.3) inset;
}
/* Tooltip — below button */
.vt-tb-btn::after {
  content: attr(title);
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: rgba(18,18,22,0.96); color: rgba(255,255,255,0.9);
  font-size: 10px; font-weight: 600; white-space: nowrap;
  padding: 4px 9px; border-radius: 7px; border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  pointer-events: none; opacity: 0; transition: opacity 120ms;
  letter-spacing: 0.02em; z-index: 99;
}
.vt-tb-btn:hover::after { opacity: 1; }
/* Group separator */
.vt-sep {
  width: 1px; height: 22px;
  background: rgba(255,255,255,0.08);
  flex-shrink: 0; margin: 0 4px;
}

.vt-subbar {
  display: flex; align-items: center; gap: 6px; padding: 7px 20px;
  border-top: 1px solid rgba(255,255,255,0.055);
  background: rgba(10,10,14,0.65);
}
.vt-sub-label {
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.35);
  letter-spacing: 0.06em; text-transform: uppercase; flex-shrink: 0;
}
.vt-sub-sep { width: 1px; height: 18px; background: rgba(255,255,255,0.1); margin: 0 4px; flex-shrink: 0; }

.vt-color-dot {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer; flex-shrink: 0;
  transition: transform 120ms, border-color 120ms;
}
.vt-color-dot.selected { border-color: white; transform: scale(1.25); }
.vt-color-dot:hover { transform: scale(1.12); }

.vt-thick-btn, .vt-dash-btn {
  display: flex; align-items: center; justify-content: center;
  padding: 4px 6px; border-radius: 6px; border: none;
  background: transparent; color: rgba(255,255,255,0.5);
  cursor: pointer; transition: all 120ms;
}
.vt-thick-btn.selected, .vt-dash-btn.selected { background: rgba(255,255,255,0.12); color: white; }
.vt-thick-btn:hover, .vt-dash-btn:hover { background: rgba(255,255,255,0.08); }

.vt-presets-panel {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  background: rgba(22,22,26,0.96); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px; padding: 12px; min-width: 280px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5); z-index: 50;
  backdrop-filter: blur(24px);
  pointer-events: all; /* sobrescribe el none del padre vt-float */
}

/* ── W/L Side Panel — always visible, right side of canvas ── */
.wl-side-panel {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  z-index: 25; display: flex; flex-direction: column; gap: 8px;
  pointer-events: all;
  max-height: 90%; overflow-y: auto; overflow-x: hidden;
}
.wl-side-card {
  background: rgba(18,18,22,0.90);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
  min-width: 218px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  animation: slideInRight 180ms cubic-bezier(.32,.72,0,1);
}
.wl-side-header {
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.wl-side-btn {
  flex: 1; border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06); border-radius: 7px;
  color: rgba(255,255,255,0.55); font-size: 10px; font-weight: 600;
  padding: 4px 8px; cursor: pointer; letter-spacing: 0.03em;
  transition: background 120ms, color 120ms;
}
.wl-side-btn:hover { background: rgba(255,255,255,0.11); color: rgba(255,255,255,0.85); }
.wl-side-btn-accent.active { background: rgba(10,132,255,0.18); color: #0A84FF; border-color: rgba(10,132,255,0.35); }
.vt-presets-title {
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.35);
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 10px; padding: 0 4px;
}
.vt-presets-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.vt-preset-card {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 8px 10px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05); cursor: pointer; transition: all 150ms;
}
.vt-preset-card:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.15); }
.vt-pc-name { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.85); }
.vt-pc-wl { font-size: 9px; color: rgba(255,255,255,0.4); margin-top: 2px; font-family: var(--font-mono); }

/* ── Floating viewer toolbar ── */
.vt-float {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 20; display: flex; flex-direction: column; align-items: center; gap: 7px;
  pointer-events: none;
  max-width: none;
}
.vt-float-bar {
  display: flex; align-items: center; gap: 3px; flex-wrap: nowrap; justify-content: center;
  padding: 6px 9px;
  background: rgba(22,22,27,0.86);
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 17px;
  box-shadow: 0 12px 38px rgba(0,0,0,0.52), 0 0 0 0.5px rgba(255,255,255,0.04) inset;
  pointer-events: all;
}
.vt-float-sub {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 12px;
  background: rgba(20,20,24,0.88);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.4);
  pointer-events: all;
}
.vt-float-sep {
  width: 1px; height: 20px; background: rgba(255,255,255,0.1); flex-shrink: 0; margin: 0 2px;
}
.vt-fb {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border: none; border-radius: 12px;
  background: transparent; color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: background 150ms var(--ease-out), color 150ms var(--ease-out),
              transform 130ms var(--ease-out), box-shadow 150ms var(--ease-out);
  flex-shrink: 0; position: relative;
}
.vt-fb:hover {
  background: rgba(255,255,255,0.13); color: #ffffff; transform: translateY(-1.5px);
}
.vt-fb:active { transform: translateY(0) scale(0.92); }
.vt-fb.on-nav  { background: linear-gradient(155deg, rgba(10,132,255,0.36), rgba(10,132,255,0.16));  color: #5fb0ff; box-shadow: 0 0 0 1px rgba(10,132,255,0.5) inset, 0 5px 16px rgba(10,132,255,0.3); }
.vt-fb.on-meas { background: linear-gradient(155deg, rgba(48,209,88,0.34), rgba(48,209,88,0.15));   color: #5fe089; box-shadow: 0 0 0 1px rgba(48,209,88,0.5) inset, 0 5px 16px rgba(48,209,88,0.26); }
.vt-fb.on-draw { background: linear-gradient(155deg, rgba(191,90,242,0.4), rgba(191,90,242,0.18));  color: #d699f7; box-shadow: 0 0 0 1px rgba(191,90,242,0.55) inset, 0 5px 16px rgba(191,90,242,0.32); }
.vt-fb.on-img  { background: linear-gradient(155deg, rgba(255,159,10,0.34), rgba(255,159,10,0.15)); color: #ffbd52; box-shadow: 0 0 0 1px rgba(255,159,10,0.5) inset, 0 5px 16px rgba(255,159,10,0.26); }
/* Tooltip below the button (toolbar is at top, so tooltip goes into canvas space) */
.vt-fb::after {
  content: attr(title);
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: rgba(18,18,22,0.96); color: rgba(255,255,255,0.9);
  font-size: 10px; font-weight: 600; white-space: nowrap;
  padding: 4px 9px; border-radius: 7px; border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  pointer-events: none; opacity: 0; transition: opacity 120ms; letter-spacing: 0.02em;
  z-index: 99;
}
.vt-fb:hover::after { opacity: 1; }

/* Canvas */
.canvas-area {
  flex: 1; min-height: 0;
  position: relative; overflow: hidden;
  background: radial-gradient(ellipse at center, var(--canvas-bg) 0%, var(--canvas-bg-2) 100%);
}

.canvas-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.canvas-image {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}

/* Image labels */
.img-label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  z-index: 2;
  pointer-events: none;
  line-height: 1.5;
}
.img-label.tl { top: 64px; left: 16px; }
.img-label.tr { top: 64px; right: 220px; text-align: right; }
.img-label.bl { bottom: 16px; left: 16px; }
.img-label.br { bottom: 16px; right: 16px; text-align: right; }
.img-label .key { color: rgba(255,255,255,0.4); margin-right: 6px; }

/* AI overlay regions */
.ai-region {
  position: absolute;
  border: 1.5px solid var(--accent);
  border-radius: 4px;
  background: rgba(10,132,255,0.08);
  box-shadow: 0 0 24px rgba(10,132,255,0.3);
  animation: regionIn 400ms var(--ease-out);
}
.ai-region::before {
  content: '';
  position: absolute; inset: -1.5px;
  border: 1.5px dashed rgba(10,132,255,0.5);
  border-radius: 4px;
  animation: dash 16s linear infinite;
}
@keyframes regionIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes dash {
  to { stroke-dashoffset: -1000; }
}
.ai-region-label {
  position: absolute; top: -22px; left: -1.5px;
  background: var(--accent); color: white;
  font-size: 10px; font-weight: 600;
  padding: 2px 6px; border-radius: 4px;
  white-space: nowrap;
}

/* ===== Spotlight Modal ===== */
.spotlight-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.32);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  z-index: 1000;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 14vh;
  animation: overlayIn 200ms var(--ease-out);
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }

.spotlight {
  width: min(640px, 92vw);
  background: var(--vibrancy-bg);
  backdrop-filter: saturate(200%) blur(50px);
  -webkit-backdrop-filter: saturate(200%) blur(50px);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-popover);
  overflow: hidden;
  animation: spotlightIn 280ms var(--ease-out);
}
@keyframes spotlightIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
[data-theme="light"] .spotlight { background: rgba(255,255,255,0.78); }

.spotlight-input {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--divider);
}
.spotlight-input .ai-orb {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #0A84FF, #BF5AF2, #FF375F, #FF9F0A, #30D158, #64D2FF, #0A84FF);
  filter: blur(0.5px);
  animation: orbRotate 8s linear infinite;
  flex: 0 0 24px;
}
@keyframes orbRotate { to { transform: rotate(360deg); } }
.spotlight-input input {
  flex: 1; background: transparent; border: 0; outline: none;
  font-size: 22px; font-weight: 400;
  color: var(--text); letter-spacing: -0.01em;
}
.spotlight-input input::placeholder { color: var(--text-tertiary); }
.spotlight-input .esc {
  font-size: 11px; padding: 2px 8px;
  background: var(--hover); color: var(--text-tertiary);
  border-radius: 4px; border: 1px solid var(--border);
  font-weight: 500;
}

.spotlight-context {
  padding: 8px 16px;
  display: flex; gap: 6px; flex-wrap: wrap;
  border-bottom: 1px solid var(--divider);
  font-size: 11px;
}
.ctx-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  background: var(--hover);
  border-radius: var(--r-full);
  color: var(--text-secondary);
  font-weight: 500;
}

.spotlight-body {
  max-height: 50vh; overflow-y: auto;
  padding: 8px;
}
.sp-section-title {
  padding: 8px 12px 4px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
  color: var(--text-tertiary); text-transform: uppercase;
}
.sp-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 80ms var(--ease-out);
}
.sp-item:hover, .sp-item.selected { background: var(--accent-soft); color: var(--accent); }
.sp-item:hover .sp-icon, .sp-item.selected .sp-icon { background: var(--accent); color: white; }
.sp-icon {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  background: var(--hover); color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: all 120ms;
  flex: 0 0 28px;
}
.sp-text { flex: 1; min-width: 0; }
.sp-title { font-size: 13px; font-weight: 500; color: var(--text); }
.sp-item:hover .sp-title, .sp-item.selected .sp-title { color: var(--accent); }
.sp-sub { font-size: 11px; color: var(--text-tertiary); margin-top: 1px; }
.sp-shortcut { font-size: 11px; color: var(--text-tertiary); font-family: var(--font-sans); }

/* AI streaming response inside spotlight */
.ai-response {
  padding: 14px 16px;
  border-top: 1px solid var(--divider);
  background: var(--accent-soft-2);
}
.ai-response .ai-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.ai-response .ai-body {
  font-size: 13px; line-height: 1.55;
  color: var(--text);
}
.ai-response .ai-body p { margin: 0 0 8px; }
.ai-response .ai-body p:last-child { margin: 0; }
.ai-response .ai-body strong { color: var(--text); font-weight: 600; }
.ai-response .ai-body .finding {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 6px; background: var(--warn); color: #4a2a00;
  border-radius: 4px; font-size: 11px; font-weight: 600;
  margin: 0 2px;
}
[data-theme="dark"] .ai-response .ai-body .finding { background: rgba(255,159,10,0.18); color: var(--warn); }

.cursor-blink {
  display: inline-block; width: 7px; height: 14px;
  background: var(--accent); vertical-align: -2px;
  margin-left: 2px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Animated typing dots — chat AI indicator & DICOM loader */
.typing-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 2px;
}
.typing-dots span {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.85;
  animation: typingBounce 1.3s ease-in-out infinite;
}
.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.18s; }
.typing-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ===== Empty state / Patient picker ===== */
.empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
  padding: 32px;
  text-align: center;
  color: var(--text-tertiary);
}
.empty-icon {
  width: 64px; height: 64px;
  border-radius: var(--r-xl);
  background: var(--hover);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary);
}

/* Animations on mount — disabled in favor of always-visible state.
   The capture iframe sometimes freezes CSS animations at 0%, causing
   blank screens. Plain opacity is enough. */
.fade-in {
  opacity: 1;
  transform: none;
}

/* ===== Theme toggle ===== */
.theme-toggle {
  display: inline-flex; align-items: center;
  width: 44px; height: 24px;
  background: var(--hover);
  border-radius: var(--r-full);
  padding: 2px;
  cursor: pointer;
  transition: background 200ms;
  position: relative;
}
.theme-toggle .knob {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--bg-2);
  box-shadow: var(--shadow-1);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: transform 240ms var(--ease-out);
}
[data-theme="dark"] .theme-toggle .knob { transform: translateX(20px); }

/* ===== Multifunction Page ===== */
.mf-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.mf-tile {
  padding: 20px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all 200ms var(--ease-out);
  display: flex; flex-direction: column; gap: 10px;
}
.mf-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--accent); }
.mf-tile .tile-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  color: white;
  margin-bottom: 4px;
}
.mf-tile h4 { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.mf-tile p { margin: 0; font-size: 13px; color: var(--text-secondary); line-height: 1.45; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ===== Tabs (open studies) ===== */
.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 10px;
  background: transparent;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  flex: 0 0 auto;
  max-width: 200px;
  transition: all 120ms var(--ease-out);
  position: relative;
  border: 1px solid transparent;
}
.tab:hover { background: var(--hover); color: var(--text); }
.tab.active {
  background: var(--bg-2);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-1);
}
[data-theme="dark"] .tab.active { background: var(--elevated); }
.tab-mod {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 5px;
  border-radius: 4px;
  color: #0a0a0c;
  flex: 0 0 auto;
}
.tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}
.tab-close {
  width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px;
  color: var(--text-tertiary);
  opacity: 0.7;
  transition: all 120ms;
}
.tab-close:hover { background: var(--pressed); opacity: 1; color: var(--text); }

/* Pulse dot for analyzing state */
.pulse-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulseDot 1.2s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Barra de subida en StudyCard — se ve mientras los archivos del estudio
   están en proceso de guardarse en el backend (series_saved !== true) */
.study-upload-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; background: rgba(255,255,255,0.06);
  overflow: hidden; z-index: 5;
  border-bottom-left-radius: inherit; border-bottom-right-radius: inherit;
}
.study-upload-bar::after {
  content: ''; position: absolute; top: 0; left: 0;
  width: 32%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: studyUploadBar 1.4s ease-in-out infinite;
}
@keyframes studyUploadBar {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(310%); }
}

/* ===== Database Importer Modal ===== */
.importer {
  width: min(1100px, 94vw);
  max-height: 86vh;
  background: var(--bg-2);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-popover);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: spotlightIn 280ms var(--ease-out);
}
.importer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--divider);
}
.importer-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--divider);
  flex-wrap: wrap;
}
.importer-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--r-full);
  background: var(--hover);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  transition: all 120ms var(--ease-out);
}
.filter-chip:hover { background: var(--pressed); color: var(--text); }
.filter-chip.active {
  background: var(--accent);
  color: white;
}
.filter-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px;
}
.filter-chip.active .filter-dot { background: white !important; }
.importer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px 4px;
}
.importer-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 14px 4px 8px;
}
.importer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
.db-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 160ms var(--ease-out);
  position: relative;
}
.db-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
}
.db-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-2);
}
.db-card.imported {
  opacity: 0.55;
  cursor: not-allowed;
}
.db-card.imported:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: none;
}
.db-thumb {
  height: 90px;
  background: var(--canvas-bg);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.db-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  border: 2px solid white;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 120ms var(--ease-out);
}
.db-check.on {
  background: var(--accent);
  border-color: var(--accent);
}
.db-card.imported .db-check {
  background: var(--success);
  border-color: var(--success);
}
.importer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-top: 1px solid var(--divider);
  background: var(--bg);
}

/* ===== Report Editor ===== */
.report-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 32px;
  border-bottom: 1px solid var(--divider);
  background: var(--bg-2);
  flex-wrap: wrap;
}
.report-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  background: var(--hover);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  transition: all 120ms var(--ease-out);
}
.report-tool:hover { background: var(--pressed); }
.report-tool.recording {
  background: var(--danger);
  color: white;
  animation: recordingPulse 1.4s ease-in-out infinite;
}
@keyframes recordingPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,69,58,0.5); }
  50% { box-shadow: 0 0 0 6px rgba(255,69,58,0); }
}
.report-tool.primary {
  background: var(--accent);
  color: white;
}
.report-tool.primary:hover { background: var(--accent-hover); }

.report-canvas {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 32px;
  background: var(--bg);
}
.report-paper {
  max-width: 760px;
  margin: 0 auto;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  min-height: 60vh;
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.report-textarea {
  width: 100%;
  min-height: 60vh;
  border: 0;
  outline: none;
  padding: 32px 40px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.7;
  resize: vertical;
  white-space: pre-wrap;
  font-feature-settings: "cv11", "ss01";
}
.report-signature {
  max-width: 760px;
  margin: 24px auto 0;
  padding: 18px 32px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

/* ===== Template menu (popover) ===== */
.template-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 280px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-popover);
  padding: 6px;
  z-index: 50;
  max-height: 70vh;
  overflow-y: auto;
  animation: spotlightIn 200ms var(--ease-out);
}
.template-menu-head {
  padding: 8px 10px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.template-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 100ms;
  color: var(--text-secondary);
}
.template-item:hover { background: var(--accent-soft); color: var(--accent); }
.template-mod {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 5px;
  border-radius: 4px;
  color: #0a0a0c;
  flex: 0 0 auto;
}

/* ===== Multifunction tile grid ===== */
.mf-grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.mf-grid-2 { grid-template-columns: repeat(2, minmax(260px, 380px)); }

/* ===== Comparison screen ===== */
.cmp-modality-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: all 160ms var(--ease-out);
  text-align: left;
}
.cmp-modality-card:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--mod-color);
  box-shadow: var(--shadow-2);
}
.cmp-modality-chip {
  width: fit-content;
  padding: 3px 10px;
  border-radius: 6px;
  color: #0a0a0c;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.cmp-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 24px;
}

.cmp-grid {
  display: grid;
  gap: 12px;
}

.cmp-viewer-cell {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cmp-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--divider);
}
.cmp-viewer-canvas {
  height: 280px;
  background: var(--canvas-bg);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cmp-viewer-canvas .img-label { position: absolute; }

.cmp-report {
  margin-top: 18px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.cmp-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--divider);
  background: var(--accent-soft-2);
}
.cmp-report-body {
  margin: 0;
  padding: 20px 24px;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
}

/* ===== Confirm dialog ===== */
.confirm-dialog {
  width: min(380px, 92vw);
  background: var(--surface-solid);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-popover);
  overflow: hidden;
  animation: spotlightIn 240ms var(--ease-out);
}
.confirm-body {
  padding: 22px 22px 18px;
  text-align: center;
}
.confirm-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--divider);
}
.confirm-btn {
  padding: 13px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: background 100ms;
  border-right: 1px solid var(--divider);
}
.confirm-btn:last-child { border-right: 0; }
.confirm-btn:hover { background: var(--hover); }
.confirm-btn.danger { color: var(--danger); font-weight: 600; }
.confirm-btn.primary { color: var(--accent); font-weight: 600; }

/* ===== Chat Panel (right side, collapsible) ===== */
.chat-panel {
  width: 0;
  flex: 0 0 auto;
  background: var(--vibrancy-bg);
  backdrop-filter: saturate(180%) blur(40px);
  -webkit-backdrop-filter: saturate(180%) blur(40px);
  border-left: 1px solid transparent;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 320ms var(--ease-out);
}
.chat-panel.open {
  width: 380px;
  border-left-color: var(--border);
}
[data-theme="light"] .chat-panel { background: rgba(252,252,253,0.85); }

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--divider);
  flex: 0 0 auto;
}
.chat-orb {
  width: 24px; height: 24px; border-radius: 50%;
  background: conic-gradient(from 0deg, #0A84FF, #BF5AF2, #FF375F, #FF9F0A, #30D158, #64D2FF, #0A84FF);
  filter: blur(0.5px);
  animation: orbRotate 8s linear infinite;
  flex: 0 0 24px;
}

.chat-context {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 14px;
  border-bottom: 1px solid var(--divider);
  flex: 0 0 auto;
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.chat-body::-webkit-scrollbar { width: 6px; }
.chat-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

.chat-welcome {
  padding: 18px 8px 8px;
}

.chat-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--hover);
  border-radius: var(--r-md);
  transition: all 120ms var(--ease-out);
  border: 1px solid transparent;
}
.chat-action:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
}
.chat-action.primary {
  background: var(--accent);
  color: white;
}
.chat-action.primary:hover { background: var(--accent-hover); }
.chat-action-icon {
  width: 26px; height: 26px;
  border-radius: var(--r-sm);
  background: var(--bg-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  flex: 0 0 26px;
}
.chat-action:hover .chat-action-icon {
  background: var(--accent);
  color: white;
}

/* Templates list inside chat */
.chat-templates {
  background: var(--bg-2);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  padding: 8px;
}
.chat-templates-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--divider);
}
.chat-template-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 100ms;
}
.chat-template-item:hover { background: var(--accent-soft); }

/* Recording state */
.chat-recording {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px;
  background: var(--bg-2);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
}
.rec-orb {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--danger);
  position: relative;
  animation: recPulse 1.4s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.rec-orb::before {
  content: '';
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 4px;
}
@keyframes recPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,69,58,0.4); }
  50% { box-shadow: 0 0 0 14px rgba(255,69,58,0); }
}

/* Messages */
.msg {
  display: flex;
  gap: 8px;
  animation: fadeIn 200ms var(--ease-out);
}
.msg-user { justify-content: flex-end; }
.msg-bubble {
  padding: 9px 13px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  max-width: 88%;
}
.msg-bubble.user {
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}
.msg-bubble.assistant {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  width: 100%;
  max-width: 100%;
}
.msg-bubble.assistant p { margin: 0 0 6px; }
.msg-bubble.assistant p:last-child { margin: 0; }
.msg-bubble.assistant strong { color: var(--text); font-weight: 600; }
.msg-bubble.assistant .finding {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 6px; background: var(--warn); color: #4a2a00;
  border-radius: 4px; font-size: 11px; font-weight: 600;
}
[data-theme="dark"] .msg-bubble.assistant .finding {
  background: rgba(255,159,10,0.20); color: var(--warn);
}

.msg-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #0A84FF, #BF5AF2, #FF375F, #FF9F0A, #30D158, #64D2FF, #0A84FF);
  filter: blur(0.3px);
  flex: 0 0 24px;
  animation: orbRotate 8s linear infinite;
}
.msg-action-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 5px;
}
.msg-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

/* ── Report message action bar ── */
.msg-actions-bar {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  align-items: center;
}
.msg-action-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--divider);
  background: var(--hover);
  color: var(--text-secondary);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: all 150ms var(--ease-out);
}
.msg-action-btn:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.msg-action-btn.pdf {
  background: rgba(10,132,255,0.12);
  border-color: rgba(10,132,255,0.35);
  color: var(--accent);
  font-weight: 600;
}
.msg-action-btn.pdf:hover { background: rgba(10,132,255,0.22); }

/* ── Radiology Report Card — styled like PDF clinical note ── */
.report-card {
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg);
  font-size: 12px;
  margin: 4px 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.report-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(10,132,255,0.15) 0%, rgba(10,132,255,0.05) 100%);
  border-bottom: 1px solid rgba(10,132,255,0.2);
}
.report-card-logo {
  flex: 0 0 auto;
  padding: 4px 8px;
  background: rgba(10,132,255,0.12);
  border-radius: var(--r-sm);
  border: 1px solid rgba(10,132,255,0.25);
}
.report-section {
  padding: 9px 14px;
  border-bottom: 1px solid var(--divider);
}
.report-section:last-of-type { border-bottom: none; }
.report-section-title {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 5px;
}
.report-section-body {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.report-impression .report-section-body {
  color: var(--text);
  font-weight: 500;
}
.report-findings {
  margin: 0; padding-left: 16px;
  display: flex; flex-direction: column; gap: 3px;
}
.report-findings li { color: var(--text-secondary); line-height: 1.5; }
.report-abnormality {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid var(--divider);
}
.report-abnormality:last-child { border-bottom: none; }
.report-sev-chip {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
  flex: 0 0 auto;
  margin-top: 2px;
}
.report-region {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  flex: 0 0 auto;
}
.report-ab-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.45;
}
.report-measure-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  background: rgba(100,210,255,0.10);
  border: 1px solid rgba(100,210,255,0.25);
  border-radius: var(--r-sm);
  font-size: 11px;
  color: #64D2FF;
}
.report-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  margin-left: 6px;
}
.report-badge.quality-adequate { background: rgba(48,209,88,0.15); color: #30D158; }
.report-badge.quality-limited  { background: rgba(255,159,10,0.15); color: #FF9F0A; }
.report-badge.quality-poor     { background: rgba(255,69,58,0.15);  color: #FF375F; }
.report-card-footer {
  display: flex;
  justify-content: space-between;
  padding: 7px 14px;
  background: var(--hover);
  font-size: 10px;
  color: var(--text-tertiary);
  border-top: 1px solid var(--divider);
}

/* Quick action strip */
.chat-quick-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-top: 1px solid var(--divider);
  background: var(--bg);
  flex: 0 0 auto;
}
.chat-quick {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  transition: all 120ms var(--ease-out);
}
.chat-quick:hover { background: var(--accent-soft); color: var(--accent); }

/* Input */
.chat-input {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--divider);
  background: var(--bg-2);
  flex: 0 0 auto;
}
.chat-input input {
  flex: 1;
  background: var(--hover);
  border: 0;
  outline: none;
  padding: 8px 12px;
  border-radius: var(--r-full);
  font-size: 13px;
  color: var(--text);
  min-width: 0;
  transition: all 120ms var(--ease-out);
}
.chat-input input:focus { background: var(--bg); box-shadow: 0 0 0 2px var(--accent-soft); }
.chat-input input::placeholder { color: var(--text-tertiary); }
.chat-send {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 120ms var(--ease-out);
  flex: 0 0 32px;
  cursor: pointer; border: none;
}
.chat-send:hover:not(:disabled) { background: var(--accent-hover); transform: scale(1.05); }
.chat-send:disabled { background: var(--hover); color: var(--text-tertiary); cursor: not-allowed; }
/* Mic button — separate class so it doesn't inherit accent bg */
.chat-mic-btn {
  width: 28px; height: 28px; border-radius: 50%;
  background: transparent; border: 1px solid transparent;
  color: var(--text-tertiary);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 150ms var(--ease-out); flex: 0 0 28px;
}
.chat-mic-btn:hover { background: var(--hover); color: var(--text); }
.chat-mic-btn.active {
  background: rgba(255,55,95,0.14);
  border-color: rgba(255,55,95,0.35);
  color: #FF375F;
}

/* Mic waveform animation */
@keyframes micWave {
  from { transform: scaleY(0.4); opacity: 0.7; }
  to   { transform: scaleY(1.2); opacity: 1; }
}

/* ===== Oculus Logo DICOM Loader ===== */
.oculus-logo-loader {
  animation: oclFloat 2.8s ease-in-out infinite;
  filter: drop-shadow(0 0 18px rgba(10,132,255,0.22));
}
/* Fondo — pulso suave de escala */
.ocl-bg {
  animation: oclBgPulse 2.2s ease-in-out infinite;
  transform-origin: 20px 20px;
}
/* Barriles — parpadeo alterno que simula enfoque */
.ocl-barrel {
  transform-origin: center;
}
.ocl-left  { animation: oclBarrelL 2.0s ease-in-out infinite; transform-origin: 12px 20px; }
.ocl-right { animation: oclBarrelR 2.0s ease-in-out 0.15s infinite; transform-origin: 28px 20px; }
/* Puente */
.ocl-bridge { animation: oclFade 2.2s ease-in-out infinite; }
/* Cavidades de lente — se "enfocan" expandiéndose/contrayéndose */
.ocl-lens-l { animation: oclLens 2.0s ease-in-out infinite; transform-origin: 12px 20px; }
.ocl-lens-r { animation: oclLens 2.0s ease-in-out 0.15s infinite; transform-origin: 28px 20px; }
/* Destellos */
.ocl-glint  { animation: oclGlint 2.2s ease-in-out infinite; }

@keyframes oclFloat {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-5px); }
}
@keyframes oclBgPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.9; transform: scale(0.97); }
}
@keyframes oclBarrelL {
  0%, 100% { opacity: 1; transform: scale(1); }
  40%       { opacity: 0.85; transform: scale(0.94); }
  70%       { opacity: 1; transform: scale(1.02); }
}
@keyframes oclBarrelR {
  0%, 100% { opacity: 1; transform: scale(1); }
  40%       { opacity: 0.85; transform: scale(0.94); }
  70%       { opacity: 1; transform: scale(1.02); }
}
@keyframes oclFade {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.75; }
}
@keyframes oclLens {
  0%, 100% { r: 4; }
  45%       { r: 3.2; }
  75%       { r: 4.4; }
}
@keyframes oclGlint {
  0%, 100% { opacity: 0.55; }
  50%       { opacity: 0.9; }
}

/* ===== Report Reader — panel de informe en modo lectura ===== */
.report-reader {
  width: 440px;
  flex: 0 0 440px;
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border-left: 1px solid var(--border);
  min-height: 0;
  animation: rrSlideIn 220ms var(--ease-out);
}
@keyframes rrSlideIn {
  from { transform: translateX(24px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
/* Drawer que entra desde el borde derecho */
@keyframes drawerInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
/* Animación de espera del chatbot IA — líneas skeleton en oleada */
@keyframes aiWave { 0%, 100% { opacity: 0.28; } 50% { opacity: 0.9; } }
.rr-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 18px;
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}
.rr-title { font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.rr-sub {
  font-size: 11px; color: var(--text-tertiary); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rr-body {
  flex: 1; overflow-y: auto;
  padding: 24px 26px;
  font-family: 'Inter', system-ui, sans-serif;
}
.rr-section {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--accent);
  margin: 22px 0 9px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--divider);
}
.rr-section:first-child { margin-top: 0; }
.rr-line {
  font-size: 13.5px; line-height: 1.75;
  color: var(--text-secondary);
  margin: 0 0 4px;
}
.rr-line b, .rr-line strong { font-weight: 700; color: var(--text); }
.rr-line u { text-underline-offset: 2px; }
.rr-line i, .rr-line em { font-style: italic; }
.rr-line ul, .rr-line ol { padding-left: 20px; margin: 4px 0; }
.rr-line li { margin: 2px 0; }
.rr-blank { height: 11px; }
.rr-empty {
  color: var(--text-tertiary); font-size: 13px;
  text-align: center; padding: 48px 16px; line-height: 1.6;
}
.rr-foot {
  padding: 10px 18px;
  border-top: 1px solid var(--divider);
  font-size: 10px; color: var(--text-tertiary);
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.rr-foot-dot { width: 6px; height: 6px; border-radius: 50%; background: #30D158; }

/* ===== Dictado por voz — efecto fluido y moderno ===== */
/* Palabra en vivo (la que se está dictando ahora) — acento + resplandor suave */
/* Texto en vivo del dictado — "chip" gris translúcido que aparece y late
   suavemente; es temporal, hasta que el motor lo fije como texto definitivo. */
.dictation-interim {
  background: rgba(142,142,147,0.26);
  color: var(--text-secondary);
  border-radius: 5px;
  padding: 1px 6px;
  margin: 0 1px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  animation: dict-live 1.5s ease-in-out infinite;
}
@keyframes dict-live {
  0%, 100% { background: rgba(142,142,147,0.20); opacity: 0.72; }
  50%      { background: rgba(142,142,147,0.34); opacity: 1; }
}
/* Texto recién confirmado — "se asienta" con un fundido suave desde el resplandor */
@keyframes dict-settle {
  0%   { opacity: 0.35; filter: blur(0.7px); color: var(--accent); text-shadow: 0 0 12px rgba(10,132,255,0.7); }
  55%  { opacity: 1;    filter: blur(0); }
  100% { color: inherit; text-shadow: 0 0 0 rgba(10,132,255,0); }
}
.dictation-appear {
  animation: dict-settle 0.5s cubic-bezier(0.2,0.75,0.25,1) both;
}

/* ===== Login Screen ===== */
.login-window {
  position: fixed; inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}
@media (max-width: 880px) {
  .login-window { grid-template-columns: 1fr; }
  .login-brand-side { display: none; }
}

.login-tools {
  position: absolute;
  top: 18px;
  right: 24px;
  z-index: 10;
}

/* Left side */
.login-brand-side {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #0c1e45 0%, #172f64 100%);
  color: white;
}
.login-brand-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 30%, rgba(10,132,255,0.32) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(94,92,230,0.28) 0%, transparent 55%),
    radial-gradient(circle at 50% 10%, rgba(48,209,88,0.10) 0%, transparent 45%);
  filter: saturate(140%);
}
.login-brand-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}
.login-brand-content {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 48px 56px;
  z-index: 1;
}
.login-logo-stack {
  display: flex;
  align-items: center;
  gap: 16px;
}
.login-brand-name {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: white;
  line-height: 1;
}
.login-brand-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
  letter-spacing: 0.01em;
}
.login-tagline {
  margin-top: auto;
  margin-bottom: 32px;
}
.login-tagline-line {
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: white;
}
.login-tagline-line.accent {
  background: linear-gradient(135deg, #64D2FF 0%, #5E5CE6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
  max-width: 420px;
}
.login-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.78);
  font-size: 13px;
  line-height: 1.5;
}
.login-feature svg {
  color: #64D2FF;
  flex: 0 0 14px;
}

.login-brand-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  font-variant-numeric: tabular-nums;
}

/* Right form side */
.login-form-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;   /* 'safe' evita que el contenido se recorte arriba al desbordar */
  padding: 56px 32px 32px;
  overflow-y: auto;
  background: linear-gradient(160deg, #111827 0%, #0d1117 100%);
  position: relative;
}
[data-theme="light"] .login-form-side { background: #ffffff; }

/* "Ver planes" absolute top-right of login-window */
.login-topbar {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
}
.login-plans-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px 7px 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--r-full);
  color: rgba(255,255,255,0.85);
  font-size: 13px; font-weight: 600;
  transition: all 120ms var(--ease-out);
  letter-spacing: -0.01em;
  backdrop-filter: blur(8px);
}
.login-plans-btn:hover { background: rgba(255,255,255,0.15); color: white; }
[data-theme="light"] .login-plans-btn { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); }
[data-theme="light"] .login-plans-btn:hover { background: var(--accent); color: white; }

.login-signup-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: var(--r-full);
  color: white;
  font-size: 13px; font-weight: 600;
  transition: all 120ms var(--ease-out);
  letter-spacing: -0.01em;
}
.login-signup-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* Sign-up modal overlay */
.signup-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  animation: fadeIn 140ms var(--ease-out);
}
.signup-card {
  width: 100%; max-width: 400px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-popover);
  overflow: hidden;
  animation: scaleIn 160ms var(--ease-out);
}
@keyframes scaleIn {
  from { transform: scale(0.94); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.signup-head {
  padding: 28px 28px 0;
  text-align: center;
}
.signup-body { padding: 20px 28px 28px; display: flex; flex-direction: column; gap: 10px; }
.signup-sso-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px 16px;
  background: var(--hover);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 14px; font-weight: 500;
  color: var(--text);
  transition: all 120ms var(--ease-out);
}
.signup-sso-btn:hover { background: var(--pressed); border-color: var(--border-strong); }
.signup-sso-btn.whatsapp { color: #25D366; border-color: rgba(37,211,102,0.3); background: rgba(37,211,102,0.06); }
.signup-sso-btn.whatsapp:hover { background: rgba(37,211,102,0.12); }
.signup-sep { text-align: center; font-size: 11px; color: var(--text-tertiary); position: relative; margin: 2px 0; }
.signup-sep::before { content: ''; position: absolute; left: 0; right: 50%; top: 50%; height: 1px; background: var(--divider); transform: translateX(-4px); }
.signup-sep::after { content: ''; position: absolute; right: 0; left: 50%; top: 50%; height: 1px; background: var(--divider); transform: translateX(4px); }
.login-form {
  width: 100%;
  max-width: 408px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.login-form-head { margin-bottom: 10px; }
.login-h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}
.login-h1-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 6px 0 0;
  line-height: 1.5;
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.login-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.login-input {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  transition: all 120ms var(--ease-out);
}
.login-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.login-input svg { color: var(--text-tertiary); flex: 0 0 14px; }
.login-input input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
  color: var(--text);
  min-width: 0;
}
.login-input input::placeholder { color: var(--text-quaternary); }
.login-pw-toggle {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  padding: 2px 6px;
  flex: 0 0 auto;
}
.login-link {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}
.login-link:hover { text-decoration: underline; }

.login-row { display: flex; align-items: center; }
.login-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.login-check-box {
  width: 18px; height: 18px;
  border-radius: var(--r-xs);
  border: 1.5px solid var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 120ms var(--ease-out);
  color: white;
  flex: 0 0 18px;
}
.login-check-box.on {
  background: var(--accent);
  border-color: var(--accent);
}

.login-error {
  padding: 8px 12px;
  background: rgba(255,69,58,0.10);
  border: 1px solid rgba(255,69,58,0.3);
  color: var(--danger);
  border-radius: var(--r-sm);
  font-size: 12px;
}

.login-submit {
  padding: 12px 18px;
  background: var(--accent);
  color: white;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 120ms var(--ease-out);
  margin-top: 4px;
}
.login-submit:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--accent-soft);
}
.login-submit:disabled { opacity: 0.7; cursor: wait; }

.login-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  color: var(--text-tertiary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.login-divider::before, .login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--divider);
}

.login-sso {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.login-sso-btn {
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 120ms var(--ease-out);
}
.login-sso-btn:hover { background: var(--hover); border-color: var(--border-strong); }

.login-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 8px;
  flex-wrap: wrap;
}

/* ===== Login — Acceso rápido ===== */
.login-quick {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--divider);
}
.login-quick-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: center;
}
.login-quick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.login-quick-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--bg-2);
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color 150ms var(--ease-out), background 150ms var(--ease-out);
  text-align: left;
  width: 100%;
}
.login-quick-card:hover { background: var(--hover); }
.login-quick-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
  flex-shrink: 0;
}
.login-quick-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.login-quick-spec {
  font-size: 11px; color: var(--text-tertiary); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.login-quick-role {
  font-size: 10px; font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-full);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* ===== Profile Dropdown Menu ===== */
.profile-dropdown-wrap { position: relative; }
.profile-dropdown {
  position: absolute;
  right: 0; top: calc(100% + 8px);
  width: 260px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-popover);
  z-index: 300;
  overflow: hidden;
  animation: spotlightIn 180ms var(--ease-out);
}
.pd-user {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 16px 14px;
}
.pd-sep {
  height: 1px; background: var(--divider); margin: 4px 0;
}
.pd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; width: 100%;
  font-size: 13px; color: var(--text-secondary);
  text-align: left;
  transition: background 100ms;
}
.pd-item:hover { background: var(--hover); }
.pd-item.danger { color: var(--danger); }
.pd-item-icon {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-xs);
  background: var(--hover);
  color: var(--text-secondary);
  flex: 0 0 22px;
}
.pd-item.danger .pd-item-icon { background: rgba(255,69,58,0.10); color: var(--danger); }
.pd-theme-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px 10px;
  gap: 12px;
}
.pd-theme-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: var(--r-sm);
  font-size: 11px; font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all 100ms;
}
.pd-theme-btn:hover { background: var(--hover); }
.pd-theme-btn.active {
  background: var(--accent-soft); color: var(--accent);
  border-color: var(--accent-soft);
}

/* ===== Chat recording bar (inline, bottom of chat) ===== */
.chat-recording-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  border-top: 1px solid rgba(255,69,58,0.25);
  background: rgba(255,69,58,0.06);
  flex: 0 0 auto;
}
.rec-pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); flex: 0 0 8px;
  animation: recPulse 1.2s ease-in-out infinite;
}

/* ===== Splash Screen ===== */
.splash-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px; z-index: 9999;
  animation: splashFadeIn 0.3s var(--ease-out) both;
}
@keyframes splashFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes splashFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes splashScale {
  0%   { opacity: 0; transform: scale(0.6); }
  65%  { opacity: 1; transform: scale(1.06); }
  100% { transform: scale(1); }
}
@keyframes splashFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.splash-logo-wrap {
  animation: splashScale 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.splash-title {
  font-size: 30px; font-weight: 700; letter-spacing: -0.025em;
  color: var(--text);
  animation: splashFadeUp 0.45s 0.15s var(--ease-out) both;
}
.splash-sub {
  font-size: 12px; color: var(--text-tertiary); letter-spacing: 0.01em;
  animation: splashFadeUp 0.45s 0.25s var(--ease-out) both;
}
.splash-progress {
  width: 100px; height: 2px;
  background: var(--border); border-radius: 1px; overflow: hidden;
  animation: splashFadeUp 0.45s 0.35s var(--ease-out) both;
}
.splash-progress-bar {
  height: 100%; background: var(--accent); width: 0;
  animation: splashProgress 1.8s 0.4s var(--ease-out) forwards;
}
@keyframes splashProgress { from { width: 0; } to { width: 100%; } }

/* ===== Profile Screen — Apple-premium look ===== */
/* Fondo gris claro (iOS Settings style), cards blancos con sombra suave,
   border-radius generoso, espacio amplio entre secciones.                 */
.profile-screen {
  flex: 1; display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 40px 28px 60px;
  background: #F2F2F7;        /* iOS gris-claro tipo Settings */
}
[data-theme="dark"] .profile-screen { background: #0a0a0c; }

.profile-card {
  width: 100%; max-width: 700px;
  background: transparent;     /* el card real lo damos por sección */
  border: none;
  display: flex; flex-direction: column; gap: 18px;
  animation: fadeIn 220ms var(--ease-out);
}

/* Header: card blanco grande con avatar central */
.profile-header {
  padding: 24px 26px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.04);
  display: flex; align-items: center; gap: 18px;
}
[data-theme="dark"] .profile-header {
  background: #1c1c1e;
  border-color: rgba(255,255,255,0.06);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.profile-header .tb-btn { color: #111; }
[data-theme="dark"] .profile-header .tb-btn { color: #f5f5f7; }

.profile-avatar-lg {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, #0A84FF 0%, #007AFF 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: white;
  flex: 0 0 60px; letter-spacing: -0.02em;
  box-shadow: 0 4px 12px rgba(10,132,255,0.3);
}

/* Body: cada section es un card blanco independiente con su propia sombra */
.profile-body {
  padding: 0;
  display: flex; flex-direction: column; gap: 16px;
}
.profile-section {
  background: #ffffff;
  border-radius: 16px;
  padding: 22px 24px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  border: 1px solid rgba(0,0,0,0.04);
}
[data-theme="dark"] .profile-section {
  background: #1c1c1e;
  border-color: rgba(255,255,255,0.06);
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.profile-section-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: #8E8E93;
  padding-bottom: 12px; margin: 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
[data-theme="dark"] .profile-section-title {
  color: #98989F; border-bottom-color: rgba(255,255,255,0.08);
}

.profile-field { display: flex; flex-direction: column; gap: 6px; }
.profile-field label {
  font-size: 12px; font-weight: 600; color: #1c1c1e;
  letter-spacing: -0.005em;
}
[data-theme="dark"] .profile-field label { color: #f5f5f7; }

.profile-input {
  display: flex; align-items: center; gap: 10px;
  background: #F2F2F7;         /* gris-claro iOS, sin borde */
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 11px 14px;
  transition: all 140ms var(--ease-out);
}
[data-theme="dark"] .profile-input {
  background: rgba(255,255,255,0.06);
}
.profile-input:focus-within {
  background: #ffffff;
  border-color: #0A84FF;
  box-shadow: 0 0 0 4px rgba(10,132,255,0.15);
}
[data-theme="dark"] .profile-input:focus-within {
  background: rgba(255,255,255,0.1);
  border-color: #0A84FF;
}
.profile-input svg { color: #8E8E93; flex: 0 0 14px; }
.profile-input input, .profile-input select {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-size: 14px; color: #1c1c1e; font-family: var(--font-sans); min-width: 0;
  font-weight: 500;
}
[data-theme="dark"] .profile-input input,
[data-theme="dark"] .profile-input select { color: #f5f5f7; }
.profile-input select { cursor: pointer; }
.profile-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Highlight de campo faltante — Ola B (al llegar desde el banner del header) */
@keyframes profile-field-pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--accent-soft); }
  50%       { box-shadow: 0 0 0 8px var(--accent-soft); }
}
.profile-field-highlight .profile-input {
  border-color: var(--accent);
  animation: profile-field-pulse 1.1s ease-in-out 2;
}
.profile-field-highlight label {
  color: var(--accent);
}

/* ── Modal genérico (eliminar cuenta, confirmaciones) ───────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: modal-fade 160ms var(--ease-out);
}
.modal-card {
  width: 100%;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--r-lg, 16px);
  padding: 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
  animation: modal-pop 200ms var(--ease-out);
  max-height: 90vh; overflow-y: auto;
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.profile-actions {
  display: flex; gap: 10px; padding: 22px 24px;
  border: none; background: transparent;
  justify-content: flex-end;
}
.profile-save {
  flex: 0 1 auto; min-width: 180px; padding: 13px 28px;
  background: #0A84FF; color: white;
  border: none; border-radius: 12px;
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(10,132,255,0.3);
  transition: all 140ms var(--ease-out);
}
.profile-save:hover { background: #0070D9; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(10,132,255,0.4); }
.profile-save:active { transform: translateY(0); }
.profile-save:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.profile-cancel {
  flex: 1; padding: 12px;
  background: var(--hover); color: var(--text-secondary);
  border-radius: var(--r-md); font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 120ms var(--ease-out); border: 1px solid var(--border);
}
.profile-cancel:hover { background: var(--pressed); color: var(--text); }
.profile-logout {
  padding: 12px 18px;
  border: 1px solid var(--danger); color: var(--danger);
  border-radius: var(--r-md); font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 7px;
  transition: all 120ms var(--ease-out);
}
.profile-logout:hover { background: rgba(255,69,58,0.08); }

/* ===== Pricing Screen ===== */
.pricing-screen {
  flex: 1; display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 48px 24px; background: var(--bg);
  min-height: 0; height: 100%;
}
/* Standalone (pre-login) */
body > #root > .pricing-screen { height: 100vh; flex: none; }

.pricing-back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 10px;
  background: var(--hover);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  transition: all 120ms var(--ease-out);
}
.pricing-back-btn:hover { background: var(--pressed); color: var(--text); }
.pricing-inner { width: 100%; max-width: 920px; animation: fadeIn 220ms var(--ease-out); }
.pricing-hero { text-align: center; margin-bottom: 44px; }
.pricing-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--r-full);
  background: var(--accent-soft); color: var(--accent);
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; margin-bottom: 16px;
}
.pricing-h1 { font-size: 38px; font-weight: 700; letter-spacing: -0.03em; color: var(--text); margin: 0 0 12px; }
.pricing-sub { font-size: 15px; color: var(--text-secondary); line-height: 1.6; max-width: 500px; margin: 0 auto; }
.pricing-cards { display: grid; gap: 20px; grid-template-columns: 1fr 1fr; margin-bottom: 28px; }
@media(max-width:680px) { .pricing-cards { grid-template-columns: 1fr; } }
.pricing-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-xl); overflow: hidden;
  transition: box-shadow 200ms var(--ease-out);
}
.pricing-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-2); }
.pricing-card-head { padding: 28px 28px 18px; }
.pricing-plan-name { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--text-tertiary); text-transform: uppercase; }
.pricing-featured-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--r-full);
  background: var(--accent); color: white;
  font-size: 9px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; margin-left: 8px; vertical-align: middle;
}
.pricing-price { margin: 14px 0 4px; line-height: 1; }
.pricing-amount { font-size: 46px; font-weight: 700; letter-spacing: -0.04em; color: var(--text); }
.pricing-period { font-size: 15px; color: var(--text-tertiary); font-weight: 400; }
.pricing-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-top: 10px; }
.pricing-divider { height: 1px; background: var(--divider); margin: 0 28px; }
.pricing-features-list { padding: 20px 28px 24px; display: flex; flex-direction: column; gap: 10px; }
.pricing-feature {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: var(--text-secondary); line-height: 1.45;
}
.pricing-feature-check {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 18px; margin-top: 1px;
}
.pricing-cta-wrap { padding: 0 28px 28px; }
.pricing-cta {
  display: flex; width: 100%; padding: 13px;
  background: var(--accent); color: white;
  border-radius: var(--r-md); font-size: 14px; font-weight: 600;
  align-items: center; justify-content: center; gap: 8px;
  transition: all 120ms var(--ease-out);
}
.pricing-cta:hover { background: var(--accent-hover); transform: translateY(-1px); }
.pricing-cta.outline {
  background: transparent; color: var(--accent);
  border: 1.5px solid var(--accent);
}
.pricing-cta.outline:hover { background: var(--accent-soft); transform: none; }
.pricing-tokens-box {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 24px 28px; margin-bottom: 28px;
}
.pricing-token-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pricing-token-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.pricing-token-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), #BF5AF2); }

/* Payment gateway */
.payment-sheet {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-xl); overflow: hidden;
}
.payment-head {
  padding: 20px 28px; border-bottom: 1px solid var(--divider);
  display: flex; align-items: center; gap: 14px;
}
.payment-body { padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.payment-field { display: flex; flex-direction: column; gap: 5px; }
.payment-field label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.payment-input {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 11px 14px;
  transition: all 120ms var(--ease-out);
}
.payment-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.payment-input svg { color: var(--text-tertiary); flex: 0 0 14px; }
.payment-input input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-size: 14px; color: var(--text); font-family: var(--font-sans);
  min-width: 0; font-variant-numeric: tabular-nums;
}
.payment-input input::placeholder { color: var(--text-quaternary); }
.payment-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.payment-grid-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
.payment-card-icons { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.payment-card-chip {
  padding: 2px 6px; border-radius: 4px; font-size: 9px; font-weight: 700;
  letter-spacing: 0.04em; border: 1px solid var(--border); color: var(--text-tertiary);
}
.payment-security {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: var(--text-tertiary);
  padding: 12px 28px; border-top: 1px solid var(--divider); background: var(--bg);
}
/* Payment method selector */
.payment-methods {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 4px;
}
.payment-method-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 12px;
  background: var(--bg-2);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 140ms var(--ease-out);
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
}
.payment-method-btn:hover { border-color: var(--accent); color: var(--text); }
.payment-method-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.payment-method-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; letter-spacing: -0.02em;
}

.payment-submit {
  width: 100%; padding: 14px;
  background: var(--accent); color: white;
  border-radius: var(--r-md); font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: all 120ms var(--ease-out);
}
.payment-submit:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 6px 20px var(--accent-soft); }
.payment-submit:disabled { opacity: 0.65; cursor: wait; }
.payment-terms {
  font-size: 11px; color: var(--text-tertiary); text-align: center;
  line-height: 1.5;
}
.payment-success {
  text-align: center; padding: 52px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.payment-success-icon {
  width: 68px; height: 68px; border-radius: 50%;
  background: #30D158; color: white;
  display: flex; align-items: center; justify-content: center;
  animation: splashScale 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}

/* ===== Rich text editor (Templates) ===== */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--divider);
  background: var(--bg-2);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.editor-tool-btn {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: 13px; font-weight: 600;
  font-family: var(--font-sans);
  transition: all 100ms var(--ease-out);
  flex-shrink: 0;
}
.editor-tool-btn:hover { background: var(--hover); color: var(--text); }
.editor-tool-sep {
  width: 1px; height: 18px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
}
.editor-dictate-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-md);
  font-size: 12px; font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all 120ms var(--ease-out);
  flex-shrink: 0;
}
.editor-dictate-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.editor-dictate-btn.recording {
  background: rgba(255,69,58,0.08);
  border-color: var(--danger);
  color: var(--danger);
}

.rich-editor {
  flex: 1;
  overflow-y: auto;
  padding: 28px 40px;
  font-size: 14px;
  line-height: 1.85;
  color: var(--text);
  outline: none;
  font-family: var(--font-sans);
  min-height: 0;
  word-break: break-word;
}
.rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-quaternary);
  pointer-events: none;
}
.rich-editor b, .rich-editor strong { font-weight: 700; }
.rich-editor i, .rich-editor em { font-style: italic; }
.rich-editor u { text-decoration: underline; }
.rich-editor ul { padding-left: 22px; margin: 6px 0; }
.rich-editor ol { padding-left: 22px; margin: 6px 0; }
.rich-editor li { margin: 3px 0; }
.rich-editor::-webkit-scrollbar { width: 6px; }
.rich-editor::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

/* ===== Settings Panel (gear button in sidebar) ===== */
.settings-panel {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 8px; right: 8px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-popover);
  z-index: 80;
  overflow: hidden;
  animation: fadeIn 140ms var(--ease-out);
}
.settings-panel-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--divider);
}
.settings-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--text-tertiary);
  padding: 10px 16px 4px;
}
.settings-row {
  display: flex; align-items: center;
  padding: 9px 16px; gap: 10px;
  font-size: 13px; color: var(--text-secondary);
  transition: background 80ms;
}
.settings-row:hover { background: var(--hover); color: var(--text); }
.settings-row label { flex:1; font-size:13px; color: inherit; }
.settings-row select {
  background: var(--hover); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 4px 8px;
  font-size: 12px; color: var(--text); font-family: inherit;
  max-width: 160px; cursor: pointer;
}
.settings-toggle {
  width: 36px; height: 20px;
  background: var(--hover); border-radius: var(--r-full);
  position: relative; transition: background 160ms; cursor: pointer;
  flex: 0 0 36px; border: none;
}
.settings-toggle.on { background: var(--accent); }
.settings-toggle::after {
  content: ''; position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%; background: white;
  transition: transform 160ms var(--ease-out);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.settings-toggle.on::after { transform: translateX(16px); }
.settings-footer-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 16px;
  font-size: 13px; color: var(--text-secondary);
  transition: background 80ms;
  border-top: 1px solid var(--divider); margin-top: 2px;
}
.settings-footer-btn:hover { background: var(--hover); color: var(--text); }
.settings-footer-btn.danger { color: var(--danger); }
.settings-footer-btn.danger:hover { background: rgba(255,69,58,0.08); }

/* ===== Oculus IA FAB (floating action button) ===== */
.oculus-ai-fab {
  position: fixed;
  bottom: 42px;
  right: 28px;
  z-index: 45;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: var(--accent);
  color: white;
  border-radius: var(--r-full);
  font-size: 13px; font-weight: 600;
  box-shadow: 0 4px 20px rgba(10,132,255,0.45), 0 2px 8px rgba(0,0,0,0.18);
  transition: all 160ms var(--ease-out);
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.oculus-ai-fab:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(10,132,255,0.5), 0 4px 12px rgba(0,0,0,0.22);
}
.oculus-ai-fab:active { transform: translateY(0); }
.oculus-ai-fab .fab-orb {
  width: 14px; height: 14px; border-radius: 50%;
  background: conic-gradient(from 0deg, #fff, rgba(255,255,255,0.4), #fff);
  animation: orbRotate 3s linear infinite;
  flex: 0 0 14px;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulseDot { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:0.5; transform:scale(0.7); } }

/* ===== Payment modal overlay (pricing screen) ===== */
.payment-modal-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 180ms ease;
}
.payment-modal-inner {
  width: 100%; max-width: 520px; max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-popover);
  animation: slideUp 240ms var(--ease-out);
}

/* ===== Settings panel modals (subscription / payment method) ===== */
.sp-modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 180ms ease;
}
.sp-modal {
  width: 100%; max-width: 440px; max-height: 88vh;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-popover);
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: slideUp 240ms var(--ease-out);
}
.sp-modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}
.sp-modal-head > div { flex: 1; }
.sp-modal-body {
  padding: 18px 20px 20px;
  overflow-y: auto;
}
.sp-plan-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
}

/* ===== Facturación Electrónica DIAN ===== */

/* Spinner used in billing loading states */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Billing screen fills the tool tab area */
.billing-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
  color: var(--text);
}

/* Invoice status badge colors */
.inv-status-draft     { background: rgba(142,142,147,0.15); color: #8E8E93; }
.inv-status-pending   { background: rgba(255,159,10,0.15);  color: #FF9F0A; }
.inv-status-sent      { background: rgba(10,132,255,0.15);  color: #0A84FF; }
.inv-status-approved  { background: rgba(48,209,88,0.15);   color: #30D158; }
.inv-status-rejected  { background: rgba(255,69,58,0.15);   color: #FF453A; }
.inv-status-cancelled { background: rgba(99,99,102,0.15);   color: #636366; }

/* CUPS code monospace chip */
.cups-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 4px;
  padding: 1px 6px;
  display: inline-block;
}

/* Invoice row hover */
.inv-row { transition: background 80ms; cursor: pointer; }
.inv-row:hover { background: var(--hover); }

/* CUFE mono display */
.cufe-display {
  font-family: var(--font-mono);
  font-size: 9px;
  word-break: break-all;
  color: var(--text-secondary);
  background: var(--surface);
  border-radius: 6px;
  padding: 6px 10px;
  line-height: 1.5;
  border: 1px solid var(--divider);
}
