/*
 * Layout: 製図台。左に方眼の平面図（ボード）、右に施主メモと構造チェックの欄。スマホでは縦一列。
 * 色は図面の世界から：方眼紙の淡い灰緑、墨、藍の作図線、検査印の朱、木材の色で壁の強さ。
 */
:root {
  --paper: #ECEFE9;
  --sheet: #F7F8F4;
  --ink: #1B2326;
  --ink-2: #56625F;
  --ink-3: #8A9590;
  --rule: #C7CEC6;
  --grid: #DCE1DA;
  --accent: #2B4E86;
  --accent-soft: rgba(43, 78, 134, 0.10);
  --accent-ink: #FFFFFF;
  --seal: #C23B22;
  --ok: #2E7A4C;
  --warn: #C2860F;
  --bad: #C23B22;
  --glass: #6FA9C2;
  --ground: #DCD8CC;
  --floor: #E9E2D2;
  --roof: #3A4548;
  --w-gyp: #E2DDD1;
  --w-brace: #D3AE77;
  --w-ply: #C99448;
  --w-cross: #B07636;
  --w-plyb: #8B5627;
  --w-high: #5A361A;
  --glyph: #1B2326;
  --glyph-on-dark: #F7F2E8;
  --shadow: 0 1px 0 rgba(27, 35, 38, 0.06), 0 8px 24px -12px rgba(27, 35, 38, 0.25);

  --f-display: "Dela Gothic One", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --f-body: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  --f-num: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --r-s: 6px;
  --r-m: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12181A; --sheet: #1A2225; --ink: #E5EAE4; --ink-2: #A3AEA9; --ink-3: #6E7A76;
    --rule: #34403F; --grid: #263130; --accent: #8DAEE6; --accent-soft: rgba(141, 174, 230, 0.14);
    --accent-ink: #0F1A2E; --seal: #E8664C; --ok: #5FB884; --warn: #E2AA3B; --bad: #E8664C;
    --glass: #5B94AC; --ground: #2B2E2A; --floor: #3A362E; --roof: #C9D2CF;
    --w-gyp: #8F8A80; --w-brace: #B8935E; --w-ply: #C99448; --w-cross: #C08345; --w-plyb: #A86D38; --w-high: #E0B47A;
    --glyph: #12181A; --glyph-on-dark: #12181A;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 28px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #12181A; --sheet: #1A2225; --ink: #E5EAE4; --ink-2: #A3AEA9; --ink-3: #6E7A76;
  --rule: #34403F; --grid: #263130; --accent: #8DAEE6; --accent-soft: rgba(141, 174, 230, 0.14);
  --accent-ink: #0F1A2E; --seal: #E8664C; --ok: #5FB884; --warn: #E2AA3B; --bad: #E8664C;
  --glass: #5B94AC; --ground: #2B2E2A; --floor: #3A362E; --roof: #C9D2CF;
  --w-gyp: #8F8A80; --w-brace: #B8935E; --w-ply: #C99448; --w-cross: #C08345; --w-plyb: #A86D38; --w-high: #E0B47A;
  --glyph: #12181A; --glyph-on-dark: #12181A;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 28px -12px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { background: var(--paper); color: var(--ink); }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  padding-inline: 16px;
  padding-block: 0 32px;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; }

.wrap { max-width: 1180px; margin-inline: auto; }

/* ---------- Masthead ---------- */
.masthead {
  display: flex; align-items: center; gap: 12px;
  padding-block: 14px;
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: baseline; gap: 8px; margin-right: auto; min-width: 0; cursor: pointer; background: none; border: 0; padding: 0; }
.brand-mark { font-family: var(--f-display); font-size: 22px; letter-spacing: 0.02em; line-height: 1; }
.brand-sub { font-family: var(--f-display); font-size: 22px; line-height: 1; color: var(--accent); }
.site-link { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; color: var(--ink-2); text-decoration: none; padding: 6px 2px; border-bottom: 1px solid transparent; white-space: nowrap; }
.site-link:hover { color: var(--ink); border-bottom-color: var(--ink-3); }
.brand-mark, .brand-sub { white-space: nowrap; }
.home-site { margin-top: 10px; font-size: 13px; color: var(--ink-2); line-height: 1.8; }
.home-site a { color: var(--ink); margin: 0 2px; }
.home-site a + a { margin-left: 10px; }
@media (max-width: 560px) { .site-link { display: none; } }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 14px;
  border-radius: var(--r-s); border: 1px solid var(--rule);
  background: var(--sheet); cursor: pointer; font-weight: 700; font-size: 14px;
  transition: background-color .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.quake {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
  font-family: var(--f-display); font-weight: 400; font-size: 17px; letter-spacing: .06em;
  min-height: 48px; padding: 0 22px;
}
.btn.ghost { background: transparent; }
.badge-count { font-family: var(--f-num); font-size: 12px; color: var(--ink-2); font-weight: 500; }

/* ---------- Home ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 24px; align-items: center;
  padding-block: 28px 12px;
}
.hero-copy { min-width: 0; }
.hero-kicker { font-size: 13px; letter-spacing: .14em; color: var(--ink-2); margin: 0 0 6px; }
.hero h1 {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(34px, 6.4vw, 64px); line-height: 1.12; margin: 0;
  text-wrap: balance;
}
.hero h1 .accent { color: var(--accent); display: block; }
.hero-lead { margin: 14px 0 20px; max-width: 34em; color: var(--ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-art { min-width: 0; aspect-ratio: 4 / 3; max-width: 100%; position: relative; }
.hero-art canvas { width: 100%; height: 100%; display: block; }
.hero-spec {
  position: absolute; left: 8px; bottom: 6px; font-family: var(--f-num); font-size: 11px; color: var(--ink-3);
  letter-spacing: .04em;
}

.chapters { display: grid; gap: 28px; padding-block: 24px; }
.chapter-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 6px; margin-bottom: 12px; }
.chapter-no { font-family: var(--f-num); font-size: 13px; color: var(--ink-2); }
.chapter-title { font-family: var(--f-display); font-weight: 400; font-size: 22px; margin: 0; }
.chapter-lead { color: var(--ink-2); font-size: 14px; }
.stage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.stage-tile {
  display: grid; grid-template-rows: auto 1fr auto; gap: 4px; text-align: left;
  padding: 12px 12px 10px; min-height: 108px;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-m);
  cursor: pointer; transition: border-color .15s, transform .15s;
}
.stage-tile:hover:not([disabled]) { border-color: var(--accent); transform: translateY(-2px); }
.stage-tile[disabled] { cursor: not-allowed; opacity: .5; }
.stage-tile .no { font-family: var(--f-num); font-size: 12px; color: var(--ink-2); }
.stage-tile .name { font-weight: 700; font-size: 15px; line-height: 1.4; }
.stage-tile .meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--ink-2); }
.stars { letter-spacing: .08em; font-size: 15px; color: var(--ink-3); white-space: nowrap; }
.stars .on { color: var(--warn); }
.stage-tile.cleared { border-color: var(--ink-3); }

.home-note { font-size: 12px; color: var(--ink-2); border-top: 1px solid var(--rule); padding-top: 14px; margin-top: 8px; max-width: 60em; }

/* ---------- Play ---------- */
.stagebar { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; padding-block: 14px 10px; }
.stagebar .back { min-height: 36px; }
.stagebar h2 { font-family: var(--f-display); font-weight: 400; font-size: clamp(20px, 3vw, 26px); margin: 0; line-height: 1.2; text-wrap: balance; }
.stagebar .st-no { font-family: var(--f-num); font-size: 13px; color: var(--ink-2); display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--rule); background: var(--sheet); font-size: 13px; white-space: nowrap;
}
.chip b { font-weight: 700; }
.chip.goal { border-color: var(--warn); }

.play-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.board-col { min-width: 0; display: grid; gap: 10px; }
.board {
  position: relative; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-m);
  box-shadow: var(--shadow); overflow: hidden;
}
.board svg { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.quake-layer { position: relative; width: 100%; aspect-ratio: 4 / 3; max-height: 72vh; }
.quake-layer canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.quake-hud {
  position: absolute; left: 12px; right: 12px; top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  pointer-events: none;
}
.quake-hud .shindo {
  font-family: var(--f-display); font-size: 20px; background: var(--ink); color: var(--paper);
  padding: 2px 10px; border-radius: 4px; line-height: 1.4;
}
.quake-hud .round { font-weight: 700; font-size: 14px; }
.quake-hud .status { font-size: 13px; color: var(--ink-2); }
.quake-hud .skip { pointer-events: auto; margin-left: auto; min-height: 32px; }
.quake-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--grid); }
.quake-progress i { display: block; height: 100%; width: 0; background: var(--ink); }

/* Palette */
.palette { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; }
.tool {
  display: grid; grid-template-columns: 30px auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
  padding: 6px 10px 6px 8px; min-height: 52px; text-align: left;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-s); cursor: pointer;
}
.tool:hover { border-color: var(--ink-3); }
.tool[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.tool svg { grid-row: 1 / 3; width: 30px; height: 30px; }
.tool .t-name { font-weight: 700; font-size: 13px; line-height: 1.25; }
.tool .t-meta { font-family: var(--f-num); font-size: 11.5px; color: var(--ink-2); line-height: 1.3; white-space: nowrap; }
.tool.eraser .t-meta { font-family: var(--f-body); }

/* Side */
.side { display: grid; gap: 12px; min-width: 0; }
.panel { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 14px; min-width: 0; }
.panel h3 { margin: 0 0 8px; font-size: 12px; letter-spacing: .14em; color: var(--ink-2); font-weight: 700; }
.client-text { margin: 0; font-weight: 500; }
.client-text::before { content: "「"; }
.client-text::after { content: "」"; }
.tip { margin: 10px 0 0; font-size: 13.5px; color: var(--ink-2); padding-left: 10px; border-left: 3px solid var(--accent); }

.meter { display: grid; gap: 4px; }
.meter-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; }
.meter-row .v { font-family: var(--f-num); font-variant-numeric: tabular-nums; font-weight: 500; }
.bar { position: relative; height: 10px; border-radius: 3px; background: var(--grid); overflow: hidden; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink-2); border-radius: 3px; transition: width .2s; }
.bar.over > i { background: var(--bad); }
.bar .tick { position: absolute; top: 0; bottom: 0; width: 1.5px; background: var(--ink); opacity: .55; }
.over-note { color: var(--bad); font-size: 12.5px; font-weight: 700; }

.wish-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13.5px; }
.wish-list li { display: flex; gap: 8px; align-items: center; }
.wish-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--accent); flex: none; }
.wish-list li.kept .wish-dot { background: var(--accent); }
.wish-list li:not(.kept) { color: var(--ink-3); text-decoration: line-through; }

.check-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; }
.check-toggle input { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--rule); position: relative; cursor: pointer; flex: none; margin: 0; transition: background .15s; }
.check-toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--sheet); transition: transform .15s; }
.check-toggle input:checked { background: var(--accent); }
.check-toggle input:checked::after { transform: translateX(18px); }
.check-toggle .label { font-weight: 700; font-size: 14px; }
.check-note { font-size: 12px; color: var(--ink-2); margin: 4px 0 0; }
.check-body { display: grid; gap: 12px; margin-top: 12px; }
.check-body h4 { margin: 0 0 4px; font-size: 13px; }
.qtable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.qtable th, .qtable td { padding: 3px 4px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; }
.qtable th:first-child, .qtable td:first-child { text-align: left; }
.qtable td.ng { color: var(--bad); font-weight: 700; }
.qtable td.ok { color: var(--ok); font-weight: 700; }
.pill { display: inline-block; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 1.7; }
.pill.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions .btn.quake { grid-column: 1 / -1; }
.actions-note { grid-column: 1 / -1; margin: 0; font-size: 12px; color: var(--ink-2); text-align: center; }

/* Result */
.result {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, var(--paper) 55%, transparent);
  backdrop-filter: blur(2px);
}
.result-card {
  position: relative; width: min(460px, 100%); max-height: 100%; overflow: auto;
  background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-m); box-shadow: var(--shadow);
  padding: 18px 18px 16px;
  animation: rise .35s ease-out both;
}
@keyframes rise { from { transform: translateY(12px); opacity: .0; } to { transform: none; opacity: 1; } }
.result-top { display: flex; gap: 14px; align-items: center; }
.result-top .r-text { min-width: 0; }
.result-damage { font-family: var(--f-display); font-size: 28px; line-height: 1.15; margin: 0; }
.result-stars { font-size: 26px; letter-spacing: .1em; }
.seal {
  flex: none; width: 84px; height: 84px; border-radius: 50%; border: 3px solid var(--seal); color: var(--seal);
  display: grid; place-items: center; text-align: center; transform: rotate(-12deg);
  font-family: var(--f-display); font-size: 17px; line-height: 1.1; margin-left: auto;
  animation: stamp .45s cubic-bezier(.2, 1.6, .4, 1) .2s both;
}
.seal small { display: block; font-family: var(--f-num); font-size: 9.5px; letter-spacing: .08em; margin-top: 2px; }
.seal.fail { border-style: double; border-width: 5px; }
@keyframes stamp { from { transform: rotate(-12deg) scale(1.6); opacity: 0; } to { transform: rotate(-12deg) scale(1); opacity: 1; } }
.result-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin: 14px 0 10px; font-size: 13px; }
.result-stats div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--grid); padding-bottom: 3px; }
.result-stats .v { font-family: var(--f-num); font-weight: 500; }
.advice { margin: 0; font-size: 14px; padding: 10px 12px; background: var(--accent-soft); border-radius: var(--r-s); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.badge { font-size: 12px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--rule); color: var(--ink-3); }
.badge.got { border-color: var(--ok); color: var(--ok); font-weight: 700; }
.unlock-note { margin: 10px 0 0; font-size: 13px; color: var(--accent); font-weight: 700; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.result-actions .btn { flex: 1 1 auto; }

/* Floor tabs */
.floor-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid var(--rule); border-radius: var(--r-m); overflow: hidden; background: var(--sheet); }
.floor-tab { display: flex; align-items: baseline; justify-content: center; gap: 10px; flex-wrap: wrap; min-height: 46px; padding: 6px 12px; background: transparent; border: 0; cursor: pointer; text-align: center; }
.floor-tab + .floor-tab { border-left: 1px solid var(--rule); }
.floor-tab .ft-name { font-family: var(--f-display); font-size: 18px; line-height: 1.2; }
.floor-tab .ft-meta { font-size: 11.5px; color: var(--ink-2); }
.floor-tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.floor-tab[aria-selected="true"] .ft-meta { color: var(--paper); opacity: .8; }
.floor-tab[disabled] { cursor: not-allowed; opacity: .6; }
.stats-note { margin: -4px 0 10px; font-size: 12px; color: var(--ink-2); }

/* Damage legend under board */
.board-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink-2); align-items: center; }
.board-legend .sw { display: inline-block; width: 18px; height: 6px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }
.board-legend .sw.ghost { height: 10px; border: 1.5px dashed var(--accent); background: var(--accent-soft); }
.board-legend .sw.unsup { height: 10px; border: 2px dashed var(--bad); background: transparent; }

/* Glossary */
.overlay {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, var(--ink) 35%, transparent);
}
.sheet-panel {
  width: min(720px, 100%); max-height: calc(100% - 32px); overflow: auto;
  background: var(--sheet); border-radius: var(--r-m); border: 1px solid var(--rule); box-shadow: var(--shadow); padding: 20px;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.sheet-head h2 { font-family: var(--f-display); font-weight: 400; font-size: 24px; margin: 0; }
.gloss-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.gloss-item { border: 1px solid var(--rule); border-radius: var(--r-s); padding: 12px; min-width: 0; }
.gloss-item h3 { margin: 0 0 4px; font-size: 16px; }
.gloss-item p { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.gloss-item .src { margin-top: 6px; font-size: 12px; }
.gloss-item .src a { color: var(--accent); }
.gloss-item.locked h3 { color: var(--ink-3); }
.gloss-item.locked p { color: var(--ink-3); }

.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--r-s); font-size: 14px; font-weight: 700;
  z-index: 30; max-width: calc(100% - 32px); box-shadow: var(--shadow);
}

.site-foot { max-width: 1180px; margin: 24px auto 0; font-size: 12px; color: var(--ink-3); }

/* Plan SVG */
.plan .grid-line { stroke: var(--grid); stroke-width: 1; stroke-dasharray: 2 4; }
.plan .outline { fill: none; stroke: var(--ink-2); stroke-width: 1; }
.plan .axis-bubble { fill: var(--sheet); stroke: var(--ink-2); stroke-width: 1; }
.plan .axis-text { fill: var(--ink-2); font-family: var(--f-num); font-size: 10.5px; }
.plan .dim-line { stroke: var(--ink-3); stroke-width: 1; }
.plan .dim-text { fill: var(--ink-2); font-family: var(--f-num); font-size: 11px; }
.plan .room-label { fill: var(--ink-3); font-size: 13px; font-weight: 700; letter-spacing: .08em; }
.plan .room-open { fill: url(#hatch); }
.plan .room-open-label { fill: var(--ink-2); font-size: 11px; }
.plan .slot { stroke: var(--accent); stroke-width: 3; stroke-dasharray: 1 7; stroke-linecap: round; opacity: .6; }
.plan .slot.hot { stroke: var(--accent); stroke-width: 3; stroke-dasharray: none; opacity: 1; }
.plan .hit { stroke: transparent; stroke-width: 30; stroke-linecap: square; cursor: pointer; }
.plan .window { stroke: var(--glass); stroke-width: 1.6; }
.plan .window-sill { stroke: var(--ink-2); stroke-width: 1.2; }
.plan .door { fill: none; stroke: var(--ink-2); stroke-width: 1.2; }
.plan .garage { stroke: var(--ink-2); stroke-width: 1.4; stroke-dasharray: 8 4; }
.plan .open-label { fill: var(--ink-3); font-size: 10.5px; }
.plan .wish { stroke: var(--accent); stroke-width: 4; stroke-dasharray: 7 5; stroke-linecap: round; }
.plan .wish.broken { opacity: .35; }
.plan .wish-label { fill: var(--accent); font-size: 11.5px; font-weight: 700; }
.plan .wish-label.broken { fill: var(--ink-3); text-decoration: line-through; }
.plan .wall { stroke: var(--ink); stroke-width: 1.2; }
.plan .wall.t-gypsum { fill: var(--w-gyp); }
.plan .wall.t-brace { fill: var(--w-brace); }
.plan .wall.t-plywood { fill: var(--w-ply); }
.plan .wall.t-cross { fill: var(--w-cross); }
.plan .wall.t-plybrace { fill: var(--w-plyb); }
.plan .wall.t-high { fill: var(--w-high); }
.plan .glyph { stroke: var(--glyph); stroke-width: 1.4; }
.plan .glyph.light { stroke: var(--glyph-on-dark); }
.plan .wall.preset { stroke-dasharray: 3 2; }
.plan .load { fill: color-mix(in srgb, var(--seal) 14%, transparent); stroke: var(--seal); stroke-width: 1.5; }
.plan .load-text { fill: var(--seal); font-size: 11px; font-weight: 700; }
.plan .band { fill: var(--accent); opacity: .07; }
.plan .band.ng { fill: var(--bad); opacity: .12; }
.plan .gs-line { stroke-width: 2.5; stroke-dasharray: 5 4; fill: none; }
.plan .gs-line.ok { stroke: var(--ok); }
.plan .gs-line.warn { stroke: var(--warn); }
.plan .gs-line.bad { stroke: var(--bad); }
.plan .mark-g { fill: var(--ink); }
.plan .mark-s { fill: var(--accent); }
.plan .mark-text { fill: var(--ink); font-size: 11px; font-weight: 700; paint-order: stroke; stroke: var(--sheet); stroke-width: 3px; }
.plan .dmg { fill: none; stroke-width: 4; }
.plan .dmg.l1 { stroke: var(--warn); }
.plan .dmg.l2 { stroke: color-mix(in srgb, var(--warn) 45%, var(--bad)); }
.plan .dmg.l3, .plan .dmg.l4 { stroke: var(--bad); }
.plan .compass { fill: var(--ink-2); }
.plan .compass-text { fill: var(--ink-2); font-family: var(--f-num); font-size: 11px; font-weight: 500; }
.plan .hatch-line { stroke: var(--rule); stroke-width: 1; }
.plan .lower-roof { fill: url(#roofhatch); }
.plan .outline.lower { stroke-dasharray: 6 4; stroke: var(--ink-3); }
.plan .ghost-wall { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 4 3; opacity: .75; }
.plan .unsupported { fill: none; stroke: var(--bad); stroke-width: 2; stroke-dasharray: 4 3; }

@media (max-width: 900px) {
  .play-grid { grid-template-columns: minmax(0, 1fr); }
  .side { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
}
@media (max-width: 640px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-block: 18px 4px; }
  .hero-art { order: -1; aspect-ratio: 16 / 10; }
  .brand-mark, .brand-sub { font-size: 18px; }
  .chips { margin-left: 0; }
  .tool { grid-template-columns: 24px auto; min-height: 48px; padding: 5px 8px 5px 6px; }
  .tool svg { width: 24px; height: 24px; }
  .result-damage { font-size: 24px; }
  .seal { width: 70px; height: 70px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
