:root {
  --bg: #f2f5f2;
  --surface: #ffffff;
  --surface-2: #e3eae3;
  --surface-3: #0d3b26;
  --ink: #131c17;
  --muted: #4a5c52;
  --accent: #0e5a36;
  --accent-hover: #084025;
  --accent-ink: #ffffff;
  --link: #0e5a36;
  --ok-bg: #e2f5ea;
  --ok-ink: #0a482b;
  --warn-bg: #fdf1e4;
  --warn-ink: #7c370f;
  --font-sans: "Instrument Sans", "Noto Sans JP", -apple-system, BlinkMacSystemFont, sans-serif;
  --step-small: clamp(0.85rem, 0.83rem + 0.1vw, 0.92rem);
  --step-body: clamp(1.02rem, 0.99rem + 0.18vw, 1.1rem);
  --step-lead: clamp(1.14rem, 1.08rem + 0.22vw, 1.24rem);
  --step-h2: clamp(1.55rem, 1.22rem + 1.5vw, 2.25rem);
  --step-head: clamp(2.2rem, 1.5rem + 3.2vw, 3.9rem);
  --gap: 8px;
  --max-w: 1392px;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: 16px; line-height: 1.5; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: var(--step-body); overflow-x: clip; }
img, canvas { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 1.5px; }
a:hover { color: var(--accent-hover); }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0 0 0.44em; font-family: var(--font-sans); font-weight: 600; color: inherit; }
h1 { font-size: var(--step-head); line-height: 0.98; letter-spacing: -0.04em; }
h2 { font-size: var(--step-h2); line-height: 1.06; letter-spacing: -0.03em; }
h3, h4 { font-size: var(--step-lead); line-height: 1.2; }
p, ul, ol, dl, table, pre { margin: 0 0 0.95rem; }
p, li { max-width: 66ch; overflow-wrap: anywhere; }
p:last-child, ul:last-child, ol:last-child { margin-bottom: 0; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: var(--step-small); }
p code, li code, td code { background: var(--surface-2); color: var(--ink); padding: 0.12em 0.38em; }
pre { max-width: 100%; background: var(--surface-2); color: var(--ink); padding: 0.95rem 1.1rem; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.48; }

.board-shell { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 14px 20px; }
.top-bar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--gap); margin-bottom: var(--gap); }
.brand-tile { background: var(--surface-3); color: #ffffff; padding: 12px 18px; min-height: 46px; display: inline-flex; align-items: center; font-weight: 700; font-size: var(--step-body); text-decoration: none; letter-spacing: -0.02em; }
.brand-tile:hover { background: var(--accent); color: #ffffff; }
.nav-tile { background: var(--surface); padding: 8px 18px; min-height: 46px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.nav-tile a { color: var(--ink); text-decoration: none; font-size: var(--step-small); font-weight: 500; }
.nav-tile a:hover, .nav-tile a[aria-current="page"] { color: var(--accent); text-decoration: underline; }
.cta-tile { background: var(--accent); color: #ffffff; padding: 12px 20px; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: var(--step-small); text-decoration: none; }
.cta-tile:hover { background: var(--accent-hover); color: #ffffff; }

.board-section { margin-top: clamp(44px, 5vw, 76px); }
.board-section--first { margin-top: 0; }
.tile-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.tile { background: var(--surface); color: var(--ink); padding: 22px; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.tile--top { justify-content: flex-start; }
.tile-elev { background: var(--surface-2); color: var(--ink); }
.tile-photo { padding: 0; position: relative; overflow: hidden; background: var(--surface); min-height: 240px; }
.tile-photo img { width: 100%; height: 100%; min-height: 240px; max-height: 265px; object-fit: cover; display: block; }
.photo-strip { background: #131c17; color: #ffffff; padding: 8px 14px; font-size: var(--step-small); line-height: 1.35; }

.c-12 { grid-column: span 12; }
.c-8  { grid-column: span 8; }
.c-7  { grid-column: span 7; }
.c-6  { grid-column: span 6; }
.c-5  { grid-column: span 5; }
.c-4  { grid-column: span 4; }
.c-3  { grid-column: span 3; }
.c-2  { grid-column: span 2; }

.hero-lead { font-size: clamp(1.02rem, 0.98rem + 0.18vw, 1.12rem); line-height: 1.46; color: var(--ink); margin: 0.55rem 0 0.75rem; max-width: 62ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.btn-primary { background: var(--accent); color: #ffffff; padding: 11px 20px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: var(--step-small); text-decoration: none; border: 0; cursor: pointer; font-family: var(--font-sans); }
.btn-primary:hover { background: var(--accent-hover); color: #ffffff; }
.btn-ghost { background: var(--surface-2); color: var(--ink); padding: 11px 16px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; font-weight: 500; font-size: var(--step-small); text-decoration: none; border: 1px solid rgba(19, 28, 23, 0.16); cursor: pointer; font-family: var(--font-sans); }
.btn-ghost:hover { background: var(--surface-3); color: #ffffff; }
.stat-note { font-size: var(--step-small); color: var(--muted); margin: 0; }
.stat-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 8px; margin-top: 12px; }
.stat-pill { background: var(--surface-2); padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.stat-pill span { font-size: var(--step-small); color: var(--muted); }
.stat-pill strong { font-size: 0.98rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

[data-ui].ui-split { display: grid; grid-template-columns: minmax(0, 44fr) minmax(0, 56fr); background: var(--surface); color: var(--ink); border: 1px solid rgba(19, 28, 23, 0.14); }
[data-ui] .ui-controls { padding: 18px; background: var(--surface-2); display: flex; flex-direction: column; gap: 11px; }
[data-ui] .ui-output { padding: 20px; background: var(--surface); display: flex; flex-direction: column; justify-content: flex-start; gap: 14px; }
[data-ui] .ctrl-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
[data-ui] .ctrl-field { display: flex; flex-direction: column; gap: 5px; }
[data-ui] .ctrl-field label { font-size: var(--step-small); font-weight: 600; color: var(--ink); }
[data-ui] select, [data-ui] input[type="number"], [data-ui] input[type="text"] {
  width: 100%; min-height: 42px; padding: 8px 12px; background: #ffffff; color: var(--ink);
  border: 1px solid rgba(19, 28, 23, 0.22); font-family: var(--font-sans); font-size: var(--step-small); font-variant-numeric: tabular-nums;
}
[data-ui] .ui-kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
[data-ui] .ui-kpi { background: var(--surface-2); padding: 12px 14px; }
[data-ui] .ui-kpi span { display: block; font-size: var(--step-small); color: var(--muted); margin-bottom: 3px; }
[data-ui] .ui-kpi strong { display: block; font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
[data-ui] .ui-verdict { background: var(--surface-2); padding: 14px 16px; border-left: 4px solid var(--accent); }
[data-ui] .ui-verdict.is-warn { background: var(--warn-bg); color: var(--warn-ink); border-left-color: #c2410c; }
[data-ui] .ui-verdict.is-ok { background: var(--ok-bg); color: var(--ok-ink); border-left-color: #0e5a36; }
[data-ui] .ui-verdict strong { display: block; font-size: var(--step-body); margin-bottom: 4px; }
[data-ui] .ui-verdict p { font-size: var(--step-small); margin: 0; max-width: none; }

.plate-stage { background: #1a221e; padding: 22px; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(19,28,23,0.2); }
.plate-stage canvas { width: 100%; max-width: 520px; aspect-ratio: 2 / 1; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); border-radius: 8px; }

.next-row-title { font-size: var(--step-lead); margin-bottom: 10px; }
.next-card { text-decoration: none; gap: 8px; border: 1px solid rgba(19, 28, 23, 0.08); }
.next-card:hover { border-color: var(--accent); }
.next-q { font-weight: 600; color: var(--ink); font-size: 0.96rem; }
.next-a { font-size: var(--step-small); color: var(--muted); }
.next-go { font-size: var(--step-small); font-weight: 600; color: var(--accent); margin-top: auto; }

.table-wrap { width: 100%; overflow-x: auto; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: var(--step-small); font-variant-numeric: tabular-nums; margin: 0; }
th, td { text-align: start; padding: 11px 13px; border-bottom: 1px solid var(--surface-2); vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; color: var(--ink); }

.faq-layout { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--gap); align-items: start; }
.faq-sticky { position: sticky; top: 24px; padding-right: 12px; }
.faq-sticky p { color: var(--muted); margin-top: 8px; font-size: var(--step-small); }
.faq-stack { display: flex; flex-direction: column; gap: var(--gap); }
.faq-tile { background: var(--surface); color: var(--ink); }
.faq-tile summary { list-style: none; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; font-weight: 600; cursor: pointer; }
.faq-tile summary::-webkit-details-marker { display: none; }
.faq-plus { width: 14px; height: 14px; position: relative; flex-shrink: 0; }
.faq-plus::before, .faq-plus::after { content: ""; position: absolute; background: currentColor; }
.faq-plus::before { top: 6px; left: 0; width: 14px; height: 2px; }
.faq-plus::after { top: 0; left: 6px; width: 2px; height: 14px; }
.faq-tile[open] { background: var(--surface-3); color: #ffffff; }
.faq-tile[open] .faq-plus::after { display: none; }
.faq-ans { padding: 0 20px 18px; font-size: var(--step-small); line-height: 1.5; }

.ad-slot { margin: 12px 0; background: var(--surface); padding: 6px 10px; overflow: hidden; }
.ad-leader, .ad-300 { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 68px; }
.ad-n, .ad-native { display: block; width: 100%; text-align: center; }
.ad-slot-label { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 4px; }
.ad-slot-pending { display: none; }

.footer-board { margin-top: clamp(56px, 7vw, 104px); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.footer-wordmark { background: var(--surface-3); color: #ffffff; padding: 24px; display: flex; align-items: flex-end; min-height: 176px; }
.footer-wordmark span { font-size: clamp(2rem, 5vw, 4.4rem); font-weight: 700; line-height: 0.9; letter-spacing: -0.04em; }
.footer-cta-tile { background: var(--accent); color: #ffffff; padding: 22px; min-height: 176px; text-decoration: none; display: flex; flex-direction: column; justify-content: space-between; }
.footer-cta-tile:hover { background: var(--accent-hover); color: #ffffff; }
.footer-cta-tile strong { font-size: var(--step-lead); line-height: 1.18; }
.footer-cta-arrow { align-self: flex-end; }
.footer-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; }
.footer-list a { text-decoration: none; color: var(--ink); font-size: var(--step-small); }
.footer-list a:hover { color: var(--accent); text-decoration: underline; }

.board-section--first h1 { font-size: clamp(1.9rem, 1.35rem + 2.1vw, 2.75rem); margin-bottom: 0.3em; }
.board-section--first .tile { padding: 16px 20px; }

@media (max-width: 980px) {
  .top-bar { grid-template-columns: 1fr auto; }
  .nav-tile { grid-column: 1 / -1; order: 3; }
  .c-3, .c-2 { grid-column: span 6; }
  [data-ui].ui-split, .faq-layout { grid-template-columns: 1fr; }
  .faq-sticky { position: static; }
}
@media (max-width: 680px) {
  .board-shell { padding: 10px 14px; }
  .tile-grid, .footer-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c-12, .c-8, .c-7, .c-6, .c-5, .c-4 { grid-column: span 2; }
  .c-3, .c-2 { grid-column: span 1; }
  [data-ui] .ctrl-row-2 { grid-template-columns: 1fr; }
  .board-section--first .tile-photo img { max-height: 165px; }
}
