/* House > Panel: the electrical panel, folded in from Breakr (2026-10-16).

   The panel DRAWING is Breakr's, unchanged: bevelled steel, corner screws, the
   MAIN plate, odd spaces down the left and even down the right, amber handles
   for live breakers. It is the one place in Upkeep that is illustrated rather
   than flat, because it has to look like the box on the wall.

   Everything around it speaks Upkeep: Figtree only, Title Case copy instead of
   uppercase display type, and the House tab's teal where Breakr used its blue.
   Names that collide with Upkeep's own (.ring, .tile, .sheet, .hint) are
   renamed pn-*; printed pages are .psheet so they never meet the bottom sheet. */
:root {
  --muted:var(--slate); --paper:var(--bg); --radius:14px;
  --accent:var(--teal); --accent-ink:#0B7F72;
  --rowh:44px; --rowgap:5px; --numw:20px; --railw:10px;
  --navy:#0F2E2A; --gold:#FFC93C; --ok:#2FA26B; --okbg:#E6F5EC; --todo:#D48A06;
}

/* ---- Upkeep-side pieces ---- */
.pn-hint { font-size:13.5px; color:var(--slate); margin:10px 0 0; }
.pn-sub { margin:-8px 0 14px; color:var(--slate); font-size:14.5px; }
.pn-unset { color:#8A9099; }
.pn-card { align-items:flex-start; }
.pn-card .mini { margin-top:2px; }
.pn-card .fillbar { margin-top:8px; }
.pn-todo { margin-top:6px; font-size:13px; font-weight:700; color:var(--todo); }
.pn-proven { margin-top:6px; font-size:13px; font-weight:700; color:var(--ok); }
.pn-slot { flex-direction:column; gap:0; font-weight:800; font-size:17px; color:#fff; background:var(--k, #6B6F73); }
.pn-slot small { font-size:10px; font-weight:700; opacity:.85; }
.pn-ok { display:inline-flex; vertical-align:-2px; color:var(--ok); }
.pn .panel { margin-top:14px; }
.pn-sheet section { margin-bottom:18px; }
.pn-sheet section h3 { margin-bottom:6px; }
.pn-sheet .actionrow { margin-top:26px; }
.pn-sheet .actionrow .btn { flex:1; }
.pn-sheet details.fold { margin-bottom:14px; }
.pn-sheet details.fold > summary { cursor:pointer; font-size:14px; font-weight:700; color:var(--slate); padding:6px 0; }
.pn-sheet details.fold textarea { width:100%; margin-top:6px; }
.checkline { display:flex; gap:11px; align-items:center; cursor:pointer; margin:4px 0 16px; font-size:14.5px; line-height:1.35; }
.checkline input { width:22px; height:22px; flex:none; accent-color:var(--teal); }
.iconbtn { background:none; border:none; padding:7px; border-radius:10px; cursor:pointer; color:var(--slate); display:inline-flex; }
.iconbtn:hover { background:var(--fill); color:var(--ink); }
.iconbtn.danger:hover { color:var(--red); }
.walkbar .btn-icon { width:42px; min-height:42px; height:42px; border-radius:50%; border:none; background:var(--card); box-shadow:var(--shadow); }
.pn-ring { --p:0; position:relative; display:grid; place-items:center; border-radius:50%; }
.pn-ring::before { content:""; position:absolute; border-radius:50%; }
.pn-ring > span:not(.spark) { position:relative; text-align:center; }
.pn-ring b { display:block; font-weight:800; }
.pn-ring small { display:block; margin-top:3px; font-size:12px; font-weight:700; }

/* "Tested" is ONE control, not a status pill sitting next to a button that
   undoes it: it states the fact and flips it in the same tap. It is drawn as a
   switch, because proving a circuit is the moment worth making feel good. */
.confirmrow {
  display:flex; align-items:center; gap:13px; width:100%; cursor:pointer;
  text-align:left; padding:14px; border-radius:14px; position:relative;
  border:1.5px solid var(--line); background:var(--card); color:var(--ink);
  font:inherit; transition:border-color .2s ease, background .2s ease;
}
.confirmrow:hover { border-color:#C9C5BC; }
.confirmrow .sw {
  width:50px; height:30px; flex:none; border-radius:999px; position:relative;
  background:#D7D4CC; transition:background .25s ease;
}
.confirmrow .sw::after {
  content:""; position:absolute; top:3px; left:3px; width:24px; height:24px; border-radius:50%;
  background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.25);
  transition:transform .3s cubic-bezier(.3,1.6,.5,1);
}
.confirmrow.on { border-color:#BFE0CD; background:#EFF8F2; }
.confirmrow.on .sw { background:#1E6B45; }
.confirmrow.on .sw::after { transform:translateX(20px); }
.confirmrow .txt { display:flex; flex-direction:column; gap:2px; min-width:0; }
.confirmrow .txt b { font:700 16px/1.2 var(--font); }
.confirmrow .sub { font-size:13px; color:var(--muted); line-height:1.35; }
.confirmrow:focus-visible { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(18,165,148,.18); }
.confirmrow + .hint { margin:8px 2px 0; }
/* Remove is destructive and the confirm toggle is one tap away from it, so the
   action row gets real separation rather than the default section gap. */

/* "Remove this space" is two genuinely different intentions, so they sit side
   by side as equals rather than one being buried in a menu: leave the blank
   (the space is real and nothing is in it) or close the gap (the space is not
   on the panel at all). */
.removespace { margin-top:24px; padding-top:18px; border-top:1px solid var(--line); }
.removespace h3 { margin-bottom:4px; }
.removeopts { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:10px 0 4px; }
.removeopts .btn { width:100%; }
@media (max-width: 380px) { .removeopts { grid-template-columns:1fr; } }
/* The panel in miniature: every space in its circuit color, odd down the
   left and even down the right, so each card looks like ITS panel. */
.mini { width:58px; border-radius:7px; padding:6px 5px;
  background:linear-gradient(160deg, #E8EBEF 0%, #C9CFD6 45%, #AFB6BE 100%);
  border:2px solid #7A828B; display:grid;
  grid-template-columns:1fr 1fr; align-self:flex-start;
  /* Fixed-ish height whatever the space count, so an 84-space panel does not
     make a card three times taller than a 12-space one. */
  --rows:10; height:clamp(46px, calc(var(--rows) * 7px + 12px), 92px);
  grid-template-rows:repeat(var(--rows), minmax(0,1fr));
  gap:clamp(1px, calc(30px / var(--rows)), 3px) 4px; }
.mini i { display:block; min-height:1px; border-radius:1.5px; }
.mini i.free { background:rgba(255,255,255,.45); box-shadow:inset 0 0 0 1px rgba(110,116,124,.35); }

/* ── The panel drawing ────────────────────────────────────────────────────── */

/* The enclosure. Illustrated rather than flat: bevelled steel, corner screws, a
   MAIN plate across the top, and two recessed wells of breakers. Slot numbers
   run down the OUTSIDE of each column the way a real panel legend does, so the
   two columns sit side by side with a centre rail between them. */
.panel {
  position:relative;
  background:linear-gradient(160deg, #E8EBEF 0%, #C9CFD6 45%, #AFB6BE 100%);
  border:2px solid #7A828B;
  border-radius:16px;
  /* Wide enough that a corner screw sits ENTIRELY on the light outer frame.
     The screw is 14px at an 8px offset, so it ends 22px in; anything less and
     it straddles the darker inner body. Keep these three numbers in step. */
  padding:26px;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.85),
    inset 0 -2px 0 rgba(0,0,0,.14),
    0 8px 24px rgba(20,24,28,.20);
}
/* The inner frame: the lip you see between the door and the deadfront. */
.panel-body {
  border-radius:11px;
  padding:12px 10px 10px;
  background:linear-gradient(170deg, #DCE1E6 0%, #C2C8D0 100%);
  border:1px solid rgba(255,255,255,.6);
  box-shadow:
    inset 0 0 0 1px rgba(122,130,139,.55),
    inset 0 3px 8px rgba(0,0,0,.13);
}
/* Corner screws. Flat-head, with the slot drawn across them. */
.screw {
  position:absolute; width:14px; height:14px; border-radius:50%;
  background:radial-gradient(circle at 34% 30%, #F2F4F6 0%, #C3C9D0 55%, #8A9199 100%);
  box-shadow:inset 0 0 0 1px rgba(90,98,106,.75), 0 1px 1px rgba(255,255,255,.6);
}
.screw::after {
  content:""; position:absolute; inset:0; margin:auto;
  width:9px; height:1.5px; background:#6E757D; border-radius:1px;
  transform:rotate(45deg);
}
.screw.tl { top:8px; left:8px; } .screw.tr { top:8px; right:8px; }
.screw.bl { bottom:8px; left:8px; } .screw.br { bottom:8px; right:8px; }

/* The top strip: MAIN breaker centred, panel controls to its right.
   A 3-column grid rather than absolute positioning, so the controls can never
   overlap the plate on a narrow phone; the empty first column is what keeps
   MAIN optically centred. */
/* The main breaker plate is optically centred on the panel, with the controls
   to its right. A 1fr | auto | 1fr grid only centres while the tool group fits
   inside its column: an fr track's minimum is auto, so adding a third control
   grew column 3 and shoved the plate off centre by 7px. The tools are taken out
   of flow instead, and a mirrored gutter is reserved on both sides so the
   centred plate can never end up underneath them. */
.panel-top {
  position:relative; display:flex; align-items:center; justify-content:center;
  gap:8px; margin-bottom:12px; min-height:34px;
  --toolw:calc(3 * 34px + 2 * 7px);
  padding-inline:var(--toolw);
}
.panel-tools {
  position:absolute; right:0; top:50%; transform:translateY(-50%);
  display:flex; gap:7px;
}

/* Debossed into the steel: a dark inset at the top edge reads as a recess,
   with a light lower edge as the catch-light coming back out of it. */
.paneltool {
  width:34px; height:34px; flex:none; padding:0; cursor:pointer;
  border:1px solid rgba(110,116,124,.55); border-radius:9px;
  color:#666D76;
  background:linear-gradient(180deg, #BEC4CC 0%, #D2D7DD 100%);
  box-shadow:
    inset 0 2px 3px rgba(20,24,28,.30),
    inset 0 -1px 0 rgba(255,255,255,.60),
    0 1px 0 rgba(255,255,255,.55);
  display:flex; align-items:center; justify-content:center;
  transition:color .12s ease, box-shadow .12s ease;
}
.paneltool:hover { color:var(--accent); }
.paneltool:focus-visible {
  outline:none; color:var(--accent);
  box-shadow:inset 0 2px 3px rgba(20,24,28,.30), 0 0 0 3px rgba(18,165,148,.35);
}
/* Pressing pushes it deeper rather than lifting it, which is how a recessed
   control should behave. */
.paneltool:active {
  box-shadow:inset 0 3px 5px rgba(20,24,28,.42), inset 0 -1px 0 rgba(255,255,255,.35);
}

/* The MAIN breaker plate. */
.mainbrk {
  grid-column:2;
  display:flex; align-items:center; justify-content:center; gap:14px;
  margin:0; width:fit-content; min-width:190px;
  padding:8px 16px; border-radius:8px;
  background:linear-gradient(180deg, #33383E 0%, #22262B 100%);
  border:1px solid #14171A;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.14), 0 2px 4px rgba(0,0,0,.28);
}
.mainbrk .mainlabel {
  font-family:var(--font); font-weight:700; text-transform:uppercase;
  letter-spacing:.06em; font-size:15px; line-height:1.05; color:#F2F4F6;
}
.mainbrk .led {
  width:10px; height:10px; border-radius:50%; flex:none;
  background:radial-gradient(circle at 35% 30%, #B6F58A, #35B23A 65%, #1E7D22);
  box-shadow:0 0 7px rgba(60,200,80,.85);
}
.mainbrk .mainswitch {
  width:38px; height:26px; flex:none; border-radius:5px;
  background:linear-gradient(180deg, #14171A, #0C0E10);
  border:1px solid #05070A; position:relative;
}
.mainbrk .mainswitch::after {
  content:""; position:absolute; top:3px; bottom:3px; right:4px; width:15px;
  border-radius:3px;
  background:linear-gradient(180deg, #6B737C 0%, #454C54 50%, #2C3238 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.35);
}

.deadfront { padding:0; position:relative; }
.grid {
  display:grid;
  /* minmax(0,1fr), not 1fr. A bare 1fr resolves its minimum to min-content, so
     a long breaker label refused to shrink and pushed the whole panel wider
     than a phone screen. */
  grid-template-columns:var(--numw) minmax(0,1fr) var(--railw) minmax(0,1fr) var(--numw);
  /* Fixed row height, not auto. With auto rows, a space holding two tandem
     halves grew to twice the height of its neighbours, so the drawing no longer
     matched the panel: in real hardware a tandem is two HALF-height breakers in
     one full-height space. Fixed rows also make a 2-pole exactly two rows tall
     for free. */
  grid-auto-rows:var(--rowh);
  gap:var(--rowgap) 0;
  position:relative;
  align-items:stretch;
}
/* The recessed well each column of breakers sits in. */
.well {
  border-radius:7px; z-index:0;
  background:linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,.03));
  box-shadow:inset 0 0 0 1px rgba(122,130,139,.45), inset 0 2px 5px rgba(0,0,0,.16);
  margin:-4px -5px;
}
.well.l { grid-column:2; } .well.r { grid-column:4; }

.num {
  z-index:1; align-self:center; justify-self:center;
  font:600 12px/1 var(--font); color:#5A626A;
  text-shadow:0 1px 0 rgba(255,255,255,.7);
}
.num.l { grid-column:1; } .num.r { grid-column:5; }

.space { display:flex; flex-direction:column; gap:3px; height:100%; min-height:0; z-index:1; }
.space.l { grid-column:2; } .space.r { grid-column:4; }

/* A breaker: dark toggle housing on the outer edge, white label plate beside it. */
.brk {
  flex:1; min-height:0; width:100%; cursor:pointer;
  display:flex; align-items:stretch; gap:0; padding:0;
  background:none; border:none; font:inherit; text-align:left; overflow:visible;
  transition:transform .12s ease, filter .12s ease;
}
.brk .housing {
  flex:none; width:34px; border-radius:5px 0 0 5px;
  background:linear-gradient(180deg, #3A4046 0%, #23282D 55%, #1A1E22 100%);
  border:1px solid #14171A; border-right:none;
  display:flex; align-items:center; justify-content:center;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.13);
}
/* The handle. Amber means the breaker is live; grey means spare or empty, which
   is the fastest read on the whole drawing. */
.brk .handle {
  width:15px; height:60%; min-height:12px; border-radius:3px;
  background:linear-gradient(180deg, #FFD34E 0%, #F0B429 48%, #C98A12 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.55), 0 1px 2px rgba(0,0,0,.45);
  border:1px solid #A9740F;
}
.brk.off .handle, .brk.slot-empty .handle {
  background:linear-gradient(180deg, #4E555C 0%, #363C42 55%, #262B30 100%);
  border-color:#14171A; box-shadow:inset 0 1px 0 rgba(255,255,255,.18);
}
.brk .plate {
  flex:1; min-width:0; display:flex; align-items:center; gap:6px;
  padding:0 7px; border-radius:0 5px 5px 0; position:relative;
  background:linear-gradient(180deg, #FFFFFF 0%, #F1F1EE 100%);
  border:1px solid #B9BEC5; border-left:none;
  box-shadow:0 1px 2px rgba(0,0,0,.14);
}
/* Circuit type reads as a stripe down the inner edge of the label plate, so the
   plate itself stays black-on-white and legible at 12px. */
.brk .plate::before {
  content:""; position:absolute; left:0; top:0; bottom:0; width:4px;
  background:var(--k, #6B6F73);
}
.brk .lab {
  flex:1; min-width:0; font-size:12.5px; line-height:1.18; font-weight:600;
  padding-left:2px; overflow:hidden;
}
/* Two lines at EVERY width, not just on phones. A truncated label is useless at
   the exact moment it is needed, so the label is the one thing on the breaker
   face allowed to take the room. */
.brk .lab .t {
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
  white-space:normal; overflow:hidden;
}
.brk.half .lab .t { -webkit-line-clamp:1; }
.brk .amps {
  flex:none; font:700 10px/1 var(--font); letter-spacing:.03em; color:#5A626A;
  background:#E7E8E4; border:1px solid #CFD2D6; border-radius:3px; padding:2px 4px;
}
.tag240 {
  position:absolute; right:4px; bottom:1px;
  font:700 8px/1 var(--font); letter-spacing:.06em; color:#98a0a8;
}

.brk.k-lighting  { --k:#E0A81C; } .brk.k-outlets { --k:#1F6FEB; }
.brk.k-kitchen   { --k:#E2683D; } .brk.k-laundry { --k:#7C58D3; }
.brk.k-bath      { --k:#14919B; } .brk.k-hvac    { --k:#2E8B57; }
.brk.k-appliance { --k:#C0392B; } .brk.k-subpanel{ --k:#16181A; }
.brk.k-spare     { --k:#9AA0A6; } .brk.k-other   { --k:#6B6F73; }

/* A tandem half gets half a space, so everything in it shrinks to match. */
.brk.half .plate { padding:0 6px; gap:4px; }
.brk.half .lab { font-size:11px; }
.brk.half .amps { font-size:9px; padding:1px 3px; }
.brk.half .handle { height:56%; min-height:8px; width:13px; }

/* A 2-pole breaker: one element two rows tall, with a tie bar joining the
   handles the way a real 240V breaker does. */
/* A 240V breaker is two handles joined by a tie bar, so it reads as one tall
   handle with a joint across the middle rather than as two separate breakers. */
.brk.dual .handle { height:76%; position:relative; }
.brk.dual .handle::before {
  content:""; position:absolute; left:1px; right:1px; top:50%; height:2px;
  transform:translateY(-50%);
  background:rgba(20,23,26,.55); border-radius:1px;
  box-shadow:0 1px 0 rgba(255,255,255,.35);
}

/* Highlight BEFORE the click: hover and keyboard focus lift the breaker and
   ring it in the accent. */
.brk:hover, .brk:focus-visible { outline:none; z-index:3; }
.brk:hover .plate, .brk:focus-visible .plate,
.brk:hover .housing, .brk:focus-visible .housing {
  border-color:var(--accent);
  box-shadow:0 0 0 2px rgba(18,165,148,.35);
}
.space.l .brk:hover, .space.l .brk:focus-visible { transform:translateX(2px); }
.space.r .brk:hover, .space.r .brk:focus-visible { transform:translateX(-2px); }
.brk.is-open .plate, .brk.is-open .housing {
  border-color:var(--accent); box-shadow:0 0 0 2px rgba(18,165,148,.55);
}

/* An empty space: the housing is still there (the slot physically exists), the
   plate becomes a dashed invitation. */
.brk.slot-empty .plate {
  background:rgba(255,255,255,.55);
  border-style:dashed; border-color:#AEB4BC;
  justify-content:center;
}
.brk.slot-empty .plate::before { display:none; }
.brk.slot-empty .addlab {
  font-size:11.5px; color:#8A9099; font-weight:500; white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; display:flex; align-items:center;
  transition:color .12s ease;
}
.brk.slot-empty:hover .addlab, .brk.slot-empty:focus-visible .addlab { color:var(--accent); }

.panel-foot {
  margin-top:10px; text-align:center;
  font-family:var(--font); font-weight:600; text-transform:uppercase;
  letter-spacing:.06em; font-size:11px; color:#5A626A;
  text-shadow:0 1px 0 rgba(255,255,255,.6);
}

/* ── Phone (the primary device) ───────────────────────────────────────────────
   This app is used standing in front of the panel, so the phone layout is the
   real one. Two decisions follow from that:
   1. Rows get TALLER, not shorter. 48px clears the 44px minimum tap target,
      because every breaker is a touch target and you are often one-handed.
   2. The label wraps to two lines instead of truncating. "Kitchen Li..." is
      useless at the moment you actually need it, so the per-breaker item count
      is dropped to buy the room: it is secondary, and it is one tap away. */
@media (max-width:520px) {
  :root { --numw:16px; --railw:7px; --rowh:48px; }
  /* Same clearance rule, scaled down: a 9px screw at a 3px offset ends 12px
     in, so 15px of frame keeps it clear of the inner body without spending
     more of a 375px screen on chrome than necessary. */
  .panel { padding:15px; border-radius:13px; }
  .panel-body { padding:9px 6px 7px; }
  .screw { width:9px; height:9px; }
  .screw::after { width:6px; }
  .screw.tl, .screw.tr { top:3px; } .screw.bl, .screw.br { bottom:3px; }
  .screw.tl, .screw.bl { left:3px; } .screw.tr, .screw.br { right:3px; }
  .panel-top { gap:6px; margin-bottom:9px; --toolw:calc(3 * 30px + 2 * 5px); }
  .panel-tools { gap:5px; }
  .paneltool { width:30px; height:30px; border-radius:8px; }
  .mainbrk { gap:9px; padding:6px 11px; min-width:0; }
  .mainbrk .mainlabel { font-size:13px; }
  .mainbrk .mainswitch { width:30px; height:21px; }
  .brk .housing { width:25px; }
  .brk .handle { width:12px; }
  .brk .plate { padding:0 5px; gap:4px; }
  .brk .lab { font-size:11.5px; }
  .brk.half .lab { font-size:10.5px; }
  .brk .amps { font-size:9px; padding:1px 3px; }
  .brk.slot-empty .addlab { font-size:10.5px; }
  .num { font-size:10.5px; }
  /* The header eats a third of the screen before the panel appears. */
  }
/* ── Explainer sheets ─────────────────────────────────────────────────────── */
/* The little "i" beside a field label. Circular, quiet until you look for it. */
.infobtn {
  width:17px; height:17px; flex:none; margin-left:5px; padding:0; cursor:pointer;
  border-radius:50%; border:1px solid var(--accent); background:none; color:var(--accent);
  font:700 11px/1 var(--font); vertical-align:middle;
}
.infobtn:hover { background:var(--accent); color:#fff; }
/* A hint sentence that opens the same sheet, for anyone who reads past the label. */
.linkbtn {
  background:none; border:none; padding:0; cursor:pointer; font:inherit;
  color:var(--accent); text-decoration:underline;
}

.infointro { font-size:14.5px; color:var(--muted); margin:0 0 18px; }
.infointro b, .infofig figcaption b { color:var(--ink); }

.infofig {
  display:flex; gap:14px; align-items:center; margin:0 0 16px;
  padding-bottom:16px; border-bottom:1px solid var(--line);
}
.infofig:last-of-type { border-bottom:none; }
/* A miniature of the real deadfront: same steel, same numbers outside the
   column, so it reads as the panel the app actually draws. */
.figpanel {
  flex:none; width:158px; display:grid;
  grid-template-columns:var(--numw) minmax(0,1fr) var(--numw);
  gap:var(--rowgap) 0; padding:7px 5px; border-radius:7px;
  background:linear-gradient(170deg, #DCE1E6 0%, #C2C8D0 100%);
  box-shadow:inset 0 0 0 1px rgba(122,130,139,.5), inset 0 2px 5px rgba(0,0,0,.13);
}
.figpanel .num.l { grid-column:1; } .figpanel .num.r { grid-column:3; }
.figpanel .space.l { grid-column:2; }
.infofig figcaption { font-size:13.5px; color:var(--muted); line-height:1.45; }
/* Only the caption HEADING is a block. Scoping this to every <b> put inline
   emphasis ("count it as one space") on its own line mid-sentence. */
.infofig figcaption .figtitle { display:block; font-size:14px; margin-bottom:2px; }

/* Illustration breakers are inert: no pointer, no hover, no focus ring. */
.brk.fig { cursor:default; pointer-events:none; }
.brk.fig .lab { font-size:10.5px; }
.brk.fig .amps { font-size:9px; padding:1px 3px; }
.brk.fig .housing { width:22px; }
.brk.fig .handle { width:11px; }

@media (max-width:420px) {
  .infofig { gap:11px; }
  .figpanel { width:136px; }
  .infofig figcaption { font-size:12.5px; }
}

/* The free half of a tandem space: same dashed invitation, half height. */
.brk.slot-empty.half .addlab { font-size:9.5px; }
.brk.slot-empty.half .housing { width:25px; }

/* ── Layout edit mode ─────────────────────────────────────────────────────── */
.paneltool.on {
  color:#fff; border-color:var(--accent);
  background:linear-gradient(180deg, var(--accent) 0%, #0B7F72 100%);
  box-shadow:inset 0 2px 3px rgba(0,0,0,.25), 0 1px 0 rgba(255,255,255,.4);
}

/* In edit mode every space is one target, whatever is fitted in it. */
.spacebtn {
  flex:1; width:100%; min-height:0; cursor:pointer; padding:0;
  display:flex; align-items:center; justify-content:center;
  border:2px dashed var(--accent); border-radius:5px;
  background:rgba(18,165,148,.10); color:var(--accent-ink);
  font:600 10px/1 var(--font); text-transform:uppercase; letter-spacing:.06em;
}
.spacebtn.is-empty { border-style:dotted; background:rgba(18,165,148,.04); color:#8A9099; }
.spacebtn:hover, .spacebtn:focus-visible {
  outline:none; background:rgba(18,165,148,.20); box-shadow:0 0 0 2px rgba(18,165,148,.35);
}

.editbar {
  margin-top:12px; padding:14px; border-radius:var(--radius);
  background:rgba(18,165,148,.06); border:1px solid rgba(18,165,148,.20);
}
.editsize { display:flex; align-items:center; justify-content:center; gap:12px; flex-wrap:wrap; }
.editsize .hint { margin:0; font-weight:600; color:var(--ink); }
.editbar .hint { text-align:center; }

/* The space editor's options. */
.spaceopts { display:grid; gap:9px; margin-bottom:16px; }
.spaceopt {
  display:flex; align-items:center; gap:13px; width:100%; cursor:pointer; text-align:left;
  padding:12px 13px; border:1.5px solid var(--line); border-radius:var(--radius);
  background:var(--card); font:inherit;
}
.spaceopt:hover { border-color:var(--accent); }
.spaceopt.on { border-color:var(--accent); background:rgba(18,165,148,.06); }
.spaceopt .txt { flex:1; min-width:0; font-size:13.5px; color:var(--muted); line-height:1.4; }
.spaceopt .txt b { display:block; color:var(--ink); font-size:14.5px; margin-bottom:1px; }
.spaceopt .tick { color:var(--accent); display:flex; }

/* A miniature of the real thing, so the choice is recognisable rather than
   described: one tall bar, two short bars, or a double-height bar. */
.figmini {
  flex:none; width:30px; height:38px; border-radius:5px; padding:3px;
  background:linear-gradient(180deg,#C3C9D1,#D5DAE0);
  box-shadow:inset 0 0 0 1px rgba(110,116,124,.5);
  display:flex; flex-direction:column; gap:3px; justify-content:center;
}
.figmini i {
  display:block; flex:1; border-radius:2px;
  background:linear-gradient(180deg,#FFD34E,#C98A12); border:1px solid #A9740F;
}
.figmini.double { height:56px; }
.figmini.empty { background:linear-gradient(180deg,#D9DDE2,#E6E9ED); }

/* ── Print ────────────────────────────────────────────────────────────────── */
/* Two documents, both letter, both at real size. The screen drawing is never
   printed: it is illustrated steel, which reads as mud in black and white. */
@page { size: 8.5in 11in; margin: 0.5in; }

#printout { display:none; }
/* Laid out but off-screen, purely so the reference sheet can be measured
   before it is scaled: a display:none element has no height at all. */
#printout.measuring { display:block; position:absolute; left:-20000px; top:0; width:7.5in; }

@media print {
  /* Only the printout exists on paper. */
  #app, .nav, .sidebar, #toast, .scrim, .sheet, .noprint { display:none !important; }
  html, body { background:#fff; margin:0; padding:0; }
  #printout { display:block; color:#000; font:12px/1.35 system-ui, -apple-system, sans-serif; }
  .psheet { break-after:page; }
  .psheet:last-child { break-after:auto; }
}

/* Visible while proofing on screen, identical geometry to the printed page. */
#printout.proof { display:block; }
#printout.proof .psheet { width:7.5in; margin:0 auto 24px; background:#fff; outline:1px solid #ccc; }

/* ---- Reference sheet ---- */
/* Scaled from the top-left so a 84-space panel still lands on one page. */
.psheet.ref { transform:scale(var(--pscale, 1)); transform-origin:top left; width:7.5in; }
.psheet.ref .psheet-head { border-bottom:2px solid #000; padding-bottom:6px; margin-bottom:10px; }
.psheet.ref h1 { font-family:var(--font); font-size:22px; text-transform:uppercase; letter-spacing:.03em; }
.psheet.ref .psheet-head p { margin:3px 0 0; font-size:12px; }
table.pl { width:100%; border-collapse:collapse; }
table.pl td { border:1px solid #999; padding:3px 6px; vertical-align:middle; }
td.pl-n { width:0.32in; text-align:center; font-weight:700; font-size:11px; background:#f0f0f0; }
td.pl-lab { width:3.2in; }
td.pl-empty { color:#888; font-style:italic; }
.pl-one { display:block; }
.pl-one + .pl-one { border-top:1px dotted #bbb; margin-top:2px; padding-top:2px; }
.pl-a { font-size:10px; color:#555; }
.pl-q { font-weight:700; }
.psheet-foot { margin-top:10px; font-size:10px; color:#555; }

/* ---- Stick-on labels, at real physical size ---- */
.ls-head { font-size:10px; margin:0 0 0.12in; }
.ls-head span { display:block; color:#555; }
.ls-pair { display:flex; gap:0.5in; }
/* The strip is what gets cut out, so its border IS the cut line. */
.ls-strip { width:3.1in; border:1px dashed #666; }
.ls-cell { display:flex; align-items:stretch; border-bottom:1px solid #000; overflow:hidden; }
.ls-strip .ls-cell:last-child { border-bottom:none; }
.ls-n {
  width:0.28in; flex:none; display:flex; align-items:center; justify-content:center;
  border-right:1px solid #000; font-size:9px; font-weight:700; background:#eee;
}
.ls-body { flex:1; min-width:0; display:flex; flex-direction:column; }
/* A tandem is two circuits in one space, so the space is split in half. */
.ls-cell.is-split .ls-one + .ls-one { border-top:1px solid #000; }
.ls-one {
  flex:1; min-height:0; display:flex; align-items:center; gap:4px;
  padding:0 0.06in; overflow:hidden;
}
.ls-name { flex:1; min-width:0; font-size:10px; font-weight:600; line-height:1.1;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ls-a { flex:none; font-size:8px; color:#444; }
.ls-empty { flex:1; }

/* ── Photo import ─────────────────────────────────────────────────────────── */
/* A big target, because it is used standing at the panel holding a phone. */
.scanzone {
  display:flex; align-items:center; gap:14px; cursor:pointer;
  padding:20px 18px; margin-bottom:14px;
  border:2px dashed #C9C5BC; border-radius:14px; background:var(--card);
  color:var(--ink); transition:border-color .12s ease, background .12s ease;
}
.scanzone:hover { border-color:var(--accent); background:rgba(18,165,148,.03); }
.scanzone.is-busy { opacity:.6; cursor:default; border-style:solid; }
.scanzone .txt { display:flex; flex-direction:column; gap:3px; min-width:0; }
.scanzone .txt b { font-size:15.5px; }
.scanzone .sub { font-size:12.5px; color:var(--muted); line-height:1.35; }

/* Indeterminate: reading a photo takes as long as it takes. */
.scanbar { height:4px; border-radius:2px; background:#E8E5DE; overflow:hidden; margin-bottom:14px; }
.scanbar span { display:block; width:40%; height:100%; background:var(--accent);
  animation:scanslide 1.1s ease-in-out infinite; }
@keyframes scanslide {
  0% { transform:translateX(-100%); } 100% { transform:translateX(250%); }
}

/* The review list. Deliberately plain text, not the drawing: this is a
   proof-read, and the panel has not been created yet. */
ul.proposal { list-style:none; margin:0 0 14px; padding:0; }
ul.proposal li {
  display:flex; align-items:baseline; gap:10px;
  padding:7px 0; border-bottom:1px solid var(--line); font-size:14px;
}
ul.proposal li:last-child { border-bottom:none; }
ul.proposal .pn-n { flex:none; min-width:5.2em; font-weight:700; font-size:12.5px; color:var(--muted); }
ul.proposal .pn-l { flex:1; min-width:0; }
ul.proposal .pn-a { flex:none; font-size:12px; color:var(--muted); }

.callout {
  border:1px solid var(--line); border-left:3px solid var(--accent);
  border-radius:8px; padding:11px 13px; margin-bottom:14px; font-size:13.5px;
}
.callout.warn { border-left-color:#C77700; }
.callout b { display:block; margin-bottom:4px; }
.callout p, .callout ul { margin:0; }
.callout ul { padding-left:18px; }
/* The fill bar: how full the panel is, and with what. Doubles as the legend. */
.fillbar { display:flex; gap:2px; height:8px; border-radius:8px; overflow:hidden; background:#ECEAE4; }
.fillbar span { display:block; height:100%; min-width:4px; }
.fillbar .rest { background:transparent; min-width:0; }

/* Panel screen header. */

/* Find a circuit. */
.finder {
  display:flex; align-items:center; gap:9px; margin:12px 0 10px; padding:0 14px;
  height:var(--control-h); border:1px solid var(--line); border-radius:14px; background:var(--card); color:var(--muted);
}
.finder:focus-within { border-color:var(--accent); box-shadow:0 0 0 3px rgba(18,165,148,.18); }
.finder input {
  flex:1; min-width:0; height:100%; border:none !important; padding:0; background:none;
  box-shadow:none !important; font-size:16px; outline:none;
}
.finder-none { margin:0 0 10px; }

/* The meter card: spaces, tested, fill bar, filter chips. */
.panelstats { margin:0 0 12px; padding:12px 12px 10px; border:1px solid var(--line); border-radius:16px; background:var(--card); }
.panelstats .statline { display:flex; justify-content:space-between; align-items:baseline; gap:10px; flex-wrap:wrap; margin-bottom:8px; }
.panelstats .big { font:700 19px/1.15 var(--font); }
.panelstats .tested { font-size:13px; color:var(--muted); }
.panelstats .fillbar { height:11px; }
.panelstats .statsub { display:flex; gap:14px; margin-top:7px; font-size:12.5px; color:var(--muted); }
.fchips {
  display:flex; gap:6px; overflow-x:auto; margin:10px -12px 0; padding:0 12px 2px;
  scrollbar-width:none; -webkit-overflow-scrolling:touch;
}
.fchips::-webkit-scrollbar { display:none; }
.fchip {
  flex:none; display:inline-flex; align-items:center; gap:6px; height:34px; padding:0 12px;
  border:1px solid var(--line); border-radius:999px; background:var(--card); cursor:pointer;
  font-size:13px; font-weight:600; transition:background .15s ease, color .15s ease, border-color .15s ease;
}
.fchip .sw { width:10px; height:10px; border-radius:3px; display:inline-block; }
.fchip .sw.todo { border-radius:50%; background:var(--todo); }
.fchip.on { background:var(--ink); border-color:var(--ink); color:#fff; }

/* Status light on a breaker's housing: green tested, amber pulsing to test. */
.brk .housing { position:relative; }
.sled {
  position:absolute; top:4px; left:50%; width:6px; height:6px; margin-left:-3px; border-radius:50%;
}
.sled.tested { background:#4BE07A; box-shadow:0 0 5px rgba(75,224,122,.9); }
.sled.todo { background:#F0A21E; animation:ledping 1.8s ease-out infinite; }
.sled.inline { position:relative; display:inline-block; top:-1px; left:auto; margin:0 2px; vertical-align:middle; }
@keyframes ledping {
  0% { box-shadow:0 0 0 0 rgba(240,162,30,.7); }
  70%, 100% { box-shadow:0 0 0 6px rgba(240,162,30,0); }
}
.brk:not(.half) .housing:has(.sled) .handle { margin-top:7px; height:52%; }
.brk.dual .housing:has(.sled) .handle { height:72%; }
/* A tandem half has no room above the handle, so the light sits beside it. */
.brk.half .housing:has(.sled) { justify-content:flex-end; padding-right:3px; }
.brk.half .sled { top:50%; left:4px; margin:-2.5px 0 0; width:5px; height:5px; }

/* The amp rating carries the circuit color; the plate picks up a faint tint. */
.brk:not(.slot-empty):not(.off) .amps { background:var(--k, #6B6F73); border-color:transparent; color:#fff; }
.brk:not(.slot-empty) .plate {
  background:linear-gradient(90deg, color-mix(in srgb, var(--k, #6B6F73) 12%, #fff) 0%, #fff 72%);
}

/* A tap flicks the handle off and back, the way the hardware answers a thumb. */
.brk .handle { transition:transform .2s ease; }
.brk:not(.slot-empty):active .handle { transform:translateY(22%); }
.brk.flick .handle { animation:flick .42s cubic-bezier(.3,1.5,.5,1); }
@keyframes flick {
  0% { transform:none; }
  35% { transform:translateY(32%); filter:grayscale(1) brightness(.55); }
  100% { transform:none; }
}

/* Filter and search: everything that does not match steps back. The drawing
   never rearranges, so a breaker is always where it is on the real panel. */
.panel .brk { transition:opacity .2s ease, filter .2s ease, transform .12s ease; }
.panel.filt .brk:not(.hit) { opacity:.25; filter:saturate(.15); }
.panel.filt .brk.hit { z-index:3; }
.panel.filt .brk.hit .plate, .panel.filt .brk.hit .housing {
  border-color:var(--k); box-shadow:0 0 0 2px var(--k), 0 4px 12px rgba(0,0,0,.18);
}

/* Breaker sheet: the header wears the circuit's color. */
.pn-sheet .bhead {
  --k:#6B6F73; position:relative; margin:0 0 16px; padding:18px; border-radius:20px; color:#fff;
  background:linear-gradient(160deg, color-mix(in srgb, var(--k) 92%, #fff), color-mix(in srgb, var(--k) 68%, #000));
}
.brow { display:flex; align-items:center; gap:14px; }
.bigtoggle {
  flex:none; width:54px; height:80px; border-radius:10px; cursor:pointer; display:grid; place-items:center;
  background:linear-gradient(180deg, #3A4046, #1A1E22);
  box-shadow:inset 0 2px 0 rgba(255,255,255,.12), 0 6px 16px rgba(0,0,0,.25);
}
.bigtoggle i {
  width:24px; height:42px; border-radius:6px; transform:translateY(-9px);
  background:linear-gradient(180deg, #FFD34E, #F0B429 48%, #C98A12); border:1px solid #A9740F;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.55);
  transition:transform .3s cubic-bezier(.3,1.6,.5,1), background .2s ease;
}
.bigtoggle.off i { transform:translateY(9px); background:linear-gradient(180deg, #6B737C, #2C3238); border-color:#14171A; }
.bt { min-width:0; }
.pn-sheet .bt h2 { margin:0; color:#fff; font-size:25px; line-height:1.05; overflow-wrap:anywhere; }
.btags { display:flex; flex-wrap:wrap; gap:5px; margin-top:8px; }
.btags span {
  padding:3px 9px; border-radius:999px; background:rgba(255,255,255,.22);
  font:600 12px/1.3 var(--font);
}

.sechead { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.sechead h3 { color:var(--muted); font-size:15px; letter-spacing:.06em; }
.addpill {
  display:inline-flex; align-items:center; gap:4px; height:36px; padding:0 13px; border:none; border-radius:999px;
  background:#DAF2EE; color:var(--accent); cursor:pointer;
  font:700 13px/1 var(--font);
}
.addpill svg { stroke-width:2.6; }

/* What is on a breaker, as tiles. */
.pn-tiles { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:8px; }
.pn-tile {
  position:relative; display:flex; flex-direction:column; gap:4px; min-width:0;
  padding:10px 10px 8px; border:1px solid var(--line); border-radius:14px;
}
.pn-tile .ico { width:34px; height:34px; border-radius:10px; display:grid; place-items:center; background:#EEF0F3; color:#5A626A; margin-bottom:2px; }
.pn-tile .ico.k-light, .pn-tile .ico.k-fixture { background:#FCF3DA; color:#9A6F00; }
.pn-tile .ico.k-outlet { background:#DAF2EE; color:var(--accent); }
.pn-tile .ico.k-appliance, .pn-tile .ico.k-hardwired { background:#FBEDEB; color:#B03A2E; }
.pn-tile .ico.k-switch { background:#EFEAFB; color:#6A49C4; }
.pn-tile b { font-size:14px; line-height:1.25; overflow-wrap:anywhere; }
.pn-tile small { color:var(--muted); font-size:12px; }
.tileacts { position:absolute; top:4px; right:2px; display:flex; }
.tileacts .iconbtn { padding:7px; }

.btn-soft-danger { background:#FBEDEB; color:#B03A2E; border-color:transparent; }

/* Sparks when a circuit is proved. */
.spark {
  position:absolute; left:38px; top:50%; width:8px; height:8px; border-radius:2px; pointer-events:none;
  animation:spark .85s ease-out forwards;
}
@keyframes spark { to { transform:translate(var(--dx), var(--dy)) rotate(260deg); opacity:0; } }


@media (prefers-reduced-motion:reduce) {
  .sled.todo, .brk.flick .handle, .spark { animation:none !important; }
}
/* ── Test Walk ────────────────────────────────────────────────────────────────
   One breaker at a time, at the panel, phone in one hand. Big targets, one
   question per screen, and the answer buttons stacked full width. */
.pn-unused-herolink {
  display:inline-block; margin-left:12px; padding:8px 0; border:none; background:none; cursor:pointer;
  color:#fff; opacity:.85; font:600 13px/1 var(--font); text-transform:uppercase; letter-spacing:.05em;
  text-decoration:underline; text-underline-offset:3px;
}
.walkbtn {
  display:flex; align-items:center; justify-content:center; gap:8px; width:100%; min-height:46px; margin-top:12px;
  border:none; border-radius:12px; cursor:pointer; background:var(--navy); color:#fff;
  font:700 15px/1 var(--font);
}
.walkbtn svg { color:var(--gold); }
.walkbtn span { font:600 12px/1 system-ui, sans-serif; text-transform:none; letter-spacing:0; opacity:.7; }

.walkbar { display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.walktitle { font:600 14px/1.2 var(--font); color:var(--muted); }
.walkgo { width:100%; margin-top:10px; }

.walkintro, .walkdone { text-align:center; max-width:460px; margin:0 auto; }
.walkbadge {
  display:inline-grid; place-items:center; width:64px; height:64px; margin:6px 0 12px; border-radius:50%;
  background:var(--navy); color:var(--gold);
}
.walkintro h1, .walkdone h1 { font-size:28px; }
.walkintro .lede, .walkdone .lede { color:var(--muted); margin:6px 0 18px; }
.walksteps { text-align:left; margin:0 0 16px; padding:0; list-style:none; counter-reset:ws; display:grid; gap:10px; }
.walksteps li {
  counter-increment:ws; display:flex; gap:12px; align-items:baseline; padding:12px 14px;
  background:var(--card); border:1px solid var(--line); border-radius:14px; font-size:15px;
}
.walksteps li::before {
  content:counter(ws); flex:none; width:26px; height:26px; border-radius:50%; display:inline-grid; place-items:center;
  background:var(--accent); color:#fff; font:700 14px/1 var(--font);
}
.walkintro .callout { text-align:left; background:var(--card); }

.walkprog { display:flex; align-items:center; gap:12px; margin-bottom:14px; font-size:13px; color:var(--muted); white-space:nowrap; }
.walkprogbar { flex:1; height:8px; border-radius:8px; background:#E6E3DC; overflow:hidden; }
.walkprogbar span { display:block; height:100%; border-radius:8px; background:var(--accent); transition:width .4s ease; }

.walkcard {
  --k:#6B6F73; display:flex; align-items:center; gap:18px; padding:20px; border-radius:22px; color:#fff;
  background:linear-gradient(160deg, color-mix(in srgb, var(--k) 92%, #fff), color-mix(in srgb, var(--k) 66%, #000));
  box-shadow:0 10px 26px rgba(0,0,0,.16);
}
.walktoggle { width:76px; height:116px; border:none; padding:0; border-radius:14px; }
.walktoggle i { width:34px; height:60px; transform:translateY(-13px); }
.walktoggle.off i { transform:translateY(13px); }
.walkwhat { min-width:0; }
.walkspace { font:600 14px/1 var(--font); opacity:.85; }
.walkwhat h2 { margin:6px 0 0; color:#fff; font-size:30px; line-height:1.05; overflow-wrap:anywhere; }

.walkask { margin-top:20px; }
.walkask h3 { font-size:22px; }
.walkask .hint { font-size:14.5px; margin:4px 0 6px; }
.walkask input { width:100%; margin:8px 0 2px; }
.walkitems { list-style:none; margin:10px 0 4px; padding:0; display:grid; gap:6px; }
.walkitems li {
  display:flex; justify-content:space-between; gap:10px; padding:11px 14px; border-radius:12px;
  background:var(--card); border:1px solid var(--line); font-weight:600; font-size:15px;
}
.walkitems small { color:var(--muted); font-weight:500; }
.walkyes { position:relative; background:var(--ok); border-color:var(--ok); color:#fff; min-height:56px; font-size:17px; }
.walkskip { display:block; margin:16px auto 0; color:var(--muted); font-size:14px; }

.pn-ring.big { width:150px; height:150px; margin:8px auto 16px; background:conic-gradient(#1E6B45 calc(var(--p) * 1%), #E6E3DC 0); }
.pn-ring.big::before { inset:13px; background:var(--paper); }
.pn-ring .spark { left:50%; }
.pn-ring.big b { font-size:46px; color:var(--ink); }
.pn-ring.big small { color:var(--muted); opacity:1; font-size:12px; }
.walkstats { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:8px; margin-bottom:8px; }
.walkstats span {
  padding:12px 4px; border-radius:14px; background:var(--card); border:1px solid var(--line);
  font:600 11px/1.2 var(--font); color:var(--muted);
}
.walkstats b { display:block; margin-bottom:4px; font:700 26px/1 var(--font); color:var(--ink); }

/* ---- Fitting Figtree ----
   Figtree is wider than the system font Breakr drew labels in, and the rule is
   that a label wraps to two lines and never truncates. On a phone the panel
   bleeds a little into the page gutter and the housing and amp tag give back a
   few pixels, which is what lets "Kitchen Counter Outlets" fit at 375 wide. */
.brk .lab { letter-spacing:-.015em; }
@media (max-width:520px) {
  .pn .panel { margin-left:-10px; margin-right:-10px; }
  .brk .housing { width:22px; }
  .brk .plate { padding:0 4px 0 6px; }
  .brk .lab { font-size:11px; }
  .brk .amps { padding:1px 2px; }
  /* No room to centre MAIN between two gutters: it sits left, tools right. */
  .panel-top { justify-content:flex-start; padding-inline:0 var(--toolw); }
  .mainbrk { min-width:0; }
  .mainbrk .mainlabel { font-size:12px; letter-spacing:.03em; }
}
