/* ============================================================
   OFFLINE-ASSIST.CSS — Command Bar + Tabbed Intelligence Panel
   Digital Atelier · World-Class Copilot Interface
   ============================================================ */

/* ── Page base ── */
body.assist-page {
  background-color: var(--bg-main);
  padding-top: calc(var(--nav-height) + var(--command-bar-height, 0px));
}

/* ══════════════════════════════════════════════════════════════
   COMMAND BAR — Sticky glassmorphism control strip
   ══════════════════════════════════════════════════════════════ */
.command-bar {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: var(--glass-border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, var(--glass-shadow);
  transition: box-shadow var(--dur-normal) var(--ease-out),
              border-color var(--dur-normal) var(--ease-out);
}

.command-bar-inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}

/* Recording state — red ambient glow */
body.is-recording .command-bar {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset,
              0 0 0 1px rgba(212, 83, 75, 0.2),
              0 4px 24px rgba(212, 83, 75, 0.12);
  border-bottom-color: rgba(212, 83, 75, 0.15);
}

/* ── Record controls ── */
.cb-record {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

.record-btn {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(122, 88, 59, 0.2);
  transition: all var(--dur-slow) var(--ease-out);
}

.record-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 28px rgba(122, 88, 59, 0.3);
}

.record-btn:active {
  transform: scale(0.95);
}

.record-icon {
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: all var(--dur-normal) var(--ease-out);
}

/* Recording state */
.record-btn.recording {
  background: linear-gradient(135deg, var(--danger), #c04040);
  box-shadow: 0 6px 20px rgba(212, 83, 75, 0.3);
}

.record-btn.recording .record-icon {
  border-radius: 4px;
  transform: scale(0.78);
}

.record-btn.recording::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(212, 83, 75, 0.25);
  animation: pulse-ring 1.5s ease-out infinite;
}

/* Wave indicator — visible only when recording */
.cb-wave {
  display: none;
  color: var(--danger);
}

body.is-recording .cb-wave { display: flex; }

/* ── Metrics ── */
.cb-metrics {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-shrink: 0;
}

.cb-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.cb-metric-value {
  font-family: "Noto Serif SC", serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.cb-metric-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--subtle);
}

.cb-metric-sep {
  width: 1px;
  height: 28px;
  background: var(--line);
}

/* ── Config area ── */
.cb-config {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-4);
  min-width: 0;
}

.config-pills {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.config-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.03);
  transition: all var(--dur-fast) ease;
  white-space: nowrap;
}

.config-pill:hover {
  background: var(--accent-2-soft);
}

.config-pill-label {
  font-size: 10px;
  color: var(--subtle);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.config-pill select {
  background: transparent !important;
  border: none !important;
  padding: 2px 0 !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--accent) !important;
  width: auto !important;
  cursor: pointer;
  box-shadow: none !important;
}

.toggle-compact {
  font-size: 12px;
  gap: 6px;
}

.toggle-compact span {
  font-size: 12px;
}

.cb-actions {
  display: flex;
  gap: var(--sp-2);
  flex-shrink: 0;
}

/* ── Status line ── */
.cb-status {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 var(--sp-4) var(--sp-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.cb-status p {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.cb-status-right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.assist-version-pill {
  padding: 2px 10px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-pill);
  font-size: 11px;
  color: var(--muted);
}

.assist-version-pill strong {
  color: var(--accent);
  font-weight: 700;
}

/* ── Context disclosure ── */
.cb-context {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 var(--sp-4) var(--sp-3);
}

.cb-context textarea {
  margin-top: var(--sp-2);
  min-height: 56px;
  font-size: 13px;
}

/* ══════════════════════════════════════════════════════════════
   MAIN SHELL — offset for command bar
   ══════════════════════════════════════════════════════════════ */
.assist-shell {
  padding-top: var(--sp-6);
}

/* ══════════════════════════════════════════════════════════════
   TAB BAR
   ══════════════════════════════════════════════════════════════ */
.assist-tab-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
  gap: var(--sp-4);
}

.assist-tab-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--bg-section);
  border-radius: 12px;
  width: fit-content;
  position: relative;
}

.assist-tab-bar .assist-tab {
  padding: 8px 24px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--dur-normal) ease;
  white-space: nowrap;
  box-shadow: none;
}

.assist-tab-bar .assist-tab:hover {
  color: var(--text);
  background: rgba(122, 88, 59, 0.06);
  box-shadow: none;
}

.assist-tab-bar .assist-tab.active {
  background: #ffffff;
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(122, 88, 59, 0.08);
}

.assist-tab-actions {
  display: flex;
  gap: var(--sp-2);
}

/* Ghost button override — prevent .shell button from overriding */
.assist-shell button.btn-ghost {
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  border: 1px solid var(--line);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
}

.assist-shell button.btn-ghost:hover {
  background: var(--bg-depth);
  color: var(--text);
  box-shadow: none;
  transform: none;
}

.assist-shell button.btn-ghost:disabled {
  opacity: 0.4;
  cursor: default;
  background: transparent;
  transform: none;
  box-shadow: none;
}

/* Tab panels */
.assist-tab-panel {
  display: none;
  animation: tabFadeIn var(--dur-slow) var(--ease-out) both;
}

.assist-tab-panel.active {
  display: block;
}

/* ══════════════════════════════════════════════════════════════
   TAB 1 — INSIGHT BENTO GRID
   ══════════════════════════════════════════════════════════════ */
.insight-hint {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: var(--sp-5);
  font-weight: 500;
}

.insight-bento {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--sp-5);
  margin-bottom: var(--sp-6);
}

/* ── Hero Command Card ── */
.hero-command-card {
  grid-row: 1 / 2;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius-card);
  padding: var(--sp-6);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset,
              0 16px 48px rgba(122, 88, 59, 0.06),
              0 2px 6px rgba(15, 20, 40, 0.03);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  animation: revealUp 600ms var(--ease-out) both;
  transition: box-shadow var(--dur-normal) ease;
}

.hero-command-card:hover {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset,
              0 24px 64px rgba(122, 88, 59, 0.09),
              0 4px 12px rgba(15, 20, 40, 0.04);
}

.hcc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line);
}

.hcc-header h2 {
  font-family: "Noto Serif SC", serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.hcc-badge {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-section);
  color: var(--subtle);
}

.hcc-badge.live {
  background: var(--success-soft);
  color: var(--success);
}

.hcc-badge.warning {
  background: var(--danger-soft);
  color: var(--danger);
}

.hcc-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* V2 Command card sections inside hero */
.hcc-body .command-card-section {
  margin-bottom: var(--sp-5);
}

.hcc-body .command-card-section:last-child {
  margin-bottom: 0;
}

.hcc-body .command-card-section h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--subtle);
  margin-bottom: var(--sp-3);
}

.hcc-body .command-card-section p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
}

.command-module-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.command-module-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

/* Alert section inside hero */
.hcc-body .hcc-alerts {
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  background: var(--danger-soft);
  border-radius: var(--radius-inner);
  border-left: 3px solid var(--danger);
}

.hcc-body .hcc-alerts h3 {
  color: var(--danger);
}

/* Result bullets (reused) */
.result-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.result-bullets li {
  position: relative;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
}

.result-bullets li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ── Insight Sidebar ── */
.insight-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.sidebar-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: var(--sp-5);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset,
              0 8px 24px rgba(15, 20, 40, 0.04);
  animation: revealUp 600ms var(--ease-out) both;
}

.sidebar-section:nth-child(2) {
  animation-delay: 80ms;
}

.sidebar-title {
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--subtle);
  margin-bottom: var(--sp-4);
}

/* Task Progress — compact inside sidebar */
.task-progress {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.task-item {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
}

.task-order {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-section);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--subtle);
  flex-shrink: 0;
}

.task-body { flex: 1; }

.task-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.task-bar {
  height: 4px;
  background: var(--bg-section);
  border-radius: 2px;
  overflow: hidden;
}

.task-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 600ms var(--ease-out);
}

.task-fill.good { background: var(--success); }
.task-fill.mid  { background: var(--gold); }
.task-fill.risk { background: var(--danger); }

/* Customer Signals */
.signal-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.signal-item {
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-depth);
  border-radius: var(--radius-input);
  transition: all var(--dur-fast) ease;
}

.signal-item:hover {
  background: var(--accent-2-soft);
}

.signal-item.warning {
  background: var(--danger-soft);
}

.signal-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--subtle);
  margin-bottom: 4px;
}

.signal-item p:not(.signal-label) {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  font-weight: 500;
}

/* Backward compat: .result-item and .evidence-label for other pages */
.result-item {
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-depth);
  border-radius: var(--radius-input);
  transition: all var(--dur-fast) ease;
}
.result-item:hover { background: var(--accent-2-soft); }
.result-item.warning { background: var(--danger-soft); }
.evidence-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--subtle);
  margin-bottom: 4px;
}

/* ── Skeleton in hero card ── */
.skeleton-container { padding: var(--sp-4); }
.skeleton-container .skeleton-line { margin-bottom: var(--sp-3); }
.skeleton-container .skeleton-block { margin-bottom: var(--sp-3); border-radius: var(--radius-inner); }

/* ── Source badges ── */
.hcc-badge.badge-llm { background: var(--accent-soft); color: var(--accent); }
.hcc-badge.badge-rules { background: var(--gold-soft); color: var(--accent-2); }
.hcc-badge.is-analyzing {
  animation: skeletonPulse 1.5s ease-in-out infinite;
  background: linear-gradient(90deg, var(--bg-section) 25%, var(--bg-depth) 50%, var(--bg-section) 75%);
  background-size: 200% 100%;
}

/* ── Analysis Timeline ── */
.analysis-timeline {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: var(--sp-5);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset,
              0 8px 24px rgba(15, 20, 40, 0.04);
  animation: revealUp 600ms var(--ease-out) both;
  animation-delay: 120ms;
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  overflow-y: auto;
}

.timeline-entry {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  cursor: default;
  transition: background var(--dur-fast) var(--ease-out);
}

.timeline-entry:hover { background: var(--bg-depth); }
.timeline-entry:last-child { border-bottom: none; }

.timeline-entry.has-warning {
  border-left: 3px solid var(--danger);
}

.timeline-slice-id {
  font-weight: 700;
  color: var(--accent);
  font-size: 12px;
  flex-shrink: 0;
  min-width: 44px;
}

.timeline-ts {
  font-size: 11px;
  color: var(--subtle);
  flex-shrink: 0;
  min-width: 44px;
}

.timeline-summary {
  flex: 1;
  color: var(--text);
  line-height: 1.5;
  font-weight: 500;
}

.timeline-source {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
}
.timeline-source.badge-llm { background: var(--accent-soft); color: var(--accent); }
.timeline-source.badge-rules { background: var(--gold-soft); color: var(--accent-2); }
.timeline-alert-count {
  font-size: 11px;
  color: var(--danger);
  font-weight: 500;
}
.timeline-list:not(.expanded) { max-height: 240px; overflow-y: auto; }
.timeline-list.expanded { max-height: none; }

/* Legacy analysis card compat (used by buildAnalysisHtml) */
.analysis-output-card {
  background: var(--bg-depth);
  border-radius: var(--radius-inner);
  margin-bottom: var(--sp-4);
  overflow: hidden;
  transition: all var(--dur-normal) ease;
  animation: revealScale var(--dur-slow) var(--ease-out) both;
}

.analysis-output-card.latest {
  background: var(--card);
  box-shadow: var(--shadow-ambient);
}

.analysis-output-card.warning {
  border-left: 4px solid var(--danger);
}

.analysis-output-section {
  padding: var(--sp-5);
}

.analysis-primary-section {
  background: rgba(255, 255, 255, 0.4);
}

.analysis-secondary-section {
  border-top: 1px solid var(--line);
  background: rgba(122, 88, 59, 0.03);
}

.analysis-output-section h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--subtle);
  margin-bottom: var(--sp-3);
}

/* ══════════════════════════════════════════════════════════════
   TAB 2 — TRANSCRIPT
   ══════════════════════════════════════════════════════════════ */
.transcript-controls {
  margin-bottom: var(--sp-5);
}

.tab-bar-inline {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-section);
  border-radius: 12px;
  width: fit-content;
  margin-bottom: var(--sp-4);
}

/* Transcript sub-tabs — match assist-tab style */
.tab-bar-inline .tab-btn {
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 8px 20px;
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--dur-normal) ease;
  box-shadow: none;
}

.tab-bar-inline .tab-btn:hover {
  color: var(--text);
}

.tab-bar-inline .tab-btn.active {
  background: #ffffff;
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(122, 88, 59, 0.08);
}

/* ── Hide separate stop button (record btn is now toggle) ── */
#stop-btn { display: none; }

.transcript-view {
  display: none;
}

.transcript-view.active {
  display: block;
  animation: tabFadeIn var(--dur-normal) var(--ease-out) both;
}

.transcript-output,
.transcript-text-output {
  background: var(--bg-depth);
  border-radius: var(--radius-inner);
  padding: var(--sp-4);
  font-size: 14px;
  line-height: 1.65;
  max-height: 600px;
  overflow-y: auto;
  min-height: 200px;
}

.transcript-output p,
.transcript-text-output p {
  margin-bottom: var(--sp-2);
}

.ts {
  font-size: 11px;
  color: var(--subtle);
  margin-right: var(--sp-2);
  font-variant-numeric: tabular-nums;
}

.speaker-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: var(--sp-2);
}

.speaker-a {
  background: var(--accent-soft);
  color: var(--accent);
}

.speaker-b {
  background: var(--success-soft);
  color: var(--success);
}

.speaker-pending {
  background: var(--bg-section);
  color: var(--subtle);
}

.interim {
  opacity: 0.55;
  font-style: italic;
}

.muted-line {
  color: var(--subtle);
  font-style: italic;
}

.transcript-text-group {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: var(--sp-4);
  margin-bottom: var(--sp-2);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--line);
}

.transcript-text-group:first-child {
  margin-top: 0;
}

.transcript-text-line {
  margin-bottom: var(--sp-1);
}

.transcript-text-speaker {
  font-weight: 600;
  color: var(--accent);
  margin-right: var(--sp-2);
}

/* ══════════════════════════════════════════════════════════════
   TAB 3 — DEBUG
   ══════════════════════════════════════════════════════════════ */
.debug-toolbar {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}

.debug-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}

.debug-panel {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.debug-panel-title {
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--subtle);
}

.debug-output {
  background: var(--bg-depth);
  border-radius: var(--radius-inner);
  padding: var(--sp-3);
  font-size: 12px;
  line-height: 1.5;
  max-height: 400px;
  overflow-y: auto;
  min-height: 120px;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
}

/* Slice queue items */
.slice-item {
  padding: var(--sp-2) var(--sp-3);
  border-radius: 6px;
  margin-bottom: var(--sp-2);
  background: rgba(0, 0, 0, 0.02);
}

.slice-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.slice-item-head strong {
  font-size: 12px;
}

.slice-item-state {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}

.slice-item-state.pending   { background: var(--bg-section); color: var(--subtle); }
.slice-item-state.processing { background: var(--warning-soft); color: var(--warning); }
.slice-item-state.success   { background: var(--success-soft); color: var(--success); }
.slice-item-state.failed    { background: var(--danger-soft); color: var(--danger); }

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

/* Analysis log items */
.analysis-log-item,
.runtime-error-item {
  padding: var(--sp-1) var(--sp-2);
  border-radius: 4px;
  margin-bottom: var(--sp-1);
}

.analysis-log-item.error,
.runtime-error-item {
  color: var(--danger);
}

.analysis-log-head,
.runtime-error-head {
  display: flex;
  gap: var(--sp-2);
  font-size: 11px;
  color: var(--subtle);
  margin-bottom: 1px;
}

.analysis-log-msg,
.runtime-error-msg {
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
}

/* ══════════════════════════════════════════════════════════════
   TOGGLE (shared)
   ══════════════════════════════════════════════════════════════ */
.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  user-select: none;
}

.toggle-label input[type="checkbox"] {
  appearance: none;
  width: 36px;
  height: 20px;
  background: var(--bg-section);
  border-radius: 10px;
  position: relative;
  transition: all var(--dur-normal) ease;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle-label input[type="checkbox"]::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: all var(--dur-normal) ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.toggle-label input[type="checkbox"]:checked {
  background: var(--accent);
}

.toggle-label input[type="checkbox"]:checked::before {
  transform: translateX(16px);
}

/* ══════════════════════════════════════════════════════════════
   EMPTY / LOADING STATES
   ══════════════════════════════════════════════════════════════ */
.hcc-skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-4) 0;
}

/* ── Task focus highlight ── */
.task-item.focus {
  background: var(--accent-soft);
  border-radius: var(--radius-inner);
  padding: var(--sp-2);
  border-left: 3px solid var(--accent);
}

/* ── Signal confidence badges ── */
.signal-confidence {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  margin-left: var(--sp-2);
  vertical-align: middle;
}
.signal-confidence-high { background: var(--success-soft); color: var(--success); }
.signal-confidence-medium { background: var(--gold-soft); color: var(--accent-2); }
.signal-confidence-low { background: var(--bg-section); color: var(--subtle); }

/* ── Status error state ── */
#offline-status.error { color: var(--danger); }

/* ── Warning states ── */
.hcc-body.warning { border-left: 3px solid var(--danger); }
.signal-list.warning { border-left: 3px solid var(--warning); }

/* ── Toast notifications ── */
.toast-container {
  position: fixed;
  top: calc(var(--nav-height) + var(--command-bar-height, 0px) + 12px);
  right: var(--sp-4);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius-inner);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(15, 20, 40, 0.1);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur-normal) var(--ease-out), transform var(--dur-normal) var(--ease-out);
  animation: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast-info {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
}
.toast-success {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid var(--success);
}

.hidden { display: none !important; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 1024px) {
  .insight-bento {
    grid-template-columns: 1fr;
  }

  .hero-command-card {
    min-height: 280px;
  }

  .insight-sidebar {
    flex-direction: row;
    gap: var(--sp-4);
  }

  .insight-sidebar .sidebar-section {
    flex: 1;
  }

  .debug-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .command-bar-inner {
    flex-wrap: wrap;
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
  }

  .cb-record {
    order: 1;
  }

  .cb-wave { display: none; }

  .cb-metrics {
    order: 2;
    gap: var(--sp-3);
  }

  .cb-metric-value {
    font-size: 16px;
  }

  .cb-metric-label { display: none; }

  .cb-config {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
  }

  .config-pills {
    overflow-x: auto;
    flex-wrap: nowrap;
    width: 100%;
    padding-bottom: var(--sp-1);
    -webkit-overflow-scrolling: touch;
  }

  .cb-actions {
    margin-left: auto;
  }

  .cb-context textarea { min-height: 40px; }

  .assist-tab-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: auto;
  }

  .assist-tab {
    padding: 10px 16px;
    font-size: 13px;
    min-height: 44px;
  }

  .assist-tab-actions {
    gap: var(--sp-1);
  }

  .assist-tab-actions .btn-sm {
    font-size: 11px;
    padding: 4px 8px;
  }

  .insight-bento {
    grid-template-columns: 1fr;
  }

  .insight-sidebar {
    flex-direction: column;
  }

  .hero-command-card {
    min-height: 200px;
    padding: var(--sp-4);
  }

  .sidebar-title { font-size: 14px; }

  .task-item { padding: var(--sp-1) 0; }
  .task-order { width: 20px; height: 20px; font-size: 11px; }

  .debug-grid {
    grid-template-columns: 1fr;
  }

  .timeline-entry {
    flex-wrap: wrap;
  }

  .shell.assist-shell {
    padding: 0 var(--sp-3) var(--sp-12);
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .assist-tab-strip {
    flex-wrap: wrap;
  }

  .assist-tab-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .record-btn { width: 40px; height: 40px; }
  .record-icon { width: 14px; height: 14px; }

  .cb-metric-sep:last-of-type {
    display: none;
  }

  .cb-metrics .cb-metric:last-child {
    display: none;
  }

  .cb-metric-value { font-size: 14px; }

  .config-pill-label {
    display: none;
  }

  .hero-command-card {
    min-height: 160px;
    padding: var(--sp-3);
  }

  .analysis-output-card { padding: var(--sp-3); }
  .command-card-section h3 { font-size: 13px; }

  .assist-tab {
    padding: 6px 12px;
    font-size: 11px;
    min-height: 36px;
  }

  .timeline-entry { font-size: 12px; }
  .timeline-summary { max-width: 120px; }
}
