/* Ecommerce Intelligence — brand stylesheet
   Palette: navy #1b2432 (text), accent #42bee1 (brand cyan), white background
   Reference: christurtonecommerce.com — clean SaaS look, rounded cards, generous whitespace
   Font: Poppins throughout */

:root {
  --navy: #1b2432;
  --navy-soft: #4b5468;
  --accent: #42bee1;
  --accent-dark: #2fa3c4;
  --bg: #ffffff;
  --bg-soft: #f6f9fb;
  --border: #e6ebf0;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 30px rgba(27, 36, 50, 0.08);
  --shadow-sm: 0 2px 10px rgba(27, 36, 50, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--navy);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-weight: 600; margin: 0 0 0.5em; line-height: 1.25; }
p { line-height: 1.6; margin: 0 0 1em; color: var(--navy-soft); }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- App shell: sidebar + main content --- */
:root {
  --sidebar-w: 232px;
  --sidebar-w-collapsed: 68px;
}
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  transition: width .18s ease;
  position: sticky;
  top: 0;
  z-index: 10000; /* stays above the client setup gate overlay (z-index 9999), so the client dropdown is always clickable to switch away from a client mid-setup */
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}
.sidebar.collapsed { width: var(--sidebar-w-collapsed); }

.sidebar-top { display: flex; align-items: center; justify-content: center; position: relative; margin-bottom: 28px; padding: 0 6px; min-height: 52px; }
.sidebar-logo { height: 56px; width: auto; object-fit: contain; }
.sidebar-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.sidebar.collapsed .sidebar-top { justify-content: center; }
.sidebar.collapsed .sidebar-logo { display: none; }
.sidebar-toggle {
  background: rgba(255,255,255,0.08); border: none; color: #fff; width: 30px; height: 30px;
  border-radius: 8px; cursor: pointer; font-size: 14px; flex-shrink: 0; display: flex;
  align-items: center; justify-content: center; transition: background .15s ease;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.18); }

.sidebar-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.4); padding: 0 12px; margin: 18px 0 6px;
  white-space: nowrap; overflow: hidden;
}
.sidebar.collapsed .sidebar-section-label { opacity: 0; height: 0; margin: 0; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: rgba(255,255,255,0.8); font-size: 14px; font-weight: 500; text-decoration: none;
  white-space: nowrap; overflow: hidden; transition: background .15s ease, color .15s ease;
}
.sidebar-link:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.sidebar-link.active { background: var(--accent); color: #fff; }
.sidebar-link .icon-box {
  width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.sidebar-link .link-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sidebar.collapsed .link-label { display: none; }
.sidebar.collapsed .sidebar-link { justify-content: center; padding: 10px; }

.sidebar-spacer { flex-grow: 1; }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 14px; margin-top: 10px; }
.sidebar-user { font-size: 12px; color: rgba(255,255,255,0.5); padding: 0 12px 8px; white-space: nowrap; overflow: hidden; }
.sidebar.collapsed .sidebar-user { display: none; }

.sidebar-client { padding: 0 4px; margin-bottom: 4px; }
.sidebar.collapsed .sidebar-client { display: none; }
.sidebar-select {
  width: 100%; padding: 9px 10px; font-size: 13px; font-family: inherit; font-weight: 600;
  border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; background: rgba(255,255,255,0.06);
  color: #fff; margin-bottom: 8px; cursor: pointer;
}
.sidebar-select option { background: var(--navy); color: #fff; }
.sidebar-discover-prompt {
  font-size: 11px; color: rgba(255,255,255,0.55); background: rgba(255,255,255,0.05);
  border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; line-height: 1.5;
}
.sidebar-discover-prompt button {
  display: block; margin-top: 4px; background: none; border: none; color: var(--accent);
  font-size: 11px; font-weight: 600; cursor: pointer; padding: 0;
}
.sidebar-add-toggle {
  width: 100%; background: none; border: 1px dashed rgba(255,255,255,0.25); color: rgba(255,255,255,0.7);
  font-size: 12px; font-weight: 600; padding: 8px; border-radius: 8px; cursor: pointer;
  transition: all .15s ease;
}
.sidebar-add-toggle:hover { border-color: rgba(255,255,255,0.5); color: #fff; }
.sidebar-add-form { margin-top: 8px; }
/* Light-theme variant — these classes now only render on the Add Client
   page (a normal light-background page), not the dark sidebar they were
   originally styled for. */
.sidebar-add-input {
  width: 100%; padding: 12px 14px; font-size: 14px; font-family: inherit; margin-bottom: 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft); color: var(--navy);
}
.sidebar-add-input::placeholder { color: var(--navy-soft); }
.sidebar-add-input:focus { outline: none; border-color: var(--accent); background: var(--bg); }
.sidebar-add-submit {
  width: 100%; padding: 12px; font-size: 14px; font-weight: 600; background: var(--accent);
  color: #fff; border: none; border-radius: var(--radius-sm); cursor: pointer;
}
.sidebar-add-submit:hover { background: var(--accent-dark); }
.sidebar-add-submit:disabled { opacity: 0.6; cursor: default; }
.sidebar-add-status { font-size: 12px; color: var(--navy-soft); margin-top: 8px; line-height: 1.5; }
.sidebar-comp-row { display: flex; gap: 6px; margin-bottom: 6px; }
.sidebar-comp-row input { flex: 1; min-width: 0; }

/* --- Diagnostics panel --- */
.diagnostics-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 90vw;
  background: var(--bg); box-shadow: -8px 0 30px rgba(20,30,45,0.15); z-index: 200;
  display: flex; flex-direction: column; overflow: hidden;
}
.diagnostics-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px; border-bottom: 1px solid var(--border);
}
.diagnostics-panel-head h3 { font-size: 16px; margin: 0; }
.diagnostics-panel-head > div { display: flex; gap: 8px; }
.diagnostics-panel-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.diag-section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--navy-soft); padding: 14px 20px 6px;
}
.diag-row {
  display: grid; grid-template-columns: 70px 1fr auto 60px; gap: 8px; align-items: baseline;
  padding: 8px 20px; font-size: 12px; border-bottom: 1px solid var(--bg-soft);
}
.diag-time { color: var(--navy-soft); }
.diag-label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diag-status { font-weight: 600; text-align: right; }
.diag-duration { color: var(--navy-soft); text-align: right; }
.diag-detail { grid-column: 1 / -1; color: var(--navy-soft); font-size: 11px; margin-top: 2px; word-break: break-word; }

.client-run-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.client-run-tool { width: auto; padding: 7px 14px; font-size: 12px; }

/* --- Generate Everything progress bar --- */
.progress-track {
  width: 100%; height: 10px; border-radius: 6px; background: var(--bg-soft);
  overflow: hidden; border: 1px solid var(--border);
}
.progress-fill {
  height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  transition: width 0.4s ease;
}

/* --- Report-style data tables — used by every retail-report/LLM-metrics
   widget fragment (render_section() in lib/render-report.php, and
   tools/llm-visibility/metrics.js). Was previously only defined inside
   render_report_html()'s own inline <style> block, which individual
   widget fragments never include — every such table across the dashboard
   and retail-report pages was rendering unstyled until this was added
   here. */
.report-h { font-size: 15px; border-bottom: 2px solid var(--navy); padding-bottom: 6px; margin-top: 32px; }
.report-table { width: 100%; min-width: 200px; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
.report-table thead tr { background: var(--navy); color: #fff; }
.report-table th, .report-table td { padding: 7px 10px; text-align: center; }
.report-caption { font-size: 11px; font-style: italic; color: var(--navy-soft); margin-top: 6px; }

/* --- AI Sentiment gauge: 0-100 with red/yellow/green zones --- */
.sentiment-gauge-track {
  position: relative; height: 14px; border-radius: 7px; overflow: visible;
  display: flex; margin-top: 8px;
}
.sentiment-gauge-zone { height: 100%; }
.sentiment-gauge-zone.zone-negative { width: 40%; background: #e85d5d; border-radius: 7px 0 0 7px; }
.sentiment-gauge-zone.zone-neutral { width: 30%; background: #e8c25d; }
.sentiment-gauge-zone.zone-positive { width: 30%; background: #4caf7d; border-radius: 0 7px 7px 0; }
.sentiment-gauge-marker {
  position: absolute; top: -4px; width: 4px; height: 22px; background: var(--navy);
  border-radius: 2px; transform: translateX(-2px); box-shadow: 0 0 0 2px #fff;
}
.sentiment-gauge-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--navy-soft); margin-top: 4px; }
.sentiment-gauge-value { font-size: 28px; font-weight: 700; margin-top: 14px; line-height: 1; }
.sentiment-gauge-value.band-negative { color: #c0392b; }
.sentiment-gauge-value.band-neutral { color: #9a7c08; }
.sentiment-gauge-value.band-positive { color: #2e8b57; }

/* --- Shopping visibility vs competitors bar chart --- */
.vis-bar-chart { margin-top: 8px; }
.vis-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.vis-bar-label { flex: 0 0 110px; font-size: 12px; color: var(--navy-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vis-bar-label-brand { color: var(--navy); font-weight: 700; }
.vis-bar-track { flex: 1; height: 16px; background: var(--bg-soft); border-radius: 8px; overflow: hidden; }
.vis-bar-fill { height: 100%; background: var(--accent); border-radius: 8px; transition: width 0.4s ease; }
.vis-bar-fill-brand { background: var(--accent-dark); }
.vis-bar-value { flex: 0 0 60px; font-size: 12px; font-weight: 600; text-align: right; }
.vis-headline-score { font-size: 36px; font-weight: 700; color: var(--accent-dark); line-height: 1; }

/* --- Dashboard combined view --- */
.dashboard-view-section { margin-bottom: 32px; }
.dashboard-section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.dashboard-section-header h2 { font-size: 16px; margin: 0; }
.dashboard-section-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dashboard-section-dot.dot-retail { background: var(--accent-dark); }
.dashboard-section-dot.dot-ai { background: #8a5fd6; }

/* --- Settings: client management --- */
.client-card, .user-account-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px; margin-bottom: 12px; }
.client-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.client-comp-row-view { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 6px 0; border-top: 1px solid var(--border); }
.client-comp-row-view:first-child { border-top: none; }

.main-content { flex-grow: 1; min-width: 0; padding: 0 32px; }
.main-content .wrap { max-width: 1440px; margin: 0 auto; padding: 0; }
.main-content .wrap.wrap-full { max-width: 1800px; }

@media (min-width: 1900px) {
  .main-content .wrap.wrap-full { max-width: 94%; }
}

@media (max-width: 780px) {
  .sidebar { position: fixed; z-index: 10000; left: 0; top: 0; }
  .sidebar:not(.mobile-open) { width: 0; padding: 20px 0; overflow: hidden; }
  .main-content { padding: 0 16px; }
}

/* --- Login page --- */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  padding: 24px;
  position: relative;
}
.login-shell-logo {
  position: absolute;
  top: 28px;
  right: 32px;
  height: 42px;
}
.login-card {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.login-card h1 { font-size: 20px; margin-bottom: 8px; }
.login-card .sub { font-size: 14px; color: var(--navy-soft); margin-bottom: 28px; }

.field { text-align: left; margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--navy); }
.field input {
  width: 100%; padding: 12px 14px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-soft); color: var(--navy); transition: border-color .15s ease;
}
.field input:focus { outline: none; border-color: var(--accent); background: var(--bg); }

.btn {
  display: inline-block; width: 100%; padding: 13px 20px; font-size: 15px; font-weight: 600;
  font-family: inherit; background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius-sm); cursor: pointer; transition: background .15s ease;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-secondary {
  background: transparent; color: var(--navy); border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--navy-soft); background: var(--bg-soft); }

.error-box {
  background: #fdecec; border: 1px solid #f3c2c2; color: #b42318;
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; margin-bottom: 18px; text-align: left;
}
.info-box {
  background: #ecf9fd; border: 1px solid #c5edf7; color: #1b6f87;
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; margin-bottom: 18px; text-align: left;
}

/* --- Dashboard --- */
.hero { padding: 56px 0 40px; }
.hero .eyebrow { color: var(--accent-dark); font-weight: 600; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 10px; }
.hero h1 { font-size: 32px; max-width: 640px; }
.hero p { max-width: 560px; font-size: 16px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-bottom: 60px;
}
@media (max-width: 860px) {
  .card-grid { grid-template-columns: 1fr; }
}

.tool-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.tool-card .icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
  color: var(--accent-dark); font-size: 20px; font-weight: 700;
}
.tool-card h3 { font-size: 17px; margin-bottom: 8px; }
.tool-card p { font-size: 14px; flex-grow: 1; }
.tool-card .go {
  margin-top: 18px; font-size: 14px; font-weight: 600; color: var(--accent-dark);
  display: flex; align-items: center; gap: 6px;
}
.tool-card.disabled { opacity: 0.6; }
.tool-card .status-tag {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 0.03em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 999px; margin-bottom: 14px;
  width: fit-content;
}
.status-tag.live { background: #e7f9ee; color: #1a7f4e; }
.status-tag.soon { background: #fdf3e2; color: #9a6a08; }

/* --- Dashboard widgets --- */
.widget-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 22px;
}
@media (max-width: 1080px) {
  .widget-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .widget-grid { grid-template-columns: 1fr; }
}
/* Auto-fit variant: columns size to available space down to a sensible
 * minimum, and naturally collapse to one column on narrow screens without
 * needing manual breakpoints — used by the retail-report segment widgets,
 * which vary a lot in natural content width (a 5-column table needs far
 * more room than a short text panel). */
.widget-grid-autofit {
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}
/* Genuine 50/50 split, not auto-fit — used where two specific widgets need
   to sit exactly half-and-half regardless of how many other widgets are on
   the page, rather than being sized by how many columns happen to fit. */
.widget-grid-2col {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 700px) {
  .widget-grid-2col { grid-template-columns: 1fr; }
}
.widget-panel {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 28px; box-shadow: var(--shadow-sm); margin-bottom: 0;
}
.widget-panel-wide { grid-column: 1 / -1; margin-bottom: 22px; }
.widget-panel-primary {
  border: 1.5px solid var(--accent-dark);
  background: linear-gradient(180deg, rgba(66,190,225,0.06), var(--bg) 120px);
  box-shadow: 0 2px 14px rgba(66,190,225,0.12);
}
.widget-panel-primary .widget-head h3 { font-size: 19px; }
.widget-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.widget-head h3 { font-size: 17px; margin: 4px 0 0; }
.widget-link { font-size: 13px; font-weight: 600; color: var(--accent-dark); white-space: nowrap; }
.widget-sub { font-size: 13px; color: var(--navy-soft); margin-bottom: 18px; }
.widget-textarea {
  width: 100%; padding: 12px 14px; font-size: 14px; font-family: inherit; resize: vertical;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft); color: var(--navy);
}
.widget-status { font-size: 13px; color: var(--navy-soft); margin-top: 12px; }
.widget-answer {
  margin-top: 14px; font-size: 14px; line-height: 1.7;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px 20px;
}

/* --- Rendered markdown (LLM Visibility responses) --- */
.md-content h4, .md-content h5, .md-content h6 { color: var(--navy); font-weight: 600; margin: 16px 0 6px; line-height: 1.35; }
.md-content h4 { font-size: 15px; }
.md-content h5 { font-size: 14px; }
.md-content h6 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--navy-soft); }
.md-content p { margin: 0 0 12px; color: var(--navy); font-size: 14px; line-height: 1.7; }
.md-content ul, .md-content ol { margin: 0 0 12px; padding-left: 20px; }
.md-content li { margin-bottom: 5px; font-size: 14px; line-height: 1.6; color: var(--navy); }
.md-content li::marker { color: var(--accent-dark); }
.md-content strong { color: var(--navy); font-weight: 600; }
.md-content code {
  background: rgba(27,36,50,0.07); padding: 1px 6px; border-radius: 5px;
  font-size: 0.88em; font-family: 'SFMono-Regular', Consolas, monospace; color: var(--navy);
}
.md-content a { color: var(--accent-dark); text-decoration: underline; }
.md-content > *:first-child { margin-top: 0; }
.md-content > *:last-child { margin-bottom: 0; }
.widget-empty { font-size: 14px; color: var(--navy-soft); }
.widget-empty a { font-weight: 600; }
.widget-history-item {
  border-top: 1px solid var(--border); padding: 10px 0; font-size: 13px;
}
.widget-history-q { font-weight: 600; color: var(--navy); margin-bottom: 3px; }
.widget-history-a { color: var(--navy-soft); line-height: 1.5; }
.widget-divider { border-top: 1px solid var(--border); margin: 22px 0; }
.widget-form-label { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.report-form-grid {
  display: grid; grid-template-columns: 1fr; gap: 0; margin-bottom: 4px;
}
.mini-result {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px;
}
.mini-result .r-name { font-weight: 600; }
.mini-result .r-price { font-weight: 600; color: var(--accent-dark); white-space: nowrap; }
.mini-report-score { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 14px; }
.mini-report-score .score-item { font-size: 13px; }
.mini-report-score .score-item strong { display: block; font-size: 20px; color: var(--navy); }

/* --- Tool pages (shared) --- */
.tool-header { padding: 32px 0 8px; }
.tool-header .back-link { font-size: 13px; color: var(--navy-soft); margin-bottom: 14px; display: inline-block; }
.tool-header h1 { font-size: 24px; }

.panel {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm); margin-bottom: 24px;
}
.report-panel { overflow-x: auto; }

/* --- Retail report segmented view --- */
.segment-summary-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.segment-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px; box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.segment-card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.segment-card-head h4 { font-size: 15px; margin: 0; }
.segment-card-controls { display: flex; align-items: center; gap: 12px; }
.segment-status {
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em; padding: 3px 10px; border-radius: 999px;
  background: var(--bg-soft); color: var(--navy-soft);
}
.segment-status.done { background: #e7f9ee; color: #1a7f4e; }
.segment-status.running { background: #ecf9fd; color: #1b6f87; }
.segment-content { margin-top: 16px; overflow-x: auto; }
.segment-progress { margin-top: 12px; font-size: 13px; color: var(--navy-soft); }

.result-card {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 18px 20px; margin-bottom: 14px; background: var(--bg);
}
.result-card .retailer { font-weight: 600; font-size: 15px; }
.result-card .title { font-size: 13px; color: var(--navy-soft); margin: 4px 0 10px; }
.result-card .meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; }
.result-card .meta strong { color: var(--navy); }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.badge.ok { background: #e7f9ee; color: #1a7f4e; }
.badge.check { background: #fdf3e2; color: #9a6a08; }
.badge.cheapest { background: var(--accent); color: var(--navy); }
.badge.out-of-stock { background: #fdecec; color: #b42318; }
.catalogue-chip {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 9px;
  border-radius: 6px; white-space: nowrap;
}
.catalogue-chip-yes { background: #e7f9ee; color: #1a7f4e; }
.catalogue-chip-no { background: #f1f3f5; color: var(--navy-soft); font-weight: 500; }
.catalogue-chip-conflict { background: #fdf3e2; color: #9a6a08; cursor: help; }
.catalogue-chip-checkneeded { background: #fdecec; color: #b42318; cursor: help; }
.catalogue-chip-unchecked { background: #f1f3f5; color: var(--navy-soft); font-weight: 500; opacity: 0.6; }
.discrepancy-warning {
  font-size: 12px; color: #9a6a08; background: #fdf6e3; border-radius: 6px;
  padding: 6px 10px; margin: 6px 0; display: inline-block;
}
.price-display { display: inline-flex; align-items: baseline; gap: 8px; }
.price-edit-btn {
  border: none; background: none; color: var(--accent-dark); font-size: 11px;
  cursor: pointer; text-decoration: underline; padding: 0;
}
.price-edit-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.price-edit-input {
  width: 100px; padding: 6px 10px; font-size: 13px; font-family: inherit;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg-soft);
}
.price-edit-cancel { border: none; background: none; color: var(--navy-soft); font-size: 12px; cursor: pointer; text-decoration: underline; }
.result-card-cheapest { border-color: var(--accent-dark); box-shadow: 0 2px 10px rgba(66,190,225,0.15); }
.mini-result.result-card-cheapest { background: rgba(66,190,225,0.08); border-color: var(--accent-dark); }

.dropped-card {
  border: 1px dashed #e0c8c8; border-radius: var(--radius-sm); padding: 12px 16px;
  margin-bottom: 10px; font-size: 13px; color: #9a4a4a; background: #fdf6f6;
}

.footer-note { padding: 30px 0 60px; font-size: 12px; color: var(--navy-soft); text-align: center; }

textarea, select {
  width: 100%; padding: 12px 14px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-soft); color: var(--navy);
}

.spinner {
  width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%; display: inline-block;
  animation: spin .7s linear infinite; vertical-align: middle; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

details.debug { margin-top: 20px; font-size: 12px; }
details.debug summary { cursor: pointer; color: var(--navy-soft); }
details.debug pre {
  background: var(--navy); color: #cfe9f2; padding: 14px; border-radius: var(--radius-sm);
  overflow-x: auto; max-height: 400px;
}
