:root {
  --bg: #e8decf;
  --surface: rgba(250, 245, 236, 0.86);
  --surface-strong: #fffaf1;
  --surface-dark: #0d2a22;
  --ink: #18232d;
  --muted: #566673;
  --line: rgba(24, 35, 45, 0.14);
  --brand: #128c7e;
  --brand-deep: #075e54;
  --accent: #25d366;
  --accent-deep: #0f8b3d;
  --mint: #dcf8c6;
  --gold-wash: rgba(37, 211, 102, 0.14);
  --success: #15803d;
  --warning: #92400e;
  --shadow: 0 20px 45px rgba(58, 40, 18, 0.16);
  --shadow-strong: 0 30px 78px rgba(31, 18, 8, 0.26);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(18, 140, 126, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(37, 211, 102, 0.1), transparent 24%),
    linear-gradient(180deg, #ffffff 0%, #ffffff 100%);
}

button,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

.sidebar {
  padding: 28px 22px;
  border-right: 1px solid var(--line);
  background: rgba(251, 241, 226, 0.78);
  backdrop-filter: blur(18px);
}

.brand h1,
.section-heading h2,
.hero h2,
.screen-header h3,
.panel-card h4,
.summary-card h4 {
  font-family: "Gill Sans", "Avenir Next Condensed", "Trebuchet MS", sans-serif;
  margin: 0;
}

.brand h1 {
  font-size: 2.2rem;
  margin-top: 4px;
}

.eyebrow {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--brand-deep);
}

.subtle,
.nav-copy,
.hero-copy,
.support-copy,
.chat-topbar p,
.timeline-list p,
.section-heading p {
  color: var(--muted);
}

.scenario-panel,
.nav-card,
.summary-card,
.panel-card,
.chat-shell,
.hero-metrics article {
  border: 1px solid rgba(31, 41, 51, 0.08);
  box-shadow: var(--shadow);
}

.scenario-panel {
  margin-top: 24px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(255, 250, 243, 0.72), rgba(231, 247, 242, 0.52)),
    linear-gradient(180deg, rgba(37, 211, 102, 0.08), rgba(18, 140, 126, 0.08));
}

.section-heading,
.screen-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.section-heading h2 {
  margin-top: 6px;
  font-size: 1.1rem;
}

.scenario-list,
.nav-stack,
.panel-grid,
.insight-stack {
  display: grid;
  gap: 14px;
}

.scenario-list {
  margin-top: 16px;
}

.scenario-button,
.nav-card {
  width: 100%;
  text-align: left;
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(255, 249, 240, 0.98), rgba(236, 246, 242, 0.9));
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.scenario-button {
  border: 1px solid transparent;
  padding: 14px 16px;
}

.scenario-button:hover,
.scenario-button.active,
.nav-card:hover,
.nav-card.active {
  transform: translateY(-2px);
  border-color: rgba(18, 140, 126, 0.32);
  box-shadow: var(--shadow-strong);
}

.scenario-button strong,
.nav-title {
  display: block;
  font-weight: 700;
}

.scenario-button span,
.nav-copy {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.scenario-meta {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.mini-chip,
.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.82rem;
}

.mini-chip {
  background: rgba(18, 140, 126, 0.1);
  color: var(--brand-deep);
}

.mini-chip.soft {
  background: rgba(200, 121, 24, 0.12);
  color: var(--warning);
}

.status-pill {
  background: rgba(200, 121, 24, 0.14);
  color: var(--warning);
}

.status-pill.live,
.status-pill.good {
  background: rgba(21, 128, 61, 0.12);
  color: var(--success);
}

.badge {
  background: rgba(18, 140, 126, 0.12);
  color: var(--brand-deep);
}

.nav-card {
  border: 1px solid transparent;
  padding: 16px;
}

.main-panel {
  padding: 28px;
  max-width: 1560px;
  margin: 0 auto;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  padding: 30px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top right, rgba(37, 211, 102, 0.16), transparent 28%),
    radial-gradient(circle at center left, rgba(18, 140, 126, 0.24), transparent 30%),
    linear-gradient(130deg, rgba(255, 249, 240, 0.96), rgba(234, 220, 198, 0.92));
  border: 1px solid rgba(31, 41, 51, 0.08);
  box-shadow: var(--shadow-strong);
}

.hero-actions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.hero h2 {
  margin-top: 8px;
  max-width: 760px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.02;
}

.hero-copy {
  max-width: 620px;
  margin-top: 12px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px;
  min-width: min(100%, 430px);
}

.hero-metrics article,
.summary-card,
.panel-card,
.chat-shell {
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.98), rgba(245, 237, 224, 0.88));
}

.hero-metrics article {
  padding: 16px;
  border-radius: var(--radius-md);
}

.hero-metrics span,
.metrics-grid span,
.limit-grid span,
.basket-list span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.hero-metrics strong,
.metrics-grid strong,
.limit-grid strong,
.basket-list strong {
  display: block;
  margin-top: 8px;
  font-size: 1.42rem;
  font-family: "Gill Sans", "Avenir Next Condensed", "Trebuchet MS", sans-serif;
}

.screen {
  display: none;
  margin-top: 26px;
  padding: 26px;
  border-radius: 36px;
  background:
    radial-gradient(circle at top right, rgba(37, 211, 102, 0.14), transparent 20%),
    radial-gradient(circle at bottom left, rgba(18, 140, 126, 0.18), transparent 22%),
    linear-gradient(180deg, rgba(255, 251, 244, 0.82), rgba(244, 235, 220, 0.76));
  border: 1px solid rgba(31, 41, 51, 0.08);
  box-shadow: var(--shadow-strong);
}

.screen.active {
  display: block;
}

.screen-header {
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(31, 41, 51, 0.08);
}

.buyer-layout {
  display: grid;
  gap: 18px;
}

.buyer-layout.mobile-first {
  grid-template-columns: minmax(420px, 0.95fr) minmax(320px, 1fr);
  align-items: start;
}

.mobile-stage {
  display: grid;
  gap: 16px;
}

.stage-copy {
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top right, rgba(37, 211, 102, 0.14), transparent 24%),
    linear-gradient(135deg, rgba(255, 248, 239, 0.98), rgba(229, 244, 239, 0.8));
  border: 1px solid rgba(31, 41, 51, 0.08);
  box-shadow: var(--shadow-strong);
}

.stage-copy h4 {
  margin: 8px 0 10px;
  font-size: 1.35rem;
  font-family: "Gill Sans", "Avenir Next Condensed", "Trebuchet MS", sans-serif;
}

.phone-frame {
  width: min(100%, 436px);
  margin: 0 auto;
  padding: 18px 16px 20px;
  border-radius: 42px;
  background:
    radial-gradient(circle at top left, rgba(37, 211, 102, 0.2), transparent 24%),
    linear-gradient(180deg, #183a35 0%, #081210 100%);
  box-shadow: 0 36px 94px rgba(11, 21, 20, 0.4);
  position: relative;
}

.phone-notch {
  width: 138px;
  height: 24px;
  border-radius: 0 0 18px 18px;
  background: #0d1614;
  margin: 0 auto 10px;
}

.chat-shell,
.summary-card,
.panel-card {
  border-radius: var(--radius-lg);
}

.chat-shell {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f8f5ef;
}

.chat-topbar {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(18, 140, 126, 0.28), rgba(255, 255, 255, 0.5));
}

.chat-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, #128c7e, #075e54);
  color: white;
  font-weight: 700;
}

.chat-thread {
  min-height: 560px;
  overflow: auto;
  padding: 20px;
  background:
    linear-gradient(rgba(7, 24, 34, 0.16), rgba(255, 255, 255, 0.18)),
    url("assets/chat-background.jpeg");
  background-size: cover, cover;
  background-position: center, center;
}

.chat-shell.analysis-complete .chat-thread {
  min-height: 670px;
}

.phone-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 140, 126, 0.12);
}

.summary-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.bubble {
  width: fit-content;
  max-width: 88%;
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  line-height: 1.5;
  white-space: pre-line;
}

.bubble.incoming {
  background: white;
  border-top-left-radius: 6px;
  box-shadow: 0 10px 24px rgba(25, 35, 28, 0.08);
}

.bubble.outgoing {
  margin-left: auto;
  background: linear-gradient(135deg, #dcf8c6, #c9f1af);
  border-top-right-radius: 6px;
  box-shadow: 0 10px 24px rgba(18, 140, 126, 0.14);
}

.bubble.system {
  background: linear-gradient(135deg, rgba(238, 252, 244, 0.98), rgba(221, 247, 232, 0.96));
  border: 1px dashed rgba(18, 140, 126, 0.26);
}

.chat-composer {
  padding: 18px;
  border-top: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.96);
}

.chat-composer[hidden] {
  display: none;
}

.composer-meta,
.composer-actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.composer-meta {
  margin-bottom: 12px;
}

textarea {
  width: 100%;
  min-height: 92px;
  resize: none;
  border-radius: 18px;
  border: 1px solid var(--line);
  padding: 16px;
  background: rgba(255, 255, 255, 0.96);
}

.composer-actions,
.action-row {
  margin-top: 14px;
}

.primary-button,
.secondary-button,
.ghost-button,
.ghost-link {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.ghost-link:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: linear-gradient(135deg, #128c7e, #25d366);
  color: white;
  box-shadow: 0 14px 30px rgba(18, 140, 126, 0.24);
}

.secondary-button {
  background: linear-gradient(135deg, rgba(18, 140, 126, 0.14), rgba(220, 248, 198, 0.96));
  color: var(--brand-deep);
}

.ghost-button,
.ghost-link {
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid var(--line);
  color: var(--ink);
}

body.presentation-mode .app-shell {
  grid-template-columns: 0 1fr;
}

body.presentation-mode .sidebar {
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  padding: 0;
  border-right: none;
}

body.presentation-mode .main-panel {
  max-width: 1680px;
  padding: 22px 28px 40px;
}

body.presentation-mode .hero {
  margin-bottom: 12px;
}

body.presentation-mode .screen {
  margin-top: 18px;
}

body.presentation-mode #presentation-toggle {
  background: linear-gradient(135deg, rgba(18, 140, 126, 0.18), rgba(37, 211, 102, 0.18));
  color: var(--brand-deep);
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.summary-card,
.panel-card {
  padding: 22px;
}

.buyer-sidepanels {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  align-content: start;
}

.summary-card h4,
.panel-card h4 {
  margin: 14px 0 10px;
}

.accent-card,
.accent {
  background:
    radial-gradient(circle at top right, rgba(37, 211, 102, 0.16), transparent 26%),
    linear-gradient(135deg, rgba(18, 140, 126, 0.16), rgba(240, 252, 242, 0.96));
}

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

.journey-step {
  padding: 12px 10px;
  border-radius: 16px;
  border: 1px solid rgba(31, 41, 51, 0.08);
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.journey-step span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 0 auto 8px;
  border-radius: 999px;
  background: rgba(18, 140, 126, 0.12);
  color: var(--brand-deep);
  font-weight: 700;
}

.journey-step.active {
  border-color: rgba(18, 140, 126, 0.26);
  background: linear-gradient(135deg, rgba(220, 248, 198, 0.96), rgba(204, 239, 228, 0.92));
}

.desktop-dashboard {
  display: grid;
  gap: 18px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: 1.15fr 0.9fr 0.8fr;
  gap: 16px;
  align-items: stretch;
}

.dashboard-main {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.9fr;
  gap: 16px;
  align-items: stretch;
}

.panel-card.wide {
  min-height: 100%;
}

.desktop-dashboard .panel-card {
  min-height: 100%;
}

.dark-card {
  background:
    radial-gradient(circle at top right, rgba(37, 211, 102, 0.16), transparent 28%),
    linear-gradient(180deg, #0d2a22 0%, #06100f 100%);
  color: #f4f7f6;
  box-shadow: 0 24px 44px rgba(16, 39, 36, 0.28);
}

.dark-card .eyebrow,
.dark-card h4,
.dark-card strong,
.metrics-grid.inverted strong {
  color: #f4f7f6;
}

.dark-card .metrics-grid div,
.dark-card .limit-grid div,
.dark-card .timeline-list div,
.metrics-grid.inverted div {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.dark-card span,
.dark-card p,
.metrics-grid.inverted span {
  color: rgba(244, 247, 246, 0.72);
}

.panel-grid.three-column {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

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

.definition-grid div,
.metrics-grid div,
.limit-grid div,
.timeline-list div,
.basket-list div,
.signal-list li {
  border-radius: 16px;
  border: 1px solid rgba(31, 41, 51, 0.08);
  background: linear-gradient(135deg, rgba(255, 252, 246, 0.86), rgba(243, 236, 224, 0.8));
}

.definition-grid div,
.metrics-grid div,
.limit-grid div,
.basket-list div {
  padding: 14px;
}

.definition-grid dt {
  color: var(--muted);
  font-size: 0.82rem;
}

.definition-grid dd {
  margin: 6px 0 0;
  font-weight: 600;
}

.metrics-grid,
.limit-grid,
.basket-list,
.signal-list,
.timeline-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.signal-list li,
.timeline-list div {
  padding: 12px 14px;
}

.signal-list.compact li {
  font-size: 0.94rem;
}

.desktop-dashboard .metrics-grid,
.desktop-dashboard .limit-grid,
.desktop-dashboard .timeline-list,
.desktop-dashboard .signal-list {
  gap: 14px;
}

.desktop-dashboard .metrics-grid div,
.desktop-dashboard .limit-grid div,
.desktop-dashboard .timeline-list div,
.desktop-dashboard .signal-list li {
  padding: 14px 16px;
}

#supplier-order ul {
  margin: 14px 0 0;
  padding-left: 18px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1180px) {
  .app-shell,
  .buyer-layout,
  .panel-grid.three-column,
  .dashboard-hero,
  .dashboard-main,
  .buyer-layout.mobile-first,
  .buyer-sidepanels {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

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

  .phone-frame {
    width: min(100%, 430px);
  }

  body.presentation-mode .app-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .sidebar,
  .main-panel {
    padding: 18px;
  }

  .hero,
  .summary-card,
  .panel-card,
  .chat-shell,
  .scenario-panel,
  .screen {
    border-radius: 22px;
  }

  .hero-metrics,
  .definition-grid,
  .journey-strip,
  .phone-summary {
    grid-template-columns: 1fr;
  }

  .phone-frame {
    padding: 12px 10px 14px;
    border-radius: 30px;
  }

  .chat-thread {
    height: 460px;
  }

  .screen {
    padding: 18px;
  }
}
