/* ═══════════════════════════════════════════════════════════════
   Super Data Extractor — Bento Grid Design System
   Lexend + Sora · Clean · Modular · Apple-meets-Bento
   ═══════════════════════════════════════════════════════════════ */

/* ── Design Tokens ─────────────────────────────────────── */

:root {
  color-scheme: light;
  --font-heading: 'Lexend', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
  --sf-mono: 'SF Mono', 'SFMono-Regular', 'JetBrains Mono', monospace;

  /* Bento palette — clean, muted, premium */
  --bg: #f1f3f6;
  --bg-elevated: #ffffff;
  --bg-soft: #f7f8fa;
  --surface: #ffffff;
  --surface-hover: #fafbfc;
  --surface-muted: #ebedf2;
  --line: rgba(0, 0, 0, 0.07);
  --line-strong: rgba(0, 0, 0, 0.14);
  --text: #1a1d26;
  --text-soft: #5a5f6e;
  --text-muted: #9499a8;

  /* Bento accent — cooler, more refined */
  --accent: #3b5de7;
  --accent-hover: #2f4ed4;
  --accent-soft: rgba(59, 93, 231, 0.08);
  --accent-2: #6366f1;
  --accent-3: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;

  /* Bento surfaces */
  --bento-card: #ffffff;
  --bento-border: rgba(0, 0, 0, 0.07);
  --bento-border-hover: rgba(0, 0, 0, 0.14);

  /* Shadows — barely there, clean */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.08);

  /* Radii — Bento signature */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Sizing */
  --topbar-height: 56px;
  --sidebar-width: 240px;
  --content-width: 1320px;

  /* Bento grid gaps */
  --bento-gap: 16px;
  --bento-gap-lg: 20px;

  /* Transitions */
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0d0f13;
  --bg-elevated: #14171e;
  --bg-soft: #111319;
  --surface: #161920;
  --surface-hover: #1c1f28;
  --surface-muted: #1a1d26;
  --line: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.12);
  --text: #edf0f7;
  --text-soft: #8b90a0;
  --text-muted: #5d6378;
  --accent: #5b7bf7;
  --accent-hover: #6f8cff;
  --accent-soft: rgba(91, 123, 247, 0.12);
  --accent-2: #818cf8;
  --accent-3: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;
  --bento-card: #161920;
  --bento-border: rgba(255, 255, 255, 0.06);
  --bento-border-hover: rgba(255, 255, 255, 0.14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ── Reset ─────────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

html, body {
  min-height: 100%;
  margin: 0;
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  letter-spacing: -0.01em;
}

/* ── Typography ────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

h1 { font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: 22px; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: 17px; line-height: 1.3; font-weight: 600; letter-spacing: -0.015em; }
h4 { font-size: 15px; line-height: 1.35; font-weight: 600; letter-spacing: -0.01em; }

a { color: var(--accent); text-decoration: none; transition: color 200ms var(--ease); }
a:hover { color: var(--accent-hover); }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

.eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-family: var(--font-heading);
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.lead {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-soft);
  max-width: 600px;
}

.muted { color: var(--text-soft); }
.microcopy { font-size: 11px; color: var(--text-muted); }

/* ── Bento Grid System ─────────────────────────────────── */

.bento-grid {
  display: grid;
  gap: var(--bento-gap);
  grid-template-columns: 1fr;
}

.bento-grid-2 {
  display: grid;
  gap: var(--bento-gap);
  grid-template-columns: 1fr;
}

.bento-grid-3 {
  display: grid;
  gap: var(--bento-gap);
  grid-template-columns: 1fr;
}

.bento-grid-4 {
  display: grid;
  gap: var(--bento-gap);
  grid-template-columns: 1fr;
}

.bento-card {
  background: var(--bento-card);
  border: 1px solid var(--bento-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  transition: all 240ms var(--ease);
  position: relative;
  overflow: hidden;
}

.bento-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid transparent;
  transition: border-color 240ms var(--ease);
  pointer-events: none;
}

.bento-card:hover {
  border-color: var(--bento-border-hover);
  box-shadow: var(--shadow-lg);
  
}

.bento-card:hover::after {
  border-color: rgba(59, 93, 231, 0.08);
}

.bento-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.bento-card-header h3 {
  font-size: 15px;
  font-weight: 600;
}

.bento-card-body {
  display: grid;
  gap: 12px;
}

.bento-section {
  display: grid;
  gap: 16px;
}

.bento-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-family: var(--font-heading);
}

/* ── App Shell ─────────────────────────────────────────── */

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}

.app-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms var(--ease);
  z-index: 20;
}

.app-shell.sidebar-open .app-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* ── Sidebar — Clean Apple-Inspired ─────────────────────── */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(86vw, 240px);
  display: flex;
  flex-direction: column;
  background: var(--bg-soft, #f7f8fa);
  border-right: 1px solid var(--line);
  transform: translateX(-102%);
  transition: transform 300ms cubic-bezier(0.25, 0.1, 0.25, 1);
  z-index: 30;
}

.app-shell.sidebar-open .sidebar {
  transform: translateX(0);
  box-shadow: 8px 0 40px rgba(0, 0, 0, 0.12), 2px 0 8px rgba(0, 0, 0, 0.04);
}

/* ── Sidebar Brand ── */

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  min-height: 50px;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
}

.brand:hover { text-decoration: none; }

.brand-mark {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  flex-shrink: 0;
}

.brand-orb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(255,255,255,0.5);
}

.brand strong {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-family: var(--font-heading);
  line-height: 1.2;
}

.brand small {
  display: block;
  font-size: 8px;
  color: var(--text-muted);
  line-height: 1.2;
}

/* ── Sidebar Nav — Bento Boxes ── */

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Each nav section is a bento box */
.nav-section {
  background: var(--surface);
  border: 1px solid var(--bento-border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.nav-section-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 5px 12px 4px;
  font-family: var(--font-heading);
  border-bottom: 1px solid var(--line);
  line-height: 1.3;
}

/* Nav links inside bento boxes */
.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  text-decoration: none;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-heading);
  transition: background 140ms ease, color 140ms ease;
  position: relative;
  border-bottom: 1px solid var(--line);
  line-height: 1.2;
}

.nav-link:last-child {
  border-bottom: none;
}

.nav-link:hover {
  background: var(--surface-muted);
  color: var(--text);
  text-decoration: none;
}

.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 6px;
}

.nav-link:hover .nav-icon {
  background: rgba(0,0,0,0.03);
}

.nav-link.active .nav-icon {
  background: rgba(59, 93, 231, 0.12);
}

.nav-icon .icon {
  font-size: 16px;
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 20;
}

.nav-link.active .nav-icon .icon {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 20;
}

.nav-icon svg { display: block; width: 16px; height: 16px; }

.nav-link strong {
  display: block;
  font-weight: 500;
  font-size: 11px;
  line-height: 1.2;
}

.nav-link small {
  display: block;
  font-size: 8px;
  color: inherit;
  opacity: 0.5;
  line-height: 1.2;
}

/* ── Sidebar Foot ── */

.sidebar-foot {
  padding: 6px;
  flex-shrink: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── Status / User Panel ───────────────────────────────── */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-soft);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  transition: all 200ms var(--ease);
}

.status-pill:hover {
  border-color: var(--bento-border-hover);
  box-shadow: var(--shadow-sm);
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 4px rgba(16, 185, 129, 0.4);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.85); }
}

.user-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  transition: all 200ms var(--ease);
}

.user-panel:hover {
  border-color: var(--bento-border-hover);
  box-shadow: var(--shadow-sm);
}

.user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  flex-shrink: 0;
  font-family: var(--font-heading);
}

.user-avatar.small {
  width: 20px;
  height: 20px;
  font-size: 8px;
}

.user-copy {
  min-width: 0;
  display: grid;
  gap: 0;
}

.user-copy strong {
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.user-copy small {
  font-size: 8px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

/* ── Top Bar ───────────────────────────────────────────── */

.main-panel {
  min-height: 100vh;
  padding: 14px 14px 18px;
}

.topbar {
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(100%, var(--content-width));
  margin: 0 auto 16px;
  padding: 0 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 12px;
  z-index: 15;
}

.topbar-leading,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-user-copy strong {
  font-size: 11px;
  font-weight: 500;
}

.menu-toggle {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  border-radius: 8px;
  transition: background 180ms var(--ease);
}

.menu-toggle:hover { background: var(--surface-muted); }

.menu-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  position: relative;
  transition: background 200ms var(--ease);
}

.menu-toggle span::before,
.menu-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 200ms var(--ease), top 200ms var(--ease);
}

.menu-toggle span::before { top: -5px; }
.menu-toggle span::after { top: 5px; }

/* ── Theme Toggle ──────────────────────────────────────── */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: var(--surface);
  cursor: pointer;
  font-size: 11px;
  color: var(--text-soft);
  transition: all 180ms var(--ease);
  font-family: var(--font-heading);
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.theme-toggle-track {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  position: relative;
  transition: background 240ms var(--ease);
}

.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 240ms var(--ease-spring);
}

[data-theme='dark'] .theme-toggle-thumb {
  transform: translateX(16px);
}

[data-theme='dark'] .theme-toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}

[data-theme='dark'] .theme-toggle-thumb {
  background: #ffffff;
}

/* ── Content Shell ─────────────────────────────────────── */

.content-shell {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  display: grid;
  gap: var(--bento-gap);
}

/* ── Glass Card (Bento styled — preserves legacy class) ── */

.glass-card {
  background: var(--bento-card);
  border: 1px solid var(--bento-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  transition: all 240ms var(--ease);
  position: relative;
}

.glass-card:hover {
  border-color: var(--bento-border-hover);
  box-shadow: var(--shadow-lg);
  
}

.glass-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.glass-card-header h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
}

/* ── HERO PANEL ────────────────────────────────────────── */

.hero-panel {
  background: var(--surface);
  border: 1px solid var(--bento-border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.hero-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
}

.hero-grid {
  display: grid;
  gap: var(--bento-gap);
  grid-template-columns: 1fr;
}

.hero-copy {
  display: grid;
  gap: 8px;
  align-content: start;
}

.hero-copy h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.headline {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  color: var(--text-soft);
  white-space: nowrap;
}

/* ── KPI / Stats ───────────────────────────────────────── */

.kpi-band {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}

.stat-card {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--bento-border);
  border-radius: var(--radius-lg);
  transition: all 240ms var(--ease);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity 240ms var(--ease);
}

.stat-card:hover {
  border-color: var(--bento-border-hover);
  box-shadow: var(--shadow-lg);
  
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-soft) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-soft);
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-detail {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Stats Grid ────────────────────────────────────────── */

.stats-grid {
  display: grid;
  gap: var(--bento-gap);
  grid-template-columns: 1fr;
}

.status-card.configured {
  border-left: 3px solid var(--accent-3);
}

.status-card.not-configured {
  border-left: 3px solid var(--text-muted);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-head h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
}

.section-head p {
  font-size: 11px;
  color: var(--text-soft);
  margin: 2px 0 0;
}

.status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 12px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  font-size: 11px;
}

.status-pill.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-3);
  border-color: transparent;
}

/* ── Extractors Layout ─────────────────────────────────── */

.extractor-layout {
  display: grid;
  gap: var(--bento-gap);
  grid-template-columns: 1fr;
}

.extractor-sidebar {
  display: grid;
  gap: var(--bento-gap);
  align-content: start;
}

.extractor-main {
  display: grid;
  gap: var(--bento-gap);
  align-content: start;
}

/* ── Settings Grid ─────────────────────────────────────── */

.settings-grid {
  display: grid;
  gap: var(--bento-gap);
  grid-template-columns: 1fr;
}

.settings-section {
  display: grid;
  gap: 14px;
}

.settings-section h3 {
  font-family: var(--font-heading);
  font-weight: 600;
}

.settings-stack {
  display: grid;
  gap: 12px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}

.toggle-row strong {
  font-size: 13px;
  font-weight: 600;
}

.validation-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.validation-badge.valid {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-3);
}

.validation-badge.invalid {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.validation-badge.neutral {
  background: var(--surface-muted);
  color: var(--text-muted);
}

.field-hint {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

/* ── Bento Buttons ─────────────────────────────────────── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 200ms var(--ease-spring);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
  position: relative;
  overflow: hidden;
}

.button:hover { text-decoration: none; }

.button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  border-color: transparent;
}

.button.primary:hover {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(59, 93, 231, 0.3);
  
}

.button.primary:active {
  transform: translateY(0) scale(0.98);
}

.button.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line-strong);
}

.button.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  
}

.button.ghost {
  background: transparent;
  color: var(--text-soft);
  border-color: transparent;
}

.button.ghost:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.button.compact {
  padding: 3px 8px;
  font-size: 11px;
}

.button.danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}

.button.danger:hover {
  background: var(--danger);
  color: #ffffff;
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Icon Button ───────────────────────────────────────── */

.icon-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  padding: 0;
  transition: all 180ms var(--ease);
}

.icon-btn:hover {
  background: var(--surface-muted);
  color: var(--text);
}

/* ── Form Fields ───────────────────────────────────────── */

.field {
  display: grid;
  gap: 4px;
}

.field-inline {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.field label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-soft);
  font-family: var(--font-heading);
}

.field input,
.field select,
.field textarea {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-body);
  transition: all 200ms var(--ease);
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.field input::placeholder {
  color: var(--text-muted);
}

.field select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23949a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

textarea {
  min-height: 76px;
  resize: vertical;
}

.field-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* ── Toggle (Bento Clean) ──────────────────────────────── */

.toggle {
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  cursor: pointer;
  position: relative;
  transition: all 200ms var(--ease);
  padding: 0;
  flex-shrink: 0;
}

.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  transition: transform 200ms var(--ease-spring);
}

.toggle.active {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle.active::after {
  transform: translateX(16px);
}

.toggle-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.toggle-field label {
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

/* ── Icons ──────────────────────────────────────────────── */

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Material Symbols Outlined';
  font-size: 18px;
  line-height: 1;
  font-style: normal;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

.icon-fill {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

/* ── Results Table ─────────────────────────────────────── */

.table-card {
  background: var(--surface);
  border: 1px solid var(--bento-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.table-toolbar h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

th {
  text-align: left;
  padding: 9px 12px;
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-soft); }
tr.selected td { background: var(--accent-soft); }

.table-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--text-soft);
}

.table-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Results Page ──────────────────────────────────────── */

.results-toolbar {
  display: grid;
  gap: 12px;
}

.results-toolbar-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.results-count {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.results-highlights {
  display: grid;
  gap: 12px;
}

.highlight-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.highlight-box .icon { color: var(--accent); font-size: 20px; }
.highlight-box strong { display: block; font-family: var(--font-heading); font-size: 16px; font-weight: 700; }
.highlight-box small { font-size: 11px; color: var(--text-soft); }

/* ── Details Panel ─────────────────────────────────────── */

.details-panel {
  display: grid;
  gap: 6px;
}

.details-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 11px;
  border-bottom: 1px solid var(--line);
}

.details-row:last-child { border-bottom: none; }
.details-row span:first-child { color: var(--text-soft); font-weight: 500; }
.details-row span:last-child { font-weight: 600; text-align: right; }

/* ── Slider ────────────────────────────────────────────── */

.slider-field input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--surface-muted);
  border: none;
  outline: none;
  padding: 0;
}

.slider-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(59, 93, 231, 0.25);
  transition: transform 200ms var(--ease-spring);
}

.slider-field input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider-field input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

/* ── Checkbox + Radio ──────────────────────────────────── */

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
}

.check-field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 2px solid var(--line-strong);
  background: var(--surface);
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 180ms var(--ease);
  flex-shrink: 0;
  margin: 0;
}

.check-field input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.check-field input[type="radio"] {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: var(--surface);
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 180ms var(--ease);
  flex-shrink: 0;
  margin: 0;
}

.check-field input[type="radio"]:checked {
  border-color: var(--accent);
  border-width: 5px;
}

/* ── Progress Dialog ───────────────────────────────────── */

.progress-dialog {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms var(--ease);
  z-index: 50;
  padding: 16px;
}

.progress-dialog[aria-hidden="false"],
.progress-dialog.open {
  opacity: 1;
  pointer-events: auto;
}

.progress-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 22px 20px;
  box-shadow: var(--shadow-xl);
  transform: scale(0.94);
  transition: transform 280ms var(--ease-spring);
}

.progress-dialog[aria-hidden="false"] .progress-card,
.progress-dialog.open .progress-card {
  transform: scale(1);
}

.progress-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.progress-card-head h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 16px;
}

.progress-description {
  font-size: 11px;
  color: var(--text-soft);
  margin-bottom: 10px;
}

.progress-current-place {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-track {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-muted);
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-value {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  width: 0%;
  transition: width 400ms var(--ease);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Toast Stack ───────────────────────────────────────── */

.toast-stack {
  position: fixed;
  bottom: 16px;
  right: 16px;
  display: grid;
  gap: 8px;
  z-index: 60;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  animation: toast-in 360ms var(--ease-spring) both;
  max-width: 360px;
}

.toast.removing {
  animation: toast-out 240ms var(--ease) both;
}

.toast .icon { font-size: 18px; flex-shrink: 0; }
.toast.success .icon { color: var(--accent-3); }
.toast.error .icon { color: var(--danger); }
.toast.warning .icon { color: var(--warning); }
.toast.info .icon { color: var(--accent); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.94); }
}

/* ── Loading Skeleton ──────────────────────────────────── */

.skeleton {
  background: linear-gradient(90deg, var(--surface-muted) 25%, var(--bg-soft) 50%, var(--surface-muted) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text { height: 12px; margin-bottom: 6px; width: 100%; }
.skeleton-text.short { width: 60%; }
.skeleton-heading { height: 20px; width: 40%; margin-bottom: 10px; }

/* ── Empty State ───────────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.empty-state .icon {
  font-size: 40px;
  margin-bottom: 14px;
  color: var(--text-muted);
  opacity: 0.5;
}

.empty-state h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 15px;
}

.empty-state p {
  font-size: 11px;
  color: var(--text-soft);
  max-width: 280px;
  margin-bottom: 14px;
}

.empty-state.compact {
  padding: 24px 16px;
}

/* ── Notice ────────────────────────────────────────────── */

.notice {
  padding: 12px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-soft);
  text-align: center;
}

/* ── Badge / Tag ───────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--accent-3); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* ── Saved Search Card ─────────────────────────────────── */

.saved-search-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: all 200ms var(--ease);
  cursor: pointer;
}

.saved-search-card:hover {
  border-color: var(--accent);
  box-shadow: 0 1px 4px rgba(59, 93, 231, 0.06);
}

.saved-search-info { min-width: 0; }

.saved-search-info strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
}

.saved-search-info small {
  font-size: 11px;
  color: var(--text-muted);
}

.saved-search-remove {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: all 180ms var(--ease);
}

.saved-search-card:hover .saved-search-remove { opacity: 1; }
.saved-search-remove:hover { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* ── Code / Pre ────────────────────────────────────────── */

code {
  font-family: var(--sf-mono);
  font-size: 11px;
  padding: 2px 5px;
  background: var(--surface-muted);
  border-radius: 4px;
  color: var(--accent-2);
}

pre {
  font-family: var(--sf-mono);
  font-size: 11px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  overflow-x: auto;
  line-height: 1.5;
}

/* ── History List ──────────────────────────────────────── */

.history-list {
  display: grid;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  transition: background 180ms var(--ease);
}

.history-item:last-child { border-bottom: none; }
.history-item:hover { background: var(--bg-soft); }

.history-main { flex: 1; min-width: 0; }

.history-main h4 {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
}

.history-main p {
  font-size: 11px;
  color: var(--text-soft);
  margin: 1px 0;
}

.history-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.history-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface-muted);
  color: var(--text-soft);
}

.history-item.compact {
  padding: 6px 12px;
}

/* ── Auth Pages ────────────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════
   Auth — Modern Bento Grid Redesign
   Clean split layout · Modular bento cards · Premium minimal
   ═══════════════════════════════════════════════════════════════ */

.auth-shell {
  min-height: 100vh;
  display: flex;
}

/* ── Left Panel — Bento Brand Section ──────────────────── */
.auth-panel-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.auth-panel-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 25% 15%, rgba(59, 93, 231, 0.06), transparent 55%),
    radial-gradient(ellipse at 75% 85%, rgba(99, 102, 241, 0.03), transparent 45%);
  z-index: -1;
}

.auth-panel-left::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 1;
}

.auth-panel-content {
  max-width: 480px;
  width: 100%;
}

/* ── Left panel brand ────────────────────────────────────── */
.auth-panel-left .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
  font-size: 13px;
  color: var(--text);
}

.auth-panel-left .brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(59, 93, 231, 0.2);
}

.auth-panel-left .brand .brand-orb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
}

.auth-panel-left .brand strong {
  display: block;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.auth-panel-left .brand small {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 1px;
}

.auth-panel-copy {
  margin-bottom: 36px;
}

.auth-panel-copy h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--text);
  margin-bottom: 10px;
}

.auth-eyebrow-inverse {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-family: var(--font-heading);
}

.auth-panel-tagline-main {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-soft);
  margin-top: 0;
}

.auth-panel-tagline-sub {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font-heading);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-top: 10px;
}

/* ── Feature list — Bento Cards ────────────────────────── */
.auth-feature-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  max-width: 400px;
}

.auth-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--bento-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: all 200ms var(--ease);
}

.auth-feature-list li:hover {
  border-color: var(--bento-border-hover);
  box-shadow: var(--shadow-sm);
}

.auth-feature-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
}

.auth-feature-icon .material-symbols-outlined {
  font-size: 15px !important;
}

/* ── Right Panel — Bento Form Card ──────────────────────── */
.auth-panel-right {
  flex: 0 0 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg-soft);
  position: relative;
}

.auth-panel-right::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

/* ── Auth Card — Premium Bento ────────────────────────────── */
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bento-card);
  border: 1px solid var(--bento-border);
  border-radius: var(--radius-lg);
  padding: 36px 32px 32px;
  box-shadow: var(--shadow);
  transition: box-shadow 240ms var(--ease), transform 240ms var(--ease);
}

.auth-card:hover {
  box-shadow: var(--shadow-lg);
}

.auth-card-mark {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}

.auth-card-mark .brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(59, 93, 231, 0.2);
}

.auth-card-mark .brand-orb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--bento-border);
}

.auth-brand .brand-mark {
  display: none;
}

.auth-brand strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: block;
  text-align: center;
}

.auth-brand small {
  font-size: 10px;
  color: var(--text-muted);
  display: block;
  margin-top: 1px;
  text-align: center;
}

/* ── Auth header ─────────────────────────────────────────── */
.auth-head {
  margin-bottom: 22px;
  text-align: center;
}

.auth-head .eyebrow {
  margin-bottom: 6px;
  text-align: center;
}

.auth-head h3 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: var(--text);
  text-align: center;
}

.auth-head p {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 auto;
  max-width: 320px;
  text-align: center;
}

/* ── Auth form ───────────────────────────────────────────── */
.auth-form {
  margin-bottom: 16px;
}

.auth-form .field {
  display: grid;
  gap: 5px;
  margin-bottom: 14px;
}

.auth-form .field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.auth-form .field input {
  min-height: 46px;
  padding: 10px 14px;
  font-size: 14px;
  background: var(--surface);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
  transition: all 200ms var(--ease);
  font-family: var(--font-body);
}

.auth-form .field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-form .field input::placeholder {
  color: var(--text-muted);
}

/* ── Auth actions ────────────────────────────────────────── */
.auth-actions {
  margin-top: 20px;
}

.auth-actions .button {
  width: 100%;
  min-height: 46px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

/* ── Links ───────────────────────────────────────────────── */
.auth-switch {
  margin: 0;
  color: var(--text-soft);
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
}

.auth-switch .link {
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
}

.auth-forgot {
  margin: 0 0 16px;
  text-align: center;
  font-size: 12px;
}

.auth-forgot .link {
  color: var(--accent);
  font-weight: 500;
  font-size: 12px;
}

/* ── Auth notice banners ──────────────────────────────────── */
.auth-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.5;
}

.auth-notice-icon {
  flex-shrink: 0;
  font-size: 20px !important;
  margin-top: 1px;
}

.auth-notice strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.auth-notice p {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
}

.auth-notice-url {
  margin-top: 6px !important;
}

.auth-notice-url .link {
  font-weight: 600;
  font-size: 13px;
}

.auth-notice-success {
  background: rgba(52, 199, 89, 0.08);
  border: 1px solid rgba(52, 199, 89, 0.2);
}

.auth-notice-success .auth-notice-icon {
  color: #34c759;
}

.auth-notice-error {
  background: rgba(255, 59, 48, 0.08);
  border: 1px solid rgba(255, 59, 48, 0.2);
}

.auth-notice-error .auth-notice-icon {
  color: #ff3b30;
}


.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  color: var(--text-muted);
  font-size: 11px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ── Page Badge ────────────────────────────────────────── */

.page-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.page-badge svg {
  width: 14px;
  height: 14px;
  vertical-align: middle;
}

/* ── Results Note ──────────────────────────────────────── */

.results-note {
  font-size: 11px;
  color: var(--text-soft);
  padding: 8px 0;
}

/* ── Brand Glyph ───────────────────────────────────────── */

.brand-glyph {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: middle;
}

/* ── History Preview Panel ─────────────────────────────── */

.history-preview-panel {
  margin-top: 0;
}

/* ── Check Field Groups ────────────────────────────────── */

.check-field-group {
  display: grid;
  gap: 8px;
}

/* ── Filter Grid ───────────────────────────────────────── */

.filter-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

/* ── Mobile Utilities ──────────────────────────────────── */

.mobile-only { display: none; }

/* ── Toolbar Actions ───────────────────────────────────── */

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* ── Slider Labels ─────────────────────────────────────── */

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Column Toggle ─────────────────────────────────────── */

.column-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0;
}

.column-toggle .check-field {
  font-size: 11px;
}

/* ── Export Modal ──────────────────────────────────────── */

.export-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 55;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease);
}

.export-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.export-modal-content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 440px;
  width: 90vw;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95);
  transition: transform 250ms var(--ease-spring);
}

.export-modal.open .export-modal-content {
  transform: scale(1);
}

.export-modal h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  margin-bottom: 4px;
}

.export-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (min-width: 880px) {
  .app-shell {
    grid-template-columns: var(--sidebar-width) 1fr;
  }

  .sidebar {
    transform: translateX(0);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .sidebar-nav {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
  }

  .sidebar-close,
  .menu-toggle { display: none; }
  .app-backdrop { display: none; }

  .main-panel {
    padding: 20px 24px 24px 0;
  }

  .bento-grid-2,
  .hero-grid,
  .extractor-layout,
  .settings-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  }

  .bento-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bento-grid-4,
  .kpi-band {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .results-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .results-highlights {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .field-inline {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 879px) {
  .theme-label { display: none; }
  .topbar { padding: 0 10px; }
  .topbar-leading { width: 100%; }
  .topbar { flex-wrap: wrap; }
}

@media (max-width: 768px) {
  .main-panel { padding: 8px; }

  .topbar,
  .hero-panel,
  .glass-card,
  .table-card {
    border-radius: var(--radius-sm);
  }

  .button,
  .theme-toggle { width: 100%; }

  .topbar-actions,
  .hero-actions,
  .toolbar-actions,
  .inline-actions,
  .form-actions { width: 100%; }

  .field-inline { grid-template-columns: 1fr; }
  .results-toolbar { gap: 6px; }
  .mobile-hide { display: none; }
  .mobile-only { display: flex; }
  .details-panel { display: grid; gap: 4px; }

  .table-footer,
  .table-footer-actions,
  .results-toolbar-main { align-items: stretch; }

  .toast-stack { right: 8px; left: 8px; }
  .toast { width: auto; }

  .auth-panel-left { display: none; }
  .auth-panel-right { flex: 1; min-height: 100vh; padding: 14px; }
  .auth-card { padding: 16px; max-width: 380px; }

  .kpi-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── Scrollbar ──────────────────────────────────────────── */

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-soft); }

/* ── Selection ──────────────────────────────────────────── */

::selection { background: var(--accent-soft); color: var(--text); }

/* ── Focus Ring ─────────────────────────────────────────── */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

/* ── Print ──────────────────────────────────────────────── */

@media print {
  .sidebar, .topbar, .toast-stack, .progress-dialog { display: none !important; }
  .main-panel { padding: 0 !important; }
  .app-shell { display: block !important; }
}

/* ── Animations ─────────────────────────────────────────── */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scale-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.animate-fade-up { animation: fade-up 400ms var(--ease-spring) both; }
.animate-fade-in { animation: fade-in 300ms var(--ease) both; }
.animate-scale-in { animation: scale-in 350ms var(--ease-spring) both; }

/* ── Bento Helper Utilities ─────────────────────────────── */

.bento-full { grid-column: 1 / -1; }
.bento-span-2 { grid-column: span 2; }

.bento-card-flush {
  padding: 0;
}

.bento-card-divider {
  border-top: 1px solid var(--bento-border);
  margin: 12px -24px;
}

.bento-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ── Reverse Person Search ─────────────────────────────────── */

.reverse-results-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .reverse-results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.person-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}

.person-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lg);
}

.person-card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.person-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
}

.person-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person-info {
  flex: 1;
  min-width: 0;
}

.person-info h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text);
}

.person-role {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 2px;
}

.person-company {
  font-size: 11px;
  color: var(--text-muted);
}

.confidence-badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.confidence-badge.high {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.confidence-badge.medium {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.confidence-badge.low {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.person-card-body {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.person-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-soft);
}

.person-field .material-symbols-outlined {
  font-size: 16px;
  color: var(--text-muted);
}

.person-field a {
  color: var(--accent);
  word-break: break-all;
}

.person-card-extra {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-bottom: 10px;
}

.person-card-extra details {
  margin-bottom: 6px;
}

.person-card-extra summary {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.person-card-extra details div {
  font-size: 11px;
  color: var(--text-soft);
  padding: 2px 0;
}

.person-card-actions {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

/* Deep search report */
.person-deep-card {
  margin-bottom: 16px;
}

.person-deep-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .person-deep-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.deep-section h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.deep-section div {
  font-size: 13px;
  color: var(--text-soft);
  padding: 2px 0;
}

.deep-section a {
  color: var(--accent);
  word-break: break-all;
}

/* Form grid for reverse search */
.form-grid {
  display: grid;
  gap: 16px;
}

.form-row {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .form-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.form-label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  position: relative;
}

.form-label input,
.form-label select {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
  color: var(--text);
  transition: border-color 200ms var(--ease);
}

.form-label input:focus,
.form-label select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
}


/* ── Location Autocomplete Dropdown ─────────────────────────── */

.autocomplete-field {
  position: relative;
}

.autocomplete-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--surface, #fff);
  border: 1px solid var(--line, rgba(0,0,0,0.1));
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
}

.autocomplete-menu.hidden {
  display: none;
}

.autocomplete-option {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text, #1a1d26);
  transition: background 120ms ease;
}

.autocomplete-option:hover,
.autocomplete-option.active {
  background: var(--accent-soft, rgba(59,93,231,0.08));
}

.autocomplete-option strong {
  display: block;
  font-weight: 600;
  font-size: 14px;
}

.autocomplete-option span {
  display: block;
  font-size: 12px;
  color: var(--text-muted, #9499a8);
  margin-top: 2px;
}

.autocomplete-option:disabled {
  color: var(--text-muted, #9499a8);
  cursor: default;
}
/* ── Person Intelligence v6.0 ──────────────────────────────── */

/* Tab bar */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 4px;
}
.tab-bar .tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 200ms var(--ease);
  font-family: var(--font-body);
}
.tab-bar .tab:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.tab-bar .tab.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

/* Person profile header */
.person-profile-header {
  margin-bottom: 16px;
}
.person-profile-top {
  display: flex;
  align-items: center;
  gap: 20px;
}
.person-avatar.large {
  width: 72px;
  height: 72px;
  font-size: 24px;
  border-radius: 50%;
  flex-shrink: 0;
}
.person-profile-info h2 {
  font-size: 24px;
  margin-bottom: 4px;
}
.person-headline {
  font-size: 15px;
  color: var(--text-soft);
  margin-bottom: 2px;
}
.person-company-loc {
  font-size: 13px;
  color: var(--text-muted);
}
.person-industry {
  font-size: 11px;
  color: var(--accent);
  margin-top: 4px;
}
.person-bio {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 8px;
  line-height: 1.5;
  max-width: 600px;
}
.confidence-badge.large {
  font-size: 18px;
  padding: 8px 16px;
  margin-left: auto;
}

/* Profile list */
.profile-list {
  display: grid;
  gap: 12px;
}
.profile-item {
  padding: 12px 16px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.profile-item h4 {
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--text);
}
.profile-item p {
  font-size: 11px;
  color: var(--text-soft);
  margin: 0;
  line-height: 1.5;
}
.profile-item a {
  font-size: 11px;
  margin-top: 4px;
  display: inline-block;
}

/* Source tags */
.source-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.source-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
}

/* Person card snippet */
.person-field.snippet {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  border-top: 1px solid var(--line);
  padding-top: 6px;
  margin-top: 4px;
}

/* Deep section improvements */
.deep-section a {
  font-size: 11px;
  word-break: break-all;
}


/* ═══════════════════════════════════════════════════════════════
   Category Leaders UI — Grid + Person Cards + Modal
   ═══════════════════════════════════════════════════════════════ */

.category-grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--bento-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
}

.category-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.category-card .category-icon {
  font-size: 24px;
  line-height: 1;
  margin-bottom: 4px;
}

.category-card .category-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.category-card .category-desc {
  font-size: 11px;
  color: var(--text-soft);
  line-height: 1.4;
}

.category-card .category-roles {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.3;
}

/* Readonly input */
.input-readonly {
  background: var(--surface-muted) !important;
  cursor: default;
  color: var(--text-soft);
  font-weight: 500;
}

/* Results Grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 12px;
}

.person-card {
  padding: 12px 14px;
  transition: all 0.2s var(--ease);
}

.person-card:hover {
  border-color: var(--bento-border-hover);
  box-shadow: var(--shadow);
}

.person-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.person-card-info {
  flex: 1;
  min-width: 0;
}

.person-card-info .person-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin: 0 0 2px;
}

.person-card-info .person-role {
  font-size: 12px;
  color: var(--accent);
  margin: 0 0 2px;
  font-weight: 500;
}

.person-card-info .person-org {
  font-size: 11px;
  color: var(--text-soft);
  margin: 0 0 1px;
}

.person-card-info .person-location {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
}

.person-card-body {
  margin-bottom: 8px;
}

.person-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.person-tags .source-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--surface-muted);
  color: var(--text-soft);
  font-weight: 500;
}

.person-tags .phone-tag {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.person-tags .email-tag {
  background: rgba(59, 93, 231, 0.1);
  color: var(--accent);
}

.person-tags .linkedin-tag {
  background: rgba(10, 102, 194, 0.1);
  color: #0a66c2;
}

.person-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.person-card-actions .button.text {
  font-size: 11px;
  padding: 4px 8px;
  background: transparent;
  border: none;
  color: var(--text-soft);
.person-contact-row {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  line-height: 1.6;
  background: rgba(52, 199, 89, 0.06);
  border-top: 1px solid rgba(52, 199, 89, 0.12);
}

.person-contact-row .person-contact {
  display: inline;
  margin-right: 1rem;
}

.person-contact-row .person-contact strong {
  margin-right: 0.25rem;
}

.person-contact-row .phone-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.person-contact-row .phone-link:hover {
  text-decoration: underline;
}

}

.person-card-actions .button.text:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.person-card-details {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  margin-top: 4px;
  font-size: 12px;
}

.person-card-details .person-snippet {
  color: var(--text-soft);
  line-height: 1.5;
  margin-bottom: 6px;
  font-size: 11px;
}

.person-contact {
  margin-bottom: 4px;
  font-size: 12px;
}

.person-contact a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.person-contact a:hover {
  text-decoration: underline;
}

.phone-link {
  font-family: var(--sf-mono);
  font-size: 12px;
  color: #059669 !important;
  font-weight: 600 !important;
}

/* Confidence Badge */
.confidence-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--sf-mono);
  flex-shrink: 0;
}

.confidence-badge.high {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.confidence-badge.medium {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.confidence-badge.low {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 16px;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0 4px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  font-size: 13px;
}

.deep-search-results {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.deep-section {
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.deep-section h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  margin: 0 0 8px;
  color: var(--text);
}

.deep-item {
  padding: 4px 0;
}

.deep-item a {
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
  word-break: break-all;
}

.deep-item a:hover {
  text-decoration: underline;
}

.muted {
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
}

.notice.error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--danger);
}

.loading-spinner {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Responsive */
@media (max-width: 640px) {
  .category-grid-inner {
    grid-template-columns: 1fr;
  }
  .results-grid {
    grid-template-columns: 1fr;
  }
  .modal-content {
    margin: 10px;
    padding: 16px;
  }
}

/* ── Government Sources ────────────────────────────────────── */

.gov-country-grid {
  margin-bottom: 1.5rem;
}

.country-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft, rgba(59, 93, 231, 0.08));
  font-size: 1.25rem;
}

.result-card .country-tag {
  background: var(--accent-soft, rgba(59, 93, 231, 0.08));
  color: var(--accent, #3b5de7);
}

.source-badge.country-tag {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-muted, #ebedf2);
  color: var(--text-soft, #5a5f6e);
  margin-left: 4px;
}

.source-badge.enriched-tag {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: #e8f5e9;
  color: #2e7d32;
  margin-left: 4px;
  border: 1px solid #a5d6a7;
  font-weight: 500;
  animation: fadeIn 0.3s ease;
}

/* Tag input for multiple cities */
.tag-input-wrapper {
  position: relative;
}

.tag-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line-strong, rgba(0,0,0,0.14));
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--text, #1a1d26);
  font-family: var(--font-body, inherit);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
}

.tag-input:focus {
  border-color: var(--accent, #3b5de7);
}

.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--accent-soft, rgba(59, 93, 231, 0.08));
  color: var(--accent, #3b5de7);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.tag-remove {
  cursor: pointer;
  font-size: 0.7rem;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.tag-remove:hover {
  opacity: 1;
}

/* Deep profile modal */
.deep-profile {
  padding: 0.5rem 0;
}

.deep-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line, rgba(0,0,0,0.07));
}

.deep-header h4 {
  font-size: 1.1rem;
  margin: 0;
}

.deep-section {
  margin-bottom: 1.25rem;
}

.deep-section h5 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft, #5a5f6e);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.contact-line {
  margin-bottom: 4px;
}

.profile-line {
  padding: 6px 0;
  border-bottom: 1px solid var(--line, rgba(0,0,0,0.05));
}

.profile-line a {
  color: var(--accent, #3b5de7);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
}

.profile-line a:hover {
  text-decoration: underline;
}

.text-muted {
  color: var(--text-muted, #9499a8);
  font-size: 0.8rem;
}

/* Country card in grid */
.category-card.featured {
  border: 2px solid var(--accent, #3b5de7);
  background: var(--accent-soft, rgba(59, 93, 231, 0.04));
}

.category-card.featured .category-card-icon {
  font-size: 1.5rem;
}
