/* ============================================================
   Wren — the tiny house studio
   Design system borrowed from Mountain Water Architecture:
   Archivo (structure) + Newsreader (flow),
   basalt / mist / water / timber, waterline motif.
   Clay is reserved for code failures — the only alarm in the room.
   ============================================================ */

:root {
  --basalt: #252d2f;
  --mist: #eff1ee;
  --paper: #f7f8f6;
  --white: #ffffff;
  --water: #5f827d;
  --timber: #a5865f;
  --clay: #a8503c;          /* code failure, the only "alarm" in the room */
  --ink-60: rgba(37, 45, 47, 0.6);
  --ink-40: rgba(37, 45, 47, 0.4);
  --line: rgba(37, 45, 47, 0.14);
  --line-soft: rgba(37, 45, 47, 0.08);
  --water-tint: rgba(95, 130, 125, 0.12);
  --timber-tint: rgba(165, 134, 95, 0.14);
  --clay-tint: rgba(168, 80, 60, 0.09);
  --font-structure: "Archivo", system-ui, sans-serif;
  --font-flow: "Newsreader", Georgia, serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-structure);
  font-size: 14px;
  color: var(--basalt);
  background: var(--mist);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

button { font: inherit; color: inherit; cursor: pointer; }
input, output, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--water);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------------- top bar ---------------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 20px;
  background: var(--mist);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 34px; height: 28px; flex: none; }
.brand-words { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.brand-tag {
  font-family: var(--font-flow);
  font-style: italic;
  font-size: 13.5px;
  color: var(--ink-60);
}

.scheme-cluster {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  min-width: 0;
}

.project-name {
  min-width: 100px;
  max-width: 340px;
  flex: 1;
  border: none;
  border-bottom: 1px solid transparent;
  background: transparent;
  font-family: var(--font-flow);
  font-size: 19px;
  font-weight: 500;
  padding: 4px 2px;
  color: var(--basalt);
}
.project-name:hover { border-bottom-color: var(--line); }
.project-name:focus { border-bottom-color: var(--water); outline: none; }

.scheme-switch {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--white);
  padding: 7px 8px;
  font-size: 12px;
  max-width: 170px;
}

.topbar-actions { display: flex; gap: 8px; align-items: center; }

.btn {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 9px 14px;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--water-tint); border-color: var(--water); }
.btn.solid {
  background: var(--basalt);
  border-color: var(--basalt);
  color: var(--mist);
}
.btn.solid:hover { background: #374245; }
.btn.small { padding: 6px 10px; font-size: 10.5px; }
.btn.danger:hover { border-color: var(--clay); background: var(--clay-tint); color: var(--clay); }

/* dropdown menus off topbar buttons */
.menu-wrap { position: relative; }
.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 210px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: 0 10px 28px rgba(37, 45, 47, 0.14);
  padding: 5px;
  display: flex;
  flex-direction: column;
}
.menu[hidden] { display: none; }
.menu button {
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  font-size: 12.5px;
  border-radius: 2px;
}
.menu button:hover { background: var(--water-tint); }
.menu .menu-head {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-40);
  padding: 7px 10px 3px;
}
.menu hr { border: none; border-top: 1px solid var(--line-soft); margin: 4px 2px; }

.waterline {
  width: 100%;
  height: 12px;
  flex: none;
  display: block;
  background: var(--mist);
}

/* ---------------- studio grid ---------------- */

.studio {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 262px minmax(340px, 1fr) 384px;
  background: var(--mist);
}

/* ---------------- left rail ---------------- */

.rail {
  border-right: 1px solid var(--line);
  overflow-y: auto;
  padding: 16px 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-60);
}

.tool-list { display: flex; flex-direction: column; gap: 4px; }

.tool {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  text-align: left;
  font-size: 12.5px;
  transition: background 0.12s ease;
}
.tool svg { width: 17px; height: 17px; flex: none; color: var(--ink-60); }
.tool kbd {
  margin-left: auto;
  font-family: var(--font-structure);
  font-size: 10px;
  color: var(--ink-40);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  padding: 1px 4px;
}
.tool:hover { background: var(--water-tint); }
.tool.active { background: var(--water-tint); border-color: var(--water); }
.tool.active svg { color: var(--water); }

.tool-hint {
  margin: 10px 2px 0;
  font-family: var(--font-flow);
  font-style: italic;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-60);
}

.room-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.room-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 12.5px;
}
.room-item:hover { background: var(--water-tint); }
.room-item.selected { border-color: var(--water); background: var(--water-tint); }
.room-dot { width: 10px; height: 10px; flex: none; border-radius: 1px; border: 1px solid rgba(37,45,47,0.35); }
.room-item .room-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-item .room-sf { color: var(--ink-60); font-size: 11px; font-variant-numeric: tabular-nums; }

.empty-note {
  margin: 4px 2px;
  font-family: var(--font-flow);
  font-style: italic;
  font-size: 12.5px;
  color: var(--ink-60);
  line-height: 1.45;
}

/* ---------------- rail fields ---------------- */

.rail-block { border-top: 1px solid var(--line); padding-top: 14px; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 11px; }
.field > span {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-60);
}
.field input[type="text"],
.field input[type="number"],
.field select {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--white);
  padding: 7px 8px;
  font-size: 13px;
  width: 100%;
}
.field input:focus, .field select:focus { border-color: var(--water); outline: none; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row .field { margin-bottom: 11px; }
.field-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

.seg {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.seg button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 7px 4px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-60);
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { background: var(--water-tint); }
.seg button.active { background: var(--basalt); color: var(--mist); }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-60);
  font-weight: 600;
}
.toggle-row input[type="checkbox"] {
  appearance: none;
  width: 32px; height: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  position: relative;
  cursor: pointer;
  margin: 0;
}
.toggle-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--ink-40);
  transition: transform 0.15s ease, background 0.15s ease;
}
.toggle-row input[type="checkbox"]:checked { border-color: var(--water); }
.toggle-row input[type="checkbox"]:checked::after {
  transform: translateX(14px);
  background: var(--water);
}

.ins-stats {
  margin: 4px 0 12px;
  padding: 10px 0 2px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ins-stats > div { display: flex; justify-content: space-between; font-size: 12.5px; }
.ins-stats dt { color: var(--ink-60); }
.ins-stats dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 500; }
.ins-stats dd.bad { color: var(--clay); font-weight: 600; }

.rail-note {
  margin: 6px 0 0;
  font-family: var(--font-flow);
  font-style: italic;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-60);
}
.rail-note.alarm { color: var(--clay); }

/* the add-window catalog opens in normal flow — the scrolling rail would clip
   an absolutely-positioned menu */
.rail .menu {
  position: static;
  box-shadow: none;
  border-color: var(--line);
  margin-top: 6px;
  min-width: 0;
}

/* window rows in the room inspector */
.window-rows { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.window-row {
  display: grid;
  grid-template-columns: 1fr 44px 44px 26px 18px;
  gap: 6px;
  align-items: center;
  font-size: 11.5px;
}
.window-row input[type="text"], .window-row input[type="number"] {
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  background: var(--white);
  padding: 5px 5px;
  font-size: 11.5px;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.window-row input:focus { border-color: var(--water); outline: none; }
.window-row .w-eero {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 0;
  color: var(--ink-40);
}
.window-row .w-eero.on { background: var(--water); border-color: var(--water); color: var(--white); }
.window-row .w-del {
  border: none; background: none; color: var(--ink-40);
  font-size: 14px; padding: 0; line-height: 1;
}
.window-row .w-del:hover { color: var(--clay); }
.window-head {
  display: grid;
  grid-template-columns: 1fr 44px 44px 26px 18px;
  gap: 6px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-40);
  margin-bottom: 3px;
}

/* ---------------- canvas zone ---------------- */

.canvas-zone {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.canvas-wrap {
  position: relative;
  min-height: 0;
  background:
    linear-gradient(rgba(247,248,246,0.92), rgba(247,248,246,0.92)),
    var(--paper);
}
.canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#planWrap { flex: 1.55; }
#sectionWrap { flex: 1; border-top: 1px solid var(--line); }

.canvas-label {
  position: absolute;
  top: 10px;
  left: 14px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-40);
  pointer-events: none;
}

.canvas-note {
  position: absolute;
  top: 10px;
  right: 14px;
  font-family: var(--font-flow);
  font-style: italic;
  font-size: 12.5px;
  color: var(--ink-60);
  pointer-events: none;
  text-align: right;
  max-width: 55%;
}
.canvas-note.alarm { color: var(--clay); }

/* ---------------- right board : the codebook ---------------- */

.board {
  border-left: 1px solid var(--line);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.verdict {
  margin: 0;
  padding: 18px 20px 16px;
  font-family: var(--font-flow);
  font-size: 17px;
  line-height: 1.5;
  font-weight: 400;
  border-bottom: 1px solid var(--line);
}
.verdict em { font-style: italic; color: var(--water); }
.verdict em.alarm { color: var(--clay); }
.verdict strong { font-weight: 500; font-variant-numeric: tabular-nums; }

.board-section { padding: 15px 20px; border-bottom: 1px solid var(--line-soft); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 10px;
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat output {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.stat output.bad { color: var(--clay); }
.stat span {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-60);
}

/* codebook rule rows */
.rule-group + .rule-group { margin-top: 14px; }
.rule-group h3 {
  margin: 0 0 7px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-40);
  display: flex;
  align-items: center;
  gap: 8px;
}
.rule-group h3 .g-count { margin-left: auto; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.rule-group h3 .g-count.bad { color: var(--clay); }

.rule-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rule-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  padding: 4px 0;
  border-radius: 2px;
}
.rule-row.highlight { background: var(--timber-tint); outline: 2px solid var(--timber); outline-offset: 1px; }
.rule-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex: none; align-self: center;
  background: var(--water);
}
.rule-row.fail .rule-dot { background: var(--clay); }
.rule-row.advisory .rule-dot { background: var(--timber); }
.rule-row.na .rule-dot { background: var(--line); }
.rule-row .rule-title { flex: 1; color: var(--ink-60); min-width: 0; }
.rule-row.fail .rule-title { color: var(--basalt); }
.rule-row .rule-actual {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  white-space: nowrap;
}
.rule-row.fail .rule-actual { color: var(--clay); font-weight: 600; }
.rule-row.na .rule-actual, .rule-row.na .rule-title { color: var(--ink-40); }

.chip {
  flex: none;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink-60);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  align-self: center;
}
a.chip:hover { border-color: var(--water); color: var(--water); background: var(--water-tint); }
.chip.q { border-style: dashed; color: var(--ink-40); cursor: help; }

.rule-detail {
  margin: 1px 0 3px 16px;
  font-family: var(--font-flow);
  font-style: italic;
  font-size: 11.5px;
  color: var(--clay);
  line-height: 1.4;
}

/* charts */
.chart-block { margin-top: 6px; position: relative; }
.chart-block canvas { width: 100%; display: block; }
.chart-block .chart-dl {
  position: absolute;
  top: -26px;
  right: 0;
  border: none;
  background: none;
  color: var(--ink-40);
  font-size: 13px;
  padding: 2px 4px;
  line-height: 1;
}
.chart-block .chart-dl:hover { color: var(--water); }
.chart-caption {
  margin: 5px 0 0;
  font-family: var(--font-flow);
  font-style: italic;
  font-size: 11.5px;
  color: var(--ink-60);
  line-height: 1.4;
}

.board-foot {
  margin-top: auto;
  padding: 14px 20px 18px;
}
.board-foot p {
  margin: 0;
  font-family: var(--font-flow);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-40);
}

/* ---------------- overlays: patterns drawer, compare, report ---------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(37, 45, 47, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}
.overlay[hidden] { display: none; }

.sheet {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: 0 24px 60px rgba(37, 45, 47, 0.28);
  max-width: 1060px;
  width: 100%;
  max-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sheet-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 18px 24px 12px;
  border-bottom: 1px solid var(--line);
}
.sheet-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.sheet-head .sheet-sub {
  font-family: var(--font-flow);
  font-style: italic;
  font-size: 13.5px;
  color: var(--ink-60);
}
.sheet-head .sheet-close {
  margin-left: auto;
  border: none;
  background: none;
  font-size: 19px;
  color: var(--ink-40);
  padding: 2px 6px;
  line-height: 1;
}
.sheet-head .sheet-close:hover { color: var(--clay); }
.sheet-body { overflow-y: auto; padding: 20px 24px 26px; }

/* pattern cards */
.pattern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.pattern-card {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--white);
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pattern-card header { display: flex; align-items: center; gap: 12px; }
.pattern-card canvas { width: 54px; height: 44px; flex: none; }
.pattern-card h3 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.03em; }
.pattern-card .p-tag {
  font-family: var(--font-flow);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-60);
  line-height: 1.3;
}
.pattern-card .p-summary {
  margin: 0;
  font-family: var(--font-flow);
  font-size: 13px;
  line-height: 1.5;
  color: var(--basalt);
}
.pattern-card table {
  border-collapse: collapse;
  width: 100%;
  font-size: 11.5px;
}
.pattern-card table td {
  padding: 3px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-60);
}
.pattern-card table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--basalt);
  white-space: nowrap;
}
.pattern-card .p-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.pattern-card .p-chips button.chip { cursor: pointer; background: transparent; }
.pattern-card .p-chips button.chip:hover { border-color: var(--timber); color: var(--timber); background: var(--timber-tint); }
.pattern-card .p-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 10.5px;
}
.pattern-card .p-sources a { color: var(--ink-40); text-decoration: none; border-bottom: 1px solid var(--line-soft); }
.pattern-card .p-sources a:hover { color: var(--water); border-bottom-color: var(--water); }

/* compare table */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.compare-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-60);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
.compare-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-soft);
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}
.compare-table td.bad { color: var(--clay); font-weight: 600; }
.compare-table td.good { color: var(--water); font-weight: 600; }
.compare-table .cmp-name { font-family: var(--font-flow); font-size: 14.5px; font-weight: 500; }
.compare-table canvas { width: 108px; height: 76px; display: block; background: var(--white); border: 1px solid var(--line-soft); }
.compare-note {
  margin: 14px 0 0;
  font-family: var(--font-flow);
  font-style: italic;
  font-size: 12.5px;
  color: var(--ink-60);
}

/* ---------------- report (screen overlay + print) ---------------- */

.report-sheet { max-width: 880px; }
.report-body { background: var(--white); }

#report { font-size: 13px; }
#report .r-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 4px; }
#report .r-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-60);
}
#report h1 {
  margin: 2px 0 2px;
  font-family: var(--font-flow);
  font-weight: 500;
  font-size: 34px;
}
#report .r-date { margin-left: auto; color: var(--ink-60); font-size: 12px; }
#report .r-tagline {
  font-family: var(--font-flow);
  font-style: italic;
  color: var(--ink-60);
  margin: 0 0 14px;
}
#report h2 {
  margin: 26px 0 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 5px;
}
#report .r-figures { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
#report .r-figures figure { margin: 0; border: 1px solid var(--line); padding: 8px; }
#report .r-figures img { width: 100%; display: block; }
#report .r-figures figcaption {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-60);
  margin-top: 6px;
}
#report table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}
#report th {
  text-align: left;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-60);
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
}
#report td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
#report td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
#report td.status-pass { color: var(--water); font-weight: 600; }
#report td.status-fail { color: var(--clay); font-weight: 700; }
#report td.status-advisory { color: var(--timber); font-weight: 600; }
#report td.status-na { color: var(--ink-40); }
#report .r-verdict {
  font-family: var(--font-flow);
  font-size: 16px;
  line-height: 1.55;
  margin: 10px 0 0;
}
#report .r-foot {
  margin-top: 30px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-family: var(--font-flow);
  font-style: italic;
  font-size: 11px;
  color: var(--ink-60);
  line-height: 1.55;
}
#report .r-foot a { color: var(--ink-60); }
#report section { break-inside: avoid; }

/* print rules only bite while the Report overlay is open (body.report-open) —
   a stray Ctrl+P elsewhere prints the studio normally instead of a blank page */
@media print {
  body.report-open > *:not(#reportOverlay) { display: none !important; }
  body.report-open { overflow: visible; background: #fff; }
  body.report-open #reportOverlay { position: static; padding: 0; background: none; display: block !important; }
  body.report-open #reportOverlay .sheet { max-width: none; max-height: none; border: none; box-shadow: none; overflow: visible; }
  body.report-open #reportOverlay .sheet-head { display: none; }
  body.report-open #reportOverlay .sheet-body { overflow: visible; padding: 0; }
  #report h2 { break-after: avoid; }
  #report table { break-inside: auto; }
  #report tr { break-inside: avoid; }
}

/* ---------------- narrow screens ---------------- */

@media (max-width: 1080px) {
  body { overflow: auto; }
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .scheme-cluster { flex: 1 1 100%; order: 3; justify-content: flex-start; }
  .studio { grid-template-columns: 1fr; }
  .rail { border-right: none; border-bottom: 1px solid var(--line); }
  #planWrap { min-height: 420px; }
  #sectionWrap { min-height: 320px; }
  .board { border-left: none; border-top: 1px solid var(--line); }
}
