:root {
  --page: #f5f0e7;
  --page-strong: #fffaf1;
  --panel: rgba(255, 251, 244, 0.9);
  --line: rgba(92, 72, 48, 0.15);
  --line-strong: rgba(92, 72, 48, 0.28);
  --text: #211814;
  --muted: #68584a;
  --accent: #b65c46;
  --accent-strong: #934432;
  --good: #2f6f49;
  --warn: #b97723;
  --bad: #a8382d;
  --teal: #1a736f;
  --shadow: 0 18px 48px rgba(53, 40, 24, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Instrument Sans", sans-serif;
  background:
    radial-gradient(circle at 12% 12%, rgba(182, 92, 70, 0.1), transparent 24%),
    radial-gradient(circle at 88% 10%, rgba(26, 115, 111, 0.08), transparent 24%),
    linear-gradient(180deg, #faf5eb 0%, var(--page) 58%, #f0e8d9 100%);
}

a,
button {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.paper-noise,
.frame-lines {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.paper-noise {
  opacity: 0.16;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(0, 0, 0, 0.05) 0, transparent 24%),
    radial-gradient(circle at 76% 28%, rgba(0, 0, 0, 0.04) 0, transparent 20%),
    radial-gradient(circle at 48% 80%, rgba(0, 0, 0, 0.04) 0, transparent 20%);
  mix-blend-mode: multiply;
}

.frame-lines {
  background-image:
    linear-gradient(to right, rgba(92, 72, 48, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(92, 72, 48, 0.06) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at center, black 24%, transparent 88%);
}

.shell {
  width: min(1320px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

.hero,
.panel {
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(255, 249, 240, 0.9));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.72fr;
  gap: 1rem;
  padding: 1.15rem;
  border-radius: 24px;
}

.panel {
  padding: 1rem;
  border-radius: 22px;
}

.eyebrow,
.panel-kicker,
.mini-label,
.scenario-code,
.scenario-family,
.info-pill,
.step-number {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow,
.panel-kicker,
.mini-label,
.scenario-code {
  color: color-mix(in srgb, var(--accent) 72%, var(--muted));
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.06;
}

h1 {
  font-size: clamp(2.35rem, 5vw, 3.8rem);
}

h2 {
  font-size: clamp(1.35rem, 2.6vw, 2rem);
}

h3 {
  font-size: 1.08rem;
}

.lede,
.overview-copy,
.panel-head p,
.content-card p,
.hero-tip p,
.scenario-note,
.small-note,
.chunk-source {
  color: var(--muted);
  line-height: 1.55;
}

.lede {
  max-width: 60ch;
  margin: 0.85rem 0 0;
  font-size: 1rem;
}

.hero-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.7rem;
}

.action,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  text-decoration: none;
  font-weight: 600;
}

.action.primary,
.primary-button {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
}

.hero-tip {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(140deg, rgba(26, 115, 111, 0.08), transparent 55%),
    rgba(255, 254, 248, 0.9);
}

.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 1rem;
}

.main-column {
  display: grid;
  gap: 1rem;
}

.scenario-list,
.card-grid,
.answer-compare {
  display: grid;
  gap: 0.8rem;
}

.scenario-button,
.step-button {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.84);
  border-radius: 18px;
}

.scenario-button {
  display: grid;
  gap: 0.45rem;
  padding: 0.9rem;
  cursor: pointer;
}

.scenario-button.is-active,
.step-button.is-active {
  border-color: color-mix(in srgb, var(--accent) 56%, var(--line-strong));
  box-shadow: 0 0 0 2px rgba(182, 92, 70, 0.08);
}

.scenario-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.15;
}

.scenario-family {
  width: fit-content;
  padding: 0.18rem 0.48rem;
  border-radius: 999px;
  background: rgba(89, 105, 61, 0.12);
  color: #6a6e34;
}

.family-chunk {
  background: rgba(185, 119, 35, 0.14);
  color: #8a5a15;
}

.family-filter {
  background: rgba(26, 115, 111, 0.12);
  color: var(--teal);
}

.family-rerank {
  background: rgba(168, 56, 45, 0.12);
  color: var(--bad);
}

.scenario-note {
  font-size: 0.94rem;
}

.overview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.overview-badges,
.hint-row,
.claim-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.info-pill,
.summary-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.58rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
}

.problem-pill,
.bad-pill {
  background: rgba(168, 56, 45, 0.1);
  color: var(--bad);
}

.good-pill {
  background: rgba(47, 111, 73, 0.12);
  color: var(--good);
}

.overview-grid,
.card-grid,
.answer-compare {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.focus-card,
.content-card {
  padding: 0.95rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 254, 249, 0.86);
}

.focus-card {
  background:
    linear-gradient(140deg, rgba(182, 92, 70, 0.08), transparent 56%),
    rgba(255, 254, 249, 0.9);
}

.overview-actions {
  margin-top: 0.85rem;
}

.query-text,
.big-text {
  margin-top: 0.45rem;
  font-size: 1.25rem;
  line-height: 1.45;
  color: var(--text);
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.85rem;
}

.step-button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  cursor: pointer;
}

.step-number {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(182, 92, 70, 0.1);
  color: var(--accent);
}

.step-title {
  font-weight: 700;
}

.standout-card {
  background:
    linear-gradient(140deg, rgba(182, 92, 70, 0.08), transparent 52%),
    rgba(255, 254, 249, 0.92);
}

.alert-card {
  box-shadow: inset 4px 0 0 rgba(168, 56, 45, 0.78);
}

.good-card {
  box-shadow: inset 4px 0 0 rgba(47, 111, 73, 0.78);
}

.stage-strip {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.stage-pill {
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.64);
  color: var(--muted);
}

.stage-pass {
  background: rgba(47, 111, 73, 0.12);
  color: var(--good);
}

.stage-fail {
  background: rgba(168, 56, 45, 0.12);
  color: var(--bad);
}

.stage-warn {
  background: rgba(185, 119, 35, 0.12);
  color: var(--warn);
}

.stage-blocked {
  background: rgba(104, 88, 74, 0.1);
}

.chunk-source {
  margin: 0.3rem 0 0.7rem;
  font-size: 0.92rem;
}

.small-note {
  margin-top: 0.7rem;
  font-size: 0.95rem;
}

.simple-list {
  margin: 0.6rem 0 0;
  padding-left: 1.05rem;
  color: var(--muted);
  line-height: 1.55;
}

.empty-state {
  padding: 1rem;
  border-radius: 18px;
  border: 1px dashed var(--line-strong);
  background: rgba(255, 255, 255, 0.6);
}

@media (max-width: 1120px) {
  .workspace,
  .hero,
  .overview-grid,
  .card-grid,
  .answer-compare {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(1320px, calc(100% - 0.9rem));
  }

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

  .overview-head {
    flex-direction: column;
  }

  .query-text,
  .big-text {
    font-size: 1.08rem;
  }
}
