:root {
  --ink: #17212b;
  --paper: #f4f0e8;
  --orange: #c65c22;
  --green: #2f6b55;
  --muted: #667085;
  --line: #cfc8bb;
  --pale-green: #e5eee8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Mono", "Courier New", monospace;
}

body::before {
  background-image: linear-gradient(rgba(23, 33, 43, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(23, 33, 43, 0.045) 1px, transparent 1px);
  background-size: 24px 24px;
  content: "";
  inset: 0;
  opacity: .42;
  pointer-events: none;
  position: fixed;
  z-index: -1;
}

.shell { display: grid; gap: 18px; grid-template-columns: repeat(12, minmax(0, 1fr)); margin: 0 auto; max-width: 1440px; padding: 32px; }
.hero { grid-column: 1 / span 8; padding: 36px 26px 28px 0; }
.eyebrow { color: var(--orange); font-size: .74rem; font-weight: 600; letter-spacing: .08em; margin: 0 0 12px; }
h1, h2 { font-family: "Noto Serif SC", "Songti SC", serif; letter-spacing: -.04em; margin: 0; }
h1 { font-size: clamp(3.1rem, 8vw, 6.8rem); line-height: .98; }
h2 { font-size: clamp(1.65rem, 3vw, 2.8rem); line-height: 1.15; }
.hero-copy { font-size: 1rem; line-height: 1.8; margin: 26px 0 14px; max-width: 620px; }
.data-notice { border-left: 4px solid var(--orange); color: var(--muted); font-size: .78rem; line-height: 1.7; margin: 0; padding: 8px 12px; }

.delivery-slip { align-self: stretch; background: var(--ink); color: var(--paper); grid-column: 9 / span 4; padding: 25px; position: relative; }
.delivery-slip::after { border: 1px solid var(--orange); content: ""; inset: 12px; pointer-events: none; position: absolute; }
.delivery-slip > * { position: relative; z-index: 1; }
.delivery-slip .eyebrow { color: #f3b273; }
dl { border-top: 1px solid rgba(244, 240, 232, .3); margin: 16px 0; }
dl div { border-bottom: 1px solid rgba(244, 240, 232, .2); display: flex; gap: 14px; justify-content: space-between; padding: 12px 0; }
dt { color: #bdc6cd; font-size: .74rem; }
dd { font-size: .74rem; margin: 0; text-align: right; }
.download-actions { display: grid; gap: 9px; margin-top: 20px; }
.download-link { background: var(--orange); color: #fff; font-size: .82rem; font-weight: 600; padding: 13px 12px; text-align: center; text-decoration: none; }
.download-link:hover, .download-link:focus { background: #a84919; }
.download-link.is-dark { background: var(--paper); color: var(--ink); }
.download-link.is-dark:hover, .download-link.is-dark:focus { background: #ded7ca; }
.slip-footnote { color: #bdc6cd; font-size: .68rem; line-height: 1.65; margin-top: 14px; }

.controls { border-bottom: 2px solid var(--ink); border-top: 2px solid var(--ink); display: grid; gap: 16px; grid-column: 1 / -1; grid-template-columns: 2fr 1fr 1fr; padding: 15px 0; }
.control-title { display: grid; gap: 4px; grid-template-columns: 28px 1fr; }
.control-title span { color: var(--orange); font-size: 1.1rem; grid-row: span 2; }
.control-title small { color: var(--muted); font-size: .72rem; grid-column: 2; }
label { color: var(--muted); display: grid; font-size: .72rem; gap: 6px; }
select { appearance: none; background: transparent; border: 1px solid var(--ink); border-radius: 0; color: var(--ink); font: inherit; font-size: .84rem; padding: 10px; }

.result-head { grid-column: 1 / span 7; padding: 28px 0 8px 8%; }
.result-head p:last-child { color: var(--muted); font-size: .78rem; line-height: 1.7; max-width: 480px; }
.metrics { display: grid; gap: 0; grid-column: 1 / -1; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.metric { border-left: 1px solid var(--line); min-height: 148px; padding: 16px 12px; }
.metric:first-child { border-left: 0; }
.metric:nth-child(3n) { background: var(--pale-green); transform: translateY(13px); }
.metric-label { color: var(--muted); font-size: .68rem; }
.metric-value { font-family: "Noto Serif SC", "Songti SC", serif; font-size: clamp(1.15rem, 2vw, 2rem); line-height: 1.3; margin: 28px 0 4px; white-space: nowrap; }
.metric-unit { color: var(--orange); font-size: .66rem; }

.trend-section { border-top: 1px solid var(--ink); grid-column: 1 / span 8; margin-top: 42px; padding-top: 18px; }
.section-heading { display: flex; gap: 20px; justify-content: space-between; align-items: baseline; }
.trend-bars { align-items: end; display: flex; gap: 8px; height: 245px; margin-top: 24px; padding-bottom: 28px; position: relative; }
.trend-bars::after { background: var(--ink); bottom: 27px; content: ""; height: 1px; left: 0; position: absolute; right: 0; }
.trend-item { display: grid; flex: 1; gap: 7px; justify-items: center; min-width: 0; position: relative; z-index: 1; }
.trend-bar { background: var(--orange); min-height: 5px; width: 100%; }
.trend-item:nth-child(even) .trend-bar { background: var(--green); }
.trend-value { color: var(--muted); font-size: .62rem; white-space: nowrap; }
.trend-month { font-size: .64rem; }

.details-section { background: #ebe6dc; grid-column: 9 / span 4; margin-top: 42px; padding: 20px; }
.details-section h2 { font-size: 1.8rem; }
.table-wrap { max-height: 370px; overflow: auto; }
table { border-collapse: collapse; font-size: .68rem; margin-top: 16px; min-width: 700px; width: 100%; }
th { border-bottom: 2px solid var(--ink); font-weight: 600; padding: 9px 7px; position: sticky; text-align: right; top: 0; background: #ebe6dc; }
td { border-bottom: 1px solid var(--line); padding: 9px 7px; text-align: right; white-space: nowrap; }
th:first-child, th:nth-child(2), td:first-child, td:nth-child(2) { text-align: left; }

.product-context { background: var(--ink); color: var(--paper); grid-column: 1 / -1; padding: 30px 32px; }
.product-context .eyebrow { color: #f3b273; }
.product-context h2 { font-size: clamp(1.3rem, 2.2vw, 2rem); margin-bottom: 18px; }
.ctx-lead { color: #dfe5ea; font-size: .86rem; line-height: 1.95; margin: 0 0 24px; max-width: 920px; }
.ctx-lead strong { color: var(--paper); font-weight: 600; }
.ctx-lead code { background: rgba(244, 240, 232, .12); color: #f3b273; font-size: .82em; padding: 2px 6px; }
.ctx-chain { background: rgba(244, 240, 232, .2); display: grid; gap: 1px; grid-template-columns: repeat(5, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; }
.ctx-chain li { align-content: start; background: var(--ink); display: grid; gap: 5px; padding: 14px 14px 18px; }
.ctx-chain span { color: var(--orange); font-size: .68rem; }
.ctx-chain strong { font-size: .8rem; font-weight: 600; }
.ctx-chain small { color: #bdc6cd; font-size: .68rem; line-height: 1.6; }
.ctx-note { border-left: 4px solid var(--orange); color: #bdc6cd; font-size: .76rem; line-height: 1.8; margin: 22px 0 0; padding: 8px 14px; }

.acceptance-map { border-left: 8px solid var(--green); grid-column: 2 / span 9; margin: 50px 0 24px; padding: 20px 26px; }
.acceptance-map ol { display: grid; gap: 12px; margin: 20px 0 0; padding-left: 20px; }
.acceptance-map li { font-size: .83rem; line-height: 1.75; padding-left: 8px; }

@media (max-width: 900px) {
  .product-context { padding: 22px; }
  .ctx-chain { grid-template-columns: 1fr; }
  .shell { padding: 20px; }
  .hero, .delivery-slip, .result-head, .trend-section, .details-section, .acceptance-map { grid-column: 1 / -1; }
  .controls { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { border-bottom: 1px solid var(--line); }
  .metric:nth-child(3n) { transform: none; }
  .result-head { padding-left: 0; }
}
