:root {
  --bg: #fafafa;
  --card: #ffffff;
  --ink: #323232;
  --ink-strong: #2e2e2e;
  --tile: #f0f0f0;
  --tile-ink: #424242;
  --band: #e6eaee;
  --muted: #6b6b6b;
  --line: #dcdcdc;
  --field-line: #a1a1a1;
  --navy: #003e69;
  --brand: #0c7bb3;
  --brand-dark: #003e69;
  --disabled: #a1a1a1;
  --disabled-ink: #d8d8d8;
  --danger: #ff0000;
  --ok: #1b7a3d;
  --ok-bg: #e5f4ea;
  --bad: #c62828;
  --bad-bg: #fdecea;
  --warn: #8a5a00;
  --warn-bg: #fff4d6;
  --kanban: #0c7bb3;
  --floating: #7b3fb5;
  --radius: 5px;
  --tap: 40px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.4 "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

a { color: var(--brand); }
h1 { font-size: 1.4rem; font-weight: 700; color: var(--ink-strong); margin: 0 0 .25rem; }
h2 { font-size: 1.15rem; font-weight: 700; color: var(--ink-strong); margin: 1.5rem 0 .6rem; }
h3 { font-size: 1rem; font-weight: 700; color: var(--ink-strong); margin: 1rem 0 .4rem; }
p { margin: .4rem 0; }
code { background: var(--tile); padding: 1px 5px; border-radius: 4px; font-size: .92em; }

.muted { color: var(--muted); }
.small { font-size: .86rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }

/* Top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1.25rem;
  padding: 0 1rem; height: 58px;
  background: var(--navy); color: #fafafa;
}
.brand { display: flex; align-items: center; gap: .75rem; color: #fafafa; font-weight: 700; font-size: 1rem; text-decoration: none; }
.brand-logo { height: 20px; width: auto; display: block; }
.brand span { border-left: 1px solid rgba(255, 255, 255, .35); padding-left: .75rem; }
.who { display: flex; align-items: center; gap: .75rem; font-size: 14px; color: #fafafa; }
.who form { margin: 0; }
.who .logout { color: #fafafa; font-size: 12px; font-weight: 500; }
.topbar { position: sticky; top: 0; z-index: 30; padding-left: .25rem; }
.topbar-left { display: flex; align-items: center; gap: .25rem; }
.menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 4px; background: none; color: #fafafa; cursor: pointer; }
.menu-toggle:hover { background: rgba(255, 255, 255, .12); }
.menu-toggle .nav-icon { width: 24px; height: 24px; fill: currentColor; }

/* Left menu */
.shell-body { display: flex; align-items: flex-start; }
.sidenav {
  position: sticky; top: 58px; flex: 0 0 auto; width: 0; height: calc(100vh - 58px);
  overflow: hidden; background: #dadde0; transition: width .2s ease;
}
.nav-open .sidenav { width: 245px; }
.no-anim .sidenav { transition: none; }
.nav { display: flex; flex-direction: column; width: 245px; }
.nav-link {
  display: flex; align-items: center; gap: 8px; height: 48px; padding: 14px;
  background: var(--band); border-bottom: 1px solid #9b9b9b;
  color: var(--tile-ink); text-decoration: none; text-transform: uppercase; font-size: 16px; white-space: nowrap;
}
.nav-link .nav-icon { width: 22px; height: 22px; flex: 0 0 auto; fill: currentColor; }
.nav-link:hover { background: #d3d8de; }
.nav-link.active { background: #fff; color: var(--navy); font-weight: 700; box-shadow: inset 4px 0 0 var(--brand); }
.shell-body > .page { flex: 1; min-width: 0; }
.sidenav-scrim { display: none; }

@media (max-width: 800px) {
  .sidenav { position: fixed; left: 0; z-index: 25; }
  .nav-open .sidenav-scrim { display: block; position: fixed; inset: 58px 0 0 0; z-index: 20; background: rgba(0, 0, 0, .3); }
  .who span { display: none; }
}

.page { max-width: 1400px; margin: 0 auto; padding: 1.25rem; }

/* Flash */
.flash { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.flash-notice { background: var(--ok-bg); color: var(--ok); }
.flash-alert { background: var(--bad-bg); color: var(--bad); }
.flash-warning { background: var(--warn-bg); color: var(--warn); }

/* Page header */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.page-head .actions form { margin: 0; }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: .25rem; }

/* Cards and grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.card.narrow { max-width: 460px; margin: 3rem auto; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.stats { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 1rem; }
.stat { background: var(--tile); border-radius: var(--radius); padding: .6rem .75rem; text-align: center; color: var(--tile-ink); display: flex; flex-direction: column; justify-content: center; }
.stat .value { order: 1; font-size: 24px; font-weight: 400; font-variant-numeric: tabular-nums; }
.stat .label { order: 2; font-size: 15px; }
.stat .sub { order: 3; color: var(--muted); font-size: .8rem; }

.headline { font-size: 1.15rem; font-weight: 700; padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.headline.ok { background: var(--ok-bg); color: var(--ok); }
.headline.bad { background: var(--bad-bg); color: var(--bad); }
.headline.need { background: var(--band); color: var(--navy); }

.settings-grid { display: grid; gap: .6rem 1rem; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); margin-top: .5rem; }
.settings-grid .field { display: grid; gap: .2rem; font-size: .85rem; font-weight: 600; }
.settings-grid input, .settings-grid select { min-height: 40px; }
input.overridden, select.overridden { border-color: var(--warn); background: var(--warn-bg); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  min-height: var(--tap); padding: 0 1.1rem;
  border: 1px solid var(--field-line); border-radius: 4px; background: #fff; color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--band); }
.btn-primary { background: var(--brand); color: #fafafa; }
.btn-primary:hover { background: var(--navy); }
.btn-danger { background: var(--danger); color: #fafafa; }
.btn-danger:hover { background: #d40000; }
.btn-small { min-height: 32px; padding: 0 .7rem; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { background: var(--disabled); border-color: var(--disabled); color: var(--disabled-ink); cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; text-decoration: underline; }
form.inline { display: inline; margin: 0; }

/* Tabs */
.tabs { display: flex; gap: 0; background: var(--band); border-radius: var(--radius); margin-bottom: 1rem; flex-wrap: wrap; overflow: hidden; }
.tab {
  display: inline-flex; align-items: center; height: 46px; padding: 0 14px;
  color: var(--tile-ink); text-decoration: none; border-bottom: 3px solid transparent; font-size: 15px;
}
.tab:hover { background: #d3d8de; }
.tab.active { color: var(--navy); font-weight: 700; background: #fff; border-bottom-color: var(--brand); }

/* Forms */
.form { display: grid; gap: .9rem; }
.form label, label.field { display: grid; gap: .3rem; font-weight: 400; font-size: 16px; }
.form .hint, .hint { font-weight: 400; color: var(--muted); font-size: .84rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=file], select, textarea {
  min-height: 36px; padding: .3rem 8px; font: inherit; font-size: 14px; color: inherit;
  border: 1px solid var(--field-line); border-radius: 2px; background: #fff; width: 100%;
}
input[disabled], select[disabled], textarea[disabled] { background: #bdbdbd; color: #767676; }
textarea { min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #7fc3e6; border-color: var(--brand); }
.form-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.form-actions.end { justify-content: flex-end; margin-bottom: 1rem; }
.save-bar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.save-bar .check-line { display: flex; align-items: center; gap: .5rem; width: fit-content; margin: 0; font-weight: 400; min-height: var(--tap); }
.form label.check-line { display: flex; align-items: center; gap: .5rem; width: fit-content; min-height: var(--tap); }
.checks { display: grid; gap: .4rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.checks label { display: flex; align-items: center; gap: .5rem; font-weight: 400; min-height: 36px; }
.run-settings .inventory-groups { margin-top: 1rem; }
.run-settings .inventory-groups h3 { margin-top: 0; }
.group-picker { display: grid; gap: .5rem; }
.group-picker-add { display: flex; gap: .5rem; align-items: flex-start; max-width: 28rem; }
.group-picker-field { position: relative; flex: 1; min-width: 0; }
label:has(.item-picker) { position: relative; z-index: 30; }
.item-picker { position: relative; }
.group-picker-suggestions, .item-picker-suggestions {
  position: absolute; z-index: 20; top: calc(100% + 2px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--field-line); border-radius: 2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .08); max-height: 220px; overflow: auto;
}
.group-picker-suggestions button, .item-picker-suggestions button {
  display: grid; gap: .05rem; width: 100%; text-align: left; background: #fff;
  border: 0; border-bottom: 1px solid var(--line); padding: .4rem .6rem; font: inherit; cursor: pointer;
}
.group-picker-suggestions button:hover, .group-picker-suggestions button.active,
.item-picker-suggestions button:hover, .item-picker-suggestions button.active { background: var(--band); }
.item-picker-suggestions .note { padding: .4rem .6rem; }
.form-actions.pager { margin-top: 1rem; }
.group-bubbles { display: flex; flex-wrap: wrap; gap: .4rem; }
.group-bubble {
  display: inline-flex; align-items: center; gap: .25rem;
  background: #e7f3fa; color: var(--navy); border-radius: 999px;
  padding: .15rem .25rem .15rem .7rem; font-weight: 700; font-size: .9rem;
}
.group-bubble.static { padding-right: .7rem; }
.group-bubble-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--navy); font-size: 1.05rem; line-height: 1; cursor: pointer;
}
.group-bubble-x:hover { background: var(--navy); color: #fff; }
input[type=checkbox] { width: 20px; height: 20px; }
.errors { background: var(--bad-bg); color: var(--bad); padding: .75rem 1rem; border-radius: 6px; }
.errors ul { margin: .25rem 0 0; padding-left: 1.2rem; }

.group-form { container-type: inline-size; container-name: group-form; }
.group-form-layout { display: grid; gap: 1.25rem; align-items: start; }
.group-form-fields { display: grid; gap: .9rem; min-width: 0; }
@container group-form (min-width: 64rem) {
  .group-form-layout { grid-template-columns: minmax(16rem, 26rem) minmax(0, 1fr); }
}

.status-picker {
  container-type: inline-size; container-name: status-picker;
  min-width: 0; margin: 0; padding: .85rem 1rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: #f7f9fb;
}
.status-picker legend { padding: 0 .35rem; font-weight: 700; color: var(--ink-strong); }
.status-mode { display: grid; gap: .5rem; margin-bottom: .35rem; grid-template-columns: 1fr; }
@container status-picker (min-width: 34rem) {
  .status-mode { grid-template-columns: 1fr 1fr; }
}
.form .status-choice, .form .status-chip {
  display: flex; align-items: center; gap: .5rem; margin: 0;
  min-height: var(--tap); padding: 0 .7rem; cursor: pointer;
  border: 1px solid var(--field-line); border-radius: 4px; background: #fff;
  font-weight: 400;
}
.form .status-choice { font-size: 15px; }
.form .status-choice:hover, .form .status-chip:hover { background: var(--band); }
.form .status-choice:has(input:checked) {
  border-color: var(--brand); background: #e1f1f9; color: var(--navy); font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--brand);
}
.form .status-choice input, .form .status-chip input {
  width: 18px; height: 18px; margin: 0; flex: 0 0 auto; accent-color: var(--brand);
}
.form .status-choice:has(input:focus-visible),
.form .status-chip:has(input:focus-visible) { outline: 2px solid #7fc3e6; outline-offset: 1px; }
.status-grid {
  display: grid; gap: .45rem;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
}
.form .status-chip { font-size: 13px; font-weight: 700; letter-spacing: .02em; min-height: 36px; }
.form .status-chip span { min-width: 0; white-space: nowrap; }
.form .status-chip:has(input:checked) {
  border-color: var(--brand); background: #e1f1f9; color: var(--navy);
  box-shadow: inset 3px 0 0 var(--brand);
}

.group-kanbans h2, .group-locations h2, .group-history h2 { margin: 0 0 .5rem; }
.group-facts { margin: 0; }
.group-facts dl { display: grid; gap: .7rem 1.5rem; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); margin: 0; }
.group-facts .wide { grid-column: 1 / -1; }
.group-facts dt { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.group-facts dd { margin: .1rem 0 0; font-weight: 700; }
.group-facts dd.plain { font-weight: 400; }
.add-item { margin: 0 0 .85rem; }
.add-item > summary { width: fit-content; list-style: none; }
.add-item > summary::-webkit-details-marker { display: none; }
.add-item > summary::marker { content: none; }
.add-item .label-open { display: none; }
.add-item[open] .label-closed { display: none; }
.add-item[open] .label-open { display: inline; }
.add-item[open] > summary { margin-bottom: .6rem; background: #fff; color: var(--ink); border-color: var(--field-line); }
.add-item[open] > summary:hover { background: var(--band); color: var(--ink); }
.add-kanban {
  display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: end; margin: 0;
  padding: .85rem 1rem .95rem; border: 1px solid #b7d7ea; border-radius: var(--radius); background: #f3f9fc;
}
.add-kanban h3 { flex: 1 0 100%; margin: 0 0 .15rem; }
.add-kanban .errors { flex: 1 0 100%; }
.add-kanban label { display: grid; gap: .2rem; font-size: 13px; font-weight: 700; min-width: 0; }
.add-kanban label.item { flex: 1 1 16rem; }
.add-kanban label.qty { flex: 0 1 6.5rem; }
.add-kanban label.source, .add-kanban label.owner { flex: 1 1 11rem; }
.add-kanban label.signal { align-self: center; display: flex; align-items: center; gap: .4rem; min-height: 36px; }
.add-kanban .source-lock { margin: 0 0 .45rem; font-size: 14px; }
.add-kanban .btn { align-self: end; }
.pattern-list { display: flex; flex-wrap: wrap; gap: .35rem; }
.pattern-list span { display: inline-flex; align-items: center; min-height: 28px; padding: 0 .55rem; border-radius: 4px; background: var(--tile); font-size: 14px; }
.group-history .table-wrap, .group-kanbans .table-wrap, .group-locations .table-wrap { margin-bottom: 0; }
.group-fit h2, .form h2 { margin: .4rem 0 .35rem; }
.group-fit h2:first-child { margin-top: 0; }
.fit-wrap { width: fit-content; max-width: 100%; }
table.fit { width: auto; min-width: 22rem; }
table.fit th { text-align: left; }
table.fit td { width: 7rem; }
table.fit td.dash { text-align: center; color: var(--muted); }
.form table.fit input[type=number] { width: 6rem; }
.form table label.rack-code { display: inline; font-weight: 700; margin: 0; }
.rack-choices td:first-child, .rack-choices th:first-child { width: 3rem; text-align: center; }

.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.filters > * { flex: 0 1 auto; }
.filters input[type=search] { min-width: 240px; }
.filters input.cart-boxes { width: 5rem; }
.next-step { background: #e1f1f9; }
table.step-lines { margin-top: .4rem; font-size: 13px; background: #fff; }

/* Carts */
.inline-form { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
label.check { display: inline-flex; align-items: center; gap: .35rem; }
.cart-preview { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: .6rem 0; }
.cart-side { border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem .8rem .8rem; background: var(--card); }
.cart-level { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin: .35rem 0; }
.cart-level-label { width: 4.5rem; font-size: 13px; color: var(--muted); }
.cart-spot { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 4px; font-size: 12px; line-height: 1.2; }
.cart-spot small { color: inherit; opacity: .8; }
.cart-box { width: 88px; height: 52px; background: #e1f1f9; border: 1px solid var(--brand); color: var(--navy); }
.cart-bin { width: 62px; height: 52px; background: #f1e9f8; border: 1px solid var(--floating); color: #4b2370; }
.cart-id { font-size: 2.6rem; font-weight: 700; color: var(--navy); letter-spacing: .04em; line-height: 1.1; }
.scan-card .scan-field { font-size: 1.4rem; min-width: 22rem; }
.scan-card .count-field { font-size: 1.4rem; width: 7rem; }
.scan-now { align-self: flex-end; padding-bottom: .5rem; }
.scan-result { border-radius: var(--radius); padding: .9rem 1.1rem; margin: 1rem 0; }
.scan-result.scan-ok { background: var(--ok-bg); }
.scan-result.scan-error { background: var(--bad-bg); color: var(--bad); }
.scan-item { font-size: 1.25rem; font-weight: 700; margin: .2rem 0; }
.scan-message { font-size: 1.35rem; margin-top: .3rem; }
.remove-count { width: 4.5rem; }
.scan-compact { padding: .6rem .9rem; display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-end; }
.scan-line { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; margin: 0; }
.scan-line label { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.scan-card .scan-line > label { flex: 0 1 28rem; }
.scan-hint { margin: 0 0 .4rem; }
.scan-feedback { margin: 0; align-self: center; }
.scan-line .scan-feedback { flex: 0 1 auto; align-self: flex-end; max-width: 36rem; }
.scan-compact .scan-field { min-width: 18rem; font-size: 1.15rem; }
.scan-compact .count-field { width: 5.5rem; font-size: 1.15rem; }
.scan-result.scan-compact-result { padding: .5rem .8rem; margin: .5rem 0; }
.scan-slots { font-size: 2rem; font-weight: 700; color: var(--navy); margin: .2rem 0; }
.cart-stage-bar { display: flex; align-items: center; gap: .75rem; margin: .35rem 0; flex-wrap: wrap; }
.cart-stage-bar p { margin: 0; }
.cart-stage-body { display: flex; align-items: flex-start; gap: 1.25rem; flex-wrap: wrap; }
.cart-and-rack { display: flex; align-items: stretch; flex-wrap: wrap; }
.rack-face-slot { display: flex; align-items: stretch; }
.rack-face-slot:empty { display: none; }
.view-separator { flex: 0 0 auto; width: 3px; margin: .5rem .9rem; border-radius: 2px; background: #9bb0c2; }
.rack-face { border: 1px solid var(--line); border-radius: var(--radius); padding: .25rem .45rem .35rem; background: var(--card); margin: .5rem 0; }
.rack-face-title { font-size: 12px; font-weight: 700; color: var(--ink-strong); }
.rack-face-meta { font-size: 11px; color: var(--muted); }
.rack-face-caption { font-size: 12px; font-weight: 700; color: var(--navy); margin: 1px 0 4px; }
.rack-face-level { display: flex; align-items: center; gap: 3px; margin: 3px 0; }
.rack-face-level-label { width: 1rem; font-size: 11px; color: var(--muted); text-align: right; margin-right: 2px; }
.rack-face-spot { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; height: 34px;
  border-radius: 3px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 11px; }
.rack-face-spot.rack-column { width: 52px; }
.rack-face-spot.rack-bin { width: 26px; }
.rack-face .rack-target { background: #ffd54f; border: 2px solid #c77700; color: #3a2600; box-shadow: 0 0 0 2px rgba(199, 119, 0, .3); }
#optimize-table { flex: 0 0 auto; }
.optimize-table { margin: .5rem 0; }
.optimize-table table { width: auto; min-width: 16rem; }
.cart-spot-form { display: inline-flex; margin: 0; }
button.cart-map-spot { padding: 0; font: inherit; cursor: pointer; }
.cart-optimizing button.cart-map-spot { box-shadow: 0 0 0 2px var(--brand); }
.cart-map { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-start; margin: .5rem 0; }
.cart-map-side { border: 1px solid var(--line); border-radius: var(--radius); padding: .25rem .45rem .35rem; background: var(--card); }
.cart-map-title { font-size: 12px; font-weight: 700; color: var(--ink-strong); margin-bottom: 2px; }
.cart-map-level { display: flex; align-items: center; gap: 3px; margin: 3px 0; }
.cart-map-level-label { width: 1rem; font-size: 11px; color: var(--muted); text-align: right; margin-right: 2px; }
.cart-map-spot { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; height: 34px;
  border-radius: 3px; font-size: 11px; line-height: 1.15; white-space: nowrap; overflow: hidden; }
.cart-map-spot small { font-size: 10px; }
.cart-map-spot.cart-box { width: 74px; height: 34px; }
.cart-map-spot.cart-bin { width: 40px; height: 34px; }
.cart-map .cart-empty { background: #fff; border-style: dashed; color: var(--muted); }
.cart-map .cart-delivered { background: var(--tile); border-color: var(--line); color: var(--muted); }
.cart-map .cart-target { background: #ffd54f; border: 2px solid #c77700; color: #3a2600; box-shadow: 0 0 0 2px rgba(199, 119, 0, .3); }
.filters select { width: auto; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: .5rem .65rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--band); font-size: 14px; font-weight: 500; text-transform: uppercase; color: var(--ink); white-space: nowrap; position: sticky; top: 0; }
tbody tr:hover { background: #f4f7fa; }
tr.row-error { background: #fff7f6; }
tr.row-warning { background: #fffbef; }
tr.row-dim td { color: var(--muted); }
tr.group-start td { border-top: 2px solid #c4cad5; }
tfoot td { font-weight: 700; background: #f7f8fa; }
td input[type=number], td select { min-height: 38px; width: auto; min-width: 70px; }
td .inline-edit { display: flex; gap: .35rem; align-items: center; }
td .inline-edit input { width: 90px; }
table.compact td, table.compact th { padding: .35rem .5rem; }
.row-links { display: flex; flex-wrap: wrap; gap: .35rem .75rem; }
.fleet-table th:first-child, .fleet-table td.fleet-check { width: 2.5rem; text-align: center; vertical-align: middle; }
.fleet-table input.fleet-quantity { width: 5rem; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.badge-draft { background: #e1f1f9; color: var(--brand); }
.badge-final { background: var(--navy); color: #fff; }
.badge-manual { background: var(--warn-bg); color: var(--warn); }
.badge-edited { background: #eef0f4; color: var(--muted); }
.badge-pin { background: #fde9d7; color: #96440b; }
.purpose-kanban { background: #e1f1f9; color: var(--kanban); }
.purpose-floating { background: #f1e7fa; color: var(--floating); }
.purpose-spare, .purpose-unassigned { background: #eef0f4; color: var(--muted); }
.purpose-consolidation { background: #fdf0d8; color: #8a5a00; }
.count-add { color: var(--ok); }
.count-error { color: var(--bad); }
.count-warning { color: var(--warn); }

details summary { cursor: pointer; color: var(--brand); min-height: 32px; display: flex; align-items: center; }
details[open] summary { margin-bottom: .4rem; }
details .override-form { display: grid; gap: .4rem; min-width: 220px; }

/* Utilization bars */
.bar { height: 8px; border-radius: 4px; background: #e6e9ef; overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; background: var(--brand); }
.bar.over > span { background: var(--bad); }
.pill { display: inline-block; padding: .1rem .45rem; border-radius: 999px; font-size: .85rem; background: var(--tile); }
.pill-healthy { background: var(--ok-bg); color: var(--ok); }
.pill-low { background: var(--warn-bg); color: var(--warn); }
.pill-signaled, tr.stale { background: var(--bad-bg); }
.pill-in_transit, .pill-pending, .pill-wip { background: #e7f3fa; color: var(--navy); }
.pill-signals_off { background: var(--tile); color: var(--muted); }

/* Rack elevation */
.elevation { display: grid; gap: 6px; background: #3b4252; padding: 10px; border-radius: var(--radius); max-width: 1100px; }
.shelf { display: grid; grid-template-columns: 70px 1fr; gap: 6px; align-items: stretch; }
.shelf-label { color: #e5e9f0; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: .85rem; }
.shelf-slots { display: grid; gap: 4px; }
.slot { background: #eceff4; border-radius: 4px; padding: 8px 4px; text-align: center; font-size: .78rem; font-weight: 600; font-family: ui-monospace, Consolas, monospace; min-height: 48px; display: flex; align-items: center; justify-content: center; }
.slot.kind-shelf { background: #d8e3f4; }
.slot.kind-column { background: #dfeedd; }
.slot.kind-bin { background: #f6e7cf; }

.mini-rack-grid { display: grid; gap: 4px; grid-template-columns: 60px repeat(6, 1fr); }
.mini-rack-grid .cell { padding: 6px; border-radius: 4px; font-size: .78rem; text-align: center; background: #eef0f4; }
.mini-rack-grid .cell.kanban { background: #d5e3fa; }
.mini-rack-grid .cell.floating { background: #e8d9f6; }
.mini-rack-grid .cell.head { background: none; font-weight: 700; color: var(--muted); }

/* Material map */
.legend { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.legend-chip { display: inline-flex; align-items: center; gap: .45rem; min-height: var(--tap); padding: 0 .8rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: inherit; cursor: pointer; }
.legend-chip.static { cursor: default; }
.legend-chip.active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.swatch { width: 16px; height: 16px; border-radius: 3px; display: inline-block; }
.map-cell { text-align: left; }
.map-cell .mix, .map-loc { display: flex; background: #e3e6ec; overflow: hidden; }
.map-cell .mix { height: 8px; border-radius: 3px; margin-top: 4px; }
.map-extra { display: grid; gap: 4px; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
.map-extra .cell { padding: 6px; border-radius: 4px; font-size: .78rem; background: #eef0f4; }
.rack-cards { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-bottom: 1rem; }
.rack-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .7rem; }
.rack-card-head { display: flex; gap: .4rem; align-items: center; margin-bottom: .4rem; }
.rack-body { display: flex; flex-direction: column; justify-content: space-between; height: 150px; background: #3b4252; padding: 4px; border-radius: 4px; }
.map-shelf { display: flex; gap: 2px; align-items: flex-end; flex: 1; border-bottom: 2px solid #8a93a3; padding-top: 3px; }
.map-shelf-no { width: 16px; height: 18px; color: #e5e9f0; font-size: .7rem; display: flex; align-items: center; justify-content: center; }
.map-loc { flex: 1; height: 18px; border-radius: 2px; }
.map-loc > span, .mix > span { display: block; height: 100%; }
.map-loc > span + span { box-shadow: inset 1px 0 0 #fff; }
.rack-card .map-loc, .rack-zoom-card .map-loc { cursor: pointer; }
.rack-card .map-loc:hover, .rack-card .map-loc:focus-visible,
.rack-zoom-card .map-loc:hover, .rack-zoom-card .map-loc:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.rack-card .map-loc.selected, .rack-zoom-card .map-loc.selected { outline: 2px solid #ffd54f; outline-offset: 1px; }
.map-detail {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 40; width: min(860px, calc(100vw - 2rem)); max-height: 88vh; overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); padding: .75rem 1rem;
}
.map-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .5rem; }
.map-detail-close { background: none; border: 0; color: var(--muted); font-size: 1.4rem; line-height: 1; padding: 0 .25rem; min-height: 0; cursor: pointer; }
.map-detail-items { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.map-detail-item { border: 1px solid var(--line); border-radius: var(--radius); padding: .45rem .6rem; font-size: .85rem; }
.map-detail-item.picked { background: #fff7d6; border-color: #f0d98a; }
.map-detail-item-head { display: flex; align-items: center; gap: .5rem; }
.map-detail-swatches { display: inline-flex; gap: 2px; flex: none; }
.map-detail-item-head .swatch { width: 12px; height: 12px; border-radius: 2px; flex: none; }
.map-detail-item-title { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .5rem; }
.map-detail-item-head .btn { flex: none; margin-left: auto; }
.map-detail-figures { display: flex; flex-wrap: wrap; gap: .1rem 1.25rem; margin: .3rem 0 .15rem; }
.map-detail-figures div { display: flex; gap: .35rem; align-items: baseline; }
.map-detail-figures dt { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.map-detail-figures dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.map-detail .moved-note { color: var(--warn); }
@media (max-width: 640px) {
  .map-detail { right: .5rem; left: .5rem; bottom: .5rem; width: auto; max-height: 90vh; padding: .6rem .7rem; }
  .map-detail-item-head { flex-wrap: wrap; }
}
.map-loc { position: relative; }
.map-loc.moved::after {
  content: ""; position: absolute; top: 0; right: 0; width: 0; height: 0;
  border-style: solid; border-width: 0 8px 8px 0; border-color: transparent #ffd54f transparent transparent;
}
.moving .rack-card .map-loc.move-blocked, .moving .rack-zoom-card .map-loc.move-blocked { opacity: .3; cursor: not-allowed; }
.moving .rack-card .map-loc.move-target, .moving .rack-zoom-card .map-loc.move-target { background: #a5d6a7; outline: 2px solid #66bb6a; outline-offset: 0; cursor: copy; }
.moving .rack-card .map-loc.move-target:hover, .moving .rack-card .map-loc.move-target:focus-visible,
.moving .rack-zoom-card .map-loc.move-target:hover, .moving .rack-zoom-card .map-loc.move-target:focus-visible { background: #66bb6a; outline-color: #fff; }
.moving .rack-card .map-loc.move-source, .moving .rack-zoom-card .map-loc.move-source { opacity: 1; outline: 2px dashed #ffd54f; outline-offset: 1px; cursor: default; }
.rack-card .map-loc.focus, .rack-zoom-card .map-loc.focus { outline: 3px solid #ffd54f; outline-offset: 2px; }
.move-bar {
  position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 45; width: min(720px, calc(100vw - 2rem));
  display: flex; gap: 1rem; align-items: center; justify-content: space-between;
  background: var(--navy); color: #fff; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); padding: .75rem 1rem;
}
.move-bar[hidden] { display: none; }
.move-error { margin-top: .4rem; padding: .35rem .6rem; border-radius: 4px; background: var(--bad-bg); color: var(--bad); font-size: .85rem; }
.card-head-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.badge-moved { background: #fff4d6; color: var(--warn); }
.badge-skipped { background: var(--bad-bg); color: var(--bad); }
[data-material].dim { opacity: .12; }
.no-match { opacity: .35; }
.map-hidden { visibility: hidden; }
.rack-floor-wrap { background: none; border: 0; }
.rack-floor { display: grid; gap: 6px; grid-template-columns: 56px repeat(6, minmax(165px, 1fr)); align-items: start; }
.rack-floor > .cell.head { font-weight: 700; color: var(--muted); font-size: .8rem; text-align: center; align-self: center; }
.rack-floor .rack-card { padding: .45rem .5rem; }
.floor-gap { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.floor-gap.walkway {
  height: 24px; margin: 6px 0; border-radius: 3px; color: #4a4a4a;
  background: repeating-linear-gradient(135deg, #cfcfcf 0 10px, #b8b8b8 10px 20px);
  border-top: 1px solid #9e9e9e; border-bottom: 1px solid #9e9e9e;
}
.floor-gap.walkway span { background: #cfcfcf; padding: 0 8px; border-radius: 3px; }
.floor-gap.not-facing {
  min-height: 28px; margin: 2px 0; padding: 4px 10px; color: #003e69; background: #fff;
  border: 1px dashed #0c7bb3; border-radius: 3px; letter-spacing: .02em; text-transform: none; font-size: .75rem;
}
.floor-gap.back-to-back { height: 4px; margin: 3px 0; background: #9e9e9e; border-radius: 2px; position: relative; }
.floor-gap.back-to-back span { position: absolute; left: 0; top: 50%; transform: translateY(-50%); background: #9e9e9e; color: #fff; padding: 1px 5px; border-radius: 3px; font-size: .55rem; white-space: nowrap; }
.view-switch { display: flex; gap: .5rem; margin-bottom: 1rem; }
.view-switch a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 .9rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; text-decoration: none; color: inherit; }
.view-switch a.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.map-cell[data-rack] { cursor: pointer; }
.rack-card[data-rack] { cursor: pointer; }
.rack-body.fit-shelves { overflow: hidden; }
.rack-body.fit-shelves .map-shelf { align-items: stretch; min-height: 0; }
.rack-body.fit-shelves .map-loc { height: auto; min-height: 8px; flex: 1 1 auto; }
.map-shelf-bars { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; min-height: 0; }
.map-shelf-slots { display: flex; gap: 2px; flex: 1; min-height: 0; }
.rack-body.fit-shelves .map-shelf-slots .map-loc { height: 100%; }
.map-shelf-bars:has(.map-shelf-slots) > .map-span { flex: 0 0 32%; }
[data-current-loc] { background: #fff; }
[data-current-loc].too-thin { background: color-mix(in srgb, #000 18%, #fff); }
[data-current-loc].too-thin > span { opacity: 0; }
button.rack-open { background: none; border: 0; padding: 0; margin: 0; min-height: 0; font: inherit; font-weight: 700; color: inherit; cursor: pointer; text-align: left; }
button.rack-open:hover, button.rack-open:focus-visible { text-decoration: underline; }
.rack-modal { width: min(1100px, calc(100vw - 2rem)); height: min(92vh, 900px); border: 0; padding: 0; overflow: hidden; border-radius: var(--radius); }
.rack-modal[open] { display: flex; flex-direction: column; }
.rack-modal::backdrop { background: rgba(0, 0, 0, .45); }
.rack-modal-head { display: flex; align-items: center; gap: .75rem; flex: none; padding: .6rem 1rem; border-bottom: 1px solid var(--line); }
.rack-modal-head > strong { flex: 1; min-width: 0; }
.rack-view-switch { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.rack-view-switch button { background: #fff; border: 0; border-radius: 0; min-height: 34px; padding: 0 .9rem; font: inherit; font-weight: 700; color: inherit; cursor: pointer; }
.rack-view-switch button + button { border-left: 1px solid var(--line); }
.rack-view-switch button.active { background: var(--navy); color: #fff; }
.rack-view-switch button:disabled { opacity: .4; cursor: not-allowed; }
.rack-zoom-frame { flex: 1; min-height: 0; overflow: hidden; padding: .75rem 1rem; }
.rack-zoom-frame[hidden], .rack-render[hidden], .rack-render figure[hidden] { display: none !important; }
.rack-render { flex: 1; min-height: 0; overflow: auto; padding: .75rem 1rem 1rem; }
.rack-render figure { margin: 0 auto; width: min(100%, 980px); }
.rack-render img { display: block; width: 100%; height: auto; max-height: calc(92vh - 9rem); object-fit: contain; background: #eef0f4; border-radius: 4px; }
.rack-render figcaption { margin-top: .45rem; color: var(--muted); font-size: .85rem; }
.rack-modal [data-material].dim { opacity: 1; }
.rack-zoom-stage { width: 960px; }
.rack-zoom-stage .rack-body { height: 640px; }
.rack-card.spare .rack-body { background: #c9ccd2; }
.rack-card.spare { background: #f4f5f7; color: var(--muted); }

.empty { padding: 2rem; text-align: center; color: var(--muted); }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 32px 1fr; gap: .75rem; align-items: start; }
.steps li::before { content: counter(step); width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.steps li.done::before { content: "✓"; background: var(--ok); }

@media print {
  .topbar, .sidenav, .tabs, .actions, .filters, form { display: none !important; }
  .page { padding: 0; }
}

.delivery-lead { display: flex; align-items: flex-start; gap: 1rem; }
.delivery-lead > .walk-plan-open { margin-left: auto; flex: none; }
.location-pair { display: flex; gap: 1rem; flex: 1 1 auto; min-width: 0; }
.location-box { flex: 1 1 14rem; min-width: 0; border: 2px solid var(--line); border-radius: var(--radius); padding: .65rem .9rem .75rem; background: #fff; }
.location-box-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.location-box-code { min-height: 2.6rem; margin-top: .15rem; font-size: 1.85rem; font-weight: 700; line-height: 1.15; color: var(--navy); word-break: break-all; }
.location-current { border-color: var(--navy); background: #f4f7fa; }
.location-next { border-color: var(--brand); background: #e1f1f9; }
.location-next .location-box-label { color: var(--brand); }
.walk-modal { width: min(1100px, calc(100vw - 2rem)); max-height: min(92vh, 900px); border: 0; padding: 0; overflow: auto; border-radius: var(--radius); }
.walk-modal::backdrop { background: rgba(0, 0, 0, .45); }
.walk-modal-body { padding: .75rem 1rem 1rem; }
.walk-modal .walk-map-frame { margin-bottom: 0; }
.walk-map-frame { margin-bottom: 1rem; }
.walk-legend { margin: 0 0 .4rem; }
.walk-floor { grid-template-columns: 14px 60px repeat(6, 1fr) 14px; }
.walk-floor > .floor-gap { grid-column: 1 / -1; }
.walk-floor > .floor-gap.walkway { display: grid; grid-template-columns: subgrid; margin: 0; align-items: center; }
.walk-floor > .floor-gap.walkway > * { grid-row: 1; }
.walk-end { background: #e6e6e6; border-radius: 2px; align-self: stretch; }
.walk-lane { grid-column: 3 / 9; justify-self: center; z-index: 3; }
.walk-route { height: 3px; background: var(--navy); align-self: center; z-index: 1; border-radius: 2px; }
.walk-vert { width: 3px; background: var(--navy); justify-self: center; z-index: 2; }
.walk-dot, .walk-x, .walk-you { justify-self: center; align-self: center; z-index: 4; }
.walk-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.walk-x { width: 14px; height: 14px; background: linear-gradient(45deg, transparent 42%, var(--navy) 42% 58%, transparent 58%), linear-gradient(-45deg, transparent 42%, var(--navy) 42% 58%, transparent 58%); }
.walk-you { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--ok); }
.tally { list-style: none; padding: 0; margin: .5rem 0 1rem; }
.tally li { font-size: 1.05rem; }
.tally li.ok { color: var(--ok); }

.tool-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.area-studio { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1rem; align-items: start; }
.area-inspector { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: grid; gap: .75rem; align-content: start; position: sticky; top: .75rem; }
.area-inspector label { display: grid; gap: .3rem; font-size: 14px; }
.area-inspector .rack-picks { margin: 0; font-weight: 700; }
.area-inspector p { margin: 0; }
.area-inspector .errors { margin: 0; padding: .55rem .7rem; }
.area-inspector { min-width: 0; }
.area-inspector input, .area-inspector select { width: 100%; min-width: 0; box-sizing: border-box; }
.area-inspector .form-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; }
.field-head { display: inline-flex; align-items: center; gap: .35rem; }
.info-tip {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 15px; height: 15px; border-radius: 50%; background: #e3edf4; color: #0c7bb3;
  font: italic 700 10px/1 Georgia, serif; cursor: help; user-select: none;
}
.info-tip:hover, .info-tip:focus { background: #0c7bb3; color: #fff; outline: none; }
.info-tip::after {
  content: attr(data-tip); position: absolute; top: calc(100% + 6px); right: -8px; z-index: 30;
  width: 250px; padding: .5rem .6rem; border-radius: 4px; background: #1f2d3a; color: #fff;
  font: 400 12px/1.4 "Noto Sans", sans-serif; font-style: normal; text-align: left; white-space: normal;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .2); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .12s;
}
.info-tip:hover::after, .info-tip:focus::after { opacity: 1; visibility: visible; }
.room-scroll { overflow: auto; max-height: calc(100vh - 220px); padding-bottom: .25rem; }
.room-grid {
  position: relative; display: grid; gap: 0; width: max-content; padding: 6px;
  background: repeating-linear-gradient(45deg, #f3f3f3, #f3f3f3 4px, #fafafa 4px, #fafafa 8px);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.room-grid.room-editing { background: #f7f8f9; }
.room-axis { display: flex; align-items: center; justify-content: flex-start; color: var(--muted); font-size: 9px; font-weight: 700; line-height: 1; overflow: visible; }
.room-axis.labeled { z-index: 3; }
.room-axis.row { justify-content: flex-end; padding-right: 2px; }
.room-cell {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-width: 0; min-height: 0; border-radius: 1px; font-size: 10px; font-weight: 700; line-height: 1;
}
button.room-cell { padding: 0; border: 0; font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; background: transparent; }
button.room-cell:hover { filter: none; }
.room-cell.outside { background: transparent; }
.room-cell.walkway { background: #f4f7f9; }
.room-cell.walkway.guide { box-shadow: inset -1px 0 0 rgba(0, 62, 105, .06); }
.room-editing .room-cell.walkway { background: transparent; box-shadow: none; }
.room-editing .room-cell.walkway.guide { box-shadow: inset -1px 0 0 rgba(0, 62, 105, .045); }
.room-editing .room-cell.outside { background: repeating-linear-gradient(45deg, #f0f0f0, #f0f0f0 3px, #f7f7f7 3px, #f7f7f7 6px); }
.room-editing button.room-cell.walkway:hover,
.room-editing button.room-cell.outside:hover { background: rgba(0, 62, 105, .05); }
.room-rack {
  z-index: 2; border-radius: 2px; overflow: hidden; cursor: grab; touch-action: none;
  box-shadow: 0 0 0 1px rgba(0, 20, 40, .55), 0 1px 2px rgba(0, 20, 40, .35);
}
.room-rack.is-dragging { cursor: grabbing; z-index: 6; }
.room-rack.is-illegal { outline: 2px solid var(--danger); outline-offset: 1px; }
.room-rack .rack-code { padding: 0 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; letter-spacing: -.02em; }
.room-cell.config-none { background: #16324f; color: #fff; }
.room-cell.config-1 { background: #003e69; color: #fff; }
.room-cell.config-2 { background: #0c7bb3; color: #fff; }
.room-cell.config-3 { background: #5b3a8c; color: #fff; }
.room-cell[class*="config-"]:not(.config-none):not(.config-1):not(.config-2):not(.config-3):not(.config-4):not(.config-5) { background: #6b6b2f; color: #fff; }
.room-cell.config-4 { background: #2f7d4f; color: #fff; }
.room-cell.config-5 { background: #b35a1f; color: #fff; }
.room-cell.is-selected { outline: 2px solid var(--warn); outline-offset: 1px; z-index: 4; }
.room-marquee {
  position: absolute; z-index: 7; pointer-events: none; box-sizing: border-box;
  border: 1px solid #0c7bb3; background: rgba(12, 123, 179, .18);
}
.room-cell .face { position: absolute; background: #fff; border-radius: 1px; }
.room-cell.face-north .face { top: 1px; left: 12%; right: 12%; height: 4px; }
.room-cell.face-south .face { bottom: 1px; left: 12%; right: 12%; height: 4px; }
.room-cell.face-west .face { left: 1px; top: 12%; bottom: 12%; width: 4px; }
.room-cell.face-east .face { right: 1px; top: 12%; bottom: 12%; width: 4px; }
.room-cell.face-south .face.opposite { top: 1px; bottom: auto; left: 12%; right: 12%; height: 4px; width: auto; }
.room-cell.face-north .face.opposite { bottom: 1px; top: auto; left: 12%; right: 12%; height: 4px; width: auto; }
.room-cell.face-west .face.opposite { right: 1px; left: auto; top: 12%; bottom: 12%; width: 4px; height: auto; }
.room-cell.face-east .face.opposite { left: 1px; right: auto; top: 12%; bottom: 12%; width: 4px; height: auto; }
.room-rack.two-faced .rack-code { position: absolute; display: flex; align-items: center; justify-content: center; }
.room-rack.two-faced .rack-divider { position: absolute; border: 0 dashed rgba(255, 255, 255, .8); }
.room-rack.two-faced.face-west .rack-code, .room-rack.two-faced.face-east .rack-code { top: 0; bottom: 0; width: 50%; }
.room-rack.two-faced.face-west .rack-code { left: 0; }
.room-rack.two-faced.face-west .rack-code.other-side { left: 50%; }
.room-rack.two-faced.face-east .rack-code { left: 50%; }
.room-rack.two-faced.face-east .rack-code.other-side { left: 0; }
.room-rack.two-faced.face-north .rack-code, .room-rack.two-faced.face-south .rack-code { left: 0; right: 0; height: 50%; }
.room-rack.two-faced.face-north .rack-code { top: 0; }
.room-rack.two-faced.face-north .rack-code.other-side { top: 50%; }
.room-rack.two-faced.face-south .rack-code { top: 50%; }
.room-rack.two-faced.face-south .rack-code.other-side { top: 0; }
.room-rack.two-faced.face-west .rack-divider, .room-rack.two-faced.face-east .rack-divider { left: 50%; top: 3px; bottom: 3px; border-left-width: 1px; }
.room-rack.two-faced.face-north .rack-divider, .room-rack.two-faced.face-south .rack-divider { top: 50%; left: 3px; right: 3px; border-top-width: 1px; }
.card.config-card { max-width: 820px; }
.config-rendering { margin-top: 1rem; }
.config-rendering h2 { margin: 0 0 .5rem; }
.config-rendering .rack-render { padding: 0; overflow: visible; }
.config-rendering .rack-render img { max-height: 70vh; }
.form.config-form { gap: .55rem; }
.config-layout { display: grid; gap: .65rem 1.25rem; align-items: start; }
.config-main { display: grid; gap: .5rem; min-width: 0; }
.config-main .form-row { gap: .5rem .75rem; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); }
.config-main .form-row .config-fixed { align-self: end; margin-bottom: .4rem; }
.config-side { padding-top: .15rem; }
.config-side .footprint-preview { margin: 0; gap: 1rem; }
.config-side .hint { margin: .35rem 0 0; }
.config-fixed { margin: 0; }
@media (min-width: 760px) {
  .config-layout { grid-template-columns: minmax(0, 1fr) 11.5rem; }
}
fieldset.config-links { border: 1px solid var(--line); border-radius: var(--radius); margin: 0; padding: .45rem .7rem .6rem; }
fieldset.config-links legend { font-weight: 700; padding: 0 .3rem; }
fieldset.config-links .hint { margin: .4rem 0 0; }

fieldset.footprint { border: 1px solid #d5dee6; border-radius: 4px; padding: .6rem .9rem .8rem; margin: .4rem 0; }
fieldset.footprint legend { font-weight: 600; padding: 0 .3rem; }
.footprint-preview { display: flex; gap: 1.5rem; align-items: flex-end; margin: .6rem 0 .2rem; }
.footprint-preview figure { margin: 0; text-align: center; font-size: .8rem; color: var(--muted); }
.footprint-box { position: relative; background-color: #2f6f4e; background-image: linear-gradient(to right, rgba(255,255,255,.15) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,.15) 1px, transparent 1px); border-radius: 2px; margin: 0 auto .3rem; }
.footprint-box.standard { background-color: #003e69; }
.footprint-box .face { position: absolute; left: 1px; top: 12%; bottom: 12%; width: 4px; background: #fff; border-radius: 1px; }
.footprint-box .face.opposite { display: none; left: auto; right: 1px; }
.footprint-box.face-east .face { left: auto; right: 1px; }
.footprint-box.face-east .face.opposite { left: 1px; right: auto; }
.footprint-box.face-north .face, .footprint-box.face-south .face { left: 12%; right: 12%; width: auto; height: 4px; }
.footprint-box.face-north .face { top: 1px; bottom: auto; }
.footprint-box.face-north .face.opposite { top: auto; bottom: 1px; }
.footprint-box.face-south .face { top: auto; bottom: 1px; }
.footprint-box.face-south .face.opposite { top: 1px; bottom: auto; }
.footprint-box.two-fronts .face.opposite { display: block; }
.room-legend { display: flex; gap: .75rem 1rem; flex-wrap: wrap; list-style: none; padding: 0; margin: .6rem 0 .2rem; font-size: .84rem; color: var(--muted); }
.room-legend .swatch { display: inline-block; width: 14px; height: 14px; border-radius: 2px; vertical-align: -2px; margin-right: 4px; }
.room-legend .swatch.outside { background: repeating-linear-gradient(45deg, #ececec, #ececec 3px, #f7f7f7 3px, #f7f7f7 6px); border: 1px dashed #bdbdbd; }
.room-legend .swatch.walkway { background: #f4f7f9; box-shadow: inset 0 0 0 1px #d5dee6; }
.room-legend .swatch.config-none { background: #16324f; }
.room-legend .swatch.config-1 { background: #003e69; }
.room-legend .swatch.config-2 { background: #0c7bb3; }
.room-legend .swatch.config-3 { background: #5b3a8c; }
.room-legend .swatch.config-4 { background: #2f7d4f; }
.room-legend .swatch.config-5 { background: #b35a1f; }
.room-legend .swatch.config-other { background: #6b6b2f; }
@media (max-width: 800px) {
  .area-studio { grid-template-columns: 1fr; }
}

