/* SSS-JORGE — dark theme matching the broader SSS brand palette. */

:root {
  --bg:           #0f172a;
  --bg-elev:     #1e293b;
  --bg-soft:     #283447;
  --fg:          #f1f5f9;
  --fg-muted:    #94a3b8;
  --fg-faint:    #64748b;
  --accent:      #E36F2C;   /* SSS orange */
  --accent-soft: #f59e0b;
  --border:      #334155;
  --error-bg:    #7f1d1d;
  --error-fg:    #fecaca;
  --ok:          #10b981;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

/* offset anchored sections so they clear the sticky topbar */
#users-section,
#top-questions-section,
#zero-results-section,
#thumbs-down-section { scroll-margin-top: 76px; }

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

/* ─── Layout ─────────────────────────────────────── */
.topbar {
  background: #0b1220;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.content {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}
.content--wide {
  max-width: 1200px;
}

.footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--fg-faint);
  font-size: 12px;
}

/* ─── Cards ─────────────────────────────────────── */
.centered {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 40px;
}
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
  width: 100%;
  max-width: 640px;
}
.card-narrow { max-width: 420px; }
.card h1 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ─── Forms ─────────────────────────────────────── */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}
.form-stack label {
  font-size: 13px;
  color: var(--fg-muted);
  margin-bottom: -6px;
}
.form-stack input[type="email"],
.form-stack input[type="text"],
.form-stack input[type="time"],
.form-stack select,
.form-stack textarea {
  width: 100%;
  max-width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
}
.form-stack input:focus,
.form-stack select:focus,
.form-stack textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(227, 111, 44, 0.15);
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  cursor: pointer;
  margin-top: 4px;
}
.checkbox-row input { width: 18px; height: 18px; }

/* ─── Buttons ────────────────────────────────────── */
.btn-primary,
.btn-send {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}
.btn-primary:hover,
.btn-send:hover { background: #c85e22; }

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}
.btn-ghost:hover { color: var(--fg); border-color: var(--fg-muted); }

.btn-mic {
  background: var(--bg-soft);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}
.btn-mic:hover { border-color: var(--accent); color: var(--accent); }
.btn-mic.recording {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(227, 111, 44, 0.5); }
  50%      { box-shadow: 0 0 0 8px rgba(227, 111, 44, 0); }
}

/* ─── Chat / query UI ────────────────────────────── */
/* The answer column runs to nearly the full window so the widest data table
   (branch detail: Description … Total Max +/- % On Rent ≈ 122 monospace cols)
   renders without clipping or horizontal scroll. The ask UI is capped narrower
   below so the search box doesn't look sparse — only the answer/table goes wide. */
.chat { max-width: min(1500px, 96vw); margin: 0 auto; }
.greeting, .query-bar, .freshness-chips, .examples {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.greeting {
  text-align: center;
  margin-bottom: 32px;
}
.greeting h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.query-bar {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.query-bar textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--fg);
  font-size: 16px;
  font-family: inherit;
  resize: none;
  outline: none;
  min-height: 24px;
  max-height: 200px;
}
.query-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(227, 111, 44, 0.15);
}

.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.example {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}
.example:hover { color: var(--fg); border-color: var(--accent); }

/* ─── Response ───────────────────────────────────── */
.response {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-top: 24px;
}
.response-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.header-right {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.btn-voice-toggle {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s;
  padding: 0;
}
.btn-voice-toggle:hover { color: var(--fg); border-color: var(--fg-muted); }
.btn-voice-toggle.muted {
  color: var(--accent);
  border-color: var(--accent);
}
/* Force-hide SVGs marked [hidden] — Chrome/Edge sometimes ignore the
   `hidden` HTML attribute on inline <svg> because of `display: inline`
   defaults, leaving both icons stacked side-by-side. */
.btn-voice-toggle svg[hidden],
.btn-voice-pill svg[hidden],
.btn-voice-pill span[hidden] { display: none !important; }

/* Always-visible topbar voice toggle. Clear ON / MUTED states so the user
   never has to guess — green when active, red when muted. */
.btn-voice-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--ok);
  background: rgba(16, 185, 129, 0.12);
  color: var(--ok);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}
.btn-voice-pill:hover { filter: brightness(1.15); }
.btn-voice-pill.muted {
  border-color: #f87171;
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}
.response-question {
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 10px;
  line-height: 1.4;
}
.response-question::before {
  content: "You asked: ";
  font-weight: 400;
  color: var(--fg-faint);
}
.narrative {
  font-size: 16px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.table {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
  color: var(--fg-muted);
  font-family: "SF Mono", Consolas, Menlo, monospace;
  font-size: 11px;
  line-height: 1.45;
  overflow-x: auto;
  white-space: pre;
}

/* ─── Freshness chips row ────────────────────────────── */
.freshness-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.freshness-chips .inv-status {
  margin-top: 0;
}

/* ─── Feedback buttons ───────────────────────────────── */
.response-feedback {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.btn-feedback {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.12s;
}
.btn-feedback:hover:not(:disabled) { color: var(--fg); border-color: var(--fg-muted); }
.btn-feedback.selected[data-value="1"] { color: var(--ok); border-color: var(--ok); }
.btn-feedback.selected[data-value="-1"] { color: var(--accent); border-color: var(--accent); }
.btn-feedback:disabled { opacity: 0.5; cursor: default; }

/* ─── Email-this-answer row (CSV / Excel) ────────────── */
.response-export {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.export-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-muted);
  font-size: 13px;
}
.btn-export {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}
.btn-export:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.btn-export:disabled { opacity: 0.5; cursor: default; }
.export-status { color: var(--fg-muted); font-size: 12px; }
.export-status.export-error { color: var(--accent); }

.badge {
  background: var(--bg-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-small { font-size: 10px; padding: 2px 7px; }

/* ─── Recent / footnote ──────────────────────────── */
.recent {
  margin-top: 32px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
}
.recent summary {
  cursor: pointer;
  color: var(--fg-muted);
  font-size: 13px;
}
.recent ul {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.recent li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.recent li:last-child { border-bottom: none; }
.recent-query { cursor: pointer; flex: 1; }
.recent-query:hover { color: var(--accent); }

/* What's-new dropdown — mirrors .recent, accent-tinted summary */
.whats-new {
  margin-top: 20px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
}
.whats-new summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.whats-new-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.whats-new-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.whats-new-item:last-child { border-bottom: none; }
.whats-new-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 3px;
}
.whats-new-head strong { font-size: 14px; }
.whats-new-body { line-height: 1.45; }

/* ─── TEMPORARY maintenance banner (2026-07-18, remove after 7/22) ── */
.maintenance-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(245,158,11,.12);
  border: 1px solid rgba(245,158,11,.4);
  color: var(--accent-soft);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}
.maintenance-banner .maintenance-icon { font-size: 16px; line-height: 1.4; }

/* ─── Inventory freshness chip ───────────────────── */
.inv-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border-radius: 99px;
  margin: 8px auto 0;
  width: fit-content;
}
.inv-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.inv-fresh   { background: rgba(34,197,94,.12);  color: #22c55e; border: 1px solid rgba(34,197,94,.3); }
.inv-fresh   .inv-dot { background: #22c55e; }
.inv-aging   { background: rgba(251,191,36,.12); color: #fbbf24; border: 1px solid rgba(251,191,36,.3); }
.inv-aging   .inv-dot { background: #fbbf24; }
.inv-stale   { background: rgba(239,68,68,.12);  color: #ef4444; border: 1px solid rgba(239,68,68,.3); }
.inv-stale   .inv-dot { background: #ef4444; animation: pulse-dot 1.2s ease-in-out infinite; }
.inv-unknown { background: rgba(148,163,184,.1); color: #94a3b8; border: 1px solid rgba(148,163,184,.2); }
.inv-unknown .inv-dot { background: #94a3b8; }
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}

.footnote {
  text-align: center;
  margin-top: 32px;
}

/* ─── Utilities ──────────────────────────────────── */
.muted        { color: var(--fg-muted); font-size: 14px; }
.muted-small  { color: var(--fg-faint); font-size: 12px; }

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-top: 16px;
}
.alert-error {
  background: var(--error-bg);
  color: var(--error-fg);
}
.alert-ok {
  background: #064e3b;
  color: #d1fae5;
}

/* ─── Reports page ───────────────────────────────────────── */
.reports { max-width: 760px; margin: 0 auto; }

/* two-column form rows that stack on mobile */
.form-row { display: flex; gap: 14px; }
.form-row > div { flex: 1; min-width: 0; }
@media (max-width: 640px) {
  .form-row { flex-direction: column; gap: 12px; align-items: stretch; }
}
.reports-header { margin-bottom: 24px; }
.reports-header h1 { margin: 0 0 8px; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }

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

.report-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}
.report-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.report-row.inactive { opacity: 0.6; }
.report-row-main { flex: 1; min-width: 0; }
.report-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 15px;
}
.report-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.btn-ghost.danger:hover { color: #fca5a5; border-color: #fca5a5; }

@media (max-width: 640px) {
  .report-row { flex-direction: column; }
  .report-row-actions { flex-wrap: wrap; }
}

/* ─── Insights dashboard ─────────────────────────────────── */
.insights { max-width: 1100px; margin: 0 auto; }
.insights .card { max-width: none; }   /* cards must fill the full insights width */
.stats-row {
  display: flex;
  gap: 24px;
  padding: 18px 24px;
}
.stat {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  padding: 6px 4px;
  transition: background 0.12s ease;
  cursor: pointer;
}
a.stat:hover { background: rgba(255,255,255,0.04); }
a.stat:hover .stat-num { filter: brightness(1.15); }
.stat-num { font-size: 28px; font-weight: 600; color: var(--accent); letter-spacing: -0.02em; }
.stat-label { font-size: 12px; color: var(--fg-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }

.insights-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 12px;
}
.insights-table th {
  text-align: left;
  font-weight: 600;
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.insights-table th.num { text-align: right; }
.insights-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.insights-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.insights-table td.q-cell {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.insights-table tr:hover td { background: rgba(255,255,255,0.02); }
.badge-small.danger { background: var(--error-bg); color: var(--error-fg); }

/* ─── Scrollable table wrapper ───────────────────── */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;          /* bleed slightly so scroll shadow is visible */
}

/* ─── Mobile ─────────────────────────────────────── */
@media (max-width: 640px) {
  .content { padding: 20px 14px 60px; }
  .greeting h1 { font-size: 24px; }
  .card { padding: 24px 20px; }

  /* hide verbose columns on narrow screens */
  .hide-mobile { display: none; }

  /* truncate long emails to local part width */
  .owner-cell {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* tighten cell padding so remaining columns breathe */
  .insights-table th,
  .insights-table td { padding: 8px 6px; }

  /* stats row: 3-up grid instead of single overflowing row */
  .stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
  }
  .stat-num { font-size: 22px; }
  .stat-label { font-size: 10px; }
}

/* ─── Min/Max: homepage card + report page ───────────────────── */
.btn-small { padding: 7px 12px; font-size: 13px; }

.minmax-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 14px 0 8px;
}
.minmax-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.minmax-title { font-weight: 600; }
.minmax-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.minmax-upload { display: flex; align-items: center; gap: 8px; margin: 0; }
.minmax-upload input[type="file"] { color: var(--fg-muted); font-size: 12px; max-width: 200px; }

.minmax-report .report-head h1 { margin-bottom: 6px; }
.report-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 14px 0 18px;
}
.report-controls .ctl { display: inline-flex; align-items: center; gap: 8px; color: var(--fg-muted); font-size: 14px; }
.report-controls select {
  background: var(--bg-soft);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 14px;
}
.report-controls .chk input { accent-color: var(--accent); }
.report-summary { margin-left: auto; }

.report-group { margin-bottom: 26px; }
.report-group h2 { font-size: 16px; margin: 0 0 10px; }

.report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-table th, .report-table td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.report-table thead th { color: var(--fg-faint); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .03em; }
.report-table td.num, .report-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.report-table td.cc { color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.report-table tbody tr:hover { background: var(--bg-elev); }
.report-table tr.row-below { background: rgba(127, 29, 29, 0.22); }   /* short of target */
.report-table tr.row-below:hover { background: rgba(127, 29, 29, 0.32); }
.report-table tr.row-over { background: rgba(16, 185, 129, 0.13); }    /* over target / surplus */
.report-table tr.row-over:hover { background: rgba(16, 185, 129, 0.20); }
.report-table tr.row-down { background: rgba(245, 158, 11, 0.13); }    /* downed → repair depot */
.report-table tr.row-down:hover { background: rgba(245, 158, 11, 0.20); }
.report-table td.delta { font-weight: 600; }
.report-table tr.row-below td.delta { color: var(--error-fg); }
.report-table tr.row-over td.delta { color: var(--ok); }
.report-table td.down-hot { color: var(--accent-soft); font-weight: 600; }  /* non-zero broken count */
.gap-bad { color: var(--error-fg); font-weight: 600; }   /* 800 can't cover the shortfall */
.gap-ok  { color: var(--fg-faint); }                      /* 800 has enough to fill */
.empty-state { padding: 24px 0; }
.minmax-schedule { margin: 8px 0 18px; }
.minmax-schedule > summary { cursor: pointer; font-weight: 600; color: var(--fg); list-style: revert; }
.minmax-schedule[open] > summary { margin-bottom: 4px; }

@media (max-width: 640px) {
  .minmax-card { flex-direction: column; align-items: stretch; }
  .minmax-actions { justify-content: space-between; }
  .report-summary { margin-left: 0; width: 100%; }
  .report-table th, .report-table td { padding: 6px 7px; }
}

/* ── Jorge avatar (Plasma Ring) ─────────────────────────────
   Always-present energy core above the query box. Rendered by avatar.js on
   the inner <canvas>; this just frames it and adds a speaking glow. */
.jorge-avatar {
  max-width: 760px;
  margin: 0 auto 22px;
  height: 150px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: radial-gradient(120% 120% at 50% 45%, #142036 0%, #0a1020 72%, #070b14 100%);
  transition: box-shadow .4s ease, border-color .4s ease;
}
.jorge-avatar canvas { display: block; width: 100%; height: 100%; }
.jorge-avatar.speaking {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 0 26px rgba(227, 111, 44, 0.18);
}
@media (max-width: 640px) {
  .jorge-avatar { height: 120px; }
}
.voice-status {
  max-width: 760px;
  margin: -10px auto 14px;
  text-align: center;
  font-size: 11px;
  color: var(--fg-faint);
  min-height: 14px;
  letter-spacing: 0.02em;
}

/* ── Voice audition page (/admin/voice-test) ───────────────── */
.voice-test {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.vt-field { display: flex; flex-direction: column; gap: 6px; }
.vt-field > span { font-size: 13px; font-weight: 600; color: var(--fg-muted); }
.vt-field textarea, .vt-field input {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--fg);
  font: inherit;
  resize: vertical;
}
.vt-field textarea:focus, .vt-field input:focus {
  outline: none;
  border-color: var(--accent);
}
.vt-inline { flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; }
.vt-inline > span:first-child { min-width: 52px; }
.vt-inline input { flex: 0 0 220px; }
.vt-voices { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.vt-voice {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border-radius: 12px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--fg);
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  text-align: left;
  min-width: 150px;
}
.vt-voice-head { display: inline-flex; align-items: center; gap: 7px; text-transform: capitalize; }
.vt-note { font-size: 11px; font-weight: 400; color: var(--fg-muted); text-transform: none; }
.vt-voice:hover { border-color: var(--accent); }
.vt-voice.vt-active {
  border-color: var(--accent);
  background: rgba(227, 111, 44, 0.16);
  color: var(--accent-soft);
}
.vt-voice.vt-active .vt-note { color: var(--accent-soft); }
.vt-play { color: var(--accent-soft); }
.vt-current {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ok);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 6px;
  padding: 1px 5px;
}
.voice-test .voice-status { margin: 4px auto 0; font-size: 13px; }

/* user voice picker (/voice) — the single, obvious place to set your voice */
.vp-current-line { margin-top: 10px; color: var(--fg-muted); font-size: 14px; }
.vp-current-line b { color: var(--accent-soft); }
.vp-grid {
  max-width: 760px; margin: 18px auto 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px;
}
.vp-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 14px;
  background: var(--bg-elev); display: flex; flex-direction: column; gap: 12px;
}
.vp-card.vp-selected { border-color: var(--accent); background: rgba(227, 111, 44, 0.10); }
.vp-card-top { display: flex; flex-direction: column; gap: 3px; }
.vp-label { font-weight: 700; font-size: 15px; }
.vp-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ok); border: 1px solid rgba(16,185,129,.4); border-radius: 6px; padding: 1px 6px;
}
.vp-note { font-size: 12px; color: var(--fg-muted); }
.vp-actions { display: flex; gap: 8px; align-items: stretch; margin-top: auto; }
.vp-actions form { margin: 0; flex: 1; }
.vp-preview { font-size: 13px; padding: 9px 12px; white-space: nowrap; }
.vp-preview.vp-playing { border-color: var(--accent); color: var(--accent-soft); }
.vp-use-btn {
  width: 100%; font: inherit; font-weight: 700; cursor: pointer;
  border: none; border-radius: 10px; padding: 9px 12px;
  background: var(--accent); color: #fff;
}
.vp-use-btn:hover { background: var(--accent-soft); }
.vp-use-btn:disabled { background: var(--bg-soft); color: var(--fg-muted); cursor: default; }
.vp-reset { margin-top: 16px; }
@media (prefers-reduced-motion: reduce) {
  .jorge-avatar.speaking { box-shadow: none; }
}
