:root {
  --ed-green: #177a4c;
  --ed-green-dark: #0c3328;
  --ed-orange: #ff6a13;
  --ed-blue: #1856d8;
  --ed-pink: #f54791;
  --ed-yellow: #ffd51f;
  --ed-cyan: #31c4d8;
  --ed-red: #e93b2f;
  --ed-violet: #7249ce;
  --ed-paper: #ffffff;
  --ed-cool: #eef7f3;
  --ed-ink: #10241f;
  --ed-muted: #53655f;
  --ed-line: #cfd9d5;
  --ed-display: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Avenir Next", sans-serif;
  --ed-serif: "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
}

html { scroll-behavior: smooth; }

body.editorial-reference {
  background: var(--ed-paper);
  color: var(--ed-ink);
}

.editorial-shell {
  width: min(1480px, calc(100% - 64px));
  margin: 0 auto;
  padding: 30px 0 110px;
}

.editorial-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 8px 0 20px;
  border-bottom: 1px solid var(--ed-ink);
  font-family: var(--ed-display);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.editorial-topbar strong {
  font-size: 14px;
  letter-spacing: .02em;
  text-transform: none;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr);
  gap: 52px;
  padding: 72px 0 58px;
  border-bottom: 1px solid var(--ed-ink);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: 0;
  top: 68px;
  width: 150px;
  height: 16px;
  background: var(--ed-orange);
  box-shadow: -164px 0 0 var(--ed-green), -328px 0 0 var(--ed-blue);
}

.hero-kicker {
  margin: 0 0 22px;
  color: var(--ed-green);
  font: 700 13px/1 var(--ed-display);
  letter-spacing: .16em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 1040px;
  margin: 0;
  font: 700 clamp(54px, 7.6vw, 122px)/.96 var(--ed-display);
  letter-spacing: -.075em;
}

.hero h1 em {
  color: var(--ed-orange);
  font-family: var(--ed-serif);
  font-weight: 400;
}

.hero-side {
  align-self: end;
  padding-top: 120px;
}

.hero-lead {
  margin: 0 0 28px;
  font: 500 18px/1.9 var(--ed-serif);
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--ed-ink);
  border: 1px solid var(--ed-ink);
}

.hero-meta div {
  background: #fff;
  padding: 13px 15px;
}

.hero-meta span {
  display: block;
  margin-bottom: 3px;
  color: var(--ed-muted);
  font: 500 10px/1.2 var(--ed-display);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hero-meta strong {
  font: 700 20px/1.1 var(--ed-display);
}

.tldr-editorial {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 28px;
  margin: 24px 0 0;
  padding: 22px 26px;
  background: var(--ed-green-dark);
  color: #fff;
}

.tldr-editorial b {
  color: var(--ed-yellow);
  font: 800 12px/1.4 var(--ed-display);
  letter-spacing: .16em;
}

.tldr-editorial p {
  margin: 0;
  font: 500 15px/1.8 var(--ed-display);
}

.palette-manifesto {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) 1.2fr;
  gap: 58px;
  padding: 78px 0;
  border-bottom: 1px solid var(--ed-line);
}

.section-label {
  margin: 0 0 14px;
  color: var(--ed-orange);
  font: 800 11px/1 var(--ed-display);
  letter-spacing: .18em;
  text-transform: uppercase;
}

.palette-manifesto h2,
.report-intro h2 {
  margin: 0 0 20px;
  font: 700 clamp(30px, 4vw, 58px)/1.05 var(--ed-display);
  letter-spacing: -.045em;
}

.palette-manifesto p,
.report-intro p {
  margin: 0;
  color: var(--ed-muted);
  font: 400 15px/1.9 var(--ed-display);
}

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

.swatch {
  min-height: 122px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(16, 36, 31, .18);
  color: var(--ed-ink);
  font: 800 11px/1.3 var(--ed-display);
  letter-spacing: .06em;
}

.swatch.dark { color: #fff; }
.swatch small { font-size: 10px; font-weight: 500; opacity: .78; }

.usage-rule {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 4px;
  background: var(--ed-line);
  border: 1px solid var(--ed-line);
}

.usage-rule div { background: #fff; padding: 17px 18px; }
.usage-rule strong { display: block; font: 800 24px/1 var(--ed-display); }
.usage-rule span { color: var(--ed-muted); font: 500 11px/1.4 var(--ed-display); }

.report-intro {
  display: grid;
  grid-template-columns: minmax(240px, .7fr) 1.3fr;
  gap: 58px;
  padding: 86px 0 36px;
}

.fresh-method-note {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 18px;
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px solid var(--ed-green);
  border-left-width: 8px;
  background: #fff;
  font: 500 13px/1.75 var(--ed-display);
}

.fresh-method-note b {
  color: var(--ed-green);
  font-size: 11px;
  letter-spacing: .1em;
}

.fresh-method-note span { color: var(--ed-muted); }

.tone-index {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 24px 0 0;
}

.tone-index a {
  color: var(--ed-ink);
  background: #fff;
  border: 1px solid var(--ed-ink);
  padding: 7px 10px;
  text-decoration: none;
  font: 700 11px/1 var(--ed-display);
}

.tone-index a:hover { color: #fff; background: var(--ed-green); }

.tone-section {
  --tone: var(--ed-green);
  margin-top: 58px;
  padding-top: 28px;
  border-top: 10px solid var(--tone);
}

.tone-head {
  display: grid;
  grid-template-columns: 92px minmax(260px, .8fr) 1.2fr;
  gap: 28px;
  align-items: start;
  padding: 16px 0 30px;
}

.tone-number {
  color: var(--tone);
  font: 800 60px/.82 var(--ed-display);
  letter-spacing: -.08em;
}

.tone-title h2 {
  margin: 0 0 7px;
  font: 800 clamp(34px, 4vw, 68px)/.95 var(--ed-display);
  letter-spacing: -.055em;
}

.tone-title p {
  margin: 0;
  color: var(--ed-muted);
  font: 600 12px/1.4 var(--ed-display);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.tone-summary {
  max-width: 720px;
  margin: 0;
  font: 400 16px/1.9 var(--ed-serif);
}

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

.study {
  margin: 0;
  border: 1px solid var(--ed-ink);
  background: #fff;
}

.study img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #fff;
}

.study figcaption {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 15px 16px 17px;
  border-top: 1px solid var(--ed-ink);
  font: 500 12px/1.6 var(--ed-display);
}

.study-label {
  display: inline-flex;
  padding: 4px 7px;
  color: #fff;
  background: var(--ed-ink);
  font: 800 9px/1 var(--ed-display);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.study.is-refined .study-label { background: var(--tone); }

.fresh-study-head {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 24px;
  align-items: end;
  margin-top: 22px;
  padding: 14px 0 12px;
  border-top: 1px solid var(--ed-ink);
}

.fresh-study-head div {
  display: flex;
  gap: 12px;
  align-items: baseline;
  color: var(--tone);
  font-family: var(--ed-display);
}

.fresh-study-head span {
  font-size: 42px;
  font-weight: 800;
  line-height: .8;
}

.fresh-study-head strong {
  font-size: 11px;
  letter-spacing: .16em;
}

.fresh-study-head p {
  margin: 0;
  color: var(--ed-muted);
  font: 500 12px/1.6 var(--ed-display);
}

.fresh-study {
  position: relative;
  margin: 0;
  border: 1px solid var(--ed-ink);
  background: #fff;
}

.fresh-study::before {
  content: "independent generation";
  position: absolute;
  z-index: 1;
  top: 14px;
  right: 14px;
  padding: 6px 8px;
  color: #fff;
  background: var(--tone);
  font: 800 9px/1 var(--ed-display);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.fresh-study.is-caution::before {
  content: "directional study";
  color: var(--ed-ink);
  background: var(--ed-yellow);
}

.fresh-study img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #fff;
}

.fresh-study figcaption {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 22px;
  padding: 18px;
  border-top: 1px solid var(--ed-ink);
  font: 500 12px/1.7 var(--ed-display);
}

.fresh-study figcaption > span:last-child {
  display: grid;
  grid-template-columns: minmax(190px, .65fr) 1.35fr;
  gap: 22px;
  color: var(--ed-muted);
}

.fresh-study figcaption b {
  color: var(--ed-ink);
  font-size: 14px;
}

.study-verdict {
  margin-left: 6px;
  padding-left: 6px;
  border-left: 1px solid rgba(255,255,255,.55);
  font-weight: 500;
  letter-spacing: .04em;
}

.fresh-study.is-caution .study-verdict { color: var(--ed-yellow); }

.qa-note {
  margin: 12px 0 0;
  padding: 13px 16px;
  border-left: 6px solid var(--tone);
  background: var(--ed-cool);
  color: var(--ed-muted);
  font: 500 12px/1.7 var(--ed-display);
}

.qa-note strong { color: var(--ed-ink); }

.tone-notes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 18px;
  background: var(--ed-line);
  border: 1px solid var(--ed-line);
}

.note-card {
  min-height: 184px;
  padding: 18px;
  background: #fff;
}

.note-card h3 {
  margin: 0 0 12px;
  color: var(--tone);
  font: 800 11px/1.3 var(--ed-display);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.note-card p,
.note-card ul {
  margin: 0;
  padding: 0;
  color: var(--ed-muted);
  font: 400 13px/1.75 var(--ed-display);
}

.note-card ul { list-style: none; }
.note-card li { margin-bottom: 5px; }
.note-card li::before { content: "— "; color: var(--tone); font-weight: 800; }

.prompt-panel {
  margin-top: 12px;
  border: 1px solid var(--ed-ink);
  background: var(--ed-cool);
}

.prompt-panel summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 14px 17px;
  list-style: none;
  font: 800 12px/1.2 var(--ed-display);
  letter-spacing: .07em;
}

.prompt-panel summary::-webkit-details-marker { display: none; }
.prompt-panel summary::after { content: "+"; color: var(--tone); font-size: 22px; }
.prompt-panel[open] summary::after { content: "−"; }

.prompt-panel pre {
  max-height: 470px;
  overflow: auto;
  margin: 0;
  padding: 20px;
  border-top: 1px solid var(--ed-ink);
  background: #fff;
  color: var(--ed-ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 500 11px/1.7 "SFMono-Regular", Consolas, monospace;
}

.source-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px 2px 0;
  color: var(--ed-muted);
  font: 500 11px/1.4 var(--ed-display);
}

.source-line a {
  color: var(--ed-green);
  text-underline-offset: 3px;
}

.workflow {
  margin-top: 100px;
  padding: 60px;
  color: #fff;
  background: var(--ed-green-dark);
}

.workflow h2 {
  max-width: 900px;
  margin: 0 0 38px;
  font: 700 clamp(34px, 4.5vw, 70px)/1.02 var(--ed-display);
  letter-spacing: -.05em;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255,255,255,.28);
}

.workflow-step {
  min-height: 220px;
  padding: 22px;
  background: var(--ed-green-dark);
}

.workflow-step b {
  display: block;
  margin-bottom: 32px;
  color: var(--ed-orange);
  font: 800 38px/1 var(--ed-display);
}

.workflow-step h3 { margin: 0 0 10px; font: 800 16px/1.3 var(--ed-display); }
.workflow-step p { margin: 0; color: rgba(255,255,255,.72); font: 400 12px/1.7 var(--ed-display); }

.quality-gate {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 1px;
  background: rgba(255,255,255,.28);
}

.quality-gate div { padding: 22px; background: var(--ed-green-dark); }
.quality-gate h3 { margin: 0 0 12px; color: var(--ed-yellow); font: 800 12px/1.3 var(--ed-display); letter-spacing: .1em; }
.quality-gate ul { columns: 2; margin: 0; padding-left: 18px; color: rgba(255,255,255,.76); font: 400 12px/1.8 var(--ed-display); }

.report-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--ed-ink);
  color: var(--ed-muted);
  font: 500 11px/1.6 var(--ed-display);
}

@media (max-width: 1100px) {
  .hero, .palette-manifesto, .report-intro { grid-template-columns: 1fr; }
  .hero-side { padding-top: 20px; }
  .tone-head { grid-template-columns: 72px 1fr; }
  .tone-summary { grid-column: 2; }
  .tone-notes, .workflow-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .editorial-shell { width: min(100% - 28px, 1480px); padding-top: 58px; }
  .editorial-topbar span:last-child { display: none; }
  .hero { padding-top: 42px; }
  .hero::after { display: none; }
  .hero h1 { font-size: clamp(48px, 17vw, 78px); }
  .tldr-editorial { grid-template-columns: 1fr; gap: 9px; }
  .swatch-grid { grid-template-columns: repeat(2, 1fr); }
  .usage-rule { grid-template-columns: 1fr; }
  .study-pair { grid-template-columns: 1fr; }
  .fresh-method-note,
  .fresh-study-head,
  .fresh-study figcaption,
  .fresh-study figcaption > span:last-child { grid-template-columns: 1fr; }
  .fresh-study-head { gap: 10px; }
  .fresh-study figcaption { gap: 12px; }
  .fresh-study::before { top: 8px; right: 8px; }
  .tone-head { grid-template-columns: 56px 1fr; gap: 14px; }
  .tone-number { font-size: 42px; }
  .tone-summary { grid-column: 1 / -1; }
  .tone-notes, .workflow-grid, .quality-gate { grid-template-columns: 1fr; }
  .note-card { min-height: 0; }
  .workflow { padding: 30px 20px; }
  .quality-gate ul { columns: 1; }
  .source-line, .report-footer { display: block; }
  .source-line a { display: inline-block; margin-top: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Inventory-gap study additions */
.gap-studies .tldr {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 28px;
  margin: 24px 0 0;
  padding: 22px 26px;
  background: var(--ed-green-dark);
  color: #fff;
}

.gap-studies .tldr-label {
  color: var(--ed-yellow);
  font: 800 12px/1.4 var(--ed-display);
  letter-spacing: .16em;
}

.gap-studies .tldr-body { font: 500 15px/1.8 var(--ed-display); }

.brief-board {
  display: grid;
  grid-template-columns: minmax(260px, .72fr) minmax(440px, 1.28fr);
  gap: 70px;
  padding: 82px 0;
  border-bottom: 1px solid var(--ed-ink);
}

.brief-copy h2,
.principles h2 {
  margin: 0;
  font: 700 clamp(34px, 4.8vw, 72px)/1 var(--ed-display);
  letter-spacing: -.055em;
}

.brief-copy blockquote {
  margin: 34px 0 0;
  padding: 0 0 0 20px;
  border-left: 8px solid var(--ed-orange);
  font: 500 16px/1.85 var(--ed-serif);
}

.brief-flow {
  display: grid;
  align-self: center;
  gap: 14px;
  font-family: var(--ed-display);
}

.flow-recorded,
.flow-leaks {
  position: relative;
  border: 1px solid var(--ed-ink);
  background: #fff;
}

.flow-recorded {
  display: grid;
  grid-template-columns: 1fr 80px 1.25fr 80px 1fr;
  align-items: center;
  min-height: 132px;
  padding: 34px 28px 18px;
}

.flow-recorded > span,
.flow-leaks > span {
  position: absolute;
  left: 14px;
  top: 12px;
  color: var(--ed-muted);
  font: 700 10px/1 var(--ed-display);
  letter-spacing: .12em;
}

.flow-recorded b,
.flow-recorded strong {
  display: grid;
  place-items: center;
  min-height: 56px;
  border: 1px solid var(--ed-green-dark);
  font-size: 18px;
}

.flow-recorded strong { color: #fff; background: var(--ed-green); }

.flow-recorded i {
  height: 4px;
  background: var(--ed-green);
}

.flow-leaks {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 30px;
  align-items: end;
  padding: 46px 28px 24px;
  border-color: var(--ed-orange);
}

.flow-leaks ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow-leaks li {
  padding: 10px 12px;
  border-bottom: 3px dotted var(--ed-orange);
  font-size: 13px;
}

.flow-leaks strong {
  display: grid;
  place-items: center;
  min-width: 128px;
  min-height: 72px;
  padding: 10px;
  color: #fff;
  background: var(--ed-orange);
  text-align: center;
}

.principles {
  padding: 82px 0;
  border-bottom: 1px solid var(--ed-line);
}

.principles-head {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: end;
  margin-bottom: 36px;
}

.principle-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 1px;
  background: var(--ed-ink);
  list-style: none;
}

.principle-grid li {
  display: grid;
  min-height: 128px;
  padding: 18px;
  background: #fff;
}

.principle-grid b {
  color: var(--ed-orange);
  font: 800 30px/1 var(--ed-display);
}

.principle-grid span {
  align-self: end;
  font: 700 14px/1.45 var(--ed-display);
}

.study.is-recommended { box-shadow: inset 0 -8px 0 var(--tone, var(--ed-green)); }

.study-verdict {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-left: 8px;
  padding: 0 7px;
  color: #fff;
  background: var(--tone, var(--ed-green));
  font: 800 9px/1 var(--ed-display);
  letter-spacing: .08em;
}

.qa-note {
  margin: 12px 0 0;
  color: var(--ed-muted);
  font: 500 12px/1.7 var(--ed-display);
}

.prompt-panel summary { cursor: pointer; }

@media (max-width: 1100px) {
  .brief-board { grid-template-columns: 1fr; }
  .principle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .gap-studies .tldr { grid-template-columns: 1fr; gap: 8px; }
  .brief-board { gap: 38px; padding: 56px 0; }
  .flow-recorded { grid-template-columns: 1fr 28px 1fr 28px 1fr; padding-inline: 12px; }
  .flow-recorded b, .flow-recorded strong { font-size: 14px; }
  .flow-leaks { grid-template-columns: 1fr; }
  .flow-leaks strong { min-height: 52px; }
  .principle-grid { grid-template-columns: 1fr 1fr; }
  .principle-grid li { min-height: 112px; }
}

/* Fresh-session cards: keep these overrides after legacy additions. */
.study-label .study-verdict {
  min-height: auto;
  margin-left: 6px;
  padding: 0 0 0 6px;
  border-left: 1px solid rgba(255,255,255,.55);
  background: transparent;
  font-weight: 500;
  letter-spacing: .04em;
}

.fresh-study.is-caution .study-verdict { color: var(--ed-yellow); }

.qa-note {
  margin: 12px 0 0;
  padding: 13px 16px;
  border-left: 6px solid var(--tone);
  background: var(--ed-cool);
  color: var(--ed-muted);
  font: 500 12px/1.7 var(--ed-display);
}
