/* Voice Sentinel – Web UI theme */
:root {
  --primary-blue: #0ea5e9;
  --light-blue: #22d3ee;
  --accent: #06b6d4;
  --dark-text: #0f172a;
  --background: #f2f8ff;
  --surface: #ffffff;
  --card-bg: #ffffff;
  --grey-100: #e8f3ff;
  --grey-400: #94a3b8;
  --grey-500: #64748b;
  --grey-600: #475569;
  --grey-700: #334155;
  --border: #c7def8;
  --shadow-blue: rgba(14, 165, 233, 0.14);
  --shadow-soft: 0 1px 3px rgba(8, 47, 73, 0.08), 0 12px 26px rgba(14, 165, 233, 0.1);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --transition: 0.2s cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
  --background: #020617;
  --surface: #0b1222;
  --card-bg: #0f172a;
  --dark-text: #dbeafe;
  --border: #1e293b;
  --grey-100: #0f172a;
  --grey-400: #475569;
  --grey-500: #94a3b8;
  --grey-600: #cbd5e1;
  --grey-700: #e2e8f0;
  --shadow-blue: rgba(14, 165, 233, 0.18);
  --shadow-soft: 0 1px 3px rgba(0,0,0,0.22), 0 14px 34px rgba(2, 6, 23, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
  background-color: var(--background);
  background-image:
    radial-gradient(circle at 8% 4%, rgba(34, 211, 238, 0.12), transparent 34%),
    radial-gradient(circle at 90% 6%, rgba(14, 165, 233, 0.14), transparent 36%),
    radial-gradient(circle at 52% 100%, rgba(125, 211, 252, 0.22), transparent 44%),
    linear-gradient(180deg, #f9fcff 0%, #edf6ff 42%, #e8f2ff 100%);
  color: var(--dark-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

[data-theme="dark"] body {
  background-image:
    radial-gradient(circle at 8% 4%, rgba(34, 211, 238, 0.2), transparent 34%),
    radial-gradient(circle at 90% 6%, rgba(14, 165, 233, 0.24), transparent 36%),
    radial-gradient(circle at 52% 100%, rgba(8, 47, 73, 0.5), transparent 44%),
    linear-gradient(180deg, #020617 0%, #0b1120 42%, #030712 100%);
}

/* Layout */
.screen {
  display: none;
  min-height: 100vh;
}
.screen.active {
  display: block;
}

.safe {
  padding: 24px;
  padding-top: env(safe-area-inset-top, 24px);
}

/* App shell: sidebar + main */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 264px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: 1px 0 8px rgba(0,0,0,0.03);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(50, 181, 232, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-logo .logo-img,
.sidebar-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.sidebar-logo .logo-fallback,
.sidebar-logo svg {
  width: 22px;
  height: 22px;
  color: var(--primary-blue);
}

.sidebar-title {
  font-size: 18px;
  font-weight: 700;
  font-family: 'Orbitron', 'Space Grotesk', sans-serif;
  color: var(--dark-text);
  letter-spacing: 0.3px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: visible;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  margin-bottom: 2px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--grey-600);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition);
}

.nav-item svg {
  flex-shrink: 0;
  color: var(--grey-400);
  transition: color var(--transition);
}

.nav-item:hover {
  background: var(--grey-100);
  color: var(--dark-text);
}

.nav-item:hover svg {
  color: var(--primary-blue);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(37,99,235,0.08), rgba(56,189,248,0.08));
  color: var(--primary-blue);
  font-weight: 600;
}

.nav-item.active svg {
  color: var(--primary-blue);
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.nav-item-logout {
  color: var(--grey-600);
}

.nav-item-logout:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
}

.nav-item-logout:hover svg {
  color: #b91c1c;
}

.main-content {
  flex: 1;
  overflow-y: visible;
  background: transparent;
  min-width: 0;
}

.send-server-card {
  max-width: 680px;
}

.send-server-hint {
  margin: 2px 0 14px;
  color: var(--grey-600);
  font-size: 13px;
}

.global-disclaimer {
  margin: 16px auto 0;
  max-width: 980px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(56, 189, 248, 0.1));
  color: var(--grey-700);
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.5;
}

.welcome-disclaimer {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--grey-600);
  line-height: 1.45;
}

.ux-flow-hint {
  margin-bottom: 20px;
  padding: 10px 12px;
  border: 1px dashed rgba(37, 99, 235, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.6);
  color: var(--grey-700);
  font-size: 13px;
}

.section-header-inline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 12px;
  flex-wrap: wrap;
}

.section-caption {
  font-size: 12px;
  color: var(--grey-600);
}

.panel-disclaimer {
  margin: -10px 0 18px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(241, 245, 249, 0.85);
  color: var(--grey-600);
  font-size: 12px;
}

.panel {
  display: none;
  min-height: 100%;
}

.panel.active {
  display: block;
}

.page-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 40px 48px;
}

.page-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--dark-text);
  margin: 0 0 6px;
}

.page-subtitle {
  font-size: 15px;
  color: var(--grey-500);
  margin-bottom: 28px;
  line-height: 1.5;
}

/* Download page */
.download-page .page-content {
  max-width: 560px;
}

.download-card {
  margin-top: 8px;
}

.download-hero {
  text-align: center;
  padding: 16px 0 8px;
}

.download-icon-wrap {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: rgba(50, 181, 232, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.download-icon-wrap svg {
  width: 44px;
  height: 44px;
  color: var(--light-blue);
}

.download-heading {
  font-size: 22px;
  font-weight: 700;
  color: var(--dark-text);
  margin: 0 0 12px;
}

.download-desc {
  font-size: 15px;
  color: var(--grey-600);
  line-height: 1.5;
  margin-bottom: 24px;
  display: block;
}

.btn-download {
  width: auto;
  min-width: 200px;
  padding-left: 28px;
  padding-right: 28px;
  margin-bottom: 16px;
}

.download-note {
  font-size: 13px;
  color: var(--grey-500);
  margin: 0;
}

@media (max-width: 768px) {
  .app-shell {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 12px;
    gap: 8px;
  }
  .sidebar-brand {
    width: 100%;
    border-bottom: none;
    padding: 12px 16px;
  }
  .sidebar-nav {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0 8px;
    border: none;
  }
  .sidebar-nav .nav-item {
    flex: 1 1 auto;
    min-width: 120px;
    margin-bottom: 0;
  }
  .sidebar-footer {
    border-top: none;
    padding: 0 8px;
  }
  .sidebar-footer .nav-item {
    margin-bottom: 0;
  }
  .page-content {
    padding: 24px 20px 40px;
  }
  .global-disclaimer {
    margin: 12px 16px 0;
    font-size: 11px;
  }
  .page-title {
    font-size: 24px;
  }
}

/* App bar (legacy – kept for any reuse) */
.app-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.app-bar .title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--dark-text);
}
.app-bar .back {
  position: absolute;
  left: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--dark-text);
}
.app-bar .action {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--dark-text);
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 16px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.08);
}
.card-inner {
  padding: 22px;
}

/* Gradient button (primary) */
.btn-gradient {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent) 100%);
  color: white;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  text-decoration: none;
  transition: all var(--transition);
}
.btn-gradient:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}
.btn-gradient:active { transform: translateY(0); }

/* Outline button (secondary) */
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--dark-text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  gap: 8px;
  transition: all var(--transition);
}
.btn-outline:hover {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  background: rgba(37, 99, 235, 0.04);
}

/* Form */
.input-wrap {
  margin-bottom: 14px;
}
.input-wrap label {
  display: block;
  color: var(--grey-600);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}
.input-wrap input,
.input-wrap select {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--dark-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input-wrap input:focus,
.input-wrap select:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.input-wrap input::placeholder {
  color: var(--grey-400);
}

select,
.auth-input[type="number"] {
  font-family: inherit;
}

select {
  -webkit-appearance: none;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--grey-500) 50%),
    linear-gradient(135deg, var(--grey-500) 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px),
    100% 0;
  background-size: 6px 6px, 6px 6px, 2.5em 2.5em;
  background-repeat: no-repeat;
  padding-right: 34px !important;
  border-radius: 10px;
}

select:hover {
  border-color: rgba(37, 99, 235, 0.45);
}

/* Icon circle (like Flutter) */
.icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(50, 181, 232, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-circle svg {
  width: 32px;
  height: 32px;
  color: var(--light-blue);
}

/* Welcome screen */
.welcome-screen {
  position: relative;
  overflow: hidden;
}

.welcome-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(165deg, rgba(50, 181, 232, 0.06) 0%, rgba(40, 91, 174, 0.03) 35%, var(--background) 65%);
  pointer-events: none;
  overflow: hidden;
}

/* Moving orbs – colours and shades that drift */
.welcome-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.85;
  pointer-events: none;
}

.welcome-bg-orb-1 {
  width: 70vmax;
  height: 70vmax;
  background: radial-gradient(circle, rgba(50, 181, 232, 0.35) 0%, transparent 65%);
  left: -20%;
  top: -20%;
  animation: welcome-orb-drift-1 22s ease-in-out infinite;
}

.welcome-bg-orb-2 {
  width: 55vmax;
  height: 55vmax;
  background: radial-gradient(circle, rgba(40, 91, 174, 0.28) 0%, transparent 65%);
  right: -15%;
  top: -10%;
  animation: welcome-orb-drift-2 26s ease-in-out infinite;
}

.welcome-bg-orb-3 {
  width: 60vmax;
  height: 60vmax;
  background: radial-gradient(circle, rgba(50, 181, 232, 0.22) 0%, transparent 65%);
  right: -10%;
  bottom: -25%;
  animation: welcome-orb-drift-3 24s ease-in-out infinite;
}

.welcome-bg-orb-4 {
  width: 50vmax;
  height: 50vmax;
  background: radial-gradient(circle, rgba(40, 91, 174, 0.2) 0%, transparent 65%);
  left: -10%;
  bottom: -15%;
  animation: welcome-orb-drift-4 20s ease-in-out infinite;
}

@keyframes welcome-orb-drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(8%, 12%) scale(1.05); }
  66% { transform: translate(-5%, 5%) scale(0.98); }
}

@keyframes welcome-orb-drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-10%, -8%) scale(0.96); }
  66% { transform: translate(6%, 10%) scale(1.04); }
}

@keyframes welcome-orb-drift-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-8%, -12%) scale(1.06); }
}

@keyframes welcome-orb-drift-4 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(12%, -6%) scale(1.03); }
}

/* Subtle dot pattern overlay */
.welcome-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at center, rgba(40, 91, 174, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 1;
}

/* Soft glow behind the card */
.welcome-bg::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 140%;
  max-width: 600px;
  height: 80%;
  max-height: 500px;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.5) 0%, transparent 65%);
  pointer-events: none;
  z-index: 1;
}

.welcome-center {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.welcome-card {
  max-width: 420px;
  width: 100%;
}

.welcome-card-elevated {
  box-shadow: 0 20px 48px rgba(40, 91, 174, 0.12), 0 8px 24px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(50, 181, 232, 0.15);
  animation: welcome-card-in 0.5s ease-out;
}

@keyframes welcome-card-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.logo-placeholder {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(50, 181, 232, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.logo-placeholder .logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.logo-placeholder .logo-fallback,
.logo-placeholder svg {
  width: 40px;
  height: 40px;
  color: var(--primary-blue);
}
.brand-title {
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  color: var(--dark-text);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.welcome-tagline {
  text-align: center;
  color: var(--grey-700);
  font-size: 15px;
  line-height: 1.45;
  margin-bottom: 20px;
}

.welcome-features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 20px;
}

.welcome-features li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--grey-700);
  font-weight: 500;
}

.welcome-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(50, 181, 232, 0.2);
  color: var(--primary-blue);
  font-size: 11px;
  font-weight: 700;
}


.welcome-buttons .btn-gradient,
.welcome-buttons .btn-outline {
  margin-bottom: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.welcome-buttons .btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.welcome-buttons .btn-outline:hover {
  transform: translateY(-2px);
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

/* Auth form */
.auth-form .card-inner {
  padding: 28px;
}
.auth-form h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--dark-text);
}
.auth-form .sub {
  font-size: 14px;
  color: var(--grey-700);
  margin-bottom: 24px;
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 4px 0 12px;
}

.auth-mode-btn {
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(15, 23, 42, 0.68);
  color: var(--grey-600);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all var(--transition);
}

.auth-mode-btn:hover {
  border-color: rgba(34, 211, 238, 0.55);
  color: var(--dark-text);
}

.auth-mode-btn.active {
  background: linear-gradient(140deg, rgba(14, 165, 233, 0.32), rgba(8, 145, 178, 0.22));
  color: #ecfeff;
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 8px 18px rgba(14, 165, 233, 0.2);
}

.auth-error {
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: #b91c1c;
  font-size: 14px;
  line-height: 1.4;
}

.auth-error:empty {
  display: none !important;
}
.auth-form .link {
  background: none;
  border: none;
  color: var(--primary-blue);
  font-size: 14px;
  cursor: pointer;
  padding: 8px 0;
  margin: 4px 0;
}

.auth-form .link:hover {
  text-decoration: underline;
}

.auth-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--grey-500);
  margin: 0 0 16px;
}

.auth-secure svg {
  flex-shrink: 0;
  color: var(--grey-500);
}

.auth-form #btn-auth-submit {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-form #btn-auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

/* Dark mode: welcome background (moving orbs a bit softer) */
[data-theme="dark"] .welcome-bg {
  background: linear-gradient(165deg, rgba(50, 181, 232, 0.04) 0%, var(--background) 65%);
}

[data-theme="dark"] .welcome-bg-orb {
  opacity: 0.6;
}

[data-theme="dark"] .welcome-bg-orb-1 {
  background: radial-gradient(circle, rgba(50, 181, 232, 0.2) 0%, transparent 65%);
}

[data-theme="dark"] .welcome-bg-orb-2 {
  background: radial-gradient(circle, rgba(40, 91, 174, 0.18) 0%, transparent 65%);
}

[data-theme="dark"] .welcome-bg-orb-3 {
  background: radial-gradient(circle, rgba(50, 181, 232, 0.15) 0%, transparent 65%);
}

[data-theme="dark"] .welcome-bg-orb-4 {
  background: radial-gradient(circle, rgba(40, 91, 174, 0.12) 0%, transparent 65%);
}

[data-theme="dark"] .welcome-bg::before {
  background-image: radial-gradient(circle at center, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

[data-theme="dark"] .welcome-bg::after {
  background: radial-gradient(ellipse, rgba(26, 35, 50, 0.6) 0%, transparent 65%);
}

[data-theme="dark"] .welcome-card-elevated {
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.2);
  border-color: rgba(50, 181, 232, 0.2);
}
[data-theme="dark"] .analysis-section-header:hover { background: rgba(255,255,255,0.04); }
[data-theme="dark"] .feat-cell { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .vote-bar-track { background: rgba(255,255,255,0.08); }
[data-theme="dark"] .analysis-prose .md-list li { background: rgba(255,255,255,0.05); }
[data-theme="dark"] .analysis-prose .md-p { color: var(--grey-400); }
[data-theme="dark"] .analysis-prose .md-list li { color: var(--grey-400); }
[data-theme="dark"] .card { border-color: var(--border); box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
[data-theme="dark"] .card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.25); }
[data-theme="dark"] .sidebar { box-shadow: 1px 0 8px rgba(0,0,0,0.15); }
[data-theme="dark"] .nav-item:hover { background: rgba(255,255,255,0.05); }
[data-theme="dark"] .settings-tile:hover { background: rgba(255,255,255,0.04); }
[data-theme="dark"] .input-wrap input:focus,
[data-theme="dark"] .input-wrap select:focus { box-shadow: 0 0 0 3px rgba(56,189,248,0.15); }

/* Home dashboard grid */
.home-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}
@media (max-width: 600px) {
  .home-grid { grid-template-columns: 1fr; }
}
.home-action-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
  box-shadow: var(--shadow-soft);
}
.home-action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border-color: var(--primary-blue);
}
.home-action-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--dark-text);
}
.home-action-card p {
  margin: 0;
  font-size: 13px;
  color: var(--grey-500);
  line-height: 1.4;
}
.home-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-action-icon--blue { background: rgba(37,99,235,0.1); color: #2563eb; }
.home-action-icon--indigo { background: rgba(99,102,241,0.1); color: #6366f1; }
.home-action-icon--teal { background: rgba(20,184,166,0.1); color: #14b8a6; }
.home-action-icon--amber { background: rgba(245,158,11,0.1); color: #f59e0b; }

/* How It Works */
.home-hiw {
  margin-bottom: 28px;
}
.home-hiw-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark-text);
  margin: 0 0 16px;
}
.home-hiw-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.home-hiw-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  box-shadow: var(--shadow-soft);
}
.home-hiw-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-blue), var(--accent, #6366f1));
  color: white;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.home-hiw-step h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--dark-text);
}
.home-hiw-step p {
  margin: 0;
  font-size: 13px;
  color: var(--grey-500);
  line-height: 1.5;
}

/* About card */
.home-about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-soft);
}
.home-about-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--dark-text);
}
.home-about-card p {
  margin: 0;
  font-size: 14px;
  color: var(--grey-600);
  line-height: 1.6;
}

/* Home screen */
.hero-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
  color: var(--dark-text);
  margin: 0 0 8px;
}
.hero-sub {
  font-size: 16px;
  color: var(--grey-500);
  line-height: 1.4;
  margin-bottom: 32px;
}
.record-card,
.upload-card {
  display: flex;
  align-items: center;
  gap: 20px;
}
.record-card .text h3,
.upload-card .text h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--dark-text);
}
.record-card .text p,
.upload-card .text p {
  font-size: 14px;
  color: var(--grey-600);
  margin: 0;
}
.upload-card {
  cursor: pointer;
}
.upload-card:hover {
  background: var(--grey-100);
}

.voice-lab-quick-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.voice-lab-quick-btn {
  width: auto;
  min-width: 180px;
  padding: 0 18px;
}

/* Audio preview */
.audio-preview-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: var(--grey-600);
  margin-bottom: 16px;
}

.waveform-container {
  position: relative;
  min-height: 56px;
}

.waveform-placeholder {
  height: 56px;
  border-radius: 12px;
  background: var(--background);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey-600);
  font-size: 13px;
}

.waveform-canvas {
  display: none;
  width: 100%;
  height: 56px;
  border-radius: 12px;
  background: var(--background);
  border: 1px solid var(--border);
}

.waveform-container.show-canvas .waveform-placeholder,
.waveform-container.show-bars .waveform-placeholder {
  display: none;
}

.waveform-container.show-canvas .waveform-canvas {
  display: block;
}

.waveform-bars {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 56px;
  border-radius: 12px;
  background: var(--background);
  border: 1px solid var(--border);
}

.waveform-container.show-bars .waveform-bars {
  display: flex;
}

.waveform-bars .bar {
  width: 4px;
  min-height: 4px;
  border-radius: 2px;
  background: var(--primary-blue);
  transition: height 0.05s ease;
}

/* Recording status: pill badge + large timer */
.recording-status-row {
  margin-bottom: 20px;
}

.recording-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(50, 181, 232, 0.15);
  color: var(--dark-text);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.recording-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dc2626;
  flex-shrink: 0;
  animation: recording-blink 1.2s ease-in-out infinite;
}

@keyframes recording-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.recording-pill.paused {
  background: rgba(107, 114, 128, 0.15);
}

.recording-pill.paused .recording-dot {
  background: var(--grey-500);
  animation: none;
}

.recording-timer {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary-blue);
  margin: 0;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

/* Record / Pause / Stop control buttons */
.recording-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  margin-bottom: 8px;
}

.ctrl-btn {
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  color: white;
}

.ctrl-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ctrl-btn:not(:disabled):hover {
  transform: scale(1.05);
}

.ctrl-btn:not(:disabled):active {
  transform: scale(0.98);
}

.ctrl-btn-pause {
  background: linear-gradient(135deg, var(--light-blue) 0%, var(--primary-blue) 100%);
  box-shadow: 0 4px 12px rgba(40, 91, 174, 0.35);
}

.ctrl-btn-stop {
  background: var(--surface);
  color: var(--dark-text);
  border: 2px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow-blue);
}

.ctrl-btn-stop:hover:not(:disabled) {
  border-color: var(--primary-blue);
  background: rgba(40, 91, 174, 0.06);
}

.ctrl-btn-record {
  background: #dc2626;
  border: 3px solid white;
  box-shadow: 0 0 0 2px var(--border), 0 4px 14px rgba(220, 38, 38, 0.4);
}

.ctrl-btn-record.active {
  box-shadow: 0 0 0 3px white, 0 0 0 6px var(--primary-blue), 0 4px 14px rgba(220, 38, 38, 0.4);
}

/* Recent recordings */
.section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--dark-text);
  margin-bottom: 12px;
}
.recording-tile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.recording-tile:last-child {
  border-bottom: none;
}
.recording-tile .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(50, 181, 232, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.recording-tile .avatar svg {
  width: 24px;
  height: 24px;
  color: var(--light-blue);
}
.recording-tile .spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--primary-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.recording-tile .info {
  flex: 1;
  min-width: 0;
}
.recording-tile .info .name {
  font-weight: 600;
  color: var(--dark-text);
}
.recording-tile .info .duration {
  font-size: 14px;
  color: var(--grey-600);
}
.recording-tile .delete {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--grey-600);
}

/* Home actions */
.home-actions .btn-gradient {
  margin-bottom: 16px;
}

/* Drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  display: none;
}
.drawer-overlay.open {
  display: block;
}
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--surface);
  z-index: 101;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  box-shadow: 4px 0 12px rgba(0,0,0,0.15);
}
.drawer.open {
  transform: translateX(0);
}
.drawer-header {
  padding: 24px 24px 16px;
  font-size: 22px;
  font-weight: 700;
  color: var(--dark-text);
  border-bottom: 1px solid var(--border);
}
.drawer-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  color: var(--dark-text);
  text-decoration: none;
  font-weight: 500;
  border: none;
  width: 100%;
  text-align: left;
  background: none;
  cursor: pointer;
  font-size: 16px;
}
.drawer-item:hover {
  background: var(--grey-100);
}
.drawer-item svg {
  flex-shrink: 0;
  color: var(--primary-blue);
}
.drawer-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

/* Settings */
.settings-section {
  margin-bottom: 16px;
}
.settings-section .header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.settings-section .header .icon-circle {
  width: 48px;
  height: 48px;
}
.settings-section .header .icon-circle svg {
  width: 24px;
  height: 24px;
}
.settings-section .header .title {
  font-size: 17px;
  font-weight: 600;
  color: var(--dark-text);
  margin: 0 0 2px;
}
.settings-section .header .subtitle {
  font-size: 13px;
  color: var(--grey-700);
  margin: 0;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}
.settings-row .label {
  font-weight: 500;
  color: var(--dark-text);
}
.settings-row .value {
  font-size: 14px;
  color: var(--grey-700);
}
.toggle {
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background: var(--border);
  border: none;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
}
.toggle.on {
  background: rgba(50, 181, 232, 0.6);
}
.toggle::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}
.toggle.on::after {
  transform: translateX(20px);
}
.settings-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  text-decoration: none;
  color: var(--dark-text);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}
.settings-tile:hover {
  background: var(--grey-100);
  border-color: var(--primary-blue);
}
.settings-tile svg {
  color: var(--primary-blue);
}
.settings-tile--danger {
  color: var(--danger, #c53030);
  border-color: rgba(197, 48, 48, 0.3);
}
.settings-tile--danger:hover {
  background: rgba(197, 48, 48, 0.08);
}
.settings-tile--danger svg {
  color: var(--danger, #c53030);
}
.settings-stats-output {
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.5;
  color: var(--dark-text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow: auto;
}
/* Export Data section in Settings */
.export-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.export-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
  padding: 12px 16px;
  font-size: 14px;
}
.export-success {
  margin-top: 10px;
  padding: 12px 16px;
  background: rgba(22, 163, 74, 0.08);
  border: 1px solid rgba(22, 163, 74, 0.25);
  border-radius: 10px;
  color: #16a34a;
  font-size: 14px;
  font-weight: 600;
}
@media (max-width: 480px) {
  .export-buttons { flex-direction: column; }
}

/* Comparative Analysis page */
.compare-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 600px) {
  .compare-mode-switch { grid-template-columns: 1fr; }
}
.compare-mode-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  color: var(--dark-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.compare-mode-option input {
  margin: 0;
  accent-color: var(--primary-blue);
}
.compare-uploads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 600px) {
  .compare-uploads { grid-template-columns: 1fr; }
}
.compare-upload-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.compare-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 20px;
  cursor: pointer;
  transition: background 0.15s;
  text-align: center;
}
.compare-upload-area:hover {
  background: var(--grey-100);
}
.compare-upload-area h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--dark-text);
}
.compare-file-name {
  font-size: 13px;
  color: var(--grey-600);
  margin: 0;
  word-break: break-all;
}
.compare-file-name.has-file {
  color: var(--primary-blue);
  font-weight: 600;
}
.compare-saved-fields {
  margin-bottom: 20px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.compare-saved-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 600px) {
  .compare-saved-header {
    flex-direction: column;
    align-items: stretch;
  }
}
.compare-saved-copy {
  margin: 0;
  font-size: 14px;
  color: var(--grey-700);
}
.compare-saved-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) {
  .compare-saved-grid { grid-template-columns: 1fr; }
}
.compare-select-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg, #fff);
}
.compare-select-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark-text);
}
.compare-select-input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--dark-text);
}
.compare-saved-status {
  margin-top: 12px;
  font-size: 13px;
  color: var(--grey-700);
}
.compare-actions {
  margin-bottom: 20px;
}
.compare-submit-btn {
  width: 100%;
  margin-top: 8px;
}
.compare-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.compare-result-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-soft);
}
.compare-agreement {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  text-align: center;
}
.compare-agreement--agree {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
}
.compare-agreement--disagree {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}
.compare-side-by-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) {
  .compare-side-by-side { grid-template-columns: 1fr; }
}
.compare-sample-result {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.compare-sample-result h4 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--dark-text);
}

/* Analysis detail & sample lookup on Audio Breakdown page */
.analysis-detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-soft);
}
.analysis-detail-content-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--dark-text);
  white-space: pre-wrap;
  word-break: break-word;
}
.analysis-detail-json {
  font-family: ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.5;
  color: var(--dark-text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow: auto;
  margin: 0;
}

/* --- Structured analysis sections --- */
.analysis-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.analysis-meta-section {
  padding: 18px 22px;
}
.analysis-meta-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.analysis-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.analysis-meta-row:last-child { border-bottom: none; }
.analysis-meta-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--grey-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.analysis-meta-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark-text);
  text-align: right;
  word-break: break-word;
}

.analysis-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.analysis-section-header:hover {
  background: var(--grey-100, #f3f4f6);
}
.analysis-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark-text);
}
.analysis-section-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-blue);
  background: color-mix(in srgb, var(--primary-blue) 10%, transparent);
  padding: 2px 10px;
  border-radius: 999px;
}
.analysis-chevron {
  margin-left: auto;
  font-size: 14px;
  color: var(--grey-600);
  transition: transform 0.2s;
}
.analysis-section-body {
  padding: 0 20px 18px;
  transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
  overflow: hidden;
}
.analysis-section-collapsed {
  max-height: 0 !important;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* Prose analysis (markdown rendered) */
.analysis-prose {
  padding: 4px 0;
  line-height: 1.7;
  color: var(--dark-text);
  font-size: 14px;
}
.analysis-prose .md-h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary-blue);
  margin: 22px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.analysis-prose .md-h2:first-child { margin-top: 0; }
.analysis-prose .md-h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark-text);
  margin: 16px 0 6px;
}
.analysis-prose .md-p {
  margin: 0 0 10px;
  color: var(--grey-600);
  line-height: 1.7;
}
.analysis-prose .md-p strong {
  color: var(--dark-text);
  font-weight: 600;
}
.analysis-prose .md-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.analysis-prose .md-list li {
  position: relative;
  padding: 8px 12px 8px 28px;
  margin: 0 0 6px;
  background: var(--grey-100);
  border-radius: var(--radius-xs);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--grey-600);
}
.analysis-prose .md-list li::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 15px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-blue);
}
.analysis-prose .md-list li.md-ol::before {
  content: counter(md-ol) '.';
  counter-increment: md-ol;
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  font-weight: 600;
  font-size: 12px;
  color: var(--primary-blue);
  top: 8px;
  left: 10px;
}
.analysis-prose .md-list:has(li.md-ol) {
  counter-reset: md-ol;
}
.analysis-prose .md-list li strong {
  color: var(--dark-text);
}

/* Model votes bar chart */
.vote-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}
.vote-model {
  font-size: 12px;
  font-weight: 700;
  color: var(--dark-text);
  width: 52px;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}
.vote-bar-track {
  flex: 1;
  height: 10px;
  background: var(--grey-100, #f3f4f6);
  border-radius: 6px;
  overflow: hidden;
}
.vote-bar-fill {
  height: 100%;
  border-radius: 6px;
  background: var(--primary-blue);
  opacity: 0.55;
  transition: width 0.4s ease;
}
.vote-bar--top {
  opacity: 1;
  background: linear-gradient(90deg, var(--primary-blue), #3b82f6);
}
.vote-score {
  font-size: 12px;
  font-weight: 600;
  color: var(--grey-600);
  width: 72px;
  text-align: right;
  flex-shrink: 0;
  font-family: ui-monospace, monospace;
}

/* Feature grid (mel, mfcc, ssl) */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 6px;
}
.feat-cell {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--grey-100, #f3f4f6);
  font-family: ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.4;
  overflow: hidden;
}
.feat-idx {
  color: var(--primary-blue);
  font-weight: 700;
  flex-shrink: 0;
  min-width: 22px;
}
.feat-val {
  color: var(--dark-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 600px) {
  .feat-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
  .vote-model { width: 40px; font-size: 11px; }
  .vote-score { width: 60px; font-size: 11px; }
}

.sample-lookup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-soft);
}
.sample-lookup-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.sample-lookup-row .auth-input {
  flex: 1;
  margin: 0;
}
.sample-lookup-row .btn-primary {
  flex-shrink: 0;
  white-space: nowrap;
}

.sample-lookup-copy {
  color: var(--grey-500);
  font-size: 13px;
  margin: 0 0 12px;
}

.compact-action-btn {
  width: auto;
  min-width: 112px;
  height: 44px;
  font-size: 14px;
}

.breakdown-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.breakdown-empty-state {
  margin-bottom: 20px;
}

/* --- Verdict snapshot (top card on Audio Breakdown) --- */
.verdict-snapshot {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-soft);
}
.verdict-snapshot-main {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}
.verdict-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}
.verdict-icon--real {
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
}
.verdict-icon--synthetic {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}
.verdict-icon--unknown {
  background: var(--grey-100);
  color: var(--grey-500);
}
.verdict-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.verdict-label {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}
.verdict-label--real { color: #16a34a; }
.verdict-label--synthetic { color: #dc2626; }
.verdict-conf {
  font-size: 14px;
  color: var(--grey-500);
  font-weight: 500;
}
.verdict-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.verdict-meta-item {
  font-size: 13px;
  color: var(--grey-600);
}
.verdict-meta-item strong {
  font-weight: 600;
  color: var(--dark-text);
}
.verdict-meta-item a {
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 500;
}
.verdict-meta-item a:hover { text-decoration: underline; }

.prediction-link-btn {
  border: none;
  background: none;
  padding: 0;
  color: var(--primary-blue);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.prediction-link-btn:hover {
  text-decoration: underline;
}

.prediction-feedback {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.prediction-feedback-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--dark-text);
}
.prediction-feedback-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.prediction-feedback-btn {
  width: auto;
  min-width: 140px;
  height: 40px;
  padding: 0 14px;
  font-size: 13px;
}
.prediction-feedback-btn-alt {
  background: var(--surface);
  color: var(--dark-text);
  border: 1px solid var(--border);
}
.prediction-feedback-btn-alt:hover {
  background: var(--grey-100);
}
.prediction-feedback-details {
  margin-top: 12px;
}
.prediction-feedback-label {
  display: block;
  font-size: 12px;
  color: var(--grey-600);
  margin-bottom: 6px;
}
.prediction-feedback-select,
.prediction-feedback-notes {
  margin-bottom: 10px;
}
.prediction-feedback-notes {
  resize: vertical;
  min-height: 74px;
}
.prediction-feedback-submit {
  height: 42px;
  width: auto;
  min-width: 180px;
  font-size: 14px;
}
.prediction-feedback-status {
  margin: 10px 0 0;
  font-size: 13px;
}
.feedback-status-success {
  color: #15803d;
}
.feedback-status-error {
  color: #b91c1c;
}

@media (max-width: 600px) {
  .voice-lab-quick-actions,
  .settings-overview-actions,
  .breakdown-tools-grid {
    display: grid;
    grid-template-columns: 1fr;
  }
  .voice-lab-quick-btn,
  .settings-overview-btn,
  .compact-action-btn {
    width: 100%;
  }
  .settings-overview-header,
  .section-header-inline {
    flex-direction: column;
    align-items: flex-start;
  }
  .prediction-feedback-actions {
    flex-direction: column;
  }
  .prediction-feedback-btn,
  .prediction-feedback-submit {
    width: 100%;
  }
}

/* --- Expandable analysis section --- */
.breakdown-expandable {
  margin-bottom: 20px;
}
.breakdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--primary-blue);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.breakdown-toggle:hover {
  background: var(--grey-100);
}
.breakdown-toggle-chevron {
  font-size: 14px;
  transition: transform 0.25s ease;
}
.breakdown-toggle.open .breakdown-toggle-chevron {
  transform: rotate(180deg);
}
.breakdown-body {
  margin-top: 12px;
  transition: max-height 0.35s ease, opacity 0.25s ease;
  overflow: hidden;
}
.breakdown-collapsed {
  max-height: 0 !important;
  opacity: 0;
  margin-top: 0;
}

/* Legacy prediction classes kept for JS compatibility */
.prediction-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--dark-text);
}
.prediction-verdict--real {
  color: #16a34a;
  font-weight: 700;
}
.prediction-verdict--synthetic {
  color: #dc2626;
  font-weight: 700;
}
.local-sample-entry {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 8px;
}
.local-sample-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.local-sample-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--dark-text);
}
.local-sample-date {
  font-size: 12px;
  color: var(--grey-600);
}
.local-sample-details {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--grey-700);
}
.local-sample-verdict {
  font-weight: 600;
}

/* About Me mini page in Settings */
.about-me-panel {
  margin-top: 8px;
  margin-bottom: 8px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.about-me-loading {
  color: var(--grey-600);
  font-size: 14px;
  text-align: center;
  padding: 12px 0;
}
.about-me-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.about-me-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.about-me-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--grey-600);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}
.about-me-value {
  font-size: 14px;
  color: var(--dark-text);
  text-align: right;
  word-break: break-word;
}

.settings-version {
  text-align: center;
  color: var(--grey-600);
  font-size: 13px;
  margin-top: 32px;
}

.settings-overview-card {
  overflow: visible;
}

.settings-overview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.settings-overview-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-blue);
}

.settings-overview-name {
  margin: 0 0 4px;
  font-size: 24px;
  line-height: 1.15;
  color: var(--dark-text);
}

.settings-overview-meta {
  margin: 0;
  font-size: 14px;
  color: var(--grey-600);
}

.settings-overview-badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-blue);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.settings-overview-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.settings-overview-btn {
  width: auto;
  min-width: 148px;
  padding: 0 16px;
}

/* Change user type / Audio breakdown */
.form-page .card-inner {
  padding: 24px;
}
.form-page .description {
  font-size: 16px;
  font-weight: 500;
  color: var(--dark-text);
  margin-bottom: 12px;
}
.form-page .btn-gradient {
  margin-top: 32px;
}
.placeholder-card {
  text-align: center;
  padding: 24px;
}
.placeholder-card .icon-circle {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
}
.placeholder-card .icon-circle svg {
  width: 56px;
  height: 56px;
}
.placeholder-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark-text);
  margin: 0 0 8px;
}
.placeholder-card p {
  font-size: 14px;
  color: var(--grey-700);
  margin: 0;
}

.history-loading {
  padding: 24px;
  text-align: center;
  color: var(--grey-600);
  font-size: 15px;
}
.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.history-summary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.history-stat {
  min-width: 128px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}
.history-stat-value {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-blue);
  line-height: 1;
  margin-bottom: 4px;
}
.history-stat-label {
  display: block;
  font-size: 12px;
  color: var(--grey-600);
}
.history-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.history-action-btn {
  width: auto;
  min-width: 108px;
  height: 42px;
  padding: 0 16px;
}
.history-clear-btn {
  margin: 0;
  width: auto;
  min-width: 108px;
  padding: 10px 16px;
}
.history-block {
  margin-bottom: 18px;
}
.history-block-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 12px;
  flex-wrap: wrap;
}
.history-block-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--dark-text);
}
.history-block-caption {
  font-size: 12px;
  color: var(--grey-600);
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.history-entry .card-inner {
  padding: 16px 20px;
}
.history-entry-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.history-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.history-entry-verdict {
  font-size: 16px;
  font-weight: 700;
}
.history-entry-conf {
  font-size: 14px;
  color: var(--grey-700);
}
.history-entry-details {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--grey-600);
}
.history-entry-actions {
  display: flex;
  justify-content: flex-end;
}
.history-open-btn {
  width: auto;
  min-width: 126px;
  height: 38px;
  padding: 0 14px;
  font-size: 13px;
}
.history-entry-json,
.history-entry-text {
  font-family: ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.5;
  color: var(--dark-text);
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 600px) {
  .history-toolbar,
  .history-actions,
  .history-summary {
    width: 100%;
  }
  .history-action-btn,
  .history-clear-btn,
  .history-open-btn {
    width: 100%;
  }
  .history-entry-actions {
    justify-content: stretch;
  }
}

/* Review Recording modal */
.review-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.review-modal-overlay.open {
  display: flex;
}

.review-modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.16), 0 8px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
  max-width: 480px;
  width: 100%;
  padding: 28px;
}

.review-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark-text);
  margin: 0 0 20px;
}

.review-audio-player {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.review-play-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-blue);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.review-play-btn:hover:not(:disabled) {
  opacity: 0.9;
}

.review-play-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.review-time {
  font-size: 13px;
  color: var(--grey-600);
  min-width: 72px;
  font-variant-numeric: tabular-nums;
}

.review-progress-wrap {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.review-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--primary-blue);
  border-radius: 3px;
  transition: width 0.05s linear;
}

.review-volume-btn,
.review-more-btn {
  background: none;
  border: none;
  color: var(--grey-600);
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.review-volume-btn:hover,
.review-more-btn:hover {
  color: var(--dark-text);
}

.review-transcription-wrap {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 24px;
  min-height: 80px;
}

.review-transcription {
  font-size: 15px;
  line-height: 1.5;
  color: var(--dark-text);
  margin: 0;
}

.review-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.btn-review-rerecord {
  padding: 0 20px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--dark-text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn-review-rerecord:hover {
  background: rgba(0, 0, 0, 0.05);
}

.btn-review-submit {
  width: auto;
  min-width: 120px;
  height: 48px;
}

.edit-profile-sub {
  font-size: 14px;
  color: var(--grey-600);
  margin: 0 0 20px;
}

.edit-profile-modal .input-wrap {
  margin-bottom: 16px;
}

.edit-profile-modal .review-modal-actions {
  margin-top: 24px;
}

/* Icons (simple SVG placeholders – you can replace with real icons) */
.icon-mic { color: var(--light-blue); }
.icon-upload { color: var(--light-blue); }
.icon-person { color: var(--primary-blue); }
.icon-analytics { color: var(--primary-blue); }
.icon-logout { color: var(--primary-blue); }
.icon-back { color: var(--dark-text); }
.icon-account { color: var(--dark-text); }
.icon-menu { color: var(--dark-text); }

/* Futuristic refresh */
.sidebar,
.card,
.review-modal,
.analysis-detail-card,
.sample-lookup-card,
.compare-result-section,
.compare-saved-fields,
.history-stat,
.panel-disclaimer,
.global-disclaimer {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(239, 248, 255, 0.95));
  border-color: rgba(14, 165, 233, 0.32);
  box-shadow: 0 14px 30px rgba(14, 165, 233, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.page-title,
.brand-title,
.settings-overview-name,
.prediction-title,
.compare-sample-result h4,
.history-block-header h3 {
  font-family: 'Orbitron', 'Space Grotesk', sans-serif;
  letter-spacing: 0.02em;
}

.panel {
  animation: panelRise 320ms ease;
}

@keyframes panelRise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn-primary,
.btn-gradient,
.compare-submit-btn,
.history-action-btn,
.history-open-btn,
.btn-secondary {
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: linear-gradient(140deg, rgba(14, 165, 233, 0.2), rgba(56, 189, 248, 0.14));
  color: #0b3a5a;
  box-shadow: 0 8px 18px rgba(14, 165, 233, 0.18);
}

.btn-primary:hover,
.btn-gradient:hover,
.compare-submit-btn:hover,
.history-action-btn:hover,
.history-open-btn:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 211, 238, 0.7);
  box-shadow: 0 12px 22px rgba(34, 211, 238, 0.24);
}

.compare-upload-area {
  min-height: 220px;
  border: 1px dashed rgba(56, 189, 248, 0.5);
  border-radius: 14px;
  background: radial-gradient(circle at 50% 0%, rgba(14, 165, 233, 0.16), rgba(224, 242, 254, 0.72));
}

.compare-upload-area:hover {
  background: radial-gradient(circle at 50% 0%, rgba(34, 211, 238, 0.24), rgba(207, 236, 255, 0.82));
}

.compare-mode-option {
  border-color: rgba(56, 189, 248, 0.4);
  background: linear-gradient(145deg, rgba(224, 242, 254, 0.96), rgba(241, 248, 255, 0.96));
}

.compare-mode-option input:checked + span {
  color: #0e7490;
  text-shadow: 0 0 10px rgba(14, 165, 233, 0.24);
}

.compare-select-input,
.auth-input,
input,
textarea,
select {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(56, 189, 248, 0.25);
  color: #0f172a;
}

.compare-agreement--agree {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
}

.compare-agreement--disagree {
  background: rgba(248, 113, 113, 0.16);
  color: #fca5a5;
}

.vs-swal-popup {
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: linear-gradient(160deg, #ffffff, #eff8ff);
  color: #0f172a;
  border-radius: 16px;
  box-shadow: 0 16px 38px rgba(14, 165, 233, 0.22);
}

.vs-swal-confirm,
.vs-swal-secondary,
.vs-swal-cancel {
  border: 1px solid rgba(56, 189, 248, 0.45) !important;
  border-radius: 10px !important;
  padding: 10px 14px !important;
  font-weight: 600 !important;
}

.vs-swal-confirm {
  background: linear-gradient(140deg, rgba(14, 165, 233, 0.28), rgba(8, 145, 178, 0.2)) !important;
  color: #0b3a5a !important;
}

.vs-swal-secondary {
  background: linear-gradient(140deg, rgba(186, 230, 253, 0.7), rgba(224, 242, 254, 0.7)) !important;
  color: #0f172a !important;
}

.vs-swal-cancel {
  background: rgba(226, 232, 240, 0.95) !important;
  color: #334155 !important;
}

.swal2-popup .swal2-title {
  font-family: 'Orbitron', 'Space Grotesk', sans-serif;
  font-size: 20px;
  letter-spacing: 0.02em;
}

.swal2-popup .swal2-html-container,
.swal2-popup .swal2-validation-message {
  color: #334155;
}

.swal2-popup .swal2-input,
.swal2-popup .swal2-textarea,
.swal2-popup .swal2-select {
  background: rgba(255, 255, 255, 0.96) !important;
  color: #0f172a !important;
  border: 1px solid rgba(56, 189, 248, 0.32) !important;
  border-radius: 10px !important;
}

[data-theme="dark"] .sidebar,
[data-theme="dark"] .card,
[data-theme="dark"] .review-modal,
[data-theme="dark"] .analysis-detail-card,
[data-theme="dark"] .sample-lookup-card,
[data-theme="dark"] .compare-result-section,
[data-theme="dark"] .compare-saved-fields,
[data-theme="dark"] .history-stat,
[data-theme="dark"] .panel-disclaimer,
[data-theme="dark"] .global-disclaimer {
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.9));
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.45), inset 0 1px 0 rgba(125, 211, 252, 0.14);
}

[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-gradient,
[data-theme="dark"] .compare-submit-btn,
[data-theme="dark"] .history-action-btn,
[data-theme="dark"] .history-open-btn,
[data-theme="dark"] .btn-secondary {
  color: #e0f2fe;
}

[data-theme="dark"] .compare-upload-area {
  background: radial-gradient(circle at 50% 0%, rgba(14, 165, 233, 0.16), rgba(2, 6, 23, 0.3));
}

[data-theme="dark"] .compare-upload-area:hover {
  background: radial-gradient(circle at 50% 0%, rgba(34, 211, 238, 0.22), rgba(2, 6, 23, 0.4));
}

[data-theme="dark"] .compare-mode-option {
  background: linear-gradient(145deg, rgba(8, 47, 73, 0.75), rgba(15, 23, 42, 0.88));
}

[data-theme="dark"] .compare-mode-option input:checked + span {
  color: #67e8f9;
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.5);
}

[data-theme="dark"] .compare-select-input,
[data-theme="dark"] .auth-input,
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: rgba(2, 6, 23, 0.72);
  color: #e2e8f0;
}

[data-theme="dark"] .vs-swal-popup {
  background: linear-gradient(160deg, #0b1222, #020617);
  color: #e2e8f0;
  box-shadow: 0 18px 46px rgba(2, 6, 23, 0.68);
}

[data-theme="dark"] .vs-swal-confirm {
  color: #ecfeff !important;
}

[data-theme="dark"] .vs-swal-secondary {
  background: linear-gradient(140deg, rgba(8, 145, 178, 0.26), rgba(2, 132, 199, 0.2)) !important;
  color: #dbeafe !important;
}

[data-theme="dark"] .vs-swal-cancel {
  background: rgba(15, 23, 42, 0.86) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .swal2-popup .swal2-html-container,
[data-theme="dark"] .swal2-popup .swal2-validation-message {
  color: #cbd5e1;
}

[data-theme="dark"] .swal2-popup .swal2-input,
[data-theme="dark"] .swal2-popup .swal2-textarea,
[data-theme="dark"] .swal2-popup .swal2-select {
  background: rgba(2, 6, 23, 0.75) !important;
  color: #e2e8f0 !important;
}

/* Precision layout pass */
.page-content {
  max-width: 820px;
  padding: 36px 44px 56px;
}

.form-page {
  display: block;
}

.page-title {
  margin-bottom: 8px;
  line-height: 1.16;
}

.page-subtitle {
  margin-bottom: 20px;
  max-width: 72ch;
}

.ux-flow-hint,
.panel-disclaimer,
.global-disclaimer {
  border-radius: 14px;
}

.compare-mode-switch {
  margin-bottom: 16px;
}

.compare-mode-option {
  min-height: 54px;
}

.compare-uploads {
  gap: 18px;
  margin-bottom: 16px;
}

.compare-upload-card,
.compare-sample-result,
.compare-select-card {
  border-radius: 14px;
}

.compare-upload-area {
  min-height: 232px;
  padding: 28px 20px;
}

.compare-upload-area h3 {
  margin-top: 2px;
}

.compare-saved-fields {
  padding: 20px;
}

.compare-saved-header {
  margin-bottom: 14px;
}

.compare-saved-grid {
  align-items: stretch;
}

.compare-select-card {
  min-height: 126px;
  justify-content: center;
}

.compare-select-input {
  min-height: 44px;
}

.compare-actions {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.compare-submit-btn,
.history-action-btn,
.history-open-btn,
.compact-action-btn,
.settings-overview-btn {
  min-height: 44px;
}

.compare-result-section {
  padding: 20px;
}

.compare-side-by-side {
  gap: 14px;
}

.history-toolbar {
  align-items: stretch;
}

.history-actions {
  flex-wrap: wrap;
}

.history-entry-header,
.history-entry-actions {
  align-items: center;
}

.settings-overview-header {
  align-items: center;
}

.settings-overview-actions {
  row-gap: 8px;
}

.sample-lookup-row {
  align-items: stretch;
}

@media (max-width: 1024px) {
  .page-content {
    padding: 30px 28px 46px;
  }
}

@media (max-width: 768px) {
  .page-content {
    padding: 24px 18px 34px;
  }

  .compare-upload-area {
    min-height: 196px;
  }

  .compare-saved-fields,
  .compare-result-section,
  .analysis-detail-card,
  .sample-lookup-card {
    padding: 16px;
  }
}

@media (max-width: 600px) {
  .page-title {
    font-size: 22px;
  }

  .page-subtitle {
    font-size: 14px;
    margin-bottom: 16px;
  }

  .compare-mode-option {
    min-height: 50px;
    padding: 12px 14px;
  }

  .compare-upload-area {
    min-height: 170px;
    padding: 20px 14px;
  }

  .compare-upload-area .icon-circle {
    width: 50px;
    height: 50px;
  }

  .compare-upload-area .icon-circle svg {
    width: 24px;
    height: 24px;
  }

  .compare-select-card {
    min-height: 110px;
    padding: 12px;
  }

  .compare-actions {
    margin-bottom: 12px;
  }

  .compare-submit-btn,
  .history-action-btn,
  .history-open-btn,
  .compact-action-btn,
  .settings-overview-btn,
  .sample-lookup-row .btn-primary {
    width: 100%;
    min-height: 42px;
  }

  .sample-lookup-row {
    flex-direction: column;
    gap: 8px;
  }

  .history-stat {
    min-width: 0;
    width: 100%;
    padding: 12px;
  }

  .history-entry .card-inner {
    padding: 14px;
  }
}
