:root {
  --bg: #f7f1e4;
  --bg-strong: #ecdfc2;
  --panel: rgba(255, 251, 242, 0.84);
  --panel-strong: rgba(255, 249, 236, 0.96);
  --line: rgba(20, 60, 34, 0.12);
  --text: #13311d;
  --muted: #54705f;
  --green: #19a552;
  --green-deep: #0d5a2b;
  --lime: #d5ff8f;
  --gold: #ffcc66;
  --coral: #ff886e;
  --shadow: 0 20px 50px rgba(32, 69, 43, 0.12);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-display: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(177, 255, 137, 0.34), transparent 32%),
    radial-gradient(circle at top right, rgba(255, 211, 130, 0.25), transparent 26%),
    linear-gradient(180deg, #fbf6ea 0%, var(--bg) 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(19, 49, 29, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 49, 29, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 70%);
  pointer-events: none;
}

.ambient {
  position: fixed;
  width: 28rem;
  height: 28rem;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.42;
  pointer-events: none;
  z-index: 0;
}

.ambient-left {
  top: -6rem;
  left: -10rem;
  background: rgba(91, 233, 138, 0.72);
}

.ambient-right {
  right: -10rem;
  bottom: 6rem;
  background: rgba(255, 204, 102, 0.52);
}

.page-shell {
  position: relative;
  z-index: 1;
  max-width: 1520px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(18px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, #1cb14f 0%, #178f43 46%, #c8fb78 100%);
  color: white;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  box-shadow: 0 16px 36px rgba(25, 165, 82, 0.28);
}

.topbar h1,
.hero h2,
.section-head h3 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

.topbar h1 {
  font-size: clamp(1.35rem, 1.2rem + 0.7vw, 1.85rem);
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.live-pill,
.ghost-button,
.secondary-button,
.chip,
.channel-tab,
.tone-tab {
  border: 1px solid var(--line);
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 600;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(25, 165, 82, 0.16);
  animation: pulse 1.6s infinite;
}

.ghost-button,
.secondary-button,
.chip,
.channel-tab,
.tone-tab,
.decision-button {
  appearance: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.ghost-button,
.secondary-button {
  padding: 12px 16px;
  font-weight: 700;
}

.ghost-button:hover,
.secondary-button:hover,
.chip:hover,
.channel-tab:hover,
.tone-tab:hover,
.decision-button:hover,
.trend-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(19, 49, 29, 0.1);
}

.secondary-button {
  background: linear-gradient(135deg, rgba(212, 255, 146, 0.9), rgba(255, 246, 189, 0.9));
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  padding: 32px;
  margin-bottom: 20px;
}

.hero h2 {
  max-width: 14ch;
  font-size: clamp(2.2rem, 2rem + 1.1vw, 3.4rem);
  line-height: 0.94;
}

.hero-text {
  max-width: 70ch;
  margin: 18px 0 0;
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--muted);
}

.hero-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-self: start;
}

.highlight-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(249, 242, 224, 0.76));
  border: 1px solid rgba(19, 49, 29, 0.08);
}

.highlight-label,
.highlight-footnote,
.mini-stat span,
.system-card-label,
.decision-label,
.notification-list-head,
.stack-title,
.guardrail-title,
.preview-label,
.output-card-label {
  display: block;
}

.highlight-label,
.highlight-footnote,
.mini-stat span,
.system-card-label,
.decision-label,
.notification-list-head,
.guardrail-title,
.preview-label,
.output-card-label {
  color: var(--muted);
}

.highlight-card strong {
  display: block;
  margin: 12px 0 6px;
  font-size: 1.85rem;
}

.highlight-footnote {
  line-height: 1.4;
  font-size: 0.9rem;
}

.flow-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.flow-step {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(19, 49, 29, 0.08);
  font-size: 0.92rem;
  color: var(--muted);
}

.flow-step.is-active {
  background: linear-gradient(135deg, rgba(214, 255, 145, 0.86), rgba(255, 245, 189, 0.92));
  color: var(--text);
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.trend-feed,
.spotlight,
.command-center,
.studio-section,
.blueprint-card {
  padding: 22px;
}

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

.section-head h3 {
  font-size: 1.35rem;
}

.mini-stat {
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  text-align: right;
}

.mini-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 1.2rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.chip,
.channel-tab,
.tone-tab {
  padding: 10px 14px;
  font-weight: 700;
}

.chip.is-selected,
.channel-tab.is-selected,
.tone-tab.is-selected {
  background: linear-gradient(135deg, rgba(212, 255, 146, 0.92), rgba(255, 245, 189, 0.96));
  border-color: rgba(25, 165, 82, 0.28);
}

.trend-list {
  display: grid;
  gap: 12px;
}

.trend-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 241, 228, 0.78));
  border: 1px solid rgba(19, 49, 29, 0.08);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.trend-card.is-selected {
  border-color: rgba(25, 165, 82, 0.4);
  box-shadow: 0 16px 32px rgba(25, 165, 82, 0.16);
}

.trend-card-top,
.trend-card-meta,
.metric-row,
.detail-top,
.source-row,
.score-row,
.decision-actions,
.preview-meta,
.output-card-top,
.notification-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.trend-card-top,
.detail-top,
.output-card-top {
  align-items: flex-start;
}

.trend-card h4,
.detail-title,
.preview-title,
.output-card h4 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

.trend-card h4 {
  font-size: 1rem;
}

.score-badge,
.status-badge,
.risk-badge,
.metric-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 800;
}

.score-badge {
  background: rgba(212, 255, 146, 0.7);
}

.status-badge {
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
}

.status-badge.fit {
  background: rgba(25, 165, 82, 0.12);
  color: var(--green-deep);
}

.status-badge.skip {
  background: rgba(255, 136, 110, 0.14);
  color: #9b442f;
}

.trend-card-meta {
  margin: 12px 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.trend-card-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.93rem;
}

.sparkline {
  width: 100%;
  height: 42px;
  margin-top: 14px;
  display: block;
}

.spotlight {
  min-height: 760px;
}

.detail-hero {
  padding: 22px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top right, rgba(213, 255, 143, 0.88), transparent 32%),
    linear-gradient(135deg, #184627 0%, #163c21 54%, #0f2f19 100%);
  color: #f7ffec;
}

.detail-title {
  max-width: 12ch;
  font-size: clamp(1.8rem, 1.5rem + 1vw, 2.8rem);
  line-height: 0.96;
}

.detail-summary {
  max-width: 70ch;
  margin: 18px 0 0;
  color: rgba(247, 255, 236, 0.84);
  line-height: 1.7;
}

.source-row {
  margin-top: 18px;
  flex-wrap: wrap;
  color: rgba(247, 255, 236, 0.84);
}

.source-link {
  color: white;
  font-weight: 700;
  text-decoration: none;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  margin-top: 18px;
}

.detail-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(19, 49, 29, 0.08);
}

.detail-card h4,
.system-card h4 {
  margin: 0 0 12px;
  font-size: 1rem;
}

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

.metric-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(247, 241, 228, 0.72);
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.4rem;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

.bullet-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.65;
}

.bullet-list li + li {
  margin-top: 8px;
}

.bullet-list.compact {
  line-height: 1.5;
  font-size: 0.94rem;
}

.score-row {
  align-items: center;
  margin-bottom: 12px;
}

.relevance-meter {
  width: 92px;
  height: 92px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--green) calc(var(--score) * 1%), rgba(19, 49, 29, 0.08) 0);
}

.relevance-meter::before {
  content: "";
  width: 66px;
  height: 66px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 1px rgba(19, 49, 29, 0.08);
}

.relevance-value {
  position: absolute;
  font-weight: 800;
  font-size: 1.1rem;
}

.meter-wrap {
  position: relative;
  width: 92px;
  height: 92px;
}

.risk-badge {
  background: rgba(255, 204, 102, 0.18);
  color: #8a5c00;
}

.decision-actions {
  margin-top: 16px;
  flex-wrap: wrap;
}

.decision-button {
  padding: 12px 16px;
  font-weight: 800;
}

.decision-button.fit {
  background: rgba(25, 165, 82, 0.12);
}

.decision-button.skip {
  background: rgba(255, 136, 110, 0.14);
}

.decision-button.notify {
  background: rgba(255, 255, 255, 0.92);
}

.adaptation-card {
  grid-column: 1 / -1;
}

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

.adaptation-item {
  padding: 16px;
  border-radius: 18px;
  background: rgba(247, 241, 228, 0.72);
  border: 1px solid rgba(19, 49, 29, 0.06);
}

.adaptation-item strong {
  display: block;
  margin-bottom: 8px;
}

.command-center {
  display: grid;
  gap: 16px;
}

.alert-callout,
.decision-card,
.system-card,
.notification-item,
.guardrail-card,
.preview-card,
.output-card,
.formula-card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(19, 49, 29, 0.08);
  background: rgba(255, 255, 255, 0.84);
}

.alert-callout {
  padding: 18px;
  background:
    radial-gradient(circle at top right, rgba(213, 255, 143, 0.8), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(246, 239, 219, 0.94));
}

.alert-callout strong,
.decision-card strong,
.preview-title,
.output-card h4 {
  display: block;
}

.alert-callout p,
.decision-card p,
.system-card p,
.guardrail-card p,
.preview-card p,
.output-card p,
.formula-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.decision-card,
.system-card,
.formula-card {
  padding: 18px;
}

.notification-list {
  display: grid;
  gap: 12px;
}

.notification-list-head {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
}

.notification-item {
  padding: 14px 16px;
}

.notification-item strong {
  font-size: 0.96rem;
}

.notification-item span,
.notification-item p {
  color: var(--muted);
  font-size: 0.9rem;
}

.notification-item p {
  margin: 8px 0 0;
  line-height: 1.45;
}

.studio-section {
  margin-top: 20px;
}

.studio-toolbar,
.brand-guardrails,
.studio-grid,
.architecture-stack,
.blueprint-grid {
  display: grid;
  gap: 18px;
}

.studio-toolbar {
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 18px;
}

.toolbar-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-guardrails {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.guardrail-card {
  padding: 18px;
}

.studio-grid {
  grid-template-columns: 340px minmax(0, 1fr);
}

.preview-card,
.output-card {
  padding: 20px;
}

.studio-preview,
.studio-output {
  display: grid;
  gap: 14px;
}

.preview-card {
  background:
    radial-gradient(circle at top right, rgba(213, 255, 143, 0.7), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 241, 228, 0.8));
}

.preview-title {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

.preview-meta {
  margin-top: 16px;
  flex-wrap: wrap;
}

.metric-pill {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.output-card {
  min-height: 188px;
}

.output-card-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.output-card h4 {
  margin-top: 8px;
  font-size: 1.28rem;
}

.output-body {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-line;
}

.output-notes {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(19, 49, 29, 0.08);
  color: var(--muted);
}

.loading-state {
  display: grid;
  place-items: center;
  min-height: 280px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(19, 49, 29, 0.18);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
}

.blueprint-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 20px;
}

.architecture-stack {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.stack-column {
  padding: 16px;
  border-radius: 20px;
  background: rgba(247, 241, 228, 0.66);
}

.stack-title {
  margin-bottom: 10px;
  font-weight: 800;
  font-size: 0.95rem;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(420px, calc(100vw - 48px));
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(19, 49, 29, 0.94);
  color: #f7ffec;
  box-shadow: 0 18px 46px rgba(19, 49, 29, 0.32);
  transform: translateY(140%);
  transition: transform 280ms ease;
  z-index: 20;
}

.toast.is-visible {
  transform: translateY(0);
}

.empty-state {
  padding: 22px;
  text-align: center;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(19, 49, 29, 0.16);
  color: var(--muted);
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(25, 165, 82, 0.24);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(25, 165, 82, 0.04);
  }
}

@media (max-width: 1260px) {
  .hero,
  .dashboard-grid,
  .studio-grid,
  .blueprint-grid,
  .architecture-stack {
    grid-template-columns: 1fr;
  }

  .hero-highlights,
  .brand-guardrails,
  .adaptation-list,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .spotlight {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding: 18px 14px 48px;
  }

  .topbar,
  .hero,
  .trend-feed,
  .spotlight,
  .command-center,
  .studio-section,
  .blueprint-card {
    padding: 18px;
  }

  .topbar,
  .section-head,
  .studio-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .hero h2 {
    max-width: none;
  }

  .hero-highlights,
  .brand-guardrails,
  .flow-strip,
  .adaptation-list,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .toolbar-group,
  .topbar-meta {
    justify-content: stretch;
  }

  .toolbar-group > *,
  .topbar-meta > *,
  .section-head > .secondary-button,
  .section-head > .ghost-button {
    width: 100%;
  }

  .decision-actions {
    flex-direction: column;
  }
}
