
:root {
  --bg: #f0f0f3;
  --surface: rgba(255,255,255,0.75);
  --surface2: rgba(245,245,247,0.8);
  --surface-solid: #ffffff;
  --border: rgba(0,0,0,0.06);
  --border2: rgba(0,0,0,0.1);
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --muted: #86868b;
  --accent: #0071e3;
  --accent-dark: #0058b0;
  --accent-text: #ffffff;
  --danger: #ff3b30;
  --warn: #e87400;
  --success: #248a3d;
  --blue: #0071e3;
}
[data-theme="dark"] {
  --bg: #0a0a0a;
  --surface: rgba(28,28,30,0.8);
  --surface2: rgba(44,44,46,0.6);
  --surface-solid: #1c1c1e;
  --border: rgba(255,255,255,0.08);
  --border2: rgba(255,255,255,0.12);
  --text: #f5f5f7;
  --text-secondary: #a1a1a6;
  --muted: #86868b;
  --accent: #0a84ff;
  --accent-dark: #0071e3;
  --accent-text: #ffffff;
  --danger: #ff453a;
  --warn: #ff9f0a;
  --success: #30d158;
  --blue: #0a84ff;
}
* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }
body {
  background: #f0f0f3;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
[data-theme="dark"] body { background: #0a0a0a; }

/* Floating halo blobs */
.bg-halo {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: -1;
  will-change: transform;
}
.bg-halo-1 {
  width: 600px; height: 600px;
  background: var(--accent);
  opacity: 0.07;
  top: -15%; left: -10%;
  animation: haloFloat1 12s ease-in-out infinite;
}
.bg-halo-2 {
  width: 500px; height: 500px;
  background: #a855f7;
  opacity: 0.06;
  bottom: -10%; right: -10%;
  animation: haloFloat2 15s ease-in-out infinite;
}
.bg-halo-3 {
  width: 450px; height: 450px;
  background: #ec4899;
  opacity: 0.05;
  top: 30%; left: 40%;
  animation: haloFloat3 10s ease-in-out infinite;
}
.bg-halo-4 {
  width: 550px; height: 550px;
  background: #6366f1;
  opacity: 0.04;
  top: 60%; left: -5%;
  animation: haloFloat4 18s ease-in-out infinite;
}
.bg-halo-5 {
  width: 400px; height: 400px;
  background: var(--accent);
  opacity: 0.05;
  top: -5%; right: 10%;
  animation: haloFloat5 13s ease-in-out infinite;
}
[data-theme="dark"] .bg-halo-1 { opacity: 0.05; }
[data-theme="dark"] .bg-halo-2 { opacity: 0.04; }
[data-theme="dark"] .bg-halo-3 { opacity: 0.03; }
[data-theme="dark"] .bg-halo-4 { opacity: 0.025; }
[data-theme="dark"] .bg-halo-5 { opacity: 0.035; }

@keyframes haloFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(20vw, 15vh) scale(1.1); }
  50% { transform: translate(10vw, 30vh) scale(0.9); }
  75% { transform: translate(-5vw, 20vh) scale(1.05); }
}
@keyframes haloFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-15vw, -12vh) scale(1.15); }
  50% { transform: translate(-25vw, -20vh) scale(0.85); }
  75% { transform: translate(-10vw, -8vh) scale(1.1); }
}
@keyframes haloFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(12vw, -15vh) scale(1.2); }
  50% { transform: translate(-10vw, -10vh) scale(0.8); }
  75% { transform: translate(-18vw, 8vh) scale(1.1); }
}
@keyframes haloFloat4 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(18vw, -10vh) scale(0.9); }
  50% { transform: translate(25vw, 5vh) scale(1.15); }
  75% { transform: translate(8vw, -15vh) scale(1.05); }
}
@keyframes haloFloat5 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-10vw, 18vh) scale(1.1); }
  50% { transform: translate(-20vw, 10vh) scale(0.9); }
  75% { transform: translate(-5vw, 25vh) scale(1.15); }
}

/*  Layout  */
.app { max-width: 960px; margin: 0 auto; padding: 48px 24px 80px; }

/*  Header  */
.app-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.logo { display: flex; align-items: baseline; gap: 10px; }
.logo-name { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; color: var(--text); }
.logo-name span { color: var(--accent); }
.logo-tag { font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0.02em; }
.header-actions { display: flex; gap: 8px; align-items: center; }

/*  Tabs  */
.tabs-nav {
  display: flex; gap: 2px; position: relative;
  background: var(--surface2);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 3px; margin-bottom: 24px;
}
.tab-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border: none; border-radius: 9px; background: transparent;
  font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer;
  transition: color .25s ease; white-space: nowrap; position: relative; z-index: 1;
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active { color: var(--text); }
/* Sliding indicator */
.tab-indicator {
  position: absolute;
  top: 3px; bottom: 3px;
  border-radius: 9px;
  background: var(--surface-solid);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  transition: left .35s cubic-bezier(0.4, 0, 0.2, 1), width .35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}
[data-theme="dark"] .tab-indicator {
  background: rgba(255,255,255,0.1);
  box-shadow: 0 0 12px rgba(0,0,0,0.2);
}
.tab-btn .tab-badge { font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: rgba(0,113,227,.08); color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.tab-btn.active .tab-badge { background: rgba(0,113,227,.1); color: var(--accent); }
.tab-btn .tab-badge.soon { background: rgba(232,116,0,.08); color: var(--warn); }
.tab-btn.active .tab-badge.soon { background: rgba(232,116,0,.1); color: var(--warn); }
/* Panel transition */
.tab-panel { display: none; }
.tab-panel.active {
  display: block;
  animation: tabFadeIn .4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes tabFadeIn {
  0% { opacity: 0; transform: translateX(-8px) scale(0.98); filter: blur(6px); }
  100% { opacity: 1; transform: translateX(0) scale(1); filter: blur(0); }
}

/*  Coming soon  */
.coming-soon {
  background: var(--surface2);
  border: 1px solid var(--border2); border-radius: 20px; padding: 64px 32px; text-align: center; margin: 24px 0;
}
.coming-soon .cs-icon { font-size: 22px; font-weight: 700; width: 52px; height: 52px; line-height: 52px; text-align: center; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--border2); color: var(--muted); margin: 0 auto 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.coming-soon h3 { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 8px; letter-spacing: -0.01em; }
.coming-soon p { font-size: 14px; color: var(--muted); line-height: 1.6; max-width: 420px; margin: 0 auto; }
.coming-soon .cs-features { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
.coming-soon .cs-chip { background: var(--surface-solid); border: 1px solid var(--border2); border-radius: 20px; padding: 6px 14px; font-size: 12px; font-weight: 500; color: var(--text-secondary); }

/*  API keys  */
.api-keys-section { background: var(--surface2); border: 1px solid var(--border); border-radius: 16px; padding: 20px 24px; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.api-keys-section .field { flex: 1; min-width: 200px; }
.api-keys-toggle { font-size: 12px; color: var(--text-secondary); cursor: pointer; background: var(--surface2); border: 1px solid var(--border2); border-radius: 8px; padding: 6px 12px; font-weight: 500; transition: all .2s; }
.api-keys-toggle:hover { border-color: var(--accent); color: var(--accent); }

/*  Sections  */
.section { background: var(--surface2); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin-bottom: 16px; }
.section-title { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; }

/*  Inputs  */
.field { display: flex; flex-direction: column; gap: 6px; position: relative; }
.field label { font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
input[type="text"], input[type="password"], input[type="number"] {
  background: var(--surface-solid); border: 1px solid var(--border2); border-radius: 10px;
  padding: 11px 14px; color: var(--text); font-size: 14px; outline: none; width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  transition: border-color .2s, box-shadow .2s;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,113,227,.12); }
input::placeholder { color: var(--muted); opacity:.6; }
.field-hint { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.field-hint a { color: var(--accent); text-decoration: none; }
.field-hint a:hover { text-decoration: underline; }

/*  Search  */
.search-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.search-bottom { display: flex; gap: 12px; align-items: flex-end; }

/* Info tooltip bubble */
.info-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  cursor: help;
  position: relative;
  flex-shrink: 0;
}
.info-tooltip:hover::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-solid);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text);
  width: 260px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 999;
  pointer-events: none;
  animation: acSlideIn .2s ease;
}
.info-tooltip:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Autocomplete dropdown — animated command-palette style */
.adv-ac-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 999;
  max-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface-solid);
  border: 1px solid var(--border2);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  padding: 4px;
  animation: acSlideIn .25s cubic-bezier(.16,1,.3,1);
  display: none;
}
@keyframes acSlideIn {
  from { opacity: 0; transform: translateY(-8px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.adv-ac-item {
  padding: 9px 12px;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background .15s, transform .15s;
  animation: acItemIn .25s cubic-bezier(.16,1,.3,1) both;
  margin: 1px 0;
}
@keyframes acItemIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.adv-ac-item:nth-child(1) { animation-delay: 0ms; }
.adv-ac-item:nth-child(2) { animation-delay: 30ms; }
.adv-ac-item:nth-child(3) { animation-delay: 60ms; }
.adv-ac-item:nth-child(4) { animation-delay: 90ms; }
.adv-ac-item:nth-child(5) { animation-delay: 120ms; }
.adv-ac-item:nth-child(6) { animation-delay: 150ms; }
.adv-ac-item:nth-child(7) { animation-delay: 180ms; }
.adv-ac-item:nth-child(8) { animation-delay: 210ms; }
.adv-ac-item:nth-child(9) { animation-delay: 240ms; }
.adv-ac-item:nth-child(10) { animation-delay: 270ms; }
.adv-ac-item:hover { background: var(--surface2); }
.adv-ac-item:active { transform: scale(.98); }
.adv-ac-item strong { color: var(--accent); font-weight: 700; }
.adv-ac-item .ac-desc { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adv-ac-item .ac-badge { font-size: 9px; color: var(--muted); background: var(--surface2); padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
[data-theme="dark"] .adv-ac-list { box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.2); }

/* Recent searches */
.recent-searches {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.recent-label { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; flex-shrink: 0; }
.recent-list { display: flex; gap: 6px; flex-wrap: wrap; }
.recent-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface-solid);
  border: 1px solid var(--border2);
  border-radius: 20px;
  cursor: pointer;
  transition: border-color .2s, color .2s;
  white-space: nowrap;
}
.recent-chip:hover { border-color: var(--accent); color: var(--accent); }
.recent-chip-x {
  font-size: 9px;
  color: var(--muted);
  cursor: pointer;
  margin-left: 2px;
  opacity: 0;
  transition: opacity .2s;
}
.recent-chip:hover .recent-chip-x { opacity: 1; }
.recent-chip-x:hover { color: var(--danger); }

/* History stats */
.history-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.stat-card {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 100px;
}
.stat-value { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.stat-label { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.limit-field { display: flex; flex-direction: column; gap: 6px; }

/* Limit pills */
.limit-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.limit-pill {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border2);
  border-radius: 8px;
  background: var(--surface-solid);
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
}
.limit-pill:hover { border-color: var(--accent); color: var(--accent); }
.limit-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.limit-field label { font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.limit-row { display: flex; align-items: center; gap: 8px; }
.limit-row input[type="number"] { width: 70px; text-align: center; }
.limit-unit { font-size: 12px; color: var(--muted); white-space: nowrap; }

/*  Dedup  */
.dedup-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--border); margin-top: 12px; }
.dedup-label { font-size: 11px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.pill-group { display: flex; gap: 6px; }
.radio-pill { display: flex; align-items: center; gap: 5px; cursor: pointer; background: var(--surface-solid); border: 1px solid var(--border2); border-radius: 20px; padding: 5px 12px; transition: all .2s; user-select: none; }
.radio-pill input { display: none; }
.radio-pill span { font-size: 12px; font-weight: 500; color: var(--muted); }
.radio-pill:has(input:checked) { border-color: var(--accent); background: rgba(0,113,227,.06); }
.radio-pill:has(input:checked) span { color: var(--accent); }
#historyCountBadge { font-size: 11px; color: var(--muted); margin-left: 4px; }

/*  Buttons  */
.btn { display: inline-flex; align-items: center; gap: 7px; border: none; border-radius: 10px; padding: 11px 20px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all .2s; white-space: nowrap; font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity:.3; cursor:not-allowed; transform:none; }
.btn-stop { background: transparent; border: 1px solid var(--danger); color: var(--danger); display: none; }
.btn-stop:hover { background: rgba(255,59,48,.04); }
.btn-ghost { background: transparent; border: 1px solid var(--border2); color: var(--text-secondary); font-size: 13px; padding: 8px 14px; }
.btn-ghost:hover { border-color: var(--text-secondary); color: var(--text); }
.btn-accent { background: var(--accent); color: #fff; font-size: 13px; padding: 8px 16px; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-accent:disabled { opacity:.3; cursor:not-allowed; }
.btn-danger-ghost { background: transparent; border: 1px solid var(--danger); color: var(--danger); font-size: 12px; padding: 7px 13px; }

/*  Progress  */
.progress-wrap { margin-top: 16px; display: none; }
.progress-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.progress-label { font-size: 12px; color: var(--muted); }
.progress-count { font-size: 14px; font-weight: 600; color: var(--accent); }
.progress-track { height: 3px; background: var(--border2); border-radius: 100px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 100px; transition: width .4s ease; width: 0%; }

/*  Zones  */
.zones-wrap { margin-top: 14px; display: none; }
.zones-label { font-size: 11px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.zones-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 72px; overflow-y: auto; }
.zone-chip { background: var(--surface-solid); border: 1px solid var(--border2); border-radius: 20px; padding: 3px 10px; font-size: 11px; color: var(--muted); transition: all .2s; }
.zone-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.zone-chip.done { background: rgba(36,138,61,.06); border-color: rgba(36,138,61,.25); color: var(--success); }

/*  Alert  */
.alert { display: none; margin-top: 12px; padding: 11px 14px; border-radius: 10px; font-size: 12px; line-height: 1.6; }
.alert.show { display: block; }
.alert.error { background: rgba(255,59,48,.05); border: 1px solid rgba(255,59,48,.15); color: #c0392b; }
.alert.warn { background: rgba(232,116,0,.05); border: 1px solid rgba(232,116,0,.15); color: #9a6000; }
.alert.info { background: rgba(0,113,227,.05); border: 1px solid rgba(0,113,227,.15); color: #0055c7; }

/*  Status  */
.status-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; flex-wrap: wrap; min-height: 32px; }
.status-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status-msg { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.status-msg.loading { color: var(--accent); }
.status-msg.success { color: var(--success); }
.status-msg.error { color: var(--danger); }
.spinner { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--accent); width: 16px; height: 16px; vertical-align: middle; }
.spinner svg { display: block; }
@keyframes spinnerBars { 0% { y: 1px; height: 14px; } 93.75% { y: 4px; height: 8px; opacity: 0.2; } }
.spinner svg rect { animation: spinnerBars .8s linear infinite; animation-delay: -.8s; }
.spinner svg rect:nth-child(2) { animation-delay: -.65s; }
.spinner svg rect:nth-child(3) { animation-delay: -.5s; }
.dedup-badge { background: rgba(232,116,0,.06); color: var(--warn); border: 1px solid rgba(232,116,0,.15); border-radius: 20px; font-size: 11px; font-weight: 600; padding: 2px 9px; display: none; }
.bar-actions { display: flex; gap: 8px; align-items: center; }

/*  Autocomplete  */
#acList, #acNaf { position: fixed; display: none; background: var(--surface-solid); border: 1px solid var(--border2); border-radius: 12px; z-index: 99999; box-shadow: 0 4px 24px rgba(0,0,0,0.1), 0 1px 4px rgba(0,0,0,0.06); max-height: 260px; overflow-y: auto; }
.ac-item { padding: 9px 14px; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 10px; transition: background .15s, transform .15s; user-select: none; border-radius: 8px; margin: 1px 4px; animation: acItemIn .25s cubic-bezier(.16,1,.3,1) both; }
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.active { background: var(--surface2); }
.ac-item:active { transform: scale(.98); }
.ac-main { font-weight: 600; font-size: 13px; display: block; color: var(--text); }
.ac-sub { font-size: 11px; color: var(--muted); display: block; }
.ac-type { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 4px; margin-left: auto; flex-shrink: 0; white-space: nowrap; }
.ac-type.region { background: rgba(0,113,227,.08); color: var(--blue); }
.ac-type.dept { background: rgba(175,82,222,.08); color: #7b2fa3; }
.ac-type.ville { background: rgba(36,138,61,.08); color: var(--success); }
.ac-type.naf { background: rgba(232,116,0,.08); color: var(--warn); }
.ac-type.conv { background: rgba(255,59,48,.06); color: var(--danger); }

/*  History  */
.history-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.history-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.history-search-input { width: 200px; padding: 8px 12px; font-size: 12px; }
select.filter-select { background: var(--surface-solid); border: 1px solid var(--border2); border-radius: 10px; padding: 8px 10px; color: var(--text); font-size: 12px; outline: none; cursor: pointer; font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif; }

/*  Tables  */
.table-wrap { background: var(--surface-solid); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--surface2); border-bottom: 1px solid var(--border2); }
th { padding: 11px 14px; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(0,0,0,0.015); }
tbody tr.seen { opacity: .35; }
tbody tr.seen .td-name { text-decoration: line-through; }
td { padding: 11px 14px; font-size: 13px; color: var(--text); vertical-align: middle; }
.td-num { font-size: 11px; color: var(--muted); width: 32px; text-align: center; }
.td-name { font-weight: 600; font-size: 14px; }
.td-phone { color: var(--accent); font-weight: 500; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.td-copyable { cursor: pointer; position: relative; transition: color .2s; }
.td-copyable:hover { color: var(--accent-dark); }
.td-copyable.copied { color: var(--success); }
.td-copyable.copied::after {
  content: 'Copi\00e9';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 600;
  color: var(--success);
  background: var(--surface-solid);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border2);
  animation: copiedFade 1.2s ease forwards;
  pointer-events: none;
  white-space: nowrap;
}
@keyframes copiedFade {
  0% { opacity: 1; transform: translateX(-50%) translateY(0); }
  70% { opacity: 1; transform: translateX(-50%) translateY(-4px); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
}
.th-sort { cursor: pointer; user-select: none; white-space: nowrap; transition: color .2s; }
.th-sort:hover { color: var(--accent); }
.td-rating { display: flex; align-items: center; gap: 4px; }
.stars { color: #e87400; font-size: 11px; }
.td-url a { color: var(--muted); text-decoration: none; font-size: 12px; }
.td-url a:hover { color: var(--accent); }
.seen-badge { display: inline-block; background: rgba(232,116,0,.06); color: var(--warn); border: 1px solid rgba(232,116,0,.15); border-radius: 4px; font-size: 9px; font-weight: 700; padding: 1px 5px; margin-left: 6px; vertical-align: middle; text-transform: uppercase; letter-spacing: .04em; }
.no-data { padding: 56px 24px; text-align: center; color: var(--muted); }
.no-data .icon { font-size: 24px; margin-bottom: 12px; opacity: .3; }
.no-data p { font-size: 13px; line-height: 1.8; }

/*  Status/note inline  */
.status-select { background: var(--surface-solid); border: 1px solid var(--border2); border-radius: 7px; padding: 4px 8px; color: var(--text); font-size: 11px; outline: none; cursor: pointer; width: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif; }
.status-select.s-contact { border-color: var(--blue); color: var(--blue); }
.status-select.s-contacte { border-color: var(--success); color: var(--success); }
.status-select.s-refus { border-color: var(--danger); color: var(--danger); }
.note-input { background: transparent; border: none; border-bottom: 1px solid var(--border2); color: var(--text-secondary); font-size: 11px; outline: none; width: 100%; padding: 2px 4px; font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif; }
.note-input:focus { border-bottom-color: var(--accent); color: var(--text); }

/*  Debug  */
.debug-wrap { margin-top: 16px; }
.debug-toggle { background: none; border: 1px solid var(--border2); color: var(--muted); border-radius: 7px; padding: 5px 12px; font-size: 11px; cursor: pointer; font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif; }
.debug-toggle:hover { border-color: var(--text-secondary); color: var(--text-secondary); }
#debugLog { display: none; margin-top: 8px; background: #1d1d1f; border: 1px solid var(--border2); border-radius: 10px; padding: 12px; font-size: 11px; color: #8ab4a0; line-height: 1.7; max-height: 160px; overflow-y: auto; font-family: 'SF Mono', 'Menlo', 'Monaco', 'Courier New', monospace; white-space: pre-wrap; }

/*  Conso cards  */
.conso-card {
  background: var(--surface-solid);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.conso-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.conso-value { font-size: 28px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.conso-sub { font-size: 11px; color: var(--muted); }

/*  Splash — combined text roll + kinetic dots  */
.splash {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 100000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.splash.hide { display: none; }

/* Text roll */
.splash-text {
  display: flex;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}
.splash-text .letter {
  display: inline-block;
  perspective: 800px;
  position: relative;
}
.splash-text .letter-inner {
  display: inline-block;
  transform-style: preserve-3d;
  animation: textRollIn .5s ease forwards;
  opacity: 0;
  transform: rotateX(-90deg);
  transform-origin: 50% 100%;
}
.splash-text .letter-inner.accent { color: var(--accent); }
.splash-text .letter-inner.roll-out {
  animation: textRollOut .4s ease forwards;
  opacity: 1;
  transform: rotateX(0deg);
}
@keyframes textRollIn {
  0% { opacity: 0; transform: rotateX(-90deg); }
  100% { opacity: 1; transform: rotateX(0deg); }
}
@keyframes textRollOut {
  0% { opacity: 1; transform: rotateX(0deg); }
  100% { opacity: 0; transform: rotateX(90deg); }
}

/* Kinetic dots */
.splash-dots {
  display: flex;
  gap: 16px;
  opacity: 0;
  transition: opacity .5s ease;
}
.splash-dots.visible { opacity: 1; }
.splash-dot-col {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 60px;
  width: 20px;
}
.splash-dot-bounce {
  position: relative;
  width: 14px; height: 14px;
  z-index: 10;
  will-change: transform;
  animation: gravityBounce 1.4s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}
.splash-dot-ball {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: linear-gradient(to bottom, var(--accent), color-mix(in srgb, var(--accent) 60%, #000));
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 50%, transparent);
  will-change: transform;
  animation: rubberMorph 1.4s linear infinite;
}
.splash-dot-highlight {
  position: absolute; top: 3px; left: 3px;
  width: 4px; height: 4px;
  background: rgba(255,255,255,0.5);
  border-radius: 50%;
  filter: blur(0.5px);
}
.splash-dot-ripple {
  position: absolute; bottom: 0;
  width: 28px; height: 8px;
  border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 100%;
  opacity: 0;
  animation: rippleExpand 1.4s linear infinite;
}
.splash-dot-shadow {
  position: absolute; bottom: -3px;
  width: 14px; height: 4px;
  border-radius: 100%;
  background: color-mix(in srgb, var(--accent) 35%, transparent);
  filter: blur(3px);
  animation: shadowBreathe 1.4s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}
@keyframes gravityBounce {
  0% { transform: translateY(0); animation-timing-function: cubic-bezier(0.33, 1, 0.68, 1); }
  50% { transform: translateY(-30px); animation-timing-function: cubic-bezier(0.32, 0, 0.67, 0); }
  100% { transform: translateY(0); }
}
@keyframes rubberMorph {
  0% { transform: scale(1.4, 0.6); }
  5% { transform: scale(0.9, 1.1); }
  15%, 50% { transform: scale(1, 1); }
  85% { transform: scale(0.9, 1.1); }
  100% { transform: scale(1.4, 0.6); }
}
@keyframes shadowBreathe {
  0%, 100% { transform: scale(1.4); opacity: 0.5; }
  50% { transform: scale(0.4); opacity: 0.1; }
}
@keyframes rippleExpand {
  0% { transform: scale(0.5); opacity: 0; border-width: 2px; }
  5% { opacity: 0.6; }
  30% { transform: scale(1.5); opacity: 0; border-width: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* Credit */
.splash-credit {
  font-size: 13px;
  font-style: italic;
  font-weight: 400;
  color: var(--muted);
  opacity: 0;
  transition: opacity .5s ease;
  white-space: nowrap;
}
.splash-credit.visible { opacity: 1; }
.splash-credit-name { color: var(--accent); font-weight: 600; }

/* App hidden until splash done */
.app { opacity: 1; transform: none; }
.app.visible { opacity: 1; transform: translateY(0); }

/*  Colorful button  */
.btn-colorful {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 14px;
  border: none;
  border-radius: 8px;
  background: #f5f5f7;
  cursor: pointer;
  overflow: hidden;
  transition: transform .2s;
  white-space: nowrap;
  border: 1px solid var(--border2);
}
.btn-colorful:hover { transform: translateY(-1px); }
.btn-colorful:active { transform: translateY(0); }
.btn-colorful:disabled { opacity: .3; cursor: not-allowed; transform: none; }
.btn-colorful-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899, #a855f7, #6366f1);
  background-size: 200% 100%;
  opacity: 0.35;
  filter: blur(2px);
  transition: opacity .4s;
  animation: colorfulShift 3s linear infinite;
}
.btn-colorful:hover .btn-colorful-glow { opacity: 0.7; }
.btn-colorful:disabled .btn-colorful-glow { animation: none; opacity: 0.15; }
@keyframes colorfulShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.btn-colorful-text {
  position: relative;
  display: flex;
  align-items: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #1d1d1f;
  z-index: 1;
}

/*  Shatter / Pop effect  */
.shatter-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  align-self: flex-end;
  height: 38px;
}
.shatter-wrap .btn-colorful {
  transition: transform .15s ease, opacity .15s ease;
}
.shatter-wrap .btn-colorful.pop-out {
  transform: scale(0);
  opacity: 0;
}
.shatter-wrap .btn-colorful.pop-in {
  animation: popReturn .35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes popReturn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.shard {
  position: absolute;
  pointer-events: none;
  z-index: 10;
  will-change: transform, opacity;
}
.shard-piece {
  width: 100%;
  height: 100%;
  border-radius: 2px;
  animation: shardFly .7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
@keyframes shardFly {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: var(--shard-end) scale(0.3); opacity: 0; }
}
.shatter-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9;
  animation: ringExpand .5s ease-out forwards;
}
@keyframes ringExpand {
  0% { width: 0; height: 0; opacity: 0.8; border-width: 2px; }
  100% { width: 100px; height: 100px; opacity: 0; border-width: 0; }
}

/*  Theme toggle slider  */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 56px;
  height: 28px;
  padding: 3px;
  border-radius: 14px;
  cursor: pointer;
  transition: all .3s ease;
  background: var(--surface2);
  border: 1px solid var(--border2);
  position: relative;
  flex-shrink: 0;
}
.theme-toggle-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  transition: transform .3s ease, background .3s ease;
  background: var(--surface-solid);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  z-index: 1;
}
.theme-toggle-bg-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  position: absolute;
  right: 3px;
  top: 3px;
  z-index: 0;
}
[data-theme="dark"] .theme-toggle {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
}
[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(28px);
  background: rgba(255,255,255,0.15);
}
[data-theme="dark"] .theme-toggle-bg-icon {
  right: auto;
  left: 3px;
}
.theme-icon { color: var(--muted); }
[data-theme="dark"] .theme-toggle-thumb .theme-icon { color: #ffffff; }

/*  Color Picker  */
.cp-container {
  width: 240px;
  background: var(--surface-solid);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cp-gradient {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 8px;
  cursor: crosshair;
  overflow: hidden;
}
.cp-gradient-white {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, #ffffff, transparent);
  border-radius: 8px;
}
.cp-gradient-black {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, #000000, transparent);
  border-radius: 8px;
}
.cp-cursor {
  position: absolute;
  width: 14px; height: 14px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.2);
  transform: translate(-50%, -50%);
  pointer-events: none;
  top: 0; left: 100%;
}
.cp-hue-wrap { display: flex; flex-direction: column; gap: 4px; }
.cp-label { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cp-hue-track {
  position: relative;
  height: 14px;
  border-radius: 7px;
  background: linear-gradient(90deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
  cursor: pointer;
}
.cp-hue-thumb {
  position: absolute;
  top: -1px;
  width: 16px; height: 16px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.15);
  transform: translateX(-50%);
  pointer-events: none;
  left: 0;
}
.cp-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cp-preview {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  flex-shrink: 0;
}
.cp-hex-field {
  display: flex;
  align-items: center;
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 0 8px;
  height: 32px;
}
.cp-hash { font-size: 12px; color: var(--muted); font-weight: 600; margin-right: 2px; }
.cp-hex-field input {
  background: transparent; border: none; outline: none;
  font-size: 12px; font-weight: 600; color: var(--text);
  font-family: 'SF Mono', 'Menlo', monospace;
  width: 100%; padding: 0;
  text-transform: uppercase;
}
.cp-reset {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 0 10px;
  height: 32px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
}
.cp-reset:hover { color: var(--text); border-color: var(--text-secondary); }
.cp-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.cp-preset {
  width: 20px; height: 20px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .15s, border-color .15s;
}
.cp-preset:hover { transform: scale(1.2); border-color: var(--text); }

/*  Dark mode overrides  */
[data-theme="dark"] .tab-btn.active { background: rgba(255,255,255,0.1); box-shadow: none; }
[data-theme="dark"] .conso-card { background: rgba(255,255,255,0.05); }
[data-theme="dark"] #acList, [data-theme="dark"] #acNaf { box-shadow: 0 8px 40px rgba(0,0,0,.5); }
[data-theme="dark"] .ac-item:hover, [data-theme="dark"] .ac-item.active { background: rgba(255,255,255,0.05); }
[data-theme="dark"] thead tr { background: rgba(255,255,255,0.03); }
[data-theme="dark"] tbody tr:hover { background: rgba(255,255,255,0.03); }
[data-theme="dark"] .coming-soon .cs-icon { background: rgba(255,255,255,0.05); box-shadow: none; }
[data-theme="dark"] input[type="file"] { background: rgba(255,255,255,0.05) !important; }
[data-theme="dark"] .cp-container { box-shadow: 0 8px 40px rgba(0,0,0,.5); }
[data-theme="dark"] .splash { background: #0a0a0a; }

@media (max-width: 640px) {
  .search-row { grid-template-columns: 1fr; }
  .app-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .tabs-nav { flex-direction: column; }
  th:nth-child(6), td:nth-child(6), th:nth-child(7), td:nth-child(7), th:nth-child(8), td:nth-child(8), th:nth-child(9), td:nth-child(9) { display: none; }
}

/* ═══ LOGIN SCREEN ═══ */
.login-screen {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.login-card {
  width: 100%; max-width: 380px; padding: 40px 32px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: 0 16px 48px rgba(0,0,0,0.1);
}
.login-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.login-card p { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.login-card label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; margin-top: 16px; }
.login-card input { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border2); background: var(--surface-solid); color: var(--text); font-size: 14px; box-sizing: border-box; }
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,113,227,0.1); }
.login-btn { width: 100%; margin-top: 24px; padding: 13px; border: none; border-radius: 12px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; transition: opacity .15s; }
.login-btn:hover { opacity: .9; }
.login-btn:disabled { opacity: .5; cursor: not-allowed; }
.login-error { margin-top: 12px; padding: 10px 14px; border-radius: 8px; background: rgba(255,59,48,.06); border: 1px solid rgba(255,59,48,.15); color: #c0392b; font-size: 12px; display: none; }

@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.login-card.shake { animation: loginShake .4s ease; }

/* ═══ ADMIN PANEL ═══ */
.admin-panel { padding: 20px 0; }
.admin-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.admin-table th { text-align: left; padding: 8px 10px; font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; border-bottom: 1px solid var(--border2); }
.admin-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:hover { background: var(--surface2); }
.admin-badge { font-size: 9px; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.admin-badge.admin { background: rgba(0,113,227,.1); color: var(--accent); }
.admin-badge.user { background: var(--surface2); color: var(--muted); }
.admin-badge.disabled { background: rgba(255,59,48,.1); color: #c0392b; }
.admin-actions button { font-size: 10px; padding: 4px 8px; margin-right: 4px; cursor: pointer; border-radius: 4px; border: 1px solid var(--border2); background: var(--surface-solid); color: var(--text); transition: all .15s; }
.admin-actions button:hover { border-color: var(--accent); color: var(--accent); }

/* User bar */
.user-bar { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.user-bar .user-name { font-weight: 600; color: var(--text); }
.user-bar .user-quota { font-size: 10px; background: var(--surface2); padding: 2px 8px; border-radius: 10px; }

/* Avatar & Profile Menu */
.avatar-wrap { position: relative; }
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.avatar:hover { transform: scale(1.08); box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
.avatar span { color: #fff; font-weight: 700; font-size: 14px; user-select: none; }
.profile-menu {
  display: none;
  position: absolute;
  right: 0; top: calc(100% + 8px);
  width: 280px;
  background: var(--surface-solid);
  border: 1px solid var(--border2);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.12), 0 4px 16px rgba(0,0,0,0.06);
  z-index: 99998;
  overflow: hidden;
  animation: acSlideIn .2s ease;
}
.profile-menu.open { display: block; }
.profile-menu-header { padding: 20px 20px 12px; }
.profile-menu-name { font-size: 15px; font-weight: 700; color: var(--text); }
.profile-menu-email { font-size: 11px; color: var(--muted); margin-top: 2px; }
.profile-menu-divider { height: 1px; background: var(--border); margin: 0 16px; }
.profile-menu-section { padding: 14px 20px; }
.profile-menu-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 8px; }
.profile-menu-quota { display: flex; align-items: center; gap: 10px; }
.profile-quota-bar { flex: 1; height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; }
.profile-quota-fill { height: 100%; border-radius: 3px; background: var(--accent); transition: width .3s ease; }
.profile-quota-text { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; }
.profile-menu-item {
  display: block; width: 100%;
  padding: 12px 20px;
  border: none; background: none;
  text-align: left;
  font-size: 13px; color: var(--text);
  cursor: pointer;
  transition: background .1s;
}
.profile-menu-item:hover { background: var(--surface2); }
.profile-menu-danger { color: var(--danger); }
.profile-menu-danger:hover { background: rgba(255,59,48,.06); }
.profile-search-list { max-height: 240px; overflow-y: auto; }
.profile-search-item { padding: 8px 0; border-bottom: 1px solid var(--border); }
.profile-search-item:last-child { border-bottom: none; }
.profile-search-query { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-search-meta { font-size: 10px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.profile-search-tab { font-size: 9px; font-weight: 600; padding: 1px 5px; border-radius: 3px; background: var(--surface2); color: var(--muted); }

/* Modal overlay */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  z-index: 99990;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; animation: modalFadeIn .2s ease; }
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  width: 90%; max-width: 520px; max-height: 80vh;
  background: var(--surface-solid);
  border: 1px solid var(--border2);
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  display: flex; flex-direction: column;
  animation: modalSlideIn .25s cubic-bezier(.16,1,.3,1);
}
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(20px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 700; color: var(--text); margin: 0; }
.modal-close {
  width: 32px; height: 32px;
  border: none; background: var(--surface2);
  border-radius: 50%;
  font-size: 18px; color: var(--muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.modal-close:hover { background: var(--border2); color: var(--text); }
.modal-body {
  padding: 16px 24px 24px;
  overflow-y: auto;
  flex: 1;
}
.sh-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.sh-item:last-child { border-bottom: none; }
.sh-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 10px;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--muted);
}
.sh-icon.lite { background: rgba(0,113,227,.08); color: var(--accent); }
.sh-icon.advanced { background: rgba(175,82,222,.08); color: #af52de; }
.sh-content { flex: 1; min-width: 0; }
.sh-query { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-location { font-size: 12px; color: var(--muted); margin-top: 1px; }
.sh-meta { text-align: right; flex-shrink: 0; }
.sh-results { font-size: 13px; font-weight: 700; color: var(--text); }
.sh-date { font-size: 10px; color: var(--muted); margin-top: 2px; }
.sh-empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 13px; }

/* ─── Spinner animation for share button ─── */
@keyframes spin360 {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
