:root {
  --bg: #efe7da;
  --panel: rgba(255, 250, 243, 0.88);
  --panel-strong: #fff7ed;
  --ink: #16211c;
  --muted: #56645c;
  --accent: #b7552d;
  --accent-deep: #87371d;
  --line: rgba(22, 33, 28, 0.12);
  --shadow: 0 24px 60px rgba(64, 32, 10, 0.14);
  --success: #295f43;
  --warn: #a33f18;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(183, 85, 45, 0.2), transparent 28%),
    radial-gradient(circle at right 20%, rgba(41, 95, 67, 0.14), transparent 24%),
    linear-gradient(180deg, #f6efe4 0%, var(--bg) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(22, 33, 28, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 33, 28, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 90%);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.hero {
  padding: 20px 8px 32px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-deep);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  font-weight: 700;
}

h1, h2, h3, p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(3rem, 7vw, 5.2rem);
  line-height: 0.95;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.lede,
.section-copy {
  max-width: 72ch;
  color: var(--muted);
  line-height: 1.6;
}

.john-card,
.john-quote {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(183, 85, 45, 0.14), rgba(255, 247, 237, 0.85));
  border: 1px solid rgba(183, 85, 45, 0.18);
  border-radius: 20px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.john-card {
  max-width: 440px;
  margin-top: 24px;
}

.john-banner-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.john-banner {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(183, 85, 45, 0.16), rgba(255, 247, 237, 0.9));
  border: 1px solid rgba(183, 85, 45, 0.18);
  box-shadow: var(--shadow);
}

.john-banner-label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-deep);
}

.john-banner p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.45;
}

.john-label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-deep);
}

.grid {
  display: grid;
  grid-template-columns: 1.4fr 0.95fr;
  gap: 20px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.panel + .panel,
.grid + .panel {
  margin-top: 20px;
}

.panel-heading {
  margin-bottom: 20px;
}

.john-inline-tip {
  margin: 10px 0 0;
  color: var(--accent-deep);
  font-size: 1rem;
  line-height: 1.5;
}

.panel-heading.secondary {
  margin-top: 24px;
}

form label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.92rem;
  font-weight: 500;
}

.label-copy,
.metric-label,
.benchmark h3,
.suggestion h3 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

input {
  width: 100%;
  border: 1px solid rgba(22, 33, 28, 0.12);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.75);
  font: inherit;
  color: var(--ink);
}

select {
  width: 100%;
  border: 1px solid rgba(22, 33, 28, 0.12);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.75);
  font: inherit;
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 2px solid rgba(183, 85, 45, 0.28);
  border-color: rgba(183, 85, 45, 0.28);
}

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

.burden-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
}

.calc-graphics {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
}

.gauge-card,
.signal-card,
.poster-card {
  position: relative;
  overflow: hidden;
}

.gauge-card {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 16px;
  padding: 18px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(255, 193, 120, 0.26), transparent 36%),
    linear-gradient(135deg, #20140f, #4f2416 55%, #7b3418);
  color: #fff4e7;
  box-shadow: 0 22px 42px rgba(97, 41, 18, 0.24);
}

.gauge-card::after,
.signal-card::after,
.poster-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 42%);
}

.gauge-copy {
  position: relative;
  z-index: 1;
}

.graphic-kicker {
  margin: 0 0 8px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 235, 215, 0.72);
}

.gauge-copy h3 {
  margin-bottom: 8px;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
}

.gauge-copy p,
.signal-card span,
.poster-card p {
  margin-bottom: 0;
  line-height: 1.5;
  color: rgba(255, 244, 231, 0.82);
}

.gauge-shell {
  position: relative;
  z-index: 1;
  align-self: center;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 247, 237, 0.1);
  border: 1px solid rgba(255, 247, 237, 0.18);
}

.gauge-scale,
.gauge-stats {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.gauge-scale {
  margin-bottom: 10px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 244, 231, 0.68);
}

.gauge-track {
  overflow: hidden;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 247, 237, 0.16);
  border: 1px solid rgba(255, 247, 237, 0.2);
}

.gauge-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f7d57c, #ff9753 55%, #ff5f3b);
  box-shadow: 0 0 28px rgba(255, 164, 92, 0.46);
  transition: width 220ms ease;
}

.gauge-stats {
  margin-top: 12px;
  align-items: end;
}

.gauge-stats strong {
  font-size: 1.55rem;
}

.gauge-stats span {
  font-size: 0.92rem;
  color: rgba(255, 244, 231, 0.76);
}

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

.signal-card,
.poster-card {
  padding: 16px;
  border-radius: 20px;
  min-height: 148px;
  box-shadow: 0 16px 30px rgba(64, 32, 10, 0.14);
}

.signal-card strong,
.poster-card strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-bottom: 8px;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  line-height: 1;
}

.signal-card span,
.poster-card p {
  position: relative;
  z-index: 1;
  font-size: 0.93rem;
}

.signal-rate {
  background: linear-gradient(135deg, #f6d98c, #ef9e57 52%, #cf5a2f);
  color: #32160e;
}

.signal-trip {
  background: linear-gradient(135deg, #ecf0d0, #b6cc8a 55%, #5d8a50);
  color: #16301e;
}

.signal-gap {
  background: linear-gradient(135deg, #ffe1d1, #f39b7a 55%, #b8472c);
  color: #37150f;
}

.signal-rate .graphic-kicker,
.signal-trip .graphic-kicker,
.signal-gap .graphic-kicker,
.signal-rate span,
.signal-trip span,
.signal-gap span {
  color: rgba(22, 21, 20, 0.72);
}

.poster-card {
  color: #fff7ed;
}

.poster-warning {
  background: linear-gradient(135deg, #432019, #8f351d 60%, #c34e1b);
}

.poster-zip {
  background: linear-gradient(135deg, #17354b, #1d6a7a 58%, #46a4a4);
}

.poster-tools {
  background: linear-gradient(135deg, #273119, #5f6b20 55%, #aa8d24);
}

.poster-stamp {
  position: relative;
  z-index: 1;
  display: inline-flex;
  margin-bottom: 14px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 247, 237, 0.26);
  background: rgba(255, 247, 237, 0.1);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.flex-entry-grid {
  display: grid;
  gap: 12px;
}

.flex-entry {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(22, 33, 28, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.46);
}

.metric-stack {
  display: grid;
  gap: 14px;
}

.metric {
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(22, 33, 28, 0.08);
}

.metric.highlight {
  background: linear-gradient(135deg, rgba(41, 95, 67, 0.92), rgba(24, 68, 48, 0.96));
  color: white;
  transform: translateY(-2px);
}

.metric-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.74;
}

.metric strong {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1;
}

.tip-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin-top: 4px;
  padding: 4px 8px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff7ed;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: help;
  box-shadow: 0 8px 18px rgba(135, 55, 29, 0.16);
}

.tip-inline {
  margin-top: 0;
  margin-left: auto;
  margin-right: 8px;
}

.tip-bubble {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  z-index: 20;
  width: min(320px, 70vw);
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff7ed;
  color: var(--accent-deep);
  border: 1px solid rgba(183, 85, 45, 0.22);
  box-shadow: 0 16px 34px rgba(64, 32, 10, 0.16);
  font-size: 0.95rem;
  line-height: 1.45;
  letter-spacing: normal;
  text-transform: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-50%);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
  pointer-events: none;
}

.tip-pinned {
  display: inline-block;
  margin-left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(183, 85, 45, 0.14);
  color: var(--accent-deep);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tip-trigger:hover .tip-bubble,
.tip-trigger:focus-visible .tip-bubble {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%);
}

.tip-trigger:focus-visible {
  outline: 3px solid rgba(183, 85, 45, 0.32);
  outline-offset: 2px;
}

.breakdown {
  margin-top: 24px;
}

.breakdown ul {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 10px;
}

.breakdown li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(22, 33, 28, 0.08);
  font-size: 0.95rem;
}

.benchmark,
.gap-list {
  margin-top: 24px;
}

.benchmark {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(22, 33, 28, 0.04);
}

.benchmark p,
.gap-list li {
  color: var(--muted);
  line-height: 1.6;
}

.quote-mark {
  position: absolute;
  top: -18px;
  left: 16px;
  font-size: 5rem;
  color: rgba(183, 85, 45, 0.25);
}

.john-quote {
  margin-top: 24px;
}

.john-quote p:last-child {
  position: relative;
  margin: 0;
  padding-top: 24px;
  line-height: 1.6;
}

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

.suggestion {
  display: grid;
  gap: 12px;
  min-height: 176px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(22, 33, 28, 0.08);
}

.suggestion[data-active="true"] {
  border-color: rgba(163, 63, 24, 0.32);
  background: linear-gradient(180deg, rgba(255, 240, 232, 0.95), rgba(255, 255, 255, 0.84));
}

.suggestion header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.suggestion h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.suggestion p {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.92rem;
}

.pill {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pill.warn {
  color: var(--warn);
  background: rgba(163, 63, 24, 0.1);
}

.pill.ok {
  color: var(--success);
  background: rgba(41, 95, 67, 0.1);
}

.suggestion label {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: auto;
  font-size: 0.9rem;
  color: var(--ink);
}

.suggestion input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.calc-suggestion-list {
  display: grid;
  gap: 10px;
}

.calc-suggestion {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(22, 33, 28, 0.08);
}

.calc-suggestion[data-active="true"] {
  border-color: rgba(163, 63, 24, 0.28);
  background: linear-gradient(180deg, rgba(255, 240, 232, 0.92), rgba(255, 255, 255, 0.82));
}

.calc-suggestion-copy {
  display: grid;
  gap: 4px;
}

.calc-suggestion-copy span {
  color: var(--muted);
  font-size: 0.9rem;
}

.calc-suggestion-toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  white-space: nowrap;
}

.gap-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
}

.gap-list li {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(22, 33, 28, 0.08);
}

.search-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.search-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  color: white;
  text-decoration: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 14px 28px rgba(135, 55, 29, 0.2);
}

.search-link:hover,
.search-link:focus-visible {
  transform: translateY(-1px);
}

@media (max-width: 980px) {
  .grid,
  .suggestion-list,
  .john-banner-grid,
  .signal-grid,
  .poster-strip {
    grid-template-columns: 1fr;
  }

  .gauge-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 18px, 1180px);
    padding-top: 24px;
  }

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

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

  .burden-line {
    grid-template-columns: 1fr;
  }

  .flex-entry {
    grid-template-columns: 1fr;
  }

  .signal-card,
  .poster-card {
    min-height: auto;
  }

  .tip-bubble {
    left: 0;
    top: calc(100% + 8px);
    width: min(280px, 84vw);
    font-size: 0.88rem;
    transform: translateY(8px);
  }

  .tip-trigger:hover .tip-bubble,
  .tip-trigger:focus-visible .tip-bubble {
    transform: translateY(0);
  }
}
