/* Ported from the <style> block in docs/prototype/index.html: same tokens, classes and dark mode. */
:root {
  color-scheme: light;
  --paper: #eef1ef;       /* page ground, faint green-grey like drafting film */
  --sheet: #fbfcfb;       /* panels */
  --ink: #17201e;
  --ink-2: #55605d;
  --rule: #d3d9d6;
  --accent: #0a6c96;      /* survey blue: tools, focus, selection */
  --accent-ink: #ffffff;
  --st-none: #8a9491;     /* not started */
  --st-prog: #c98a0b;     /* in progress */
  --st-inst: #2f6fd6;     /* installed */
  --st-test: #1f8a4c;     /* tested */
  --bad: #b3362b;
  --shadow: 0 1px 2px rgba(20,30,28,.08), 0 4px 14px rgba(20,30,28,.08);
  --f-ui: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-label: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r: 8px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #121816; --sheet: #1a2220; --ink: #e6ecea; --ink-2: #9aa6a2; --rule: #2c3734;
  --accent: #4bb3e0; --accent-ink: #081a22;
  --st-none: #8a9491; --st-prog: #e0a42a; --st-inst: #5b93f0; --st-test: #34a865; --bad: #e0675c;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35);
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --paper: #121816; --sheet: #1a2220; --ink: #e6ecea; --ink-2: #9aa6a2; --rule: #2c3734;
  --accent: #4bb3e0; --accent-ink: #081a22;
  --st-none: #8a9491; --st-prog: #e0a42a; --st-inst: #5b93f0; --st-test: #34a865; --bad: #e0675c;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35);
  color-scheme: dark;
}
html, body { height: 100%; margin: 0; }
html { touch-action: pan-x pan-y; }  /* no pinch or double-tap zoom of the page; the floorplan zooms itself */
body { background: var(--paper); color: var(--ink); font-family: var(--f-ui); font-size: 14px; line-height: 1.4; }
* { box-sizing: border-box; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app { min-height: 100%; display: flex; flex-direction: column; gap: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 12px; }

/* header */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.brand { font-family: var(--f-label); font-weight: 700; font-size: 20px; letter-spacing: .01em; text-transform: uppercase; margin: 0; white-space: nowrap; }
.brand small { font-weight: 500; color: var(--ink-2); letter-spacing: .04em; margin-left: 6px; font-size: 13px; }
.brand small:not(:empty)::before { content: "/ "; }
.crumb { cursor: pointer; }
.crumb:hover { color: var(--accent); }
.who { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.who form { margin: 0; }

/* controls */
.btn { display: inline-block; border: 1px solid var(--rule); background: var(--sheet); border-radius: 6px; padding: 5px 10px; cursor: pointer; font-size: 13px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.field { display: grid; gap: 3px; min-width: 0; }
.field label { font-size: 11px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; font-family: var(--f-label); font-weight: 600; }
.field input { border: 1px solid var(--rule); background: var(--paper); border-radius: 5px; padding: 7px 8px; min-width: 0; width: 100%; font-size: 16px; /* 16px stops iOS zooming on focus */ }
.muted { color: var(--ink-2); font-size: 13px; }
.meta { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-2); }
.err { color: var(--bad); font-size: 13px; margin: 0; }

/* dialogs (here: centered page cards) */
.centered { flex: 1; display: flex; align-items: center; justify-content: center; padding-block: 20px; }
.dialog { background: var(--sheet); border-radius: var(--r); padding: 18px; width: min(420px, 100%); display: grid; gap: 12px; box-shadow: var(--shadow); }
.dialog h2 { margin: 0; font-family: var(--f-label); text-transform: uppercase; letter-spacing: .03em; font-size: 18px; }
.dialog .row { display: flex; gap: 8px; justify-content: flex-end; }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 6px; font-size: 13px; z-index: 60;
  animation: toast-out .4s ease 4s forwards; }
@keyframes toast-out { to { opacity: 0; visibility: hidden; } }
/* Photo upload pop-up (photos.js): bottom-right on a computer, drops down from the top on a phone. */
.upq { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 70; width: min(340px, calc(100vw - 32px));
  background: var(--sheet); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 10px 12px; font-size: 13px; display: grid; gap: 6px; animation: upq-in .2s ease; }
@keyframes upq-in { from { opacity: 0; transform: translateY(8px); } }
.upq-head { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.upq-head b { flex: 1; font-family: var(--f-label); font-size: 15px; font-weight: 600; letter-spacing: .02em; }
.upq-head .mono { font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); }
.upq-head.ok b { color: var(--st-test); }
.upq-head.bad b { color: var(--bad); }
.upq-head .x { border: 0; background: none; color: var(--ink-2); font-size: 20px; line-height: 1; padding: 0 4px; cursor: pointer; }
.upq-what { color: var(--ink-2); overflow-wrap: anywhere; }
.upq-what a { color: var(--accent); font-weight: 600; }
.upq-bar { height: 6px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.upq-bar i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.upq-fail { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--rule); padding-top: 6px; }
.upq-fail div { flex: 1; min-width: 0; display: grid; }
.upq-fail b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upq-fail span { color: var(--ink-2); font-size: 12px; }
@media (max-width: 760px) {
  .upq { right: 12px; left: 12px; width: auto; bottom: auto; top: calc(env(safe-area-inset-top, 0px) + 22px); animation-name: upq-drop; }
  @keyframes upq-drop { from { opacity: 0; transform: translateY(-8px); } }
}

/* projects home */
.homeview { display: grid; gap: 14px; align-content: start; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.pcard { text-align: left; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px; display: grid; gap: 10px; align-content: start; }
.pcard h2 { margin: 0; font-family: var(--f-label); font-size: 20px; text-transform: uppercase; letter-spacing: .02em; text-wrap: balance; }
.pcard .site { color: var(--ink-2); font-size: 13px; margin-top: -6px; }
.pcard.new { border-style: dashed; place-content: center; text-align: center; color: var(--ink-2); min-height: 150px; font-family: var(--f-label); font-weight: 600; font-size: 16px; letter-spacing: .03em; text-transform: uppercase; cursor: pointer; }
.pcard.new:hover { border-color: var(--accent); color: var(--accent); }
.prow { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); gap: 8px; flex-wrap: wrap; }
.prow b { color: var(--ink); font-family: var(--f-mono); font-weight: 600; }
.bigbar { height: 14px; border-radius: 7px; background: var(--rule); overflow: hidden; }
.bigbar > div { height: 100%; background: var(--st-test); border-radius: inherit; }
.bigbar.sm { height: 8px; }
a.pcard:hover { border-color: var(--accent); }
.field input.mono { font-family: var(--f-mono); }
.field input[type=file] { padding: 6px; font-size: 14px; }

/* floorplan page: header strip, then the plan fills the rest of the screen */
.fill .app { height: 100%; }
.views { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; overflow: hidden; background: var(--sheet); }
.views a { padding: 4px 13px; font-family: var(--f-label); font-weight: 600; font-size: 14px; letter-spacing: .02em; }
.views a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.floors { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; min-width: 0; }
.ftab { border: 1px solid var(--rule); background: var(--sheet); border-radius: 999px; padding: 4px 12px; font-family: var(--f-label); font-weight: 600; font-size: 14px; letter-spacing: .02em; }
.ftab[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ftab.add { border-style: dashed; color: var(--ink-2); }

.planwrap { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.tools form { margin: 0; }
.tools .lbl { font-family: var(--f-label); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; color: var(--ink-2); margin-right: 2px; }
.tools .sp { flex: 1; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--rule); background: transparent; border-radius: 6px; min-width: 30px; height: 30px; padding: 0 8px; cursor: pointer; font-size: 13px; }
.iconbtn:disabled { opacity: .4; cursor: default; }
.upl { position: relative; }
.upl input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upl:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.viewport { flex: 1; min-height: 280px; overflow: auto; position: relative; background: repeating-linear-gradient(0deg, transparent 0 23px, var(--rule) 23px 24px), repeating-linear-gradient(90deg, transparent 0 23px, var(--rule) 23px 24px); background-color: var(--paper); }
.stage { position: relative; margin: 16px; background: #fff; box-shadow: var(--shadow); touch-action: none; cursor: grab; }
.stage.panning { cursor: grabbing; }
.stage canvas { display: block; width: 100%; height: 100%; }
.stage canvas.detail { position: absolute; pointer-events: none; }  /* sharp redraw of the zoomed-in part */
.planmsg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--ink-2); font-size: 13px; text-align: center; padding: 20px; }
.stage .planmsg { color: #6b7673; }



/* floorplan: plan on the left, device panel on the right (stacks on phones) */
:root { --plan-thin: #a9b3b0; }
.main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 12px; }
.stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 13px; }
.stat { display: flex; align-items: center; gap: 4px; }
.stat b { font-family: var(--f-mono); font-weight: 600; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-2); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-2); }
.chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.chip b { color: var(--ink); font-family: var(--f-mono); font-weight: 600; }
.tbar { width: 120px; height: 6px; border-radius: 3px; background: var(--rule); overflow: hidden; margin-left: 4px; }
.tbar > div { height: 100%; width: 0; background: var(--st-test); transition: width .4s ease; }
.tool { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rule); background: transparent; border-radius: 6px; padding: 4px 9px; cursor: pointer; font-size: 13px; }
.tool .glyph { font-family: var(--f-mono); font-size: 10px; font-weight: 600; padding: 1px 4px; border-radius: 3px; background: var(--ink); color: var(--paper); }
.tool[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tool[aria-pressed="true"] .glyph { background: var(--accent-ink); color: var(--accent); }
.hint { padding: 6px 12px; font-size: 13px; background: var(--accent); color: var(--accent-ink); }
.stage.placing { cursor: crosshair; }
#conetoggle[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.pin { position: absolute; transform: translate(-50%, -50%); border: 2px solid #fff; border-radius: 999px; min-width: 30px; height: 26px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center; font-family: var(--f-mono); font-size: 10.5px; font-weight: 600; color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.35); cursor: pointer; user-select: none; touch-action: none; white-space: nowrap; z-index: 2; }
.pin.t-rack { border-radius: 4px; }
.pin.t-idf { border-radius: 4px; outline: 2px solid currentColor; outline-offset: -5px; }
.pin.t-drop { min-width: 22px; height: 22px; font-size: 9px; }
.pin.t-osp { border-radius: 3px; border-style: dashed; }
.pin.t-mdf { border-radius: 5px; min-width: 42px; height: 32px; font-size: 11.5px; border-width: 3px;
  outline: 2px solid currentColor; outline-offset: -7px; box-shadow: 0 0 0 2px var(--ink), 0 2px 6px rgba(0,0,0,.4); }
.tool:disabled { opacity: .4; cursor: not-allowed; }
.pin.sel { box-shadow: 0 0 0 3px var(--accent), 0 2px 8px rgba(0,0,0,.4); z-index: 3; }
.pin.dragging { opacity: .8; cursor: grabbing; z-index: 4; }
.s-not_started { background: var(--st-none); }
.s-in_progress { background: var(--st-prog); }
.s-installed { background: var(--st-inst); }
.s-tested { background: var(--st-test); }
.cones { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 1; }
.cone { fill: rgba(47, 111, 214, .14); stroke: rgba(47, 111, 214, .55); stroke-width: 1.5; }
.cone.sel { fill: rgba(47, 111, 214, .26); stroke: #2f6fd6; stroke-width: 2; }
.conehandle { fill: #2f6fd6; stroke: #fff; stroke-width: 3; pointer-events: auto; cursor: grab; touch-action: none; }

/* side sheet */
.sheet { min-width: 0; min-height: 0; overflow: auto; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); }
.sheet form { margin: 0; }
.empty { padding: 22px 20px; color: var(--ink-2); }
.empty h2 { font-family: var(--f-label); font-size: 18px; text-transform: uppercase; letter-spacing: .03em; color: var(--ink); margin: 0 0 8px; }
.empty ol { padding-left: 18px; margin: 8px 0 16px; display: grid; gap: 6px; }
.legend { display: grid; gap: 6px; font-size: 13px; }
.dev-head { padding: 14px 16px 12px; border-bottom: 1px solid var(--rule); display: grid; gap: 8px; }
.dev-title { display: flex; align-items: center; gap: 8px; }
.dev-title form { flex: 1; min-width: 0; display: flex; }
.dev-title input { font-family: var(--f-mono); font-weight: 600; font-size: 17px; border: 1px solid transparent; background: transparent; border-radius: 4px; padding: 2px 4px; flex: 1; min-width: 0; }
.dev-title input:hover, .dev-title input:focus { border-color: var(--rule); background: var(--paper); }
.typebadge { font-family: var(--f-label); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-size: 12px; color: var(--ink-2); }
.closebtn { border: 0; background: transparent; cursor: pointer; font-size: 18px; line-height: 1; color: var(--ink-2); padding: 4px 6px; }
.statusrow { display: flex; gap: 4px; flex-wrap: wrap; }
.sbtn { border: 1px solid var(--rule); background: transparent; border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.sbtn i { width: 8px; height: 8px; border-radius: 50%; }
.sbtn[aria-pressed="true"] { border-color: var(--ink); background: var(--paper); font-weight: 600; }
.sbtn:disabled { cursor: default; }
.sec { padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.sec:last-child { border-bottom: 0; }
.sec h3 { margin: 0 0 8px; font-family: var(--f-label); font-weight: 600; font-size: 13px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.sec h3 .n { font-family: var(--f-mono); letter-spacing: 0; color: var(--ink); font-size: 12px; }
.sec h3 .sp { flex: 1; }
.sec h3 .btn { text-transform: none; letter-spacing: 0; font-family: var(--f-ui); font-weight: 400; }
.sec.foot { display: flex; align-items: center; gap: 10px; }
.sec.foot .meta { flex: 1; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.field select, .field textarea { border: 1px solid var(--rule); background: var(--paper); border-radius: 5px; padding: 5px 7px; min-width: 0; width: 100%; font-size: 16px; }
.sheet .field input { font-size: 14px; padding: 5px 7px; }
.field.notes { margin-top: 10px; }
textarea { resize: vertical; min-height: 70px; }
.tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tasks li { display: flex; align-items: center; gap: 8px; padding: 4px 2px; border-radius: 4px; }
.tasks li:hover { background: var(--paper); }
.tasks li form { display: flex; }
.tasks input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--st-test); flex: none; margin: 0; }
.tasks label { flex: 1; cursor: pointer; }
.tasks li.done label { color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--plan-thin); }
.tasks .x { opacity: 0; }
.tasks li:hover .x, .tasks .x:focus-visible { opacity: 1; }
@media (hover: none) { .tasks .x { opacity: .6; } }
.tasks .who { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; font-family: var(--f-mono); }
.addtask { display: flex; gap: 6px; margin-top: 6px; }
.addtask input, .addtask select { flex: 1; min-width: 0; border: 1px solid var(--rule); background: var(--paper); border-radius: 5px; padding: 5px 7px; }
.x { border: 0; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 15px; padding: 2px 6px; border-radius: 4px; }
.x.armed { background: var(--bad); color: #fff; font-size: 12px; opacity: 1; }
.btn.danger { color: var(--bad); }
.btn.danger.armed { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.small { padding: 3px 8px; font-size: 12px; }
.small { font-size: 12px; }
p.small { margin: 6px 0 0; }
.warn { grid-column: 1 / -1; font-size: 12.5px; color: var(--bad); }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photos button { padding: 0; border: 0; border-radius: 5px; overflow: hidden; aspect-ratio: 1; background: var(--paper); cursor: zoom-in; position: relative; max-width: 100%; }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos .when { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10px; padding: 2px 4px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.6)); text-align: left; font-family: var(--f-mono); }
.slide { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; margin-bottom: 6px; }
.slide label { font-size: 12.5px; }
.slide input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
form.busy { opacity: .6; }
.overlay { position: fixed; inset: 0; background: rgba(10,15,14,.6); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.overlay.lightbox { padding: 0; background: rgba(6,9,8,.97); }
/* One photo per screen width; swipe or scroll sideways and it snaps to the next. */
.lb-strip { position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  overscroll-behavior: contain; scrollbar-width: none; touch-action: pan-x; }
.lb-strip::-webkit-scrollbar { display: none; }
.lb-slide { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 12px 24px; }
.lightbox img { max-width: min(100%, 1400px); max-height: calc(100dvh - 120px); border-radius: 6px; display: block; object-fit: contain; }
.lightbox .cap { color: #fff; font-size: 13px; margin-top: 8px; font-family: var(--f-mono); text-align: center; }
.lb-count { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); color: #fff; font-size: 13px; pointer-events: none; }
.lb-close, .lb-nav { position: absolute; border: 0; background: rgba(255,255,255,.14); color: #fff; border-radius: 50%; cursor: pointer; display: grid; place-items: center; line-height: 1; }
.lb-close { top: calc(8px + env(safe-area-inset-top, 0px)); right: 10px; width: 40px; height: 40px; font-size: 26px; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 46px; height: 46px; font-size: 32px; padding-bottom: 4px; }
.lb-nav.prev { left: 12px; } .lb-nav.next { right: 12px; }
.lb-nav:disabled { opacity: .25; cursor: default; }
.lb-close:hover, .lb-nav:not(:disabled):hover { background: rgba(255,255,255,.26); }
@media (max-width: 760px) { .lb-nav { display: none; } }
.lightbox .cap a { color: #fff; text-decoration: underline; }

@media (max-width: 860px) {
  .fill .app { height: auto; min-height: 100%; }
  .main { grid-template-columns: minmax(0, 1fr); }
  .viewport { min-height: 52vh; max-height: 64vh; }
}

/* switches */
.swview { display: grid; gap: 12px; align-content: start; }
.swbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.swbar .muted { flex: 1; margin: 0; }
.swbar form { margin: 0; }
.swcard { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 12px; min-width: 0; }
.swcard p { margin: 0; }
.cardtitle { margin: 0; font-family: var(--f-label); text-transform: uppercase; letter-spacing: .03em; font-size: 18px; }
.swhead { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.swhead form { margin: 0; }
.swhead h2 { margin: 0; font-family: var(--f-mono); font-size: 16px; font-weight: 600; }
.swhead .sub { color: var(--ink-2); font-size: 13px; }
.swhead .sp { flex: 1; }
.swhead .meta b { color: var(--ink); }
.faceplate { background: #2a302e; border-radius: 6px; padding: 10px 12px; display: flex; gap: 14px; align-items: center; overflow-x: auto; max-width: 100%; }
.pgrp { display: grid; grid-template-rows: 24px 24px; grid-auto-flow: column; grid-auto-columns: 28px; gap: 4px 3px; flex: none; }
.pgrp.sfp { grid-auto-columns: 32px; }
.sport { border-radius: 3px; border: 1px solid #5a6360; background: #3a423f; padding: 0 0 2px; font-family: var(--f-mono); font-size: 9.5px; color: #c5ccc9; display: flex; align-items: flex-end; justify-content: center; line-height: 1; }
.sport.used { color: #fff; border-color: rgba(255,255,255,.55); }
.sport.up { background: #1f8a4c; }
.sport.down { background: var(--bad); border-color: #fff; }
.chip i.port-up { background: #1f8a4c; }
.chip i.port-down { background: var(--bad); }
.chip i.port-conflict { background: var(--bad); outline: 1.5px dashed currentColor; outline-offset: 1px; }
.sport.conflict { background: var(--bad); color: #fff; border: 2px dashed #fff; }
.sport.sel { box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px #2a302e; }
.chip i.unused { background: #3a423f; border: 1px solid #5a6360; }
.portdet { border: 1px solid var(--rule); border-radius: 6px; padding: 10px 12px; background: var(--paper); font-size: 13px; display: grid; gap: 8px; }
.portdet .ph { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.portdet .ph b { font-family: var(--f-mono); }
.portdet .bad { color: var(--bad); }
.pdev { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; margin: 0; }
.pdev dt { color: var(--ink-2); }
.pdev dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--rule); }
.pill i { width: 8px; height: 8px; border-radius: 50%; }
.pill.ok { color: var(--st-test); border-color: var(--st-test); }
.pill.bad { color: var(--bad); border-color: var(--bad); }
.pill.warnp { color: var(--st-prog); border-color: var(--st-prog); }
select.mini { border: 1px solid var(--rule); background: var(--sheet); border-radius: 6px; padding: 3px 6px; font-size: 12.5px; }
.field select { font-size: 16px; }
.hintline { grid-column: 1 / -1; font-size: 12.5px; }
.dialog .fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* materials pop-up */
.dialog.wide { width: min(560px, 100%); max-height: 88vh; overflow: auto; }
.pdfopts { max-height: 90vh; overflow: auto; }
.pdftypes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pdftypes label, .pdfextra label { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 6px; cursor: pointer; min-height: 44px; }
.pdftypes label:has(input:checked) { border-color: var(--accent); }
.pdftypes .glyph { font-family: var(--f-mono); font-size: 11px; font-weight: 600; background: var(--ink); color: var(--paper); border-radius: 4px; padding: 1px 5px; }
.pdftypes .tn { flex: 1; }
.pdftypes input, .pdfextra input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.pdfquick { display: flex; gap: 6px; }
.pdfextra { display: grid; gap: 6px; }
.pdfopts [data-pdf-go]:disabled { opacity: .45; }
.pdfnames { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.pdfnames .field:first-child, .pdfnames p { grid-column: 1 / -1; }
.pdfnames p { margin: 0; }
@media (max-width: 760px) { .pdfnames { grid-template-columns: 1fr; } }
.pdfcols { border: 1px solid var(--rule); border-radius: 6px; padding: 8px 10px; display: grid; gap: 8px; }
.pdfcols[open] { gap: 8px; }
.pdfcols summary { cursor: pointer; font-weight: 600; min-height: 28px; display: flex; align-items: center; gap: 6px; }
.pdfcols p { margin: 6px 0 0; }
.pdfcols.off { opacity: .5; }
.pdfcolgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin-top: 6px; }
.pdfcolgrid label { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.pdfcolgrid input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.pdfcols .pdfquick { margin-top: 8px; }
.dialog p { margin: 0; }
.dialog .sub { margin-top: -4px; }
.mgroup { display: grid; gap: 4px; }
.mgroup h3 { margin: 4px 0 2px; font-family: var(--f-label); font-weight: 600; font-size: 12.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.mrow { display: grid; grid-template-columns: 18px minmax(0, 1fr) 64px max-content auto; gap: 10px; align-items: center; padding: 4px 2px; font-size: 13.5px; }
.mrow.off label { color: var(--ink-2); text-decoration: line-through; }
.mrow input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.mrow input[type=number], .qty { width: 64px; border: 1px solid var(--rule); background: var(--paper); border-radius: 5px; padding: 4px 6px; }
.stock { font-size: 12px; color: var(--ink-2); font-family: var(--f-mono); }
.stock.short { color: var(--bad); }
.warnrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* inventory and checked out */
.cardh { margin: 0; font-family: var(--f-label); font-weight: 600; font-size: 13px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.tablewrap { overflow-x: auto; max-width: 100%; }
.itable { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.itable th { text-align: left; font-family: var(--f-label); font-weight: 600; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); padding: 6px 8px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.itable td { padding: 6px 8px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.itable td form { display: inline; margin: 0; }
.itable .num { text-align: right; }
.itable td.num input { text-align: right; }
.kitgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; }
.kit { border: 1px solid var(--rule); border-radius: 6px; padding: 10px 12px; display: grid; gap: 6px; align-content: start; background: var(--paper); }
.kit h4 { margin: 0; font-size: 14px; font-weight: 600; }
.kitform { display: grid; gap: 6px; margin: 0; }
.kitform .btn.small { justify-self: start; }
.kline { display: grid; grid-template-columns: minmax(0, 1fr) 64px auto; gap: 6px; align-items: center; font-size: 13px; }
.kline.ro { grid-template-columns: minmax(0, 1fr) auto; }
.kline select { min-width: 0; width: 100%; border: 1px solid var(--rule); background: var(--sheet); border-radius: 5px; padding: 4px 6px; }
.search { flex: 1; min-width: 0; max-width: 360px; border: 1px solid var(--rule); background: var(--sheet); border-radius: 6px; padding: 6px 10px; font-size: 16px; }
.linkbtn { color: var(--accent); font-family: var(--f-mono); text-decoration: underline; text-underline-offset: 2px; }
button.linkbtn { background: none; border: 0; padding: 0; cursor: pointer; }

/* dashboard */
.dashview { display: grid; gap: 14px; align-content: start; }
.dhead { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px 18px; display: grid; gap: 10px; }
.dhead .row1 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dhead .row1 .muted { flex: 1; min-width: 12rem; }
.pct { font-family: var(--f-label); font-weight: 700; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.bigbar > div { transition: width .5s ease; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 12px; }
.tile { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 4px; align-content: start; }
.tile .k { font-family: var(--f-label); font-weight: 600; font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.tile .v { font-family: var(--f-mono); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile .s { font-size: 12.5px; color: var(--ink-2); }
.tile.click:hover { border-color: var(--accent); }
.tile.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.dgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.dcard { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.dcard h3 { margin: 0 0 2px; font-family: var(--f-label); font-weight: 600; font-size: 13px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }
.dcard p { margin: 0; }
.dtitle { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dtitle h3 { margin: 0; }
.dtitle .sp { flex: 1; }
.frow.fhead { cursor: default; font-family: var(--f-label); font-weight: 600; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); padding-block: 0; }
.frow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(60px, 140px) 52px 44px; gap: 10px; align-items: center; font-size: 13px; padding: 5px 6px; border-radius: 5px; }
a.frow:hover { background: var(--paper); }
.frow .n { font-family: var(--f-mono); text-align: right; font-variant-numeric: tabular-nums; }
.frow .pill { font-size: 11px; padding: 0 6px; vertical-align: 1px; }
.stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--rule); }
.stack > i { display: block; height: 100%; }
.trow { display: grid; grid-template-columns: 100px minmax(0, 1fr) 30px; gap: 10px; align-items: center; font-size: 13px; padding: 3px 0; }
.trow .n { font-family: var(--f-mono); text-align: right; }
.attn { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.attn li { display: flex; gap: 8px; align-items: baseline; }
.attn li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--st-prog); flex: none; transform: translateY(-1px); }
.attn li.ok::before { background: var(--st-test); }
.drow { display: grid; grid-template-columns: minmax(70px, max-content) minmax(0, 1fr) auto; gap: 3px 12px; align-items: center; border-top: 1px solid var(--rule); padding: 8px 6px; font-size: 13px; }
.drow:hover { background: var(--paper); }
.drow b { font-family: var(--f-mono); }
.drow .info { grid-column: 2 / -1; color: var(--ink-2); font-size: 12.5px; }
.whead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.whead h3 { margin: 0; }
.whead .sp { flex: 1; }
.whead .iconbtn { min-width: 28px; height: 28px; font-size: 16px; line-height: 1; }
.iconbtn.disabled { opacity: .4; }
.wstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr)); gap: 8px; }
.wstat { background: var(--paper); border-radius: 6px; padding: 8px 10px; display: grid; gap: 1px; }
.wstat .v { font-family: var(--f-mono); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wstat .k { font-size: 12px; color: var(--ink); }
.wstat .s { font-size: 11px; color: var(--ink-2); }
.wline { margin: 0; font-size: 13px; }
.wline b { font-weight: 600; }
.weekly details summary { cursor: pointer; font-size: 12.5px; color: var(--ink-2); }
.wtext { white-space: pre-wrap; font-family: var(--f-mono); font-size: 12px; background: var(--paper); border-radius: 6px; padding: 10px; margin: 6px 0 0; overflow-x: auto; }

/* notifications bell */
.bellwrap { position: relative; margin-left: auto; }
.bellwrap + .who { margin-left: 0; }
.bell { list-style: none; border: 1px solid var(--rule); background: var(--sheet); border-radius: 999px; height: 30px; padding: 0 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.bell::-webkit-details-marker { display: none; }
.bell .cnt { background: var(--bad); color: #fff; border-radius: 999px; font-size: 11px; font-family: var(--f-mono); padding: 0 6px; line-height: 18px; min-width: 18px; text-align: center; }
.bell .cnt.zero { background: var(--rule); color: var(--ink-2); }
.notifs { position: absolute; right: 0; top: calc(100% + 6px); width: min(400px, calc(100vw - 32px)); max-height: 65vh; overflow: auto; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow); z-index: 40; padding: 6px; }
.nhead { font-family: var(--f-label); font-weight: 600; font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); padding: 6px 8px 4px; }
.nitem { display: flex; gap: 9px; width: 100%; padding: 8px; border-radius: 6px; font-size: 13px; align-items: baseline; }
.nitem:hover { background: var(--paper); }
.nitem::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--st-prog); transform: translateY(-1px); }
.nitem.bad::before { background: var(--bad); }
.nitem.ok::before { background: var(--st-test); }
.nitem small { display: block; color: var(--ink-2); font-size: 11.5px; margin-top: 2px; }
.dcard .nitem { padding: 6px 4px; }
@media (max-width: 600px) { .notifs { position: fixed; left: 16px; right: 16px; width: auto; top: calc(env(safe-area-inset-top, 0px) + 82px); } }

/* in-app camera */
.overlay.camera { padding: 0; background: #000; }
.cambox { width: 100%; height: 100%; display: flex; flex-direction: column; color: #fff; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
.camhead { display: flex; justify-content: space-between; padding: 10px 16px; font-family: var(--f-mono); font-size: 13px; }
.cambox video { flex: 1; min-height: 0; width: 100%; object-fit: contain; background: #000; }
.camthumbs { display: flex; gap: 6px; padding: 8px 16px; overflow-x: auto; min-height: 64px; }
.camthumbs img { height: 48px; width: 48px; object-fit: cover; border-radius: 4px; flex: none; }
.camrow { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px 20px; }
.shutter { width: 68px; height: 68px; border-radius: 50%; border: 4px solid #fff; background: rgba(255,255,255,.25); cursor: pointer; }
.shutter:active { background: #fff; }
.overlay.camera.flash video { opacity: .4; }

/* "hidden" always wins, even over classes that set display (pills, buttons). */
[hidden] { display: none !important; }

/* ---------- branding ---------- */
.brand { display: flex; align-items: center; gap: 6px; min-width: 0; }
.brand .crumb { display: inline-flex; align-items: center; gap: 8px; }
.logo { height: 32px; width: auto; display: block; }
.brand small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.loginbrand { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.loginbrand img { height: 96px; width: auto; }
.loginbrand .brand { font-size: 26px; }

/* desktop vs phone pieces */
.mobile-only { display: none !important; }
.phone-part { display: none; }

/* ---------- phone version ---------- */
@media (max-width: 760px) {
  .desk-only { display: none !important; }
  .mobile-only { display: revert !important; }
  .tabbar.mobile-only { display: flex !important; }

  /* Clear the phone's status bar / blurred top edge, plus a few mm of breathing room. */
  .app { padding-top: calc(env(safe-area-inset-top, 0px) + 28px); gap: 8px; }
  body:has(.tabbar) .app { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }

  /* compact top bar: logo, project name, bell, menu */
  .top { flex-wrap: wrap; gap: 8px 10px; }
  .brand { flex: 1; font-size: 18px; }
  .logo { height: 28px; }
  .brand small { font-size: 12px; margin-left: 0; }
  .bellwrap { margin-left: 0; order: 1; }
  .usermenu { order: 2; }
  .top > .floors, .top > .stats { order: 3; }
  .bell { height: 36px; }

  /* bottom tab bar */
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--sheet); border-top: 1px solid var(--rule);
    padding: 4px 4px env(safe-area-inset-bottom, 0px); justify-content: space-around; }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 4px; min-height: 56px; justify-content: center;
    font-family: var(--f-label); font-weight: 600; font-size: 11.5px; letter-spacing: .03em; color: var(--ink-2); }
  .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current="page"] { color: var(--accent); }

  /* floor tabs and floor stats: one row each, swipe sideways */
  .floors, .stats { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; }
  .floors::-webkit-scrollbar, .stats::-webkit-scrollbar { display: none; }
  .ftab { flex: none; padding: 6px 14px; }
  .stats { gap: 12px; font-size: 12px; white-space: nowrap; }
  .stats .chips { flex-wrap: nowrap; }
  .tbar { width: 60px; }

  /* floorplan: plan fills the screen, toolbar is one swipeable row */
  .fill .app { height: 100dvh; min-height: 0; }
  /* iPhone Safari only shrinks its bottom toolbar when the page can scroll. Short pages
     (Plan, Switches, Log) couldn't, so the tab bar sat higher there than on long pages.
     Making every page at least the full screen tall ("lvh") lets a small swipe shrink
     the toolbar on every tab, so the tab bar ends up in the same place everywhere. */
  body:has(.tabbar) .app { min-height: 100lvh; }
  .fill .app { height: 100lvh; }
  .main { display: flex; flex-direction: column; }
  .planwrap { flex: 1; min-height: 0; }
  .viewport { min-height: 0; max-height: none; flex: 1; }
  .stage { margin: 10px; }
  .tools { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 6px 8px; }
  .tools::-webkit-scrollbar { display: none; }
  .tools .lbl { display: none; }
  .tools .sp { flex: 0 0 4px; }
  .tool { flex: none; height: 38px; padding: 0 10px; }
  .tool .tname { display: none; }
  .tool .glyph { font-size: 12px; padding: 3px 6px; }
  .iconbtn { flex: none; min-width: 38px; height: 38px; }
  .pin { min-width: 34px; height: 30px; }
  .pin.t-drop { min-width: 26px; height: 26px; }

  /* device panel: a bottom sheet over the plan */
  .sheet { position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); max-height: 62dvh; z-index: 25;
    border-radius: 14px 14px 0 0; border-bottom: 0; box-shadow: 0 -6px 24px rgba(0,0,0,.25);
    transform: translateY(calc(100% + 80px)); transition: transform .25s ease; overscroll-behavior: contain;
    overflow-x: hidden; touch-action: pan-y; }  /* scroll up and down only */
  .sheet * { max-width: 100%; }
  .sheet.open { transform: none; }
  /* swiped down: just the handle and the device's name show; tap to bring it back */
  .sheet.open.peek { transform: translateY(calc(100% - 92px)); overflow: hidden; cursor: pointer; }
  .sheet.open.peek * { pointer-events: none; }
  .sheet.open.peek .closebtn { pointer-events: auto; }
  .sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--rule); margin: 8px auto 0; }
  .sheet .empty { display: none; }

  /* bigger touch targets in the panel */
  .sbtn { padding: 7px 12px; font-size: 13px; }
  .tasks li { padding: 7px 2px; flex-wrap: wrap; }
  .tasks input[type=checkbox] { width: 22px; height: 22px; }
  .tasks label { font-size: 15px; }
  .tasks .who { order: 3; flex-basis: 100%; padding-left: 30px; margin-top: -2px; }
  .tasks .x { font-size: 18px; padding: 4px 8px; }
  .sheet .field input, .field select, .field textarea, .addtask input, .addtask select, .search, .qty, .mrow input[type=number] { font-size: 16px; }
  .sheet .field input { padding: 8px; }
  .btn { padding: 8px 12px; font-size: 14px; }
  .btn.small { padding: 6px 10px; font-size: 13px; }
  .closebtn { font-size: 24px; padding: 6px 10px; }
  .photos { grid-template-columns: repeat(3, 1fr); }

  /* dialogs fill the width and scroll */
  .overlay { padding: 10px; align-items: flex-end; }
  .overlay.lightbox, .overlay.camera { align-items: center; }
  .dialog, .dialog.wide { width: 100%; max-height: calc(100dvh - 20px); overflow: auto; border-radius: 14px; }
  .dialog .fields { grid-template-columns: 1fr; }
  .mrow { grid-template-columns: 22px minmax(0, 1fr) 64px; row-gap: 2px; }
  .mrow .stock { grid-column: 2 / 4; }
  .mrow .x { grid-row: 1; grid-column: 3; justify-self: end; display: none; }
  .centered { align-items: flex-start; }

  /* dashboard and lists */
  .pct { font-size: 38px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile { padding: 10px 12px; }
  .tile .v { font-size: 19px; }
  .wstats { grid-template-columns: 1fr 1fr; }
  .frow { grid-template-columns: minmax(0, 1fr) 70px 44px 40px; gap: 6px; }
  .trow { grid-template-columns: 82px minmax(0, 1fr) 26px; }
  .drow { grid-template-columns: minmax(0, 1fr) auto; }
  .drow > span:nth-of-type(1) { grid-column: 1 / -1; grid-row: 2; color: var(--ink-2); font-size: 12.5px; }
  .swhead { gap: 8px; }
  .swhead .sp { display: none; }
  .itable { font-size: 13px; }
  .itable .desk-cell { display: none; }
  .phone-part { display: block; font-size: 11px; }
  .swbar .muted { flex-basis: 100%; }
  .itable th, .itable td { padding: 8px 6px; }
  .pgrid { gap: 10px; }
  .notifs { top: calc(env(safe-area-inset-top, 0px) + 88px); }
}

/* IDF/rack: switches located here */
.swhere { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; border-top: 1px solid var(--rule); }
.swhere:first-of-type { border-top: 0; }
.swhere > div { flex: 1; display: grid; gap: 2px; min-width: 0; }
.swhere form { margin: 0; }

/* project settings */
.settings .fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); align-items: end; }
.floorrow { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--rule); }
.floorrow:first-of-type { border-top: 0; }
.floorfields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 90px auto; gap: 8px; align-items: end; margin: 0; }
.flooracts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.flooracts .muted { flex: 1; }
.flooracts form { margin: 0; display: flex; gap: 4px; }
.addrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.addrow select, .addrow input { flex: 1; min-width: 140px; border: 1px solid var(--rule); background: var(--paper); border-radius: 6px; padding: 6px 8px; font-size: 16px; }
.newuser summary { cursor: pointer; font-size: 13px; color: var(--accent); }
.newuser form { margin-top: 10px; }
.danger-zone { border-color: var(--bad); }
@media (max-width: 760px) {
  .floorfields { grid-template-columns: 1fr 1fr; }
  .floorfields .field:first-child { grid-column: 1 / -1; }
}

/* search */
.hsearch { margin: 0; }
.hsearch input { border: 1px solid var(--rule); background: var(--sheet); border-radius: 999px; padding: 5px 12px; width: 190px; font-size: 13px; }
.field ul { margin: 2px 0 0; padding-left: 18px; font-size: 12px; color: var(--ink-2); }
@media (max-width: 760px) {
  .searchbtn.mobile-only { display: grid !important; order: 1; place-items: center; width: 36px; height: 36px; border: 1px solid var(--rule); border-radius: 50%; background: var(--sheet); }
  .searchbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
}

/* daily activity chart: bars stretch, labels stay readable */
.chart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
.yaxis { position: relative; width: 2.2em; height: 170px; font-family: var(--f-mono); font-size: 11px; color: var(--ink-2); text-align: right; }
.yaxis span { position: absolute; right: 0; transform: translateY(-50%); }
.plot { min-width: 0; }
.plot svg { display: block; width: 100%; height: 170px; }
.xaxis { position: relative; height: 18px; font-size: 11px; color: var(--ink-2); }
.xaxis span { position: absolute; top: 4px; transform: translateX(-50%); white-space: nowrap; }
.xaxis span:last-child { transform: translateX(-100%); }
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 10px; }
.checkgrid .kit { margin: 0; }
.checkgrid textarea { font-size: 13px; line-height: 1.5; }
.checkgrid .row { display: flex; gap: 6px; justify-content: flex-end; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--ink-2); }
label.check input { margin-top: 2px; }
@media (max-width: 760px) { .checkgrid textarea { font-size: 16px; } }

/* assignments */
.assignrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.assignrow form { margin: 0; }
.assignrow .lbl { font-family: var(--f-label); font-weight: 600; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
.stage.mine-only .pin:not(.mine):not(.sel) { opacity: .25; }
#minetoggle[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.workbanner { display: flex; gap: 6px; align-items: baseline; background: var(--sheet); border: 1px solid var(--accent); border-radius: var(--r); padding: 12px 16px; font-size: 14px; }
.workbanner b { font-family: var(--f-mono); }
.workbanner span { margin-left: auto; color: var(--accent); }
.dcard h3 .n { font-family: var(--f-mono); color: var(--ink); margin-left: 4px; }

/* round initials menu (all screen sizes) and the Export menu */
.usermenu { position: relative; }
.avatar { list-style: none; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-family: var(--f-label); font-weight: 700; font-size: 14px; cursor: pointer; }
.avatar::-webkit-details-marker { display: none; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: var(--sheet); border: 1px solid var(--rule);
  border-radius: var(--r); box-shadow: var(--shadow); z-index: 45; padding: 6px; display: grid; }
.menu a, .menu button { padding: 11px 10px; border-radius: 6px; font-size: 15px; text-align: left; border: 0; background: none; width: 100%; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--paper); }
.menu form { margin: 0; }
.menuhead { padding: 8px 10px 6px; font-size: 12px; color: var(--ink-2); border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.usermenu, .exportmenu { position: relative; }
.exportmenu summary { list-style: none; cursor: pointer; }
.exportmenu summary::-webkit-details-marker { display: none; }
.exportmenu .menu { left: 0; right: auto; min-width: 240px; }
.menu .muted { margin-left: 4px; }
.menu a.mobile-only { display: none !important; }
@media (max-width: 760px) { .menu a.mobile-only { display: block !important; } }

/* arriving from a notification: mark what needs fixing until it's fixed */
@keyframes flash { 0%, 60% { background-color: color-mix(in srgb, var(--accent) 22%, transparent); } 100% { background-color: color-mix(in srgb, var(--accent) 8%, transparent); } }
.needs-fix { position: relative; box-shadow: inset 0 0 0 2px var(--accent); background-color: color-mix(in srgb, var(--accent) 8%, transparent); scroll-margin-top: 24px; }
.needs-fix.flash { animation: flash 2s ease-out 2; }
.sec.needs-fix h3::after, .dev-head.needs-fix .typebadge::after { content: "Needs attention"; margin-left: auto; font-family: var(--f-label); font-size: 11px; letter-spacing: .05em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.dev-head.needs-fix .typebadge { display: flex; }
.warn.needs-fix { padding: 8px 10px; border-radius: 6px; }
.tasks li.todo { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.tasks li.todo label { font-weight: 600; }
@keyframes pulsebtn { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
.pulse-btn { border-color: var(--accent) !important; animation: pulsebtn 1.4s ease-in-out infinite; }
@keyframes pinring { 0% { box-shadow: 0 0 0 3px var(--bad), 0 0 0 3px color-mix(in srgb, var(--bad) 60%, transparent); } 100% { box-shadow: 0 0 0 3px var(--bad), 0 0 0 18px transparent; } }
.pin.hl { animation: pinring 1.2s ease-out infinite; z-index: 3; }
.itable tr:target td { background: color-mix(in srgb, var(--accent) 16%, transparent); animation: flash 2s ease-out 2; }
.itable tr:target td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.itable tr { scroll-margin-top: 80px; }
.swcard { scroll-margin-top: 12px; }
.portdet.flash { box-shadow: inset 0 0 0 2px var(--bad); animation: flash 2s ease-out 2; }

/* one-line rows, each in its own box */
.line { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 10px; margin-top: 6px; font-size: 13.5px; min-width: 0;
  background: var(--paper); border: 1px solid var(--rule); border-left-width: 3px; border-radius: 8px; }
.line:hover { border-color: var(--accent); }
.line:has(.sev-bad) { border-left-color: var(--bad); }
.line:has(.sev-warn) { border-left-color: var(--st-prog); }
.line:has(.sev-ok) { border-left-color: var(--st-test); }
.line:has(.s-not_started) { border-left-color: var(--st-none); }
.line:has(.s-in_progress) { border-left-color: var(--st-prog); }
.line:has(.s-installed) { border-left-color: var(--st-inst); }
.line:has(.s-tested) { border-left-color: var(--st-test); }
.line .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.line .dot.sev-bad { background: var(--bad); }
.line .dot.sev-warn { background: var(--st-prog); }
.line .dot.sev-ok { background: var(--st-test); }
.line b { font-family: var(--f-mono); font-weight: 600; white-space: nowrap; flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
.line .txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.line .where { flex: none; max-width: 30%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); font-size: 12px; }
.line .chev { flex: none; color: var(--ink-2); font-size: 18px; line-height: 1; }
.notifs .line { margin: 6px 4px 0; }
.notifs { padding-bottom: 8px; }
.chip.person { background: var(--paper); border: 1px solid var(--rule); border-radius: 999px; padding: 2px 9px; color: var(--ink); font-size: 12.5px; }
.pickpeople { position: relative; }
.pickpeople summary { list-style: none; cursor: pointer; }
.pickpeople summary::-webkit-details-marker { display: none; }
.pickpeople .menu { left: 0; right: auto; min-width: 220px; gap: 4px; padding: 10px; }
.pickpeople label.check { color: var(--ink); font-size: 14px; padding: 6px 4px; }

/* mass edit */
.bulk .filters .addrow select, .bulk .filters .addrow input { min-width: 120px; }
.picklist { display: grid; }
.line.pick { cursor: pointer; }
.line.pick input { width: 18px; height: 18px; flex: none; margin: 0; accent-color: var(--accent); }
.bulkactions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.peoplepick { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.peoplepick label.check { color: var(--ink); font-size: 14px; padding: 4px 0; }

/* inline rename for tasks and inspection items */
.tasks li { flex-wrap: wrap; }
.rename { position: static; }
.rename summary { list-style: none; cursor: pointer; opacity: 0; }
.rename summary::-webkit-details-marker { display: none; }
.tasks li:hover .rename summary, .rename[open] summary, .rename summary:focus-visible { opacity: 1; }
@media (hover: none) { .rename summary { opacity: .6; } }
.rename[open] { flex-basis: 100%; order: 4; }
.rename[open] summary { display: none; }
.rename .addtask { margin-top: 2px; }
.cellinput { border: 1px solid transparent; background: transparent; border-radius: 4px; padding: 3px 5px; width: 100%; min-width: 120px; font: inherit; }
.cellinput:hover, .cellinput:focus { border-color: var(--rule); background: var(--paper); }
.cellinput.mono { font-family: var(--f-mono); font-size: 12.5px; min-width: 90px; }
.tasknames summary { cursor: pointer; }
.tasknames ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; font-size: 13px; }
.tasknames li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--rule); }
.tasknames .mono { color: var(--ink-2); font-size: 12px; }

/* Appearance picker in the menu */
.themepick { padding: 8px 10px 10px; display: grid; gap: 6px; border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.menulbl { font-family: var(--f-label); font-weight: 600; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.themepick .views { display: flex; }
.themepick .views button { flex: 1; border: 0; background: transparent; padding: 6px 8px; cursor: pointer; font-family: var(--f-label); font-weight: 600; font-size: 13px; color: var(--ink); }
.themepick .views button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* ---------- opening animation: LC connector plugs in, link light, power on ---------- */
#boot { display: none; }
.booting #boot { display: flex; position: fixed; inset: 0; z-index: 100; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: var(--paper); cursor: pointer; animation: boot-out .45s ease-in 2.25s forwards; }
.booting body { overflow: hidden; }
.bootart { width: min(80vw, 420px); height: auto; overflow: visible; }
.b-plug { transform: translateX(-150px); animation: plug-in .75s cubic-bezier(.3, .0, .2, 1) .15s forwards; }
.b-light { stroke-dasharray: 34 400; stroke-dashoffset: 34; opacity: 0; animation: light-run .55s ease-in .95s forwards; }
.b-led, .b-led2 { animation: led-on .2s linear .9s forwards; }
.b-ledglow { opacity: 0; animation: led-glow .9s ease-out .9s forwards; }
.bootbrand { display: flex; align-items: center; gap: 10px; opacity: 0; transform: scale(.94); animation: power-on .6s ease-out 1.35s forwards; }
.bootbrand img { height: 46px; width: auto; }
.bootbrand span { font-family: var(--f-label); font-weight: 700; font-size: 30px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
@keyframes plug-in { 0% { transform: translateX(-150px); } 82% { transform: translateX(4px); } 100% { transform: translateX(0); } }
@keyframes light-run { 0% { opacity: 1; stroke-dashoffset: 34; } 100% { opacity: 0; stroke-dashoffset: -190; } }
@keyframes led-on { to { fill: #34d27a; } }
@keyframes led-glow { 0% { opacity: 0; } 30% { opacity: .9; } 100% { opacity: .55; } }
@keyframes power-on { 0% { opacity: 0; transform: scale(.94); filter: drop-shadow(0 0 0 transparent); }
  60% { opacity: 1; filter: drop-shadow(0 0 14px color-mix(in srgb, var(--accent) 70%, transparent)); }
  100% { opacity: 1; transform: scale(1); filter: drop-shadow(0 0 4px color-mix(in srgb, var(--accent) 40%, transparent)); } }
@keyframes boot-out { to { opacity: 0; visibility: hidden; } }
.itemrename { display: inline-block; vertical-align: middle; }
.itemrename summary { opacity: .55; }
.itable tr:hover .itemrename summary { opacity: 1; }
.itemrename[open] { display: block; margin-top: 4px; }
.itemrename .addtask { flex-wrap: wrap; }
.itemrename .addtask input { min-width: 120px; }
.email { border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); overflow: hidden; }
.emailsubj { padding: 8px 12px; border-bottom: 1px solid var(--rule); font-weight: 600; font-size: 13.5px; }
.emailbody { padding: 4px 12px; font-size: 14px; line-height: 1.5; }
.emailbody p { margin: 8px 0; }
.radios { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.radios label.check { color: var(--ink); font-size: 14px; }

/* per-task photos */
.taskcam { margin: 0; display: flex; }
.taskcam label { position: relative; cursor: pointer; font-size: 15px; opacity: .8; }
.taskcam label.needphoto { opacity: 1; }
.taskcam input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.taskthumb { width: 30px; height: 30px; padding: 0; border: 1px solid var(--rule); border-radius: 5px; overflow: hidden; cursor: zoom-in; flex: none; background: var(--paper); }
.taskthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tasks li.done .taskcam label { text-decoration: none; color: inherit; flex: none; }

/* Unplaced tray */
.traybtn { border-style: dashed; }
.tray { display: grid; gap: 6px; }
.tray h3 { margin-bottom: 0; }
.tray p { margin: 0 0 4px; }
.trayitem { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); cursor: pointer; }
.trayitem:hover { border-color: var(--accent); }
.trayitem .glyph { font-family: var(--f-mono); font-size: 10px; font-weight: 600; padding: 2px 5px; border-radius: 3px; background: var(--ink); color: var(--paper); }
.trayitem b { font-family: var(--f-mono); }
.trayitem .muted { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.traydrag { font-size: 20px; color: var(--ink-2); cursor: grab; touch-action: none; padding: 0 4px; user-select: none; }
.pin.dragghost { position: fixed; z-index: 90; pointer-events: none; transform: translate(-50%, -50%) scale(1.15); box-shadow: 0 6px 18px rgba(0,0,0,.35); }
@media (max-width: 760px) { .sheet.dragging-out { transform: translateY(calc(100% + 80px)); } }
/* device table */
.devtable th[data-sort] { cursor: pointer; user-select: none; }
.devtable th[data-sort]::after { content: " ↕"; opacity: .35; }
.devtable th.asc::after { content: " ↑"; opacity: 1; }
.devtable th.desc::after { content: " ↓"; opacity: 1; }
.devtable td { white-space: nowrap; }
.devtable .cellinput { min-width: 90px; }
.cellinput.saved { box-shadow: inset 0 0 0 1px var(--st-test); }

/* admin console */
.adminbtn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--accent);
  color: var(--accent); font-family: var(--f-label); font-weight: 600; font-size: 13px; letter-spacing: .03em; text-transform: uppercase; }
.adminbtn:hover { background: var(--accent); color: var(--accent-ink); }
.adminbtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bellwrap { margin-left: auto; }
.adminbtn + .bellwrap { margin-left: 0; }
.adminbtn { margin-left: auto; }
.itable tr.off td { opacity: .5; }
.plainlist { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 4px; font-size: 14px; }
@media (max-width: 760px) {
  .adminbtn { order: 1; width: 36px; height: 36px; padding: 0; justify-content: center; margin-left: 0; }
  .adminbtn span { display: none; }
}
@media (max-width: 760px) {
  .top > .consolenav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .top > .consolenav a { flex: 1; text-align: center; white-space: nowrap; }
}

/* ---------- virtual racks (racks.html): front view, U1 at the bottom ---------- */
.racksetup { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.racksetup label { display: grid; gap: 2px; font-size: 12px; color: var(--ink-2); }
.racksetup input { width: 64px; }
.racktip { margin: 0; }
.rackrow { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 6px; align-items: flex-start; }
.rackcard { flex: none; width: 300px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 12px; display: grid; gap: 8px; scroll-margin-top: 12px; }
.rackhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rackname { display: flex; gap: 6px; flex: 1; min-width: 0; }
.rackname input { flex: 1; min-width: 0; font-family: var(--f-label); font-weight: 600; font-size: 16px; }
.rackname select { width: auto; }
/* The rack is a physical thing, so it stays dark in light and dark mode, like the switch faceplate. */
.rack { display: grid; grid-template-columns: 26px 1fr; grid-template-rows: repeat(var(--units), 22px); gap: 1px 0;
  background: #1b201f; border: 6px solid #2f3634; border-radius: 4px; padding: 4px 6px 4px 0; }
.ru-n { grid-column: 1; font-family: var(--f-mono); font-size: 9.5px; color: #8a9491; text-align: right; padding-right: 5px; line-height: 22px; }
.ru-free { grid-column: 2; border: 1px dashed #343c3a; background: transparent; border-radius: 2px; padding: 0; }
button.ru-free { cursor: pointer; }
button.ru-free:hover, button.ru-free:focus-visible { border-color: var(--accent); background: rgba(75,179,224,.12); }
.ru-item { grid-column: 2; border-radius: 3px; padding: 2px 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; overflow: hidden;
  background: #3a4240; color: #e6ecea; border: 1px solid #56605d; font-size: 12px; min-height: 0; }
.ru-item[data-item] { cursor: pointer; }
.ru-item[data-item]:hover, .ru-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.ru-name { font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ru-u { font-size: 10px; color: #9aa6a2; }
.ru-item.k-switch { background: #2a302e; border-color: #0a6c96; }
.ru-item.k-patch { background: repeating-linear-gradient(90deg, #3a4240 0 9px, #4a5350 9px 11px); }
.ru-item.k-fiber { background: #3b3a2a; border-color: #8a7a2a; }
.ru-item.k-manager { background: repeating-linear-gradient(90deg, #2c3331 0 5px, #39413f 5px 7px); color: #b8c2bf; }
.ru-item.k-ups { background: #2a2730; border-color: #6a5f80; }
.ru-item.k-server { background: #26303a; border-color: #4a6a8a; }
.ru-item.k-firewall { background: #3a2826; border-color: #a0453c; }
.ru-item.k-shelf { background: #4a4438; border-color: #6a6250; }
.ru-ports { flex-basis: 100%; display: grid; grid-template-columns: repeat(24, 1fr); gap: 1px; max-width: 240px; padding: 1px 0 2px; }
.ru-ports i { height: 5px; border-radius: 1px; background: #5a6360; }
.ru-ports i.on { background: #34a865; }
.ru-item.h1 .ru-ports { display: none; }  /* 1U switches: too short for the port dots */
.dialog [data-for][hidden] { display: none; }
@media (max-width: 760px) {
  .rackcard { width: min(300px, calc(100vw - 48px)); }
  .racksetup { width: 100%; }
}

/* ---------- how-to-use tour (tour.js) ---------- */
.tour { position: fixed; inset: 0; z-index: 95; }
.tour-spot { position: absolute; border-radius: 8px; box-shadow: 0 0 0 200vmax rgba(10,15,14,.62); outline: 2px solid var(--accent); outline-offset: 0;
  transition: left .2s, top .2s, width .2s, height .2s; pointer-events: none; }
.tour.alone { background: rgba(10,15,14,.62); }
.tour.alone .tour-spot { display: none; }
.tour-card { position: absolute; width: min(340px, calc(100vw - 24px)); background: var(--sheet); color: var(--ink); border: 1px solid var(--rule);
  border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; display: grid; gap: 8px; transition: left .2s, top .2s; }
.tour.alone .tour-card { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); }
.tour-card h3 { margin: 0; font-family: var(--f-label); text-transform: uppercase; letter-spacing: .03em; font-size: 18px; }
.tour-card p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.tour-n { font-size: 11px; color: var(--ink-2); letter-spacing: .04em; }
.tour-card .row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.tour-card .row .sp { flex: 1; }
.tour-card .btn { padding: 7px 14px; font-size: 14px; }
.tour-skip { border: 0; background: none; padding: 6px 0; color: var(--ink-2); font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .tour-spot, .tour-card { transition: none; } }

/* Logo: navy on light backgrounds, a light version on dark ones. */
.dk { display: none !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lt { display: none !important; } :root:not([data-theme="light"]) .dk { display: block !important; } }
:root[data-theme="dark"] .lt { display: none !important; }
:root[data-theme="dark"] .dk { display: block !important; }

/* Admin console > Company: the logo on a white sheet, as it prints. */
.companylogo { background: #fff; border: 1px solid var(--rule); border-radius: var(--r); padding: 14px; display: inline-flex; max-width: 100%; }
.companylogo img { max-height: 90px; max-width: 100%; width: auto; }

/* An invisible first button so pressing Enter in a form saves instead of hitting its first × */
.enter-save { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; overflow: hidden; }

/* Move on the toolbar: unlocks every pin for dragging until Lock. Its name stays visible on phones too. */
.movetool svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.movetool svg[hidden] { display: none; }
@media (max-width: 760px) { .tool.movetool .tname { display: inline; } }
.stage.moveall .pin { cursor: grab; box-shadow: 0 0 0 2px var(--accent), 0 1px 4px rgba(0,0,0,.35); }
.stage.moveall .pin.sel { box-shadow: 0 0 0 3px var(--accent), 0 0 0 7px rgba(58,176,230,.3), 0 2px 8px rgba(0,0,0,.4); }
.hintbtn { margin-left: 8px; border: 1px solid currentColor; background: none; color: inherit; border-radius: 6px; padding: 2px 10px; font: inherit; font-weight: 600; cursor: pointer; }

/* Photos tab */
.photofilter select { border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); border-radius: 6px; padding: 6px 8px; font-size: 14px; }
.photogroup .pghead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.photogroup .pghead .cardh { margin: 0; font-family: var(--f-mono); }
.photogroup .pghead .sp { flex: 1; }
.photos.wide { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
@media (max-width: 760px) {
  .photos.wide { grid-template-columns: repeat(3, 1fr); }
  .photofilter .search { flex-basis: 100%; max-width: none; }
  .photofilter select { flex: 1; min-width: 0; }
}

/* Photo viewer: where the device is, beside the photo (below it on phones). */
.lb-slide { flex-direction: row; gap: 20px; }
.lb-shot { display: flex; flex-direction: column; align-items: center; min-width: 0; flex: 1 1 auto; max-width: 1400px; }
.lb-where { flex: 0 0 min(340px, 30vw); align-self: center; background: #fff; border-radius: 8px; padding: 8px; color: #17201e; }
.lb-wherehead { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 6px; }
.lb-wherehead a { color: #0a6c96; text-decoration: underline; white-space: nowrap; }
.lb-plan { display: block; width: 100%; height: auto; border: 1px solid #d3d9d6; border-radius: 4px; }
.nomap .lb-where { display: none; }
.lb-maptog { position: absolute; top: calc(8px + env(safe-area-inset-top, 0px)); left: 10px; border: 0; border-radius: 999px; padding: 9px 14px;
  background: rgba(255,255,255,.14); color: #fff; font-size: 13px; cursor: pointer; }
.lb-maptog:hover { background: rgba(255,255,255,.26); }
@media (max-width: 760px) {
  .lb-slide { flex-direction: column; gap: 10px; padding-top: 56px; }
  .lb-where { flex: 0 0 auto; width: 100%; padding: 6px; }
  .lb-where .lb-plan { max-height: 30dvh; width: auto; max-width: 100%; margin: 0 auto; }
  .lightbox:not(.nomap) .lb-shot img { max-height: calc(100dvh - 110px - 30dvh - 50px); }
}

/* "Show on plan": a pulsing blue ring on the device you came to see. */
@keyframes pinspot { 0% { box-shadow: 0 0 0 3px var(--accent), 0 0 0 3px color-mix(in srgb, var(--accent) 70%, transparent); } 100% { box-shadow: 0 0 0 3px var(--accent), 0 0 0 22px transparent; } }
.pin.spot { animation: pinspot 1.3s ease-out infinite; z-index: 3; }

/* Invites: Project settings > Team, and the sign-up page */
.invites { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule); }
.invites h4 { margin: 0 0 4px; font-family: var(--f-label); text-transform: uppercase; letter-spacing: .03em; font-size: 15px; }
.inviterow { border: 1px solid var(--rule); border-radius: var(--r); padding: 10px 12px; margin-top: 10px; display: grid; gap: 6px; }
.inviterow .row { display: flex; align-items: center; gap: 8px; }
.inviterow .row .sp { flex: 1; }
.inviterow form { margin: 0; }
.invitemeta { font-size: 13px; }
.invitelink { display: block; font-size: 12.5px; background: var(--paper); border-radius: 6px; padding: 6px 8px; overflow-wrap: anywhere; user-select: all; }
.invitewho { margin: 0; text-align: center; line-height: 1.45; }
.dialog .center { text-align: center; }
.inviterow.flash { animation: flash 2s ease-out 2; }
.nmore { margin: 6px 8px 8px; font-size: 13px; }

/* Racks page: Move unlocks the gear for dragging (app.js). */
#rackarea.unlocked .ru-item[data-item] { cursor: grab; touch-action: none; box-shadow: 0 0 0 2px var(--accent); }
.ru-item.dragging { opacity: .4; }
.ru-item.saving { opacity: .6; }
.ru-ghost { grid-column: 2; position: relative; z-index: 3; pointer-events: none; border: 2px dashed var(--accent); border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--ink); font-family: var(--f-mono); font-size: 11px;
  display: flex; align-items: center; justify-content: flex-end; padding: 0 8px; }
.ru-ghost.bad { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 22%, transparent); }
.swbar .movetool { display: inline-flex; align-items: center; gap: 6px; }
.swbar .movetool[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ---------- Network tab: sub-tabs, uplinks, patch panels and fiber bulkheads ---------- */
.subviews { align-self: flex-start; justify-self: start; width: max-content; max-width: 100%; overflow-x: auto; }
.subviews a { white-space: nowrap; }
.sport.uplink { background: #0a6c96; }
.chip i.port-uplink { background: #0a6c96; }
.portdet .sp { flex: 1; }
.portdet .unplug { margin: 0; }
.portdet .linkbtn { font-size: 13px; }
.portdet .connect { display: grid; gap: 8px; border-top: 1px dashed var(--rule); padding-top: 10px; }
.portdet .connect .row { display: flex; gap: 8px; }
.connect .field.wide { grid-column: 1 / -1; }
.portdet .sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.portdet .side { display: grid; gap: 8px; align-content: start; border: 1px solid var(--rule); border-radius: 6px; padding: 10px; background: var(--sheet); min-width: 0; }
.portdet .side h4 { margin: 0; font-family: var(--f-label); text-transform: uppercase; letter-spacing: .04em; font-size: 13px; }
.portdet .side h4 .muted { font-weight: 500; text-transform: none; letter-spacing: 0; margin-left: 4px; }
.portdet .side p { margin: 0; }
.roomsum { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }

/* Copper patch panel: black plate, white keystone jacks numbered underneath. */
.patchplate { background: #1d2120; gap: 18px; }
.pbank { display: grid; grid-template-rows: 26px; grid-auto-flow: column; grid-auto-columns: 26px; gap: 3px; flex: none; }
.pport { position: relative; border-radius: 2px; background: #e9ecea; border: 1px solid #9aa3a0; font-family: var(--f-mono); font-size: 9px; color: #2a302e;
         display: flex; align-items: flex-end; justify-content: center; padding-bottom: 1px; line-height: 1; }
.pport::before { content: ""; position: absolute; left: 6px; right: 6px; top: 4px; height: 9px; background: #2a302e; border-radius: 1px 1px 0 0; }
.pport.cab { background: #f3d9a1; border-color: #c98a0b; }
.pport.pat { background: #c6dcf5; border-color: #2f6fd6; }
.pport.both { background: #1f8a4c; border-color: #fff; color: #fff; }
.pport.both::before { background: #0e3f22; }
.pport.sel, .fport.sel { box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px #1d2120; z-index: 1; }
.chip i.pp-both { background: #1f8a4c; }
.chip i.pp-cab { background: #f3d9a1; border: 1px solid #c98a0b; }
.chip i.pp-pat { background: #c6dcf5; border: 1px solid #2f6fd6; }

/* Fiber bulkhead: brushed adapter plates with screws, LC duplex or SC adapters. Blue = single-mode, aqua = multimode. */
.bulkhead { display: flex; flex-wrap: wrap; gap: 10px; background: #262b2a; border-radius: 6px; padding: 10px 12px; overflow-x: auto; max-width: 100%;
            --adapter: #2f6fd6; --adapter-edge: #1b4a99; }
.bulkhead.mode-mm { --adapter: #2fb9c4; --adapter-edge: #17808a; }
.bplate { position: relative; display: flex; gap: 6px; padding: 10px 18px; border-radius: 3px; flex: none;
          background: linear-gradient(180deg, #c9cfcd, #9ea6a3); border: 1px solid #6f7875; }
.bplate .screw { position: absolute; top: 50%; left: 5px; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%;
                 background: radial-gradient(circle at 35% 35%, #f2f4f3, #6f7875); box-shadow: inset 0 0 0 1px #59615e; }
.bplate .screw.r { left: auto; right: 5px; }
.adapter { display: flex; gap: 2px; padding: 3px; border-radius: 3px; background: var(--adapter); border: 1px solid var(--adapter-edge);
           box-shadow: inset 0 -2px 0 rgba(0,0,0,.25); }
.fport { position: relative; width: 22px; height: 30px; border-radius: 2px; background: #121514; display: flex; align-items: flex-end; justify-content: center; }
.fport span { font-family: var(--f-mono); font-size: 9px; color: #fff; line-height: 1; padding-bottom: 2px; }
.fport::before { content: ""; position: absolute; top: 5px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: #3b4240; box-shadow: inset 0 0 0 2px #121514; }
.bulkhead.sc .adapter { padding: 4px; }
.bulkhead.sc .fport { width: 28px; height: 32px; border-radius: 3px; }
.bulkhead.sc .fport::before { width: 10px; height: 10px; margin-left: -5px; border-radius: 2px; }
.fport.cab::before { background: #f3d9a1; }
.fport.pat::before { background: #8fb8f0; }
.fport.both::before { background: #34c36f; box-shadow: inset 0 0 0 2px #121514, 0 0 6px #34c36f; }
@media (max-width: 760px) {
  .portdet .sides { grid-template-columns: 1fr; }
  .portdet .connect .fields { grid-template-columns: 1fr 1fr; }
}

/* ---------- Projects page: sort and groups ---------- */
.homebar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.homebar .sp { flex: 1; }
.sortpick { display: flex; align-items: center; gap: 8px; margin: 0; }
.sortpick label { font-size: 11px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; font-family: var(--f-label); font-weight: 600; }
.sortpick select { border: 1px solid var(--rule); background: var(--sheet); border-radius: 999px; padding: 4px 10px; font-size: 14px; font-family: var(--f-label); font-weight: 600; }
.pgroup { display: grid; gap: 10px; }
.pgroup > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--rule); }
.pgroup > summary::-webkit-details-marker { display: none; }
.pgroup > summary::before { content: "▸"; color: var(--ink-2); font-size: 13px; transition: transform .15s; display: inline-block; }
.pgroup[open] > summary::before { transform: rotate(90deg); }
.pgroup .gname { font-family: var(--f-label); font-weight: 700; font-size: 17px; text-transform: uppercase; letter-spacing: .03em; }
.pgroup .n { color: var(--ink-2); font-size: 13px; }
.pgroup[open] > .pgrid { margin-top: 2px; }
.groupsview .swcard { gap: 8px; }
.grow { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--rule); }
.grow form { margin: 0; display: flex; gap: 6px; }
.grow .grename input { border: 1px solid var(--rule); background: var(--paper); border-radius: 5px; padding: 6px 8px; font-size: 16px; min-width: 0; width: min(320px, 60vw); }
.groupsview .addrow input { flex: 1; min-width: 0; }
.catalog-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.catalog-actions form { margin: 0; }
.catfilter input[type=search] { flex: 2; }

/* ---------- Site surveys ---------- */
.kindtabs { align-self: flex-start; justify-self: start; width: max-content; max-width: 100%; }
.kindtabs a b { font-family: var(--f-mono); font-weight: 600; margin-left: 4px; opacity: .8; }
.pcard.survey { border-left: 4px solid var(--accent); }
.surveyview .shead { gap: 10px; }
.sprog { display: grid; gap: 6px; }
.sprog .bigbar > div { background: var(--accent); transition: width .3s; }
.schips { display: flex; flex-wrap: wrap; gap: 6px; }
.chipbtn { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--rule); border-radius: 999px;
           font-size: 12.5px; font-family: var(--f-label); font-weight: 600; letter-spacing: .02em; background: var(--paper); }
.chipbtn b { font-family: var(--f-mono); font-weight: 600; color: var(--ink-2); }
.chipbtn.ok { border-color: var(--st-test); color: var(--st-test); }
.chipbtn.ok b { color: var(--st-test); }
.ssec { gap: 0; }
.ssech { display: flex; align-items: baseline; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.ssec > .muted.small { margin: 2px 0 6px; }
.sitem { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 6px 14px; padding: 10px 0; border-top: 1px solid var(--rule); align-items: start; }
.sitem .sq { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.sitem .sqtext { display: grid; gap: 2px; min-width: 0; flex: 1; }
.sitem .sqtext label { font-weight: 500; }
.sitem .tick { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--rule); margin-top: 1px; }
.sitem.done .tick { background: var(--st-test); border-color: var(--st-test); box-shadow: inset 0 0 0 3px var(--sheet); }
.sitem.na .tick { background: var(--st-none); border-color: var(--st-none); box-shadow: inset 0 0 0 3px var(--sheet); }
.sitem.na .sqtext label { color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--rule); }
.sitem .sdel { margin: 0; }
.sans { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; min-width: 0; }
.sans input:not([type=checkbox]):not([type=radio]), .sans textarea, .sans select { flex: 1; min-width: 140px; border: 1px solid var(--rule); background: var(--paper);
           border-radius: 5px; padding: 6px 8px; font-size: 16px; font-family: inherit; color: inherit; }
.sans textarea { resize: vertical; min-height: 38px; width: 100%; }
.sans .num { max-width: 140px; flex: 0 1 140px; }
.sans input.err, .sans textarea.err { border-color: var(--bad); }
.sans .snote { flex-basis: 100%; }
.yesno { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; overflow: hidden; }
.yesno label { margin: 0; }
.yesno input { position: absolute; opacity: 0; pointer-events: none; }
.yesno span { display: inline-block; padding: 5px 14px; font-family: var(--f-label); font-weight: 600; font-size: 14px; cursor: pointer; }
.yesno input:checked + span { background: var(--accent); color: var(--accent-ink); }
.yesno input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.nabtn { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-2); margin-left: auto; cursor: pointer; white-space: nowrap; }
.sphotos { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-left: 26px; }
.sphotos .photos { display: flex; gap: 6px; flex-wrap: wrap; }
.sphoto { position: relative; }
.sphoto button[data-photo] { padding: 0; border: 1px solid var(--rule); border-radius: 5px; overflow: hidden; width: 64px; height: 64px; background: var(--paper); }
.sphoto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sphoto form { position: absolute; top: -6px; right: -6px; margin: 0; }
.sphoto .x { width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--ink); color: var(--sheet); font-size: 13px; line-height: 1; padding: 0; opacity: .85; }
.sphoto .x.armed { width: auto; padding: 0 6px; background: var(--bad); color: #fff; }
.scam { margin: 0; }
.scam input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.needphoto { font-size: 12px; color: var(--st-prog); font-weight: 600; }
.sadd { border-top: 1px solid var(--rule); padding-top: 8px; }
.sadd summary { cursor: pointer; list-style: none; }
.sadd form { margin-top: 8px; align-items: center; }
.sroom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--rule); }
.sroom .sp { flex: 1; }
.einv { display: grid; grid-template-columns: 1.2fr 1.2fr .5fr 1fr 1fr 1.2fr auto; gap: 6px; margin-top: 8px; }
.einv input { min-width: 0; border: 1px solid var(--rule); background: var(--paper); border-radius: 5px; padding: 6px 8px; font-size: 16px; }
.existrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.existrow .check { font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.checkrow { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
@media (max-width: 760px) {
  .sitem { grid-template-columns: 1fr; }
  .sans { padding-left: 26px; }
  .einv { grid-template-columns: 1fr 1fr; }
  .einv button { grid-column: 1 / -1; }
}
