/* ═══════════ TOKENS ═══════════ */
:root {
  --bg: #060609;
  --bg-card: #0c0d14;
  --bg-card-2: #10111a;
  --bg-inset: #090a10;
  --border: #1d1f2e;
  --border-soft: #16182404;
  --text: #eef0f6;
  --text-dim: #9aa0b4;
  --text-faint: #5e6478;
  --blue: #3b82f6;
  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --magenta: #d946ef;
  --green: #22c55e;
  --amber: #f59e0b;
  --grad: linear-gradient(90deg, #2563eb 0%, #7c3aed 60%, #a855f7 100%);
  --radius: 14px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

h1,
h2 {
  font-weight: 700;
}

/* ═══════════ TOP BAR ═══════════ */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: inline-flex;
  transition:
    color 0.15s,
    background 0.15s;
}
.icon-btn:hover {
  color: var(--text);
  background: var(--bg-card-2);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.version-pill {
  border: 1px solid #24406e;
  color: #7fb0f5;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 999px;
}

.topbar-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
}
.topbar-title {
  color: var(--text-dim);
  font-size: 13px;
}
.topbar-divider {
  width: 1px;
  height: 26px;
  background: var(--border);
  margin: 0 6px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 10px;
}
.user-chip:hover {
  background: var(--bg-card-2);
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-dim);
}
.avatar svg {
  width: 17px;
  height: 17px;
}
.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.user-meta strong {
  font-size: 13px;
}
.user-meta small {
  color: var(--text-faint);
  font-size: 11px;
}
.chevron {
  width: 15px;
  height: 15px;
  color: var(--text-faint);
}

/* ═══════════ LAYOUT ═══════════ */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card-heading {
  font-size: 15px;
  margin-bottom: 18px;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.card-title-row.no-margin {
  margin-bottom: 0;
}
.card-title-row.space-between {
  justify-content: space-between;
  align-items: flex-start;
}
.card-title-row h2 {
  font-size: 16px;
}
.card-subtitle {
  color: var(--text-faint);
  font-size: 12px;
  margin-top: 2px;
}

.mini-icon {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card-2);
  display: grid;
  place-items: center;
  color: var(--violet);
}
.mini-icon svg {
  width: 18px;
  height: 18px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
}

/* status pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.status-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.status-pill.ok {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}
.status-pill.ok .dot {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}
.status-pill.warn {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.status-pill.warn .dot {
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber);
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition:
    color 0.15s,
    border-color 0.15s;
}
.ghost-btn:hover {
  color: var(--text);
  border-color: #2c2f45;
}
.ghost-btn svg {
  width: 14px;
  height: 14px;
}

/* ═══════════ HERO ═══════════ */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
  padding-top: 12px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand-logo {
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 0 18px rgba(139, 92, 246, 0.45));
}
.brand-word {
  display: flex;
  flex-direction: column;
}
.brand-kicker {
  letter-spacing: 0.55em;
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
}
.brand-name {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1.1;
  background: linear-gradient(90deg, #e0e7ff, #ffffff 40%, #c7d2fe);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-tagline {
  letter-spacing: 0.3em;
  font-size: 10.5px;
  color: var(--text-faint);
  font-weight: 600;
  margin-top: 4px;
}

.hero-brand h1 {
  font-size: 27px;
  margin-top: 26px;
}
.hero-sub {
  color: var(--text-dim);
  margin-top: 8px;
  font-size: 14px;
}
.hero-underline {
  display: block;
  width: 46px;
  height: 3px;
  border-radius: 3px;
  background: var(--grad);
  margin-top: 18px;
}

/* summary grid */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 18px;
}
.summary-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.summary-icon {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card-2);
  display: grid;
  place-items: center;
  color: var(--violet);
}
.summary-icon svg {
  width: 19px;
  height: 19px;
}
.summary-item strong {
  display: block;
  font-size: 13px;
}
.summary-item small {
  font-size: 12px;
  color: #4ade80;
}
.summary-item small.neutral {
  color: var(--text-dim);
}

/* ═══════════ CONSOLA + RESULTADO ═══════════ */
.console-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  align-items: stretch;
}

#question {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  padding: 14px 16px;
}
#question::placeholder {
  color: var(--text-faint);
}
#question:focus {
  outline: none;
  border-color: #3f4470;
}

.char-counter {
  text-align: right;
  font-size: 11.5px;
  color: var(--text-faint);
  margin: 8px 2px 16px;
}

.run-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(90deg, #2563eb, #7c3aed 55%, #a855f7);
  border: none;
  border-radius: 12px;
  color: #fff;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  padding: 14px;
  cursor: pointer;
  transition:
    filter 0.15s,
    transform 0.1s;
}
.run-btn:hover {
  filter: brightness(1.12);
}
.run-btn:active {
  transform: scale(0.99);
}
.run-btn:disabled {
  filter: grayscale(0.4) brightness(0.7);
  cursor: wait;
}
.run-btn svg {
  width: 17px;
  height: 17px;
}

.flow-label {
  margin-top: 20px;
}

.flow-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 999px;
}
.chip-arrow {
  color: var(--text-faint);
  font-size: 14px;
}

.reasoning-flow.hidden {
  display: none;
}

.empty-response {
  color: var(--text-faint);
  font-size: 14px;
}

.result-card .result-bubble {
  min-height: 190px;
}

.result-bubble {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: 12px;
  padding: 18px 20px;
}
.result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.g-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.result-author {
  color: var(--text-dim);
  font-size: 13px;
}
#result-text {
  font-size: 15px;
  line-height: 1.65;
}

/* ═══════════ INSPECTOR ═══════════ */
.pipeline {
  display: flex;
  align-items: flex-start;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.pipe-step {
  flex: 1 1 0;
  min-width: 106px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.pipe-node {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid var(--violet);
  background: radial-gradient(circle at 30% 25%, #1b1440, #0c0d14 70%);
  display: grid;
  place-items: center;
  color: #a78bfa;
  z-index: 1;
}
.pipe-step.inactive .pipe-node {
  border-color: #33364a;
  background: var(--bg-card-2);
  color: var(--text-faint);
}
.pipe-node svg {
  width: 22px;
  height: 22px;
}

.pipe-check {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--bg-card);
  display: grid;
  place-items: center;
}
.pipe-check svg {
  width: 9px;
  height: 9px;
  stroke: #05240f;
  stroke-width: 3;
}

/* connector */
.pipe-step::after {
  content: '';
  position: absolute;
  top: 27px;
  left: calc(50% + 29px);
  width: calc(100% - 58px);
  border-top: 2px solid #3f3470;
}
.pipe-step.to-inactive::after,
.pipe-step.inactive::after {
  border-top-style: dotted;
  border-top-color: #33364a;
}
.pipe-step:last-child::after {
  display: none;
}

.pipe-title {
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
}
.pipe-sub,
.pipe-sub2 {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 3px;
}
.pipe-sub2 {
  color: var(--text-faint);
}

/* ═══════════ BOTTOM ROW ═══════════ */
.bottom-row {
  display: grid;
  grid-template-columns: 1.15fr 0.75fr 1.4fr;
  gap: 26px;
  align-items: start;
}

/* estado */
.state-list {
  list-style: none;
}
.state-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-soft);
}
.state-list li + li {
  border-top: 1px solid var(--border);
}
.state-list strong {
  display: block;
  font-size: 13px;
}
.state-list small {
  color: var(--text-faint);
  font-size: 11.5px;
}

/* providers */
.provider-box {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  min-width: 0;
}
.provider-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
.provider-heading {
  min-width: 0;
  flex: 1 1 auto;
}
.provider-name {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  max-width: 100%;
  font-size: 13.5px;
  line-height: 1.2;
  overflow-wrap: normal;
  word-break: normal;
}
.provider-name > span,
.provider-slug,
.provider-name-subtitle {
  max-width: 100%;
  overflow-wrap: normal;
  word-break: normal;
}
.provider-name > span,
.provider-slug {
  overflow: hidden;
  text-overflow: ellipsis;
}
.provider-name-subtitle,
.provider-row small {
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 500;
}
.provider-slug {
  display: block;
  margin-top: 3px;
  white-space: nowrap;
}
.provider-row .status-pill {
  flex: 0 0 auto;
  max-width: 100%;
  white-space: nowrap;
}
.provider-card-compact {
  padding: 14px 16px;
  gap: 0;
}
.provider-summary-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.provider-summary-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}
.provider-summary-item > span:first-child {
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 600;
}
.provider-summary-item strong {
  max-width: 100%;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.provider-summary-item .status-pill {
  max-width: 100%;
  white-space: normal;
}
.provider-kv-grid {
  align-items: start;
}
.provider-kv-grid strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  word-break: normal;
  white-space: nowrap;
}
.providers-card .field-label {
  margin-top: 18px;
}

.model-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.model-chips .chip {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
.provider-model-chips .chip {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip.active-model {
  border-color: #3b5fa8;
  color: #93bbf7;
  background: rgba(59, 130, 246, 0.08);
}

/* logs */
.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.log-table th {
  text-align: left;
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 8px 10px;
  border-bottom: 1px solid var(--border);
}
.log-table .th-right,
.log-table td:last-child {
  text-align: right;
}
.log-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.log-table tr:last-child td {
  border-bottom: none;
}
.log-time {
  color: var(--text-dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.log-engine {
  font-weight: 700;
  white-space: nowrap;
}
.log-msg {
  color: var(--text-dim);
}
.log-level {
  display: inline-block;
  background: rgba(59, 130, 246, 0.15);
  color: #7fb0f5;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
}

/* ═══════════ FOOTER ═══════════ */
.footer {
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 12.5px;
  text-align: center;
  padding: 22px;
  margin-top: 12px;
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 1024px) {
  .hero,
  .console-row {
    grid-template-columns: 1fr;
  }
  .bottom-row {
    grid-template-columns: 1fr;
  }
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .brand-name {
    font-size: 34px;
  }
  .user-meta,
  .topbar-title {
    display: none;
  }
  .summary-grid {
    grid-template-columns: 1fr;
  }
  .pipeline {
    flex-wrap: nowrap;
  }
}

/* ═══════════ OBSERVABILIDAD COGNITIVA ═══════════ */
.observability-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 24px;
}
.trace-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.trace-meta {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.trace-meta small {
  display: block;
  color: var(--text-faint);
  font-size: 11px;
  margin-bottom: 4px;
}
.trace-meta strong {
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.trace-timeline {
  display: grid;
  gap: 10px;
}
.trace-stage {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-left: 3px solid var(--violet);
  border-radius: 12px;
  padding: 11px 13px;
}
.trace-stage strong {
  display: block;
  font-size: 12.5px;
}
.trace-stage small {
  color: var(--text-faint);
  font-size: 11.5px;
}
.trace-duration {
  color: #93bbf7;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.execution-list {
  list-style: none;
  display: grid;
  gap: 10px;
}
.execution-list li {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.execution-list strong {
  display: block;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
.execution-list small {
  color: var(--text-faint);
  font-size: 11.5px;
}
.engine-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.engine-tag {
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 11px;
  padding: 2px 8px;
}
@media (max-width: 1024px) {
  .observability-grid {
    grid-template-columns: 1fr;
  }
  .trace-meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ═══════════ GENESIS CONTROL CENTER v2 ═══════════ */
.control-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: calc(100vh - 68px);
}
.sidebar {
  border-right: 1px solid var(--border);
  background: linear-gradient(
    180deg,
    rgba(16, 17, 26, 0.96),
    rgba(6, 6, 9, 0.96)
  );
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: calc(100vh - 0px);
}
.sidebar-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 10px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.sidebar-brand strong {
  display: block;
  font-size: 13px;
}
.sidebar-brand small {
  color: var(--text-faint);
  font-size: 11px;
}
.sidebar-nav {
  display: grid;
  gap: 8px;
}
.nav-item {
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  border-radius: 12px;
  padding: 11px 13px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.nav-item:hover {
  color: var(--text);
  background: rgba(139, 92, 246, 0.08);
  border-color: var(--border);
}
.nav-item.active {
  color: #fff;
  background: linear-gradient(
    90deg,
    rgba(37, 99, 235, 0.28),
    rgba(124, 58, 237, 0.22)
  );
  border-color: #2e3a70;
  box-shadow: inset 3px 0 0 var(--violet);
}
.page-heading {
  display: grid;
  gap: 8px;
}
.page-heading h1 {
  font-size: 30px;
  letter-spacing: -0.02em;
}
.page-heading p {
  color: var(--text-dim);
  max-width: 760px;
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.metric-card,
.engine-card,
.execution-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.metric-card small {
  display: block;
  color: var(--text-faint);
  font-size: 11.5px;
  margin-bottom: 6px;
}
.metric-card strong {
  display: block;
  font-size: 20px;
}
.metric-card span {
  color: var(--text-dim);
  font-size: 12px;
}
.execution-grid,
.engine-grid,
.provider-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.execution-card {
  display: grid;
  gap: 12px;
}
.execution-card strong {
  overflow-wrap: anywhere;
}
.execution-card small,
.execution-card p {
  color: var(--text-dim);
}
.execution-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.execution-meta span,
.kv-grid span,
.kv-grid strong {
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 5px;
}
.execution-meta span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--text-dim);
  font-size: 11.5px;
}
.engine-card {
  display: grid;
  gap: 12px;
}
.provider-card {
  display: grid;
  gap: 14px;
  margin-bottom: 0;
}
.kv-grid {
  display: grid;
  grid-template-columns: minmax(120px, 0.55fr) 1fr;
  gap: 8px 12px;
  font-size: 12px;
}
.kv-grid span {
  color: var(--text-faint);
}
.kv-grid strong {
  color: var(--text-dim);
  overflow-wrap: anywhere;
}
.log-controls {
  display: grid;
  grid-template-columns: 1fr 160px 180px 120px;
  gap: 10px;
  margin-bottom: 18px;
}
.log-controls input,
.log-controls select {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}
.empty-state {
  color: var(--text-faint);
  padding: 18px;
  text-align: center;
}
.metadata-block {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-dim);
  overflow: auto;
  padding: 16px;
  max-height: 420px;
}

@media (max-width: 1180px) {
  .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .control-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .control-shell {
    display: block;
  }
  .sidebar {
    display: none;
    position: fixed;
    z-index: 20;
    inset: 58px auto 0 0;
    width: 280px;
    height: auto;
  }
  .sidebar.open {
    display: block;
  }
  .metrics-grid,
  .execution-grid,
  .engine-grid,
  .provider-grid,
  .settings-grid,
  .log-controls {
    grid-template-columns: 1fr;
  }
  .page {
    padding: 22px 16px 34px;
  }
}

.mode-select {
  width: 100%;
  margin: 6px 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text-main);
}

.hidden {
  display: none !important;
}
.reasoning-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.result-metadata {
  margin-top: 1rem;
}

.presentation-card {
  display: grid;
  gap: 1rem;
}
.presentation-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.presentation-title {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-strong, #f8fafc);
}
.presentation-summary {
  margin: 0.35rem 0 0;
  color: var(--text-muted, #94a3b8);
}
.presentation-item {
  margin-top: 0.8rem;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.42);
}
.presentation-item-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--text-strong, #f8fafc);
}
.presentation-item-meta {
  margin: 0.15rem 0;
  color: var(--text-muted, #94a3b8);
  font-size: 0.92rem;
}
.presentation-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.7rem;
}
.presentation-badge {
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: rgba(59, 130, 246, 0.18);
  color: #bfdbfe;
  font-size: 0.78rem;
  border: 1px solid rgba(147, 197, 253, 0.25);
}
.presentation-markdown {
  white-space: normal;
  line-height: 1.65;
}
.technical-details {
  margin-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding-top: 0.8rem;
}
.technical-details summary {
  cursor: pointer;
  color: var(--text-muted, #94a3b8);
  font-weight: 700;
}

/* Conversation response experience */
.conversation-panel {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
}

.conversation-log {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
}

.conversation-message {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.conversation-message.user {
  align-items: flex-end;
}

.conversation-message.assistant {
  align-items: flex-start;
}

.message-label {
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.message-bubble {
  width: min(100%, 720px);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
  padding: 16px 18px;
  background: rgba(15, 23, 42, 0.48);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.conversation-message.user .message-bubble {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.22),
    rgba(124, 58, 237, 0.18)
  );
  border-color: rgba(96, 165, 250, 0.3);
}

.conversation-text,
.presentation-copy,
.thinking-state {
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  margin: 0;
}

.thinking-state {
  color: #bfdbfe;
}

.conversation-empty {
  margin: 0;
}

.presentation-items {
  display: grid;
  gap: 12px;
}

.presentation-suggestions {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  color: var(--text-dim);
}

.presentation-suggestions p {
  margin: 0 0 8px;
  font-weight: 700;
}

.suggestion-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text);
}

.suggestion-list li + li {
  margin-top: 4px;
}

.result-card .result-bubble {
  min-height: 0;
}

@media (max-width: 760px) {
  .conversation-panel {
    padding: 14px;
  }

  .message-bubble {
    width: 100%;
  }

  .conversation-log {
    max-height: 480px;
  }
}

/* ═══════════ DUAL EXPERIENCE: PRODUCT WORKSPACE ═══════════ */
.view-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
}
.view-switch-btn {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
}
.view-switch-btn.active {
  background: var(--grad);
  color: #fff;
}

.product-shell {
  grid-template-columns: 220px minmax(0, 1fr);
}
.product-page {
  max-width: 1040px;
  gap: 22px;
}
.product-sidebar .sidebar-brand {
  padding-bottom: 18px;
}
.product-hero {
  padding-top: 10px;
}
.product-brand {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}
.product-brand .brand-row {
  justify-content: center;
}
.product-logo {
  width: 74px;
  height: 74px;
}
.product-brand .brand-name {
  font-size: 38px;
}
.product-brand h1 {
  font-size: 34px;
  letter-spacing: -0.02em;
}
.product-conversation-shell {
  display: grid;
  gap: 14px;
}
.product-conversation-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.product-conversation-header h2,
.product-suggestions h2 {
  font-size: 18px;
}
.product-conversation-header p {
  color: var(--text-dim);
  margin-top: 4px;
}
.product-conversation-panel {
  min-height: 45vh;
  display: flex;
  flex-direction: column;
}
.product-conversation-log {
  max-height: none;
  min-height: 260px;
  flex: 1 1 auto;
}
.product-input-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
}
.product-input-card #question {
  min-height: 112px;
}
.product-input-actions {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(180px, 0.58fr);
  gap: 14px;
  align-items: end;
}
.product-mode-field {
  display: grid;
  gap: 7px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
}
.product-mode-field .mode-select {
  margin: 0;
}
.product-suggestions {
  display: grid;
  gap: 14px;
  padding-bottom: 18px;
}
.suggestion-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.suggestion-btn {
  min-height: 70px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.55);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 14px;
  transition:
    border-color 0.15s,
    transform 0.1s,
    background 0.15s;
}
.suggestion-btn:hover {
  border-color: #3f4470;
  background: rgba(59, 130, 246, 0.12);
  transform: translateY(-1px);
}
body[data-view-mode='product'] .result-metadata,
body[data-view-mode='product'] .technical-details {
  display: none !important;
}

@media (max-width: 1024px) {
  .product-shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .suggestion-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .product-shell {
    display: block;
  }
  .product-input-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar-right {
    gap: 8px;
  }
  .version-pill,
  .topbar-sep,
  .topbar-right > .icon-btn {
    display: none;
  }
  .view-switch-btn {
    padding: 6px 9px;
  }
  .product-conversation-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .suggestion-buttons {
    grid-template-columns: 1fr;
  }
  .product-brand .brand-name {
    font-size: 30px;
  }
}

/* ═══════════ PX v1: Product Workspace ═══════════ */
body[data-view-mode='product'] {
  background:
    radial-gradient(circle at top center, rgba(124, 58, 237, 0.12), transparent 34rem),
    var(--bg);
}
body[data-view-mode='product'] .topbar {
  border-bottom-color: rgba(148, 163, 184, 0.08);
}
body[data-view-mode='product'] .footer {
  display: none;
}
.product-shell {
  grid-template-columns: 210px minmax(0, 1fr);
}
.product-page {
  width: 100%;
  max-width: 1380px;
  min-height: calc(100vh - 66px);
  padding: 34px 36px 56px;
  gap: 34px;
}
.product-sidebar {
  border-right-color: rgba(148, 163, 184, 0.08);
  background: rgba(6, 6, 9, 0.78);
}
.product-sidebar .sidebar-brand {
  margin-bottom: 12px;
}
.product-sidebar .nav-item {
  border: 0;
  background: transparent;
  border-radius: 14px;
  color: rgba(238, 240, 246, 0.68);
  font-weight: 650;
}
.product-sidebar .nav-item.active,
.product-sidebar .nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.product-hero {
  padding: 22px 0 2px;
}
.product-brand {
  gap: 18px;
}
.product-brand h1 {
  display: none;
}
.product-logo {
  width: 88px;
  height: 88px;
}
.product-brand .brand-name {
  font-size: clamp(38px, 5vw, 58px);
  line-height: 0.95;
  letter-spacing: -0.06em;
}
.product-brand .brand-kicker {
  color: rgba(154, 160, 180, 0.76);
}
.product-brand .hero-sub {
  color: rgba(238, 240, 246, 0.74);
  font-size: clamp(16px, 2vw, 21px);
  letter-spacing: 0.02em;
}
.product-workspace-grid {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 52px);
  align-items: stretch;
}
.recent-conversations {
  align-self: start;
  display: grid;
  gap: 18px;
  padding-top: 8px;
}
.recent-conversations-header {
  display: grid;
  gap: 12px;
}
.recent-conversations-header p {
  color: rgba(238, 240, 246, 0.78);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.new-context-btn {
  width: fit-content;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  padding: 9px 14px;
}
.recent-conversation-list {
  display: grid;
  gap: 6px;
}
.recent-conversation-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(238, 240, 246, 0.72);
  cursor: pointer;
  font: inherit;
  padding: 10px 8px;
  text-align: left;
}
.recent-conversation-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}
.product-conversation-shell {
  display: grid;
  gap: 16px;
}
.product-conversation-panel {
  min-height: clamp(430px, 52vh, 720px);
  padding: clamp(18px, 3vw, 34px);
  border: 0;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.product-conversation-log {
  min-height: 360px;
  gap: 24px;
}
.conversation-message {
  gap: 6px;
}
.message-label {
  color: rgba(154, 160, 180, 0.78);
  font-size: 12px;
  letter-spacing: 0.03em;
}
.message-bubble {
  width: min(100%, 780px);
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
}
.conversation-message.user .message-bubble {
  width: fit-content;
  max-width: min(76%, 680px);
  border: 1px solid rgba(147, 197, 253, 0.16);
  background: rgba(59, 130, 246, 0.1);
  border-radius: 22px 22px 6px 22px;
  padding: 12px 16px;
}
.conversation-message.assistant .message-bubble {
  max-width: 860px;
}
.message-actions {
  display: flex;
  gap: 6px;
  opacity: 0.52;
  transition: opacity 0.15s;
}
.conversation-message:hover .message-actions {
  opacity: 1;
}
.message-actions button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  padding: 5px 8px;
}
.message-actions button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.presentation-card {
  gap: 14px;
}
.presentation-title {
  font-size: 16px;
  font-weight: 760;
}
.presentation-item {
  margin-top: 0;
  border-color: rgba(148, 163, 184, 0.13);
  background: rgba(255, 255, 255, 0.035);
}
.presentation-markdown,
.presentation-copy,
.conversation-text {
  font-size: 15.5px;
}
.product-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
}
.product-suggestions .suggestion-btn {
  min-height: 0;
  border-color: rgba(148, 163, 184, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(238, 240, 246, 0.76);
  font-size: 13px;
  font-weight: 650;
  padding: 8px 12px;
}
.product-input-card {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.045);
  padding: 16px 18px 14px;
}
.product-input-card #question {
  min-height: 92px;
  border: 0;
  background: transparent;
  resize: vertical;
  padding: 8px 0 14px;
}
.product-input-card #question:focus {
  outline: none;
  box-shadow: none;
}
.product-input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  padding-top: 12px;
}
.product-input-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.product-mode-field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.product-mode-field .mode-select {
  width: auto;
  min-width: 150px;
  border: 0;
  background: transparent;
  padding: 0;
}
.product-run-btn {
  width: auto;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
}
.product-placeholder-page {
  max-width: 720px;
  margin: 18vh auto 0;
  text-align: center;
}
.placeholder-kicker {
  color: var(--violet);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.product-placeholder-page h1 {
  margin-top: 8px;
  font-size: clamp(34px, 5vw, 54px);
}
.product-placeholder-page p:last-child {
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 17px;
}

@media (max-width: 980px) {
  .product-workspace-grid {
    grid-template-columns: 1fr;
  }
  .recent-conversations {
    order: 2;
  }
  .recent-conversation-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .product-page {
    padding: 24px 18px 42px;
  }
  .product-input-footer {
    align-items: stretch;
    flex-direction: column;
  }
  .product-run-btn {
    width: 100%;
  }
  .recent-conversation-list {
    grid-template-columns: 1fr;
  }
  .conversation-message.user .message-bubble {
    max-width: 92%;
  }
}

/* ═══════════ Bundle 33.1: Product Workspace Visual Alignment ═══════════ */
body[data-view-mode='product'] {
  background:
    radial-gradient(circle at 52% 8%, rgba(124, 58, 237, 0.18), transparent 28rem),
    radial-gradient(circle at 82% 34%, rgba(59, 130, 246, 0.08), transparent 24rem),
    #05060d;
}
body[data-view-mode='product'] .topbar-title,
body[data-view-mode='product'] .topbar-sep {
  display: none;
}
.product-shell {
  grid-template-columns: 260px minmax(0, 1fr);
}
.product-page {
  max-width: none;
  min-height: calc(100vh - 66px);
  padding: clamp(30px, 5vw, 70px) clamp(24px, 7vw, 112px) 54px;
}
.product-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 16px;
  border-right: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(5, 6, 13, 0.84);
  backdrop-filter: blur(20px);
}
.product-sidebar .sidebar-brand {
  align-items: center;
  margin: 30px 14px 28px;
}
.product-sidebar .g-avatar {
  box-shadow: 0 0 28px rgba(168, 85, 247, 0.38);
}
.product-sidebar .sidebar-nav {
  gap: 10px;
}
.product-sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: rgba(238, 240, 246, 0.78);
  padding: 0 14px;
}
.product-sidebar .nav-item.active {
  border-color: rgba(168, 85, 247, 0.34);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.34), rgba(255, 255, 255, 0.055));
  box-shadow: inset 3px 0 0 #a855f7;
}
.sidebar-icon {
  display: inline-grid;
  flex: 0 0 auto;
  height: 22px;
  place-items: center;
  width: 22px;
}
.sidebar-icon svg {
  height: 22px;
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
.sidebar-recents {
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  display: grid;
  gap: 12px;
  margin: 28px 0 0;
  padding: 22px 0 0;
}
.sidebar-section-title {
  color: rgba(203, 213, 225, 0.72);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0 14px;
  text-transform: uppercase;
}
.sidebar-recent-list {
  display: grid;
  gap: 4px;
}
.sidebar-recent-item {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 12px;
  color: rgba(238, 240, 246, 0.78);
  cursor: pointer;
  display: grid;
  font: inherit;
  font-size: 13px;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 9px;
  padding: 9px 10px;
  text-align: left;
}
.sidebar-recent-item:hover {
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}
.sidebar-recent-item time {
  color: rgba(154, 160, 180, 0.78);
  font-size: 12px;
}
.sidebar-new-context {
  justify-content: center;
  margin: auto 14px 8px;
  width: calc(100% - 28px);
  border-color: rgba(168, 85, 247, 0.7);
  color: #c084fc;
}
.product-workspace {
  display: grid;
  min-height: calc(100vh - 190px);
  place-items: center;
}
.product-empty-hero {
  display: grid;
  gap: 22px;
  justify-items: center;
  text-align: center;
}
.product-brand {
  align-items: center;
  display: grid;
  gap: 12px;
  justify-items: center;
}
.product-logo {
  height: 112px;
  width: 112px;
}
.product-brand .brand-name {
  font-size: clamp(42px, 5vw, 62px);
  letter-spacing: 0.34em;
  margin-right: -0.34em;
}
.product-brand .hero-sub {
  color: rgba(238, 240, 246, 0.68);
  font-size: 16px;
  letter-spacing: 0.1em;
  margin: 0;
  text-transform: uppercase;
}
.product-empty-hero h1 {
  color: rgba(248, 250, 252, 0.92);
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 720;
  margin: 12px 0 0;
}
.product-conversation-shell {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 900px;
  width: min(100%, 900px);
}
.product-conversation-panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-height: 0;
  padding: 0;
}
.product-workspace:not(.has-conversation) .product-conversation-panel {
  display: none;
}
.product-workspace:not(.has-conversation) .product-conversation-shell {
  align-items: center;
}
.product-workspace.has-conversation {
  align-content: start;
  place-items: stretch center;
}
.product-workspace.has-conversation .product-empty-hero {
  display: none;
}
.product-workspace.has-conversation .product-conversation-shell {
  max-width: 980px;
}
.product-conversation-log {
  gap: 24px;
  max-height: none;
  min-height: 0;
  overflow: visible;
  padding: 0 0 4px;
}
.conversation-message.user {
  align-items: flex-end;
}
.conversation-message.assistant {
  align-items: flex-start;
}
body[data-view-mode='product'] .message-label {
  color: rgba(203, 213, 225, 0.64);
  font-size: 12px;
  padding: 0 8px;
}
body[data-view-mode='product'] .message-bubble {
  box-shadow: none;
}
body[data-view-mode='product'] .conversation-message.user .message-bubble {
  background: linear-gradient(135deg, rgba(91, 76, 255, 0.44), rgba(168, 85, 247, 0.28));
  border: 1px solid rgba(168, 85, 247, 0.22);
  border-radius: 18px;
  max-width: min(74%, 720px);
  padding: 14px 18px;
}
body[data-view-mode='product'] .conversation-message.assistant .message-bubble {
  background: rgba(15, 23, 42, 0.38);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 20px;
  max-width: 820px;
  padding: 20px 22px;
}
.product-input-card {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.36);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 18px;
  width: 100%;
}
.product-workspace:not(.has-conversation) .product-input-card {
  margin-top: 6px;
}
.product-input-card #question {
  color: var(--text);
  min-height: 86px;
  resize: none;
}
.product-input-footer {
  border-top: 0;
}
.product-mode-field .mode-select {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  padding: 8px 34px 8px 12px;
}
.product-run-btn {
  background: linear-gradient(135deg, #3b82f6, #a855f7);
  border-radius: 14px;
  gap: 10px;
  min-width: 152px;
}
.product-suggestions {
  justify-content: center;
  order: 3;
}
.product-workspace.has-conversation .product-suggestions {
  display: none;
}
.product-suggestions .suggestion-btn {
  align-items: center;
  border-radius: 16px;
  display: inline-flex;
  gap: 10px;
  min-height: 50px;
  padding: 0 18px;
}
body[data-view-mode='product'] .result-metadata {
  display: none;
}
body[data-view-mode='product'] .presentation-item small,
body[data-view-mode='product'] .metadata-block,
body[data-view-mode='product'] .technical-details {
  display: none;
}
@media (max-width: 980px) {
  .product-shell {
    grid-template-columns: 1fr;
  }
  .product-sidebar {
    height: auto;
    position: relative;
  }
}

/* ═══════════ Bundle 33.2: Product Workspace UX Refinement ═══════════ */
body[data-view-mode='product'] {
  background:
    radial-gradient(ellipse 70% 115% at 54% 14%, rgba(124, 58, 237, 0.2), rgba(124, 58, 237, 0.08) 32%, transparent 70%),
    radial-gradient(circle at 84% 42%, rgba(59, 130, 246, 0.09), transparent 28rem),
    linear-gradient(180deg, #05060d 0%, #070813 54%, #05060d 100%);
  background-attachment: fixed;
}
.product-sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.product-sidebar .sidebar-nav {
  flex: 0 0 auto;
}
.sidebar-recents {
  flex: 1 1 auto;
  min-height: 0;
  gap: 14px;
  margin-top: 30px;
  padding-top: 24px;
}
.sidebar-section-title {
  color: rgba(203, 213, 225, 0.58);
  font-size: 10.5px;
  letter-spacing: 0.11em;
  padding: 0 16px;
}
.sidebar-recent-list {
  align-content: start;
  gap: 7px;
  min-height: 0;
  overflow-y: auto;
  padding: 0 4px 18px 0;
  scrollbar-width: thin;
}
.sidebar-recent-item {
  grid-template-columns: 28px minmax(0, 1fr) 46px;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px 8px 12px;
}
.sidebar-recent-item span:not(.sidebar-icon) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-recent-item time {
  justify-self: end;
  text-align: right;
  white-space: nowrap;
}
.sidebar-bottom-actions {
  display: grid;
  flex: 0 0 auto;
  gap: 10px;
  padding: 18px 0 2px;
}
.sidebar-new-context {
  margin: 0 14px;
}
.sidebar-logout-btn {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 14px;
  color: rgba(203, 213, 225, 0.68);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  gap: 10px;
  margin: 0 14px;
  min-height: 42px;
  padding: 0 14px;
}
.sidebar-logout-btn:hover {
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}
.product-workspace {
  transition: align-content 0.24s ease, place-items 0.24s ease;
}
.product-empty-hero {
  animation: productFadeUp 0.42s ease both;
  gap: 18px;
}
.product-logo {
  height: clamp(78px, 8vw, 86px);
  width: clamp(78px, 8vw, 86px);
}
.product-brand {
  gap: 10px;
}
.product-brand .brand-name {
  font-size: clamp(34px, 4.1vw, 50px);
}
.product-brand .hero-sub {
  font-size: 13px;
  letter-spacing: 0.12em;
}
.product-empty-hero h1 {
  color: rgba(248, 250, 252, 0.82);
  font-size: clamp(22px, 2.35vw, 30px);
  font-weight: 620;
  letter-spacing: -0.02em;
  margin-top: 8px;
}
.product-conversation-shell {
  animation: productFadeUp 0.36s ease both;
  gap: 22px;
}
.product-conversation-log {
  gap: 32px;
  transition: gap 0.2s ease;
}
body[data-view-mode='product'] .conversation-message.user .message-bubble {
  padding: 15px 19px;
}
body[data-view-mode='product'] .conversation-message.assistant .message-bubble {
  line-height: 1.65;
  padding: 22px 24px;
}
.product-input-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.46), rgba(15, 23, 42, 0.32));
  border-color: rgba(203, 213, 225, 0.2);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 20px 20px 16px;
}
.product-input-card #question {
  font-size: 15px;
  line-height: 1.55;
  min-height: 90px;
  padding: 6px 2px 16px;
}
.product-input-card #question::placeholder {
  color: rgba(203, 213, 225, 0.48);
}
.product-input-footer {
  align-items: center;
  padding-top: 10px;
}
.product-mode-field {
  color: rgba(203, 213, 225, 0.68);
  font-size: 12px;
  font-weight: 700;
}
.product-mode-field .mode-select {
  background: rgba(255, 255, 255, 0.045);
  color: rgba(248, 250, 252, 0.86);
  min-height: 38px;
}
.product-run-btn {
  box-shadow: 0 12px 32px rgba(124, 58, 237, 0.28);
  min-height: 44px;
}
.product-suggestions {
  gap: 10px;
}
.product-suggestions .suggestion-btn {
  background: rgba(15, 23, 42, 0.34);
  border-color: rgba(203, 213, 225, 0.14);
  color: rgba(238, 240, 246, 0.8);
  font-weight: 680;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.product-suggestions .suggestion-btn:hover {
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(168, 85, 247, 0.34);
  transform: translateY(-1px);
}
.suggestion-icon {
  display: inline-grid;
  height: 22px;
  place-items: center;
  width: 22px;
}
.suggestion-icon svg {
  height: 21px;
  width: 21px;
}
@keyframes productFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 1180px) {
  .product-page {
    padding-inline: clamp(22px, 4vw, 56px);
  }
}
@media (max-width: 980px) {
  .product-sidebar {
    max-height: 58vh;
  }
  .sidebar-bottom-actions {
    background: linear-gradient(180deg, rgba(5, 6, 13, 0), rgba(5, 6, 13, 0.96) 24%);
  }
}

/* ═══════════ Bundle 33.3: Sidebar & Empty State Refinement ═══════════ */
body[data-view-mode='product'] .product-sidebar {
  gap: 0;
  padding-bottom: 18px;
}
body[data-view-mode='product'] .product-sidebar .sidebar-brand {
  flex: 0 0 auto;
  margin: 22px 14px 24px;
}
body[data-view-mode='product'] .product-sidebar .sidebar-brand strong {
  font-size: 15px;
  letter-spacing: 0.01em;
}
body[data-view-mode='product'] .product-sidebar .sidebar-brand small {
  color: rgba(203, 213, 225, 0.56);
  font-size: 11px;
}
body[data-view-mode='product'] .product-sidebar .sidebar-nav {
  gap: 6px;
}
body[data-view-mode='product'] .product-sidebar .nav-item {
  min-height: 42px;
  padding: 0 12px;
}
.sidebar-primary-action {
  flex: 0 0 auto;
  padding: 18px 14px 0;
}
.sidebar-primary-action .sidebar-new-context {
  align-items: center;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.26), rgba(168, 85, 247, 0.14));
  border-color: rgba(168, 85, 247, 0.42);
  box-shadow: 0 12px 28px rgba(88, 28, 135, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: rgba(248, 250, 252, 0.94);
  display: inline-flex;
  font-size: 13px;
  gap: 8px;
  justify-content: center;
  margin: 0;
  min-height: 38px;
  padding: 8px 12px;
  width: 100%;
}
.sidebar-primary-action .sidebar-new-context:hover {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.34), rgba(168, 85, 247, 0.2));
  border-color: rgba(192, 132, 252, 0.58);
}
body[data-view-mode='product'] .sidebar-recents {
  border-top: 0;
  gap: 9px;
  margin: 18px 0 0;
  min-height: 0;
  padding: 0;
}
body[data-view-mode='product'] .sidebar-section-title {
  color: rgba(203, 213, 225, 0.62);
  font-size: 10px;
  letter-spacing: 0.12em;
  line-height: 1;
  padding: 0 16px;
}
body[data-view-mode='product'] .sidebar-recent-list {
  align-content: start;
  display: grid;
  gap: 3px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 8px 8px;
  scrollbar-color: rgba(148, 163, 184, 0.28) transparent;
  scrollbar-width: thin;
}
body[data-view-mode='product'] .sidebar-recent-list::-webkit-scrollbar {
  width: 6px;
}
body[data-view-mode='product'] .sidebar-recent-list::-webkit-scrollbar-track {
  background: transparent;
}
body[data-view-mode='product'] .sidebar-recent-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.24);
  border-radius: 999px;
}
body[data-view-mode='product'] .sidebar-recent-item {
  border-radius: 10px;
  font-size: 12.5px;
  grid-template-columns: 22px minmax(0, 1fr) max-content;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
}
body[data-view-mode='product'] .sidebar-recent-item .sidebar-icon,
body[data-view-mode='product'] .sidebar-recent-item .sidebar-icon svg {
  height: 18px;
  width: 18px;
}
body[data-view-mode='product'] .sidebar-recent-item time {
  color: rgba(154, 160, 180, 0.66);
  font-size: 11px;
}
body[data-view-mode='product'] .sidebar-bottom-actions {
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  gap: 0;
  margin-top: 10px;
  padding: 12px 0 0;
}
body[data-view-mode='product'] .sidebar-logout-btn {
  margin: 0 14px;
  min-height: 38px;
  padding: 0 12px;
}
.product-logo {
  height: clamp(60px, 6vw, 66px);
  width: clamp(60px, 6vw, 66px);
}
.product-empty-hero {
  gap: 14px;
  transform: translateY(-8px);
}
.product-brand {
  gap: 8px;
}
.product-brand .brand-name {
  font-size: clamp(29px, 3.45vw, 40px);
}
.product-brand .hero-sub {
  font-size: 12px;
  letter-spacing: 0.11em;
}
.product-empty-hero h1 {
  color: rgba(248, 250, 252, 0.76);
  font-size: clamp(19px, 2vw, 25px);
  font-weight: 560;
  letter-spacing: -0.015em;
  margin-top: 4px;
}
.product-workspace:not(.has-conversation) .product-input-card {
  margin-top: 0;
}
@media (max-width: 980px) {
  body[data-view-mode='product'] .product-sidebar {
    padding-bottom: 14px;
  }
  body[data-view-mode='product'] .sidebar-recents {
    max-height: 34vh;
  }
  body[data-view-mode='product'] .sidebar-bottom-actions {
    background: transparent;
  }
}

/* ═══════════ Bundle 33.4: Product Workspace Final Visual Polish ═══════════ */
.user-menu {
  position: relative;
}

.user-chip {
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
}

.user-dropdown {
  background: rgba(9, 12, 24, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 4px;
  min-width: 210px;
  opacity: 0;
  padding: 8px;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  transform: translateY(-4px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 40;
}

.user-menu.open .user-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.user-menu.open .chevron {
  transform: rotate(180deg);
}

.user-menu-item {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 11px;
  color: rgba(226, 232, 240, 0.82);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 13px;
  font-weight: 620;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  text-align: left;
}

.user-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.user-menu-item svg {
  fill: none;
  height: 17px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 17px;
}

.user-menu-separator {
  background: rgba(148, 163, 184, 0.12);
  display: block;
  height: 1px;
  margin: 4px 2px;
}

.user-menu-logout {
  color: rgba(248, 113, 113, 0.88);
}

body[data-view-mode='product'] .sidebar-recents {
  gap: 12px;
  padding-bottom: 2px;
}

body[data-view-mode='product'] .sidebar-section-title {
  line-height: 1.45;
  margin-bottom: 2px;
  padding: 3px 16px 4px;
}

body[data-view-mode='product'] .sidebar-bottom-actions,
body[data-view-mode='product'] .sidebar-logout-btn {
  display: none;
}

.product-empty-hero h1 {
  color: rgba(248, 250, 252, 0.7);
  font-size: clamp(18px, 1.75vw, 22px);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 2px 0 10px;
}

.product-workspace:not(.has-conversation) .product-input-card {
  margin-top: 12px;
}
