:root {
  --bg: #f6efe4;
  --bg-strong: #f1e0c8;
  --ink: #1f2d33;
  --muted: #61727b;
  --line: rgba(31, 45, 51, 0.12);
  --line-strong: rgba(31, 45, 51, 0.2);
  --panel: rgba(255, 250, 242, 0.86);
  --sea: #0c7f7f;
  --sea-deep: #0e5960;
  --sun: #e79158;
  --danger: #9f4f43;
  --shadow: 0 24px 60px rgba(63, 54, 37, 0.12);
  --title-font: "Avenir Next", "Segoe UI Variable Display", "Trebuchet MS", sans-serif;
  --body-font: "Segoe UI Variable Text", "Segoe UI", "Tahoma", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--body-font);
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.92), transparent 24%),
    radial-gradient(circle at 82% 14%, rgba(12, 127, 127, 0.14), transparent 18%),
    linear-gradient(180deg, #fdf8f0 0%, var(--bg) 36%, var(--bg-strong) 100%);
}

.app-frame {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  width: min(1580px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 32px;
}

.app-sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 32px);
  padding: 16px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background: rgba(252, 247, 240, 0.88);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 42px rgba(63, 54, 37, 0.08);
}

.sidebar-header,
.sidebar-actions,
.sidebar-links,
.sidebar-build-top {
  display: grid;
  gap: 12px;
}

.sidebar-brand {
  gap: 12px;
}

.sidebar-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(31, 45, 51, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
}

.sidebar-panel-intro {
  background:
    radial-gradient(circle at top right, rgba(12, 127, 127, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 250, 242, 0.98), rgba(252, 243, 230, 0.92));
}

.sidebar-actions {
  gap: 10px;
}

.history-new-button {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid rgba(12, 127, 127, 0.18);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(12, 127, 127, 0.12), rgba(231, 145, 88, 0.16));
  color: var(--sea-deep);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.sidebar-title {
  margin: 0;
  font-family: var(--title-font);
  font-size: clamp(1.7rem, 2.2vw, 2.5rem);
  line-height: 1.06;
}

.sidebar-text,
.sidebar-subtle {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.sidebar-panel-head .eyebrow,
.sidebar-label {
  color: var(--sea-deep);
}

.sidebar-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar-scenario-tabs {
  display: grid;
  gap: 10px;
  margin-top: 0;
}

.sidebar-scenario-tabs .scenario-tab {
  width: 100%;
  min-height: 64px;
}

.sidebar-build-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sidebar-build-grid strong,
.sidebar-build-name strong,
.sidebar-run strong {
  display: block;
  margin-top: 6px;
  font-size: 0.98rem;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.history-empty.hidden {
  display: none;
}

.history-item {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(31, 45, 51, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.history-item.active {
  border-color: rgba(12, 127, 127, 0.34);
  background:
    linear-gradient(135deg, rgba(12, 127, 127, 0.12), rgba(231, 145, 88, 0.14)),
    rgba(255, 255, 255, 0.88);
}

.history-item-title {
  font-weight: 700;
  line-height: 1.45;
}

.history-item-meta {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.app-workspace {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.workspace-topbar {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 24px;
  background: rgba(255, 250, 242, 0.78);
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 34px rgba(63, 54, 37, 0.06);
}

.workspace-topbar-copy h2 {
  margin: 0;
  font-family: var(--title-font);
  font-size: clamp(1.5rem, 2vw, 2rem);
}

.workspace-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.workspace-prompt-row {
  margin-top: 0;
}

.chat-shell-main {
  min-height: calc(100vh - 68px);
}

.chat-head-copy {
  display: grid;
  gap: 6px;
}

.chat-shell-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sea-deep);
}

.chat-shell-intro {
  margin: 0;
  color: var(--muted);
  line-height: 1.68;
  max-width: 62ch;
}

.workspace-evidence {
  display: grid;
  gap: 18px;
}

a {
  color: inherit;
}

.page-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.app-shell-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 24px;
  background: rgba(255, 250, 242, 0.72);
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 40px rgba(63, 54, 37, 0.08);
}

.app-brand,
.brand-mark,
.brand-copy,
.shell-actions {
  display: flex;
  align-items: center;
}

.app-brand {
  gap: 16px;
  flex-wrap: wrap;
}

.brand-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sea-deep);
}

.brand-mark {
  gap: 12px;
}

.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sea), var(--sun));
  box-shadow: 0 0 0 6px rgba(12, 127, 127, 0.08);
}

.brand-copy {
  flex-direction: column;
  align-items: flex-start;
}

.brand-copy strong {
  font-family: var(--title-font);
  font-size: 1.1rem;
}

.brand-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.9rem;
}

.shell-actions {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.locale-switch {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
}

.locale-button {
  min-width: 52px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.locale-button.active {
  background: linear-gradient(135deg, rgba(12, 127, 127, 0.12), rgba(231, 145, 88, 0.18));
  color: var(--sea-deep);
  font-weight: 700;
}

.shell-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(12, 127, 127, 0.18);
  border-radius: 999px;
  background: rgba(12, 127, 127, 0.08);
  color: var(--sea-deep);
  font: inherit;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
}

.shell-link:hover {
  border-color: rgba(12, 127, 127, 0.32);
  background: rgba(12, 127, 127, 0.14);
}

.shell-link-soft {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
  gap: 24px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(12, 127, 127, 0.92), rgba(22, 52, 70, 0.96)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -90px;
  top: -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 178, 127, 0.42), rgba(244, 178, 127, 0));
}

.hero-copy,
.hero-panel {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 248, 239, 0.78);
}

.hero h1,
.scenario-brief h2,
.panel-head h2,
.rail-head h2 {
  margin: 0;
  font-family: var(--title-font);
  line-height: 1.04;
}

.hero h1 {
  max-width: 12ch;
  font-size: clamp(2.3rem, 4vw, 4.6rem);
  color: #fff7eb;
}

.hero-text {
  max-width: 56ch;
  margin: 16px 0 0;
  font-size: 1.02rem;
  line-height: 1.75;
  color: rgba(255, 248, 239, 0.88);
}

.hero-value-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.hero-value-card {
  padding: 16px;
  border: 1px solid rgba(255, 248, 239, 0.14);
  border-radius: 20px;
  background: rgba(255, 248, 239, 0.08);
}

.hero-value-card strong {
  display: block;
  color: #fff9f2;
  font-size: 0.98rem;
  line-height: 1.35;
}

.hero-value-card p {
  margin: 8px 0 0;
  color: rgba(255, 248, 239, 0.8);
  line-height: 1.65;
  font-size: 0.92rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.hero-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-ribbon span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 248, 239, 0.18);
  border-radius: 999px;
  background: rgba(255, 248, 239, 0.1);
  color: rgba(255, 248, 239, 0.88);
  font-size: 0.84rem;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 248, 239, 0.14);
  color: #fff9f2;
  text-decoration: none;
}

.hero-link.muted {
  background: rgba(255, 248, 239, 0.08);
}

.hero-panel {
  display: grid;
  gap: 16px;
  align-content: start;
}

.run-stamp,
.meta-stack,
.about-panel,
.scenario-rail,
.scenario-brief,
.cards-panel {
  border: 1px solid rgba(31, 45, 51, 0.1);
  border-radius: 28px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 48px rgba(56, 49, 37, 0.08);
}

.run-stamp,
.meta-stack,
.about-panel,
.scenario-rail,
.scenario-brief,
.cards-panel {
  padding: 22px;
}

.stamp-label,
.meta-label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 248, 239, 0.72);
}

.run-stamp strong,
.meta-stack strong {
  color: #fff9f2;
  font-size: 1.06rem;
}

.meta-stack {
  display: grid;
  gap: 16px;
  background: rgba(255, 248, 239, 0.08);
}

.about-panel {
  display: grid;
  gap: 14px;
  background: rgba(255, 248, 239, 0.08);
}

.about-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.about-label {
  margin-bottom: 0;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.about-grid strong {
  color: #fff9f2;
  font-size: 0.98rem;
}

.about-note {
  margin: 0;
  color: rgba(255, 248, 239, 0.82);
  line-height: 1.65;
}

.scenario-layout {
  margin-top: 22px;
  display: grid;
  gap: 22px;
}

.decision-flow {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid rgba(31, 45, 51, 0.1);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.95), rgba(250, 241, 227, 0.82));
  box-shadow: 0 18px 48px rgba(56, 49, 37, 0.08);
}

.decision-flow .eyebrow {
  color: var(--sea-deep);
}

.decision-flow-head {
  display: grid;
  gap: 8px;
}

.decision-flow-head h2 {
  margin: 0;
  font-family: var(--title-font);
  font-size: clamp(1.7rem, 2.4vw, 2.5rem);
  line-height: 1.08;
}

.decision-flow-text {
  max-width: 70ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

.decision-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.decision-step,
.decision-flow-note {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
}

.decision-step {
  padding: 18px;
}

.decision-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(12, 127, 127, 0.12), rgba(231, 145, 88, 0.18));
  color: var(--sea-deep);
  font-family: var(--title-font);
  font-weight: 700;
}

.decision-step h3 {
  margin: 14px 0 8px;
  font-size: 1.02rem;
}

.decision-step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.68;
}

.decision-flow-note {
  display: grid;
  gap: 8px;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(12, 127, 127, 0.08), rgba(255, 255, 255, 0.82));
}

.decision-flow-note strong {
  font-size: 0.98rem;
  color: var(--sea-deep);
}

.decision-flow-note p {
  margin: 0;
  color: var(--ink);
  line-height: 1.68;
}

.scenario-stage {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.45fr);
  gap: 22px;
}

.scenario-brief {
  position: sticky;
  top: 20px;
  align-self: start;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.96), rgba(252, 243, 230, 0.86));
}

.scenario-brief .eyebrow,
.rail-head .eyebrow,
.panel-head .eyebrow {
  color: var(--sea-deep);
}

.scenario-brief h2,
.panel-head h2,
.rail-head h2 {
  font-size: clamp(1.6rem, 2vw, 2.3rem);
}

.brief-text,
.panel-note {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.metric-card,
.reason-block,
.risk-block,
.fact-grid,
.price-pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.metric-card {
  padding: 14px;
  border-radius: 20px;
}

.metric-card span,
.fact span,
.price-pill span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.metric-card strong,
.fact strong,
.price-pill strong {
  display: block;
  margin-top: 8px;
  font-size: 1.04rem;
}

.brief-block {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.brief-block h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.bullet-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.watch-list {
  color: var(--danger);
}

.scenario-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.scenario-tab {
  min-height: 56px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.scenario-tab strong,
.scenario-tab span {
  display: block;
}

.scenario-tab strong {
  font-size: 0.98rem;
}

.scenario-tab span {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--muted);
}

.scenario-tab.active {
  border-color: rgba(12, 127, 127, 0.5);
  background:
    linear-gradient(135deg, rgba(12, 127, 127, 0.12), rgba(231, 145, 88, 0.18)),
    rgba(255, 255, 255, 0.9);
}

.cards-panel {
  background:
    linear-gradient(180deg, rgba(255, 248, 239, 0.92), rgba(255, 255, 255, 0.82));
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.panel-note {
  max-width: 32ch;
  text-align: right;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.listing-card {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(31, 45, 51, 0.1);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 250, 242, 0.88));
  box-shadow: 0 16px 36px rgba(63, 54, 37, 0.08);
  overflow: hidden;
}

.listing-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--sea), var(--sun));
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 58px;
  padding: 0 12px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(12, 127, 127, 0.12), rgba(231, 145, 88, 0.22));
  font-family: var(--title-font);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--sea-deep);
}

.card-score {
  text-align: right;
}

.card-score span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-score strong {
  display: block;
  margin-top: 6px;
  font-size: 1.35rem;
}

.listing-card h3 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.3;
}

.listing-subline,
.card-caption {
  color: var(--muted);
  line-height: 1.6;
}

.price-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.price-pill {
  padding: 12px;
  border-radius: 18px;
  background: rgba(12, 127, 127, 0.08);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-size: 0.84rem;
}

.chip.badge {
  border-color: rgba(12, 127, 127, 0.22);
  color: var(--sea-deep);
  background: rgba(12, 127, 127, 0.08);
}

.chip.warn {
  border-color: rgba(159, 79, 67, 0.2);
  color: var(--danger);
  background: rgba(159, 79, 67, 0.08);
}

.chip.soft {
  color: var(--muted);
}

.reason-block,
.risk-block,
.fact-grid {
  padding: 16px;
  border-radius: 22px;
}

.reason-block h4,
.risk-block h4 {
  margin: 0 0 10px;
  font-size: 0.96rem;
}

.reason-block ul,
.risk-block ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.68;
}

.risk-block {
  background: rgba(159, 79, 67, 0.06);
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.fact {
  padding: 10px 0;
}

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.source-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  color: #fff8ef;
  background: linear-gradient(135deg, var(--sea), var(--sea-deep));
}

.loading-state {
  padding: 32px;
  border-radius: 24px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  text-align: center;
}

.chat-stage {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.chat-stage-copy,
.chat-shell {
  padding: 26px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 42px rgba(63, 54, 37, 0.08);
}

.chat-stage-copy {
  background:
    radial-gradient(circle at top right, rgba(12, 127, 127, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255, 250, 242, 0.96), rgba(252, 243, 230, 0.9));
}

.chat-stage-copy h1,
.chat-head h3 {
  margin: 0;
  font-family: var(--title-font);
}

.chat-stage-copy h1 {
  max-width: 15ch;
  font-size: clamp(2rem, 3.2vw, 3.4rem);
  line-height: 1.04;
}

.chat-stage-text {
  max-width: 72ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.76;
}

.chat-stage-benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.chat-stage-benefit {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
}

.chat-stage-benefit strong {
  display: block;
  font-size: 0.98rem;
}

.chat-stage-benefit p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.68;
}

.chat-prompt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chat-stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.chat-stage-action,
.chat-prompt,
.chat-settings-toggle,
.chat-save-button,
.chat-secondary-button,
.chat-send-button {
  border: 1px solid rgba(12, 127, 127, 0.18);
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
}

.chat-stage-action,
.chat-prompt,
.chat-settings-toggle,
.chat-secondary-button {
  min-height: 40px;
  padding: 0 16px;
  background: rgba(12, 127, 127, 0.08);
  color: var(--sea-deep);
}

.chat-stage-action-soft {
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  border-color: var(--line);
}

.chat-config-summary,
.chat-settings-note,
.chat-status {
  color: var(--muted);
  line-height: 1.6;
}

.chat-config-summary {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.72);
}

.chat-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(255, 255, 255, 0.9);
}

.chat-head,
.chat-composer-actions,
.chat-settings-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 420px;
  max-height: 640px;
  padding: 22px;
  border: 1px solid rgba(31, 45, 51, 0.08);
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(12, 127, 127, 0.06), transparent 22%),
    linear-gradient(180deg, rgba(248, 251, 252, 0.96), rgba(255, 250, 242, 0.88));
  overflow-y: auto;
}

.chat-message {
  max-width: min(760px, 92%);
  padding: 16px 18px;
  border-radius: 24px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.chat-message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(12, 127, 127, 0.14), rgba(231, 145, 88, 0.14));
  border: 1px solid rgba(12, 127, 127, 0.16);
}

.chat-message.assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(31, 45, 51, 0.08);
}

.chat-message-role {
  display: block;
  margin-bottom: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sea-deep);
}

.chat-message-body a {
  color: var(--sea-deep);
}

.chat-message-body strong {
  color: var(--ink);
}

.chat-supporting-cards {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(31, 45, 51, 0.08);
}

.chat-supporting-head strong {
  display: block;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.chat-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.chat-support-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(31, 45, 51, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(63, 54, 37, 0.06);
}

.chat-support-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.chat-support-card-copy h4 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.chat-support-card-location,
.chat-support-card-summary,
.chat-support-detail p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.chat-support-card-location {
  margin-top: 4px;
}

.chat-support-card-score {
  min-width: 72px;
  text-align: right;
}

.chat-support-card-score span,
.chat-support-detail span,
.chat-support-pill-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.chat-support-card-score strong,
.chat-support-pill-value {
  display: block;
  margin-top: 4px;
  color: var(--ink);
}

.chat-support-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-support-pill {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 96px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(248, 251, 252, 0.92);
}

.chat-support-detail {
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(31, 45, 51, 0.08);
  background: rgba(248, 251, 252, 0.84);
}

.chat-support-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chat-support-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(12, 127, 127, 0.08);
  color: var(--sea-deep);
  font-size: 0.82rem;
}

.chat-support-card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(12, 127, 127, 0.12), rgba(231, 145, 88, 0.14));
  color: var(--sea-deep);
  text-decoration: none;
  font-weight: 700;
}

.chat-settings-panel {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(248, 251, 252, 0.88);
}

.chat-settings-panel.hidden {
  display: none;
}

.chat-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.chat-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-field span {
  font-size: 0.84rem;
  color: var(--muted);
}

.chat-field-wide {
  grid-column: 1 / -1;
}

.chat-field input,
.chat-field textarea {
  width: 100%;
  border: 1px solid rgba(31, 45, 51, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  font: inherit;
}

.chat-field input {
  min-height: 46px;
  padding: 0 14px;
}

.chat-field textarea {
  min-height: 120px;
  resize: vertical;
  padding: 12px 14px;
}

.chat-composer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(31, 45, 51, 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.88);
}

.chat-save-button,
.chat-send-button {
  min-height: 44px;
  padding: 0 18px;
  color: #fff8ef;
  background: linear-gradient(135deg, var(--sea), var(--sea-deep));
}

.chat-send-button[disabled] {
  opacity: 0.58;
  cursor: wait;
}

.legacy-chat-workspace {
  display: none !important;
}

.evidence-hero {
  margin-top: 22px;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  padding: 24px;
}

.evidence-hero h1 {
  max-width: 16ch;
  font-size: clamp(1.9rem, 3vw, 3.2rem);
}

.evidence-hero::after {
  width: 220px;
  height: 220px;
  right: -70px;
  top: -50px;
}

@media (max-width: 1180px) {
  .app-frame {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .sidebar-build-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-shell-bar {
    align-items: flex-start;
  }

  .hero,
  .chat-stage-benefits,
  .scenario-stage,
  .chat-card-grid,
  .card-grid,
  .hero-value-grid,
  .decision-steps {
    grid-template-columns: 1fr;
  }

  .scenario-brief {
    position: static;
  }

  .chat-stage-copy h1 {
    max-width: none;
  }

  .panel-note {
    text-align: left;
  }
}

@media (max-width: 760px) {
  .app-frame {
    width: min(100% - 20px, 100%);
    padding-top: 16px;
  }

  .app-sidebar,
  .workspace-topbar,
  .chat-shell,
  .decision-flow,
  .scenario-rail,
  .scenario-brief,
  .cards-panel,
  .listing-card {
    padding: 18px;
    border-radius: 24px;
  }

  .sidebar-build-grid {
    grid-template-columns: 1fr 1fr;
  }

  .sidebar-links .shell-link,
  .sidebar-actions .shell-link,
  .locale-switch {
    width: 100%;
  }

  .page-shell {
    width: min(100% - 20px, 100%);
    padding-top: 16px;
  }

  .app-shell-bar {
    padding: 16px;
    border-radius: 22px;
  }

  .shell-actions {
    width: 100%;
  }

  .shell-link,
  .locale-switch {
    width: 100%;
  }

  .locale-switch {
    justify-content: stretch;
  }

  .locale-button {
    flex: 1;
  }

  .hero h1 {
    max-width: none;
  }

  .chat-stage-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-stage-action,
  .chat-prompt {
    width: 100%;
  }

  .price-strip,
  .fact-grid,
  .metric-grid,
  .about-grid,
  .chat-settings-grid,
  .sidebar-build-grid {
    grid-template-columns: 1fr;
  }

  .card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .source-link {
    width: 100%;
  }

  .chat-head,
  .chat-settings-actions,
  .chat-composer-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-thread {
    min-height: 360px;
    padding: 16px;
  }

  .chat-support-card-top {
    flex-direction: column;
  }

  .chat-support-card-score {
    text-align: left;
  }
}
