:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #e4e9f1;
  --surface-3: #121826;
  --ink: #111827;
  --muted: #4b5563;
  --accent: #0284c7;
  --accent-hover: #0369a1;
  --accent-ink: #ffffff;
  --link: #0369a1;
  --signal: #f59e0b;
  --ok-bg: #e2f4ec;
  --ok-ink: #0b4a33;
  --warn-bg: #fdf0e3;
  --warn-ink: #7a3410;
  --bad-bg: #fde8e8;
  --bad-ink: #7f1d1d;
  --font-head: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --step-small: clamp(0.85rem, 0.83rem + 0.1vw, 0.92rem);
  --step-body: clamp(1rem, 0.97rem + 0.16vw, 1.08rem);
  --step-lead: clamp(1.12rem, 1.06rem + 0.22vw, 1.22rem);
  --step-h2: clamp(1.5rem, 1.2rem + 1.4vw, 2.15rem);
  --step-head: clamp(2.1rem, 1.5rem + 3vw, 3.6rem);
  --gap: 8px;
  --pad: 20px;
  --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 { 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, textarea: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-head); font-weight: 600; color: inherit; }
h1 { font-size: var(--step-head); line-height: 1.02; letter-spacing: -0.03em; }
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, blockquote { 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: var(--font-mono); font-size: 0.86em; }
p code, li code, td code, summary 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; gap: 10px; font-family: var(--font-head); 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-accent { background: var(--accent); color: #ffffff; }
.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: var(--surface-3); font-family: var(--font-mono); letter-spacing: 0.02em; 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(16, 27, 39, 0.14); 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; }

/* Interactive UI Split & SUS Matrix */
[data-ui].ui-split { display: grid; grid-template-columns: minmax(0, 56fr) minmax(0, 44fr); background: var(--surface); color: var(--ink); border: 1px solid rgba(16, 27, 39, 0.14); }
[data-ui] .ui-controls { padding: 18px; background: var(--surface-2); display: flex; flex-direction: column; gap: 12px; }
[data-ui] .ui-output { padding: 20px; background: var(--surface); display: flex; flex-direction: column; justify-content: flex-start; gap: 14px; }
[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"], [data-ui] textarea {
  width: 100%; min-height: 42px; padding: 8px 12px; background: #ffffff; color: var(--ink);
  border: 1px solid rgba(16, 27, 39, 0.22); font-family: var(--font-sans); font-size: var(--step-small); font-variant-numeric: tabular-nums;
}
[data-ui] textarea { min-height: 150px; font-family: var(--font-mono); line-height: 1.4; resize: vertical; }
[data-ui] textarea.is-short { min-height: 84px; }
[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-family: var(--font-mono); font-size: 1.12rem; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
[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: #0f766e; }
[data-ui] .ui-verdict.is-bad { background: var(--bad-bg); color: var(--bad-ink); border-left-color: #b91c1c; }
[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; }

.next-row-title { font-size: var(--step-lead); margin-bottom: 10px; }
.next-card { text-decoration: none; gap: 8px; border: 1px solid rgba(16, 27, 39, 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-family: var(--font-head); font-size: clamp(1.8rem, 4.4vw, 3.9rem); 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; }
  .u-list { grid-template-columns: 1fr; }
  .board-section--first .tile-photo img { max-height: 165px; }
}
@media print {
  .top-bar, .ad-slot, .next-row, .footer-board, [data-no-print] { display: none !important; }
  body, .board-shell, .tile { background: #ffffff !important; padding: 0 !important; }
  [data-ui].ui-split { grid-template-columns: 1fr !important; border: 1px solid #000 !important; }
}


/* Field terminal additions */
.brand-dot { width: 10px; height: 10px; background: var(--signal); display: inline-block; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25); }
.eyebrow { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-hover); margin: 0 0 8px; }
.footer-brand { font-family: var(--font-head); font-size: var(--step-lead); font-weight: 600; margin-bottom: 8px; }
.footer-head { margin-bottom: 10px; display: block; font-family: var(--font-head); }
[data-ui].ui-split--wide { grid-template-columns: minmax(0, 52fr) minmax(0, 48fr); }
.drop-zone { border: 2px dashed rgba(17, 24, 39, 0.28); background: var(--surface); padding: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.drop-zone span { font-size: var(--step-small); color: var(--muted); }
.drop-zone.is-over { border-color: var(--accent); background: #e0f2fe; }
.file-btn { cursor: pointer; margin-top: 4px; }
.ctrl-sep { border: 0; border-top: 1px solid rgba(17, 24, 39, 0.14); width: 100%; margin: 4px 0; }
.ed-panel { display: flex; flex-direction: column; gap: 12px; }
.ed-panel[hidden] { display: none; }
.u-groups { display: flex; flex-direction: column; gap: 8px; }
.u-group { border: 1px solid rgba(17, 24, 39, 0.14); background: var(--surface); padding: 8px 10px 10px; margin: 0; min-width: 0; }
.u-group legend { font-family: var(--font-head); font-weight: 600; font-size: 0.95rem; padding: 0 6px; display: flex; gap: 10px; align-items: center; }
.u-all { font-family: var(--font-mono); font-size: 0.72rem; background: var(--surface-2); border: 1px solid rgba(17, 24, 39, 0.18); padding: 2px 8px; cursor: pointer; color: var(--ink); }
.u-all:hover { background: var(--surface-3); color: #ffffff; }
.u-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; }
.u-row { display: flex; align-items: center; gap: 7px; font-size: 0.86rem; min-width: 0; cursor: pointer; padding: 3px 0; }
.u-row input { accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
.u-row code { font-size: 0.74rem; color: var(--muted); background: none; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-row.is-fixed { cursor: default; opacity: 0.75; }
.u-row.is-switch { align-items: flex-start; font-size: var(--step-small); }
.u-name { font-weight: 600; white-space: nowrap; }
.u-eclipse { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 0.86rem; }
.u-eclipse select { width: auto !important; min-height: 34px !important; margin-left: 6px; }
.id-badge { font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 5px; border: 1px solid currentColor; flex-shrink: 0; line-height: 1.4; }
.id-badge.is-guide { color: #047857; }
.id-badge.is-wiki { color: #0369a1; }
.id-badge.is-pattern { color: #b45309; }
.out-head { display: block; font-family: var(--font-head); font-size: 0.95rem; margin-bottom: 6px; }
.mono-box { font-family: var(--font-mono); font-size: 0.8rem; background: var(--surface-2); padding: 10px 12px; margin: 0 0 8px; max-width: none; overflow-wrap: anywhere; max-height: 140px; overflow-y: auto; }
.change-log { list-style: none; padding: 0; margin: 0; font-family: var(--font-mono); font-size: 0.78rem; max-height: 170px; overflow-y: auto; background: var(--surface-2); }
.change-log li { padding: 5px 10px; border-bottom: 1px solid var(--surface); max-width: none; }
.change-log li.is-add { border-left: 3px solid #0f766e; }
.change-log li.is-del { border-left: 3px solid #b91c1c; }
.xml-preview summary { cursor: pointer; font-weight: 600; font-size: var(--step-small); }
.xml-preview pre { max-height: 320px; overflow: auto; white-space: pre; margin-top: 8px; }
[data-ui] .ui-output pre { max-height: 220px; overflow-y: auto; margin-bottom: 8px; }
.check-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.check-list li { padding: 9px 12px; font-size: var(--step-small); background: var(--surface-2); border-left: 4px solid var(--muted); max-width: none; }
.check-list li strong { display: block; }
.check-list li.is-pass { background: var(--ok-bg); color: var(--ok-ink); border-left-color: #0f766e; }
.check-list li.is-warn { background: var(--warn-bg); color: var(--warn-ink); border-left-color: #c2410c; }
.check-list li.is-fail { background: var(--bad-bg); color: var(--bad-ink); border-left-color: #b91c1c; }
.rr-table { max-height: 360px; overflow-y: auto; }
.rr-table td:first-child { font-family: var(--font-mono); font-size: 0.78rem; overflow-wrap: anywhere; }
.rr-table input[type="text"], .rr-table input[type="number"] { min-height: 32px !important; padding: 4px 8px !important; }
.rr-table tr.is-changed td { background: #e0f2fe; }
button[disabled] { opacity: 0.45; cursor: not-allowed; }
[data-ui] > .ui-controls, [data-ui] > .ui-output, .u-groups, .u-list, .ctrl-field { min-width: 0; }
.drop-zone code, .drop-zone span { overflow-wrap: anywhere; max-width: 100%; }
.u-row code { min-width: 0; flex: 0 1 auto; }
@media (max-width: 980px) {
  [data-ui].ui-split--wide { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .u-row { flex-wrap: wrap; row-gap: 2px; }
  .u-name { white-space: normal; overflow-wrap: anywhere; min-width: 0; }
  .u-row code { flex-basis: 100%; padding-left: 23px; white-space: normal; overflow-wrap: anywhere; }
  .u-eclipse label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
}
