/* ──────────────────────────────────────────────────────────────────────────────
   RD SEO Tools — Light theme matching Programatic SEO design system
   ────────────────────────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #fdfcfb;
  --bg-surface:#ffffff;
  --bg-card:   #ffffff;
  --bg-hover:  #f3f2ef;
  --border:    #e5e3db;
  --border-lt: #d6d4ce;
  --txt:       #2d2d2a;
  --txt-2:     #63635e;
  --txt-3:     #9a9993;
  --accent:    #da7756;
  --accent-bg: rgba(218, 119, 86, 0.08);
  --green:     #108050;
  --green-bg:  rgba(16, 128, 80, 0.08);
  --red:       #c54040;
  --red-bg:    rgba(197, 64, 64, 0.08);
  --blue:      #3b71ca;
  --blue-bg:   rgba(59, 113, 202, 0.08);
  --yellow:    #b36b00;
  --yellow-bg: rgba(179, 107, 0, 0.08);
  --head:      'Syne', sans-serif;
  --mono:      'JetBrains Mono', monospace;
  --body:      'Plus Jakarta Sans', sans-serif;
  --r:         8px;
  --r-sm:      4px;
  --radius:    8px;
  --radius-sm: 4px;
  --shadow:    0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--txt);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

html, body { height: 100%; }

/* ── Hide dark-mode decorations ────────────────────────────────────────────── */
.grid-3d,
.bg-blob, .blob-1, .blob-2, .blob-3,
.orbit-scene, .orbit-ring,
.orbit-ring-1, .orbit-ring-2, .orbit-ring-3, .orbit-ring-4,
.node, .node-1, .node-2, .node-3, .node-4 {
  display: none !important;
}

.hidden { display: none !important; }

/* ── Sidebar Layout ───────────────────────────────────────────────────────── */
.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 252px;
  min-width: 252px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  padding: 1.125rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.sidebar-logo img { height: 2rem; width: auto; }

.logo-text {
  font-family: var(--head);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: -0.01em;
  color: var(--txt);
}

.logo-text em { font-style: normal; color: var(--accent); }

.sidebar-nav {
  flex: 1;
  padding: 0.875rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--txt-3);
  font-weight: 600;
  padding: 0.625rem 0.625rem 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--r-sm);
  color: var(--txt-2);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 120ms;
}
.nav-link::before { display: none; }
.nav-link:hover { color: var(--txt); background: var(--bg-hover); transform: none; box-shadow: none; }
.nav-link.active { color: var(--accent); background: var(--accent-bg); }
.nav-link svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .7; }
.nav-link:hover svg, .nav-link.active svg { opacity: 1; }
.nav-icon { font-size: 1rem; flex-shrink: 0; }

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

.sign-out-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--r-sm);
  color: var(--txt-2);
  font-size: 0.875rem;
  font-weight: 500;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--body);
  transition: all 120ms;
}
.sign-out-btn:hover { color: var(--red); background: var(--red-bg); }

/* ── Main content area ────────────────────────────────────────────────────── */
.main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  padding: 1rem 1.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.page-title {
  font-family: var(--head);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  color: var(--txt);
}

.page {
  padding: 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeUp 180ms ease both;
}

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

/* Legacy aliases — keep card/form centred on index page */
.app-shell { display: contents; }
.header, .nav-bar { display: none; }

/* ── Card ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 28px 32px;
  box-shadow: var(--shadow);
  backdrop-filter: none;
  transform-style: flat;
  transition: border-color 120ms;
}

.card:hover { border-color: var(--border-lt); }

@keyframes popIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Form Styling ─────────────────────────────────────────────────────────── */
.card-header { margin-bottom: 24px; transform: none; }

.card-title {
  font-family: var(--head);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--txt);
  margin-bottom: 6px;
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
}

.card-subtitle { color: var(--txt-2); font-size: 0.875rem; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
  transform: none;
}

.input-group { display: flex; flex-direction: column; gap: 6px; }

.input-group label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--txt-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 12px;
  font-size: 1rem;
  pointer-events: none;
  z-index: 1;
  filter: none;
  opacity: 0.6;
}

.input-wrapper input,
.input-wrapper select {
  width: 100%;
  padding: 9px 12px 9px 38px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--txt);
  font-family: var(--body);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 120ms, box-shadow 120ms;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  -webkit-appearance: none;
}

.input-wrapper select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239a9993' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.input-wrapper input::placeholder { color: var(--txt-3); }

.input-wrapper input:focus,
.input-wrapper select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
  transform: none;
}

/* ── Submit Button ────────────────────────────────────────────────────────── */
.btn-submit {
  width: 100%;
  padding: 12px 24px;
  background: var(--accent);
  border: none;
  border-radius: var(--r-sm);
  color: #fff;
  font-family: var(--body);
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  letter-spacing: 0.01em;
  transition: all 120ms;
  box-shadow: 0 3px 10px rgba(218,119,86,0.3);
  transform: none;
}

.btn-submit:hover {
  background: #c9684a;
  box-shadow: 0 4px 14px rgba(218,119,86,0.4);
}

.btn-submit:active { transform: scale(0.99); }

.btn-submit:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

.btn-icon { font-size: 1rem; transition: transform 120ms; }
.btn-submit:hover .btn-icon { transform: translateX(3px); }

/* ── Status Card ──────────────────────────────────────────────────────────── */
.status-card { text-align: center; padding: 56px 32px; }
.status-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; position: relative; }

.pulse-ring {
  position: absolute;
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: pulseRing 2s ease infinite;
  opacity: 0;
}
@keyframes pulseRing {
  0%   { transform: scale(0.7); opacity: 0.5; }
  100% { transform: scale(2); opacity: 0; }
}

.spinner {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
  margin-bottom: 4px;
  filter: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status-title { font-family: var(--head); font-size: 1.25rem; font-weight: 700; color: var(--txt); }
.status-sub { color: var(--txt-2); font-size: 0.9rem; max-width: 400px; }

.progress-bar-wrap {
  width: 100%; max-width: 400px;
  height: 5px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #e8920a);
  border-radius: 999px;
  transition: width 0.5s ease;
  box-shadow: none;
}

.progress-bar::after { display: none; }

.status-check { font-size: 0.8125rem; color: var(--txt-3); font-family: var(--mono); }

.btn-cancel {
  margin-top: 8px;
  background: var(--red-bg);
  border: 1px solid rgba(197, 64, 64, 0.25);
  border-radius: var(--r-sm);
  color: var(--red);
  font-family: var(--body);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 8px 20px;
  cursor: pointer;
  transition: all 120ms;
}
.btn-cancel:hover { background: rgba(197,64,64,0.14); border-color: var(--red); transform: none; box-shadow: none; }

/* ── Results Card ─────────────────────────────────────────────────────────── */
.results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  transform: none;
}

.results-title {
  font-family: var(--head);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--txt);
}

.results-meta { color: var(--txt-2); font-size: 0.8125rem; font-family: var(--mono); margin-top: 4px; }

.btn-verify {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--txt-2);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 120ms;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.btn-verify:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); transform: none; box-shadow: none; }

/* ── Stats Row ────────────────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
  transform: none;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 120ms;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 60%);
}

.stat-card:hover { border-color: var(--border-lt); transform: none; box-shadow: var(--shadow); }

.stat-card.highlight {
  background: var(--accent-bg);
  border-color: rgba(218, 119, 86, 0.3);
}
.stat-card.highlight::before { background: linear-gradient(90deg, var(--accent), transparent); }

.stat-label { font-size: 0.625rem; font-weight: 700; color: var(--txt-3); text-transform: uppercase; letter-spacing: 0.1em; }
.stat-value { font-family: var(--head); font-size: 2rem; font-weight: 800; line-height: 1.1; color: var(--txt); text-shadow: none; }
.stat-card.highlight .stat-value { color: var(--accent); text-shadow: none; }
.stat-hint { font-size: 0.75rem; color: var(--txt-3); font-weight: 500; }

/* Variant classes used on gmb/other pages */
.stat-value.organic { color: var(--green); }
.stat-value.maps    { color: var(--blue); }
.stat-value.neutral { color: var(--txt); }

/* ── Ranking Items ────────────────────────────────────────────────────────── */
.ranking-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 8px;
  animation: popIn 0.3s ease both;
  transition: all 120ms;
}

.ranking-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-lt);
  transform: none;
  box-shadow: var(--shadow);
}

.ranking-badge {
  min-width: 44px; height: 44px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: #fff;
  font-family: var(--head);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: none;
}

.ranking-body { flex: 1; min-width: 0; }

.ranking-url {
  color: var(--accent);
  font-size: 0.8125rem;
  font-family: var(--mono);
  font-weight: 500;
  word-break: break-all;
  text-decoration: none;
}
.ranking-url:hover { text-decoration: underline; color: #c9684a; }
.ranking-title { font-size: 0.9375rem; font-weight: 600; margin-top: 4px; color: var(--txt); }
.ranking-desc  { font-size: 0.8125rem; color: var(--txt-2); margin-top: 4px; line-height: 1.5; }

.ranking-organic {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--green);
  background: var(--green-bg);
  border: 1px solid rgba(16, 128, 80, 0.2);
  border-radius: 999px;
  padding: 4px 12px;
  white-space: nowrap;
  align-self: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--mono);
  box-shadow: none;
}

/* ── Not Found ────────────────────────────────────────────────────────────── */
.not-found {
  text-align: center;
  padding: 40px;
  background: var(--bg-hover);
  border: 1px dashed var(--border);
  border-radius: var(--r);
  color: var(--txt-2);
}
.not-found-icon { font-size: 2.5rem; display: block; margin-bottom: 12px; opacity: 0.5; }
.not-found p { margin-bottom: 6px; font-size: 1rem; }
.not-found-hint { font-size: 0.875rem; color: var(--txt-3); }

/* ── Reset Button ─────────────────────────────────────────────────────────── */
.btn-reset {
  margin-top: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--txt-2);
  font-family: var(--body);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 9px 20px;
  cursor: pointer;
  transition: all 120ms;
}
.btn-reset:hover { border-color: var(--border-lt); color: var(--txt); background: var(--bg-hover); transform: none; box-shadow: none; }

/* ── Error Card ───────────────────────────────────────────────────────────── */
.error-card { text-align: center; padding: 48px 32px; border-color: rgba(197,64,64,0.25); background: var(--red-bg); }
.error-icon  { font-size: 2.5rem; display: block; margin-bottom: 16px; filter: none; }
.error-title { font-family: var(--head); font-size: 1.25rem; font-weight: 700; margin-bottom: 10px; color: var(--txt); }
.error-msg   { color: var(--red); font-size: 0.9375rem; margin-bottom: 20px; max-width: 480px; margin-inline: auto; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer {
  margin-top: 40px;
  font-size: 0.8125rem;
  color: var(--txt-3);
  text-align: center;
}
.footer a { color: var(--accent); font-weight: 600; }
.footer a:hover { text-decoration: underline; text-shadow: none; }

/* ── Autocomplete ─────────────────────────────────────────────────────────── */
.autocomplete-wrap { position: relative; }

.input-clear {
  position: absolute;
  right: 10px;
  font-size: 0.75rem;
  color: var(--txt-3);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all 120ms;
  z-index: 2;
  background: transparent;
}
.input-clear:hover { color: var(--red); background: var(--red-bg); box-shadow: none; }

.autocomplete-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  z-index: 100;
  max-height: 260px;
  overflow-y: auto;
  list-style: none;
  padding: 4px;
  animation: dropIn 0.15s ease;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.autocomplete-list::-webkit-scrollbar { width: 4px; }
.autocomplete-list::-webkit-scrollbar-track { background: transparent; }
.autocomplete-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.ac-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 100ms;
}
.ac-item:hover { background: var(--bg-hover); transform: none; }

.ac-badge {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid rgba(218,119,86,0.2);
  border-radius: var(--r-sm);
  padding: 2px 7px;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: none;
  font-family: var(--mono);
}

.ac-text {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ac-flag {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--txt-3);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 2px 6px;
  flex-shrink: 0;
  font-family: var(--mono);
}

.autocomplete-hint {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--txt-3);
  margin-top: 6px;
  min-height: 16px;
}

/* ── Business Selector ────────────────────────────────────────────────────── */
.biz-panel { display: flex; flex-direction: column; gap: 8px; }
.biz-selector-row { display: flex; align-items: center; gap: 6px; }
.biz-selector-row .input-wrapper { flex: 1; }

.btn-biz-add {
  flex-shrink: 0;
  width: 38px; height: 38px;
  background: var(--accent);
  border: none;
  border-radius: var(--r-sm);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: none;
  transition: background 120ms;
}
.btn-biz-add:hover { background: #c9684a; transform: none; box-shadow: none; }

.btn-biz-del {
  flex-shrink: 0;
  width: 38px; height: 38px;
  background: var(--red-bg);
  border: 1px solid rgba(197,64,64,0.25);
  border-radius: var(--r-sm);
  color: var(--red);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 120ms;
}
.btn-biz-del:hover { background: rgba(197,64,64,0.14); transform: none; }

.biz-add-form {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--r);
  animation: dropIn 0.15s ease;
}
.biz-add-form.open { display: flex; }

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

.biz-add-actions { display: flex; gap: 6px; justify-content: flex-end; }

.biz-add-form input {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--txt);
  font-family: var(--body);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 120ms;
}
.biz-add-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.biz-add-form input::placeholder { color: var(--txt-3); }

.btn-biz-save {
  padding: 8px 18px;
  background: var(--accent);
  border: none;
  border-radius: var(--r-sm);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--body);
  transition: background 120ms;
  box-shadow: none;
}
.btn-biz-save:hover { background: #c9684a; transform: none; box-shadow: none; }

.btn-biz-cancel {
  padding: 8px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--txt-2);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--body);
  transition: all 120ms;
}
.btn-biz-cancel:hover { background: var(--bg-hover); }

.biz-tag {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-bg);
  border: 1px solid rgba(218,119,86,0.2);
  border-radius: 4px;
  padding: 1px 7px;
  margin-left: 5px;
  font-family: var(--mono);
}

/* ── Select Override ──────────────────────────────────────────────────────── */
select,
select.row-limit-input {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--txt) !important;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239a9993' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  padding-right: 30px !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important;
}
select option { background: #fff !important; color: var(--txt) !important; }
select option:checked { background: var(--accent-bg) !important; }
select:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-bg) !important; outline: none !important; }

/* ── Business Name+Domain Chips ───────────────────────────────────────────── */
.biz-chips-row { display: none; gap: 6px; flex-wrap: wrap; margin-top: 4px; align-items: center; }
.biz-chips-row.visible { display: flex; }

.biz-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: default;
  transition: all 120ms;
  max-width: 200px;
}
.biz-chip-name {
  background: var(--accent-bg);
  border: 1px solid rgba(218,119,86,0.3);
  color: var(--accent);
}
.biz-chip-domain {
  background: var(--blue-bg);
  border: 1px solid rgba(59,113,202,0.25);
  color: var(--blue);
}
.biz-chip-label { font-size: 0.625rem; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.04em; margin-right: 1px; }
.biz-chip-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.biz-chip-clear { background: none; border: none; color: inherit; opacity: 0.5; cursor: pointer; padding: 0; font-size: 0.85rem; line-height: 1; transition: opacity 120ms; flex-shrink: 0; }
.biz-chip-clear:hover { opacity: 1; }
.biz-chip.cleared { opacity: 0.35; text-decoration: line-through; }
.biz-chip-primary { border-width: 1.5px !important; }
.biz-chip-badge { font-size: 0.6rem; font-weight: 600; opacity: 0.6; background: rgba(0,0,0,0.06); border-radius: 3px; padding: 1px 5px; white-space: nowrap; text-transform: uppercase; flex-shrink: 0; font-family: var(--mono); }

/* ── Auth Pages ───────────────────────────────────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo img { height: 2.4em; }

.auth-title {
  font-family: var(--head);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--txt);
  margin-bottom: 6px;
  text-align: center;
}

.auth-subtitle { font-size: 0.875rem; color: var(--txt-2); text-align: center; margin-bottom: 28px; }

.auth-field { margin-bottom: 14px; }
.auth-field label { display: block; font-size: 0.6875rem; font-weight: 600; color: var(--txt-2); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.auth-field input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--txt);
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  font-family: var(--body);
  outline: none;
  transition: border-color 120ms, box-shadow 120ms;
}
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.auth-field input::placeholder { color: var(--txt-3); }

.auth-remember { display: flex; align-items: center; gap: 7px; margin-bottom: 20px; font-size: 0.875rem; color: var(--txt-2); cursor: pointer; }
.auth-remember input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; }

.auth-btn {
  width: 100%;
  padding: 11px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-size: 0.9375rem;
  font-weight: 700;
  font-family: var(--body);
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(218,119,86,0.3);
  transition: background 120ms;
}
.auth-btn:hover { background: #c9684a; }
.auth-btn:active { transform: scale(0.99); }

.auth-footer { text-align: center; margin-top: 20px; font-size: 0.875rem; color: var(--txt-2); }
.auth-footer a { color: var(--accent); font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

.auth-error {
  background: var(--red-bg);
  border: 1px solid rgba(197,64,64,0.25);
  color: var(--red);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 0.875rem;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 7px;
}

.auth-success {
  background: var(--green-bg);
  border: 1px solid rgba(16,128,80,0.2);
  color: var(--green);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 0.875rem;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 7px;
}

.auth-divider { height: 1px; background: var(--border); margin: 24px 0; }

.pw-strength { margin-top: 6px; }
.pw-strength-bar { height: 3px; border-radius: 999px; background: var(--border); overflow: hidden; }
.pw-strength-bar::after { content: ''; display: block; height: 100%; border-radius: 999px; width: 0%; transition: width 0.3s, background 0.3s; }

/* ── Batch / GMB Inline Styles Override ───────────────────────────────────── */
.batch-container {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding-bottom: 40px;
}

.upload-zone {
  background: var(--bg-hover);
  border: 2px dashed var(--border);
  border-radius: var(--r);
  padding: 28px;
  text-align: center;
  margin-bottom: 20px;
  transition: border-color 120ms, background 120ms;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--accent); background: var(--accent-bg); }
.upload-icon { font-size: 1.75rem; }
.upload-text { font-size: 0.875rem; color: var(--txt-2); }
.upload-zone input[type="file"] { display: none; }

.controls-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 16px; }

.row-limit-input {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--txt) !important;
  font-family: var(--mono);
  font-size: 0.875rem;
  border-radius: var(--r-sm);
  padding: 7px 10px;
  outline: none;
  cursor: pointer;
}

/* Sheet / batch table */
.sheet-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; font-family: var(--mono); }
.sheet-table th {
  text-align: left;
  padding: 8px 12px;
  background: var(--bg-surface);
  color: var(--txt-3);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.sheet-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--txt);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sheet-table tr:last-child td { border-bottom: none; }
.sheet-table tbody tr:hover td { background: var(--bg-hover); }

/* Editable cells */
.row-kw, .row-loc-input, .row-coord, .row-loc-name, .row-loc-code, .row-depth {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--txt);
  font-family: var(--mono);
  font-size: 0.8125rem;
  border-radius: 3px;
  padding: 4px 8px;
  width: 100%;
  outline: none;
}
.row-kw:focus, .row-loc-input:focus, .row-coord:focus, .row-depth:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }

/* Status badges in tables */
.status-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 0.6875rem; font-weight: 700; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.05em; }
.status-pending  { background: var(--yellow-bg);  color: var(--yellow); border: 1px solid rgba(179,107,0,0.2); }
.status-running  { background: var(--blue-bg);    color: var(--blue);   border: 1px solid rgba(59,113,202,0.2); }
.status-success  { background: var(--green-bg);   color: var(--green);  border: 1px solid rgba(16,128,80,0.2); }
.status-error    { background: var(--red-bg);     color: var(--red);    border: 1px solid rgba(197,64,64,0.2); }

/* Rank value coloring */
.row-rank-abs, .row-rank-org, .row-rank-maps, .row-rating { font-weight: 700; color: var(--txt); font-family: var(--mono); }

/* Action buttons in rows */
.btn-run, .btn-run-scan, .btn-geocode, .btn-sm {
  padding: 5px 12px;
  background: var(--accent);
  border: none;
  border-radius: var(--r-sm);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--body);
  transition: background 120ms;
  white-space: nowrap;
}
.btn-run:hover, .btn-run-scan:hover, .btn-geocode:hover, .btn-sm:hover { background: #c9684a; }
.btn-run:disabled, .btn-run-scan:disabled { opacity: 0.4; cursor: not-allowed; }

.action-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Scan progress */
.scan-progress-wrap { height: 4px; background: var(--border); border-radius: 999px; overflow: hidden; margin: 12px 0; }
.scan-progress-bar { height: 100%; background: linear-gradient(90deg, var(--accent), #e8920a); border-radius: 999px; transition: width 0.4s ease; }
.scan-status-msg { font-size: 0.8125rem; color: var(--txt-2); font-family: var(--mono); margin: 6px 0; }

/* GMB page extras */
.form-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r); padding: 20px 24px; margin-bottom: 16px; box-shadow: var(--shadow); }
.gmb-note { font-size: 0.8125rem; color: var(--txt-2); background: var(--blue-bg); border: 1px solid rgba(59,113,202,0.2); border-radius: var(--r-sm); padding: 10px 14px; margin-bottom: 12px; }

/* Stats bar for GMB result */
.stats-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }

/* Cost card */
.cost-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 20px; box-shadow: var(--shadow); }
.cost-item { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.cost-item:last-child { border-bottom: none; }
.cost-lbl { color: var(--txt-2); }
.cost-val { font-family: var(--mono); font-weight: 600; color: var(--txt); }
.cost-note { font-size: 0.75rem; color: var(--txt-3); margin-top: 8px; }

/* Grid Map extras */
.grid-map-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; height: calc(100vh - 200px); }
.map-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.history-table-wrap { overflow-y: auto; }
.coords-display { font-family: var(--mono); font-size: 0.8125rem; color: var(--txt-2); padding: 6px 10px; background: var(--bg-hover); border-radius: var(--r-sm); margin-top: 6px; }
.geocode-row { display: flex; gap: 6px; align-items: center; }

/* Rank legend */
.rank-legend { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 0.75rem; color: var(--txt-2); font-family: var(--mono); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Autocomplete dropdown for batch pages */
.ac-wrapper { position: relative; }
.ac-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
  list-style: none;
  padding: 4px;
  min-width: 220px;
}
.ac-dropdown li {
  padding: 7px 10px;
  font-size: 0.8125rem;
  color: var(--txt);
  cursor: pointer;
  border-radius: var(--r-sm);
  font-family: var(--mono);
}
.ac-dropdown li:hover { background: var(--bg-hover); }

/* Chart wrap */
.chart-wrap { border-radius: var(--r); overflow: hidden; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 650px) {
  .form-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr; }
  .card { padding: 20px 16px; }
  .header-badge { display: none; }
  .results-header { flex-direction: column; }
  .biz-add-form-row { grid-template-columns: 1fr; }
  .grid-map-layout { grid-template-columns: 1fr; }
}
