:root {
  --ink: #1c1917;
  --muted: #57534e;
  --line: #e6dfd4;
  --paper: #f6f3ee;
  --card: #fffdf9;
  --copper: #9a3412;
  --copper-soft: #fff1e8;
  --ok: #166534;
  --ok-bg: #ecf8f0;
  --warn: #9a3412;
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.45 "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
a { color: var(--copper); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 { font-weight: 650; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.15rem; }

.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px 24px;
  background: #1c1917;
  color: #f6f3ee;
}
.top a { color: inherit; text-decoration: none; }
.top-links { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; font-size: 0.92rem; }
.top-links form { margin: 0; }
.top-exit {
  background: transparent;
  color: #f6f3ee;
  border: 1px solid #78716c;
  padding: 4px 10px;
}
.brand { font-weight: 700; }
.brand small { display: block; font-weight: 400; color: #d6d3d1; font-size: 0.78rem; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 20px 64px; }
.msg {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid #b7e4c7;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}
.error {
  background: #fdecec;
  color: #8c2f2f;
  border: 1px solid #f3c0c0;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}
.card h2 { margin-bottom: 12px; }
.sheet {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.sheet-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  height: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 10px;
  background: #fffdf9;
}
.sheet-main { flex: 1; min-width: 0; }
.sheet-title { margin: 0; font-weight: 650; }
.sheet-sum { margin: 2px 0 0; color: var(--muted); font-size: 0.92rem; white-space: pre-line; overflow-wrap: anywhere; }
.sheet-sum[data-more] { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.sheet-tip {
  position: fixed;
  z-index: 40;
  max-width: min(36rem, calc(100vw - 16px));
  max-width: min(36rem, calc(100dvw - 16px));
  max-height: min(50vh, 20rem);
  max-height: min(50dvh, 20rem);
  overflow: auto;
  padding: 10px 12px;
  background: var(--card);
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(28, 25, 23, 0.16);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
}
.sheet-tip[hidden] { display: none; }
.sheet-actions { display: flex; flex: none; align-items: center; gap: 6px; }
.sheet-actions .button,
.sheet-actions button { margin: 0; }
.sheet-row .button { flex: none; }
.mark-rail { border-left-color: #78716c; }
.mark-feed { border-left-color: #c2410c; }
.mark-link { border-left-color: #a16207; }
.mark-n { border-left-color: #0284c7; }
.mark-pe { border-left-color: #65a30d; }
.mark-sign { border-left-color: #a8a29e; }
.mark-cable { border-left-color: #92400e; }
.mark-note { border-left-color: #d6d3d1; }
.editor-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 12px;
  padding: 10px 0;
  background: var(--card);
  border-top: 1px solid var(--line);
}
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.block {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
  min-width: 0;
}
.block[hidden] { display: none; }
.tone {
  padding: 10px 12px 12px;
  border: 1px solid #e7e0d4;
  border-left-width: 4px;
  border-radius: 10px;
  background: #f7f4ef;
}
.tone > .section-label { grid-column: 1 / -1; margin: 0; color: var(--ink); }
.tone-rail { background: #f3f2f0; border-color: #e4e2de; border-left-color: #78716c; }
.tone-feed { background: #fff1e8; border-color: #f5d0c0; border-left-color: #c2410c; }
.tone-link { background: #f8f1e7; border-color: #eadcc8; border-left-color: #a16207; }
.tone-sign { background: #faf8f4; border-color: #ebe6dc; border-left-color: #a8a29e; }
.tone-cable { background: #f6f0e6; border-color: #e7dcc8; border-left-color: #92400e; }
.tone-note { background: #fbfaf7; border-color: #ebe6dc; border-left-color: #d6d3d1; }
.tone-n { background: #e0f2fe; border-color: #bae6fd; border-left-color: #0284c7; }
.tone-pe { background: #f4f8c8; border-color: #e4e8a4; border-left-color: #65a30d; }
.tone[data-ink="коричневый"] { background: #ffedd5; border-color: #fdba74; border-left-color: #c2410c; }
.tone[data-ink="чёрный"] { background: #e7e5e4; border-color: #d6d3d1; border-left-color: #44403c; }
.tone[data-ink="серый"] { background: #f5f5f4; border-color: #e7e5e4; border-left-color: #78716c; }
.tone[data-ink="синий"] { background: #dbeafe; border-color: #bfdbfe; border-left-color: #2563eb; }
.tone[data-ink="бело-синий"] { background: #e0e7ff; border-color: #c7d2fe; border-left-color: #4f46e5; }
.tone[data-ink="голубой"] { background: #e0f2fe; border-color: #bae6fd; border-left-color: #0284c7; }
.tone[data-ink="жёлто-зелёный"] { background: #f4f8c8; border-color: #e4e8a4; border-left-color: #65a30d; }
.tone[data-ink="жёлтый"] { background: #fef9c3; border-color: #fde68a; border-left-color: #ca8a04; }
.tone[data-ink="зелёный"] { background: #dcfce7; border-color: #bbf7d0; border-left-color: #16a34a; }
.tone[data-ink="красный"] { background: #fee2e2; border-color: #fecaca; border-left-color: #dc2626; }
.tone[data-ink="белый"] { background: #fafaf9; border-color: #e7e5e4; border-left-color: #a8a29e; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; }
.span-10 { grid-column: span 10; }
.span-12 { grid-column: span 12; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 0.92rem; }
.field[hidden] { display: none; }
.field > span { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.field span { color: var(--muted); }
button.help, button.help-close {
  width: 1.15rem;
  height: 1.15rem;
  min-width: 1.15rem;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #d6d3d1;
  background: var(--copper-soft);
  color: var(--copper);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  flex: none;
}
button.help-close { background: transparent; color: var(--muted); font-size: 1rem; }
.help-card {
  display: none;
  width: min(36rem, calc(100vw - 32px));
  max-height: min(70vh, 36rem);
  max-height: min(70dvh, 36rem);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px 18px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 16px 40px rgba(28, 25, 23, 0.18);
}
.help-card:popover-open {
  display: block;
  position: fixed;
  inset: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  width: min(36rem, calc(100vw - 24px));
  height: fit-content;
  margin: auto;
}
.help-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 8px; }
.help-card p { margin: 0 0 8px; }
.help-card ul { margin: 0; padding-left: 1.15rem; }
.help-card li { margin: 4px 0; }
.help-card li b { font-weight: 650; }
.field small { color: var(--muted); }
input, select, textarea {
  font: inherit;
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  background: white;
  border: 1px solid #d6d3d1;
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
}
select option {
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  background: white;
}
input[type="checkbox"] {
  width: auto;
  padding: 0;
  accent-color: var(--copper);
}
textarea { min-height: 76px; resize: vertical; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: var(--copper);
  color: white;
  font: inherit;
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
}
.button.secondary, button.secondary { background: #44403c; }
.button.ghost, button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.row-actions { display: flex; gap: 8px; align-items: center; }
.toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 16px; }
.muted { color: var(--muted); }
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0 0 20px;
  border-bottom: 1px solid var(--line);
}
.tabs a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 2px 10px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs a.active { color: var(--copper); border-bottom-color: var(--copper); font-weight: 650; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
}
.stat:hover { border-color: var(--copper); }
.stat b { display: block; font-size: 1.6rem; letter-spacing: -0.03em; }
.stat span { color: var(--muted); }
.stat small { display: block; margin-top: 6px; color: var(--ink); }
.steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.steps span {
  background: var(--copper-soft);
  color: var(--copper);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.85rem;
}
.table-scroll { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }
.tree { display: grid; gap: 10px; }
.board-block { border-left: 3px solid var(--copper); padding-left: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: #f5f5f4;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.82rem;
}
.chip form { display: inline; }
.chip button {
  background: transparent;
  color: var(--muted);
  border: 0;
  padding: 0 0 0 4px;
  font: inherit;
  cursor: pointer;
}
.section-label { margin: 4px 0 0; font-size: 0.8rem; font-weight: 650; color: var(--muted); }
.panel {
  background: #d6d3d1;
  border-radius: 8px;
  padding: 16px 14px 12px;
  overflow-x: auto;
}
.rail-block { margin-top: 16px; }
.rail-block:first-child { margin-top: 0; }
.rail-title { margin: 0 0 6px; font-size: 0.85rem; }
.rail, .ticks {
  display: grid;
  width: max-content;
  grid-template-columns: repeat(var(--slots), 46px);
  gap: 2px;
}
.scheme-tools { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.scheme { position: relative; display: flex; align-items: flex-start; gap: 16px; padding-bottom: 18px; }
.scheme.labels-off .wires text:not(.inlet-name):not(.load-name) { display: none; }
.wires a.load-link { cursor: pointer; pointer-events: auto; }
.place-room { display: grid; gap: 8px; margin: 10px 0; padding: 10px; border: 1px solid #e7e5e4; border-radius: 10px; }
.place-bit { display: flex; gap: 8px; align-items: center; }
.place-bit input[name="place_text"] { flex: 1; }
.wires a.load-link .load-name { text-decoration: underline; }
.feed-pick { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 0.9rem; }
.feed-pick select { width: auto; min-width: 12rem; }
.wire-tip {
  position: fixed;
  z-index: 30;
  max-width: min(340px, calc(100vw - 16px));
  max-width: min(340px, calc(100dvw - 16px));
  padding: 8px 10px;
  background: #1c1917;
  color: #f6f3ee;
  -webkit-text-fill-color: #f6f3ee;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.4;
  white-space: pre-line;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.wire-tip[hidden] { display: none; }
.scheme-rails, .scheme-buses { position: relative; z-index: 2; min-width: 0; pointer-events: none; }
.module, .bus, .scheme-rails a, .scheme-buses a { pointer-events: auto; }
.scheme.wire-focus .conductor { opacity: 0.16; }
.scheme.wire-focus .conductor.is-hot { opacity: 1; filter: drop-shadow(0 0 1px #1c1917); }
.scheme.wire-focus .conductor.is-hot .load-mark { stroke: #1c1917; stroke-width: 1.8px; }
.scheme.wire-focus .module,
.scheme.wire-focus .bus,
.scheme.wire-focus .inlet,
.scheme.wire-focus .inlet-name { opacity: 0.28; }
.scheme.wire-focus .module.is-hot,
.scheme.wire-focus .bus.is-hot,
.scheme.wire-focus.inlet-hot .inlet,
.scheme.wire-focus.inlet-hot .inlet-name { opacity: 1; }
.scheme.wire-focus .bus.is-hot:has(li.is-hot) .contacts li:not(.is-hot) { opacity: 0.35; }
.scheme.wire-focus .contacts li.is-hot {
  opacity: 1;
  background: #fffbeb;
  border-color: #1c1917;
  box-shadow: 0 0 0 1.5px #1c1917;
}
.scheme-buses { display: flex; gap: 8px; flex: none; }
.bus {
  width: 46px;
  background: #e0f2fe;
  border: 1px solid #0284c7;
  border-radius: 2px;
  padding: 3px 2px 4px;
  text-align: center;
}
.bus-on-rail {
  width: auto;
  grid-column: var(--start) / span 1;
  grid-row: 1;
  align-self: end;
}
.bus[data-color="голубой"] { background: #e0f2fe; border-color: #0284c7; }
.bus[data-color="жёлтый"] { background: #fef9c3; border-color: #ca8a04; }
.bus[data-color="зелёный"] { background: #dcfce7; border-color: #16a34a; }
.bus.clash { box-shadow: inset 0 0 0 1px #b91c1c; }
.bus p { margin: 0; font-size: 0.55rem; color: var(--muted); }
.bus-name { display: block; font-weight: 700; font-size: 0.62rem; color: inherit; text-decoration: none; line-height: 1.1; }
.contacts { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 1px; }
.contacts li {
  height: 11px;
  line-height: 11px;
  font-size: 0.55rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(68, 64, 60, 0.35);
  border-radius: 2px;
}
.contacts li.clash { border-color: #b91c1c; background: #fee2e2; }
.wires { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.rail {
  position: relative;
  align-items: end;
  min-height: 66px;
  margin: 64px 0;
  padding: 5px 4px 8px;
  background: linear-gradient(#a8a29e, #a8a29e) left 4px bottom 3px / calc(100% - 8px) 4px no-repeat;
}
.ticks { margin: 0 4px; }
.ticks span { text-align: center; font-size: 0.55rem; color: #57534e; }
.rail-edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-top: 12px; }
.rail-edit form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.rail-edit input[name="name"] { width: 14rem; }
.rail-edit input[name="length"] { width: 5.5rem; }
.loose { margin: 12px 0 0; padding-left: 18px; }
.module {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  grid-column: var(--start) / span var(--mods);
  grid-row: 1;
  width: auto;
  min-height: 59px;
  padding: 4px 3px;
  background: #fffdf9;
  color: inherit;
  text-decoration: none;
  text-align: center;
  border: 1px solid #44403c;
  border-radius: 2px;
  box-shadow: inset 0 5px 0 #e7e5e4;
  font-size: 0.62rem;
  line-height: 1.15;
}
.module.clash { border-color: #b91c1c; box-shadow: inset 0 10px 0 #fecaca; }
.module b { font-size: 0.72rem; }
.n-mark {
  position: absolute;
  top: 1px;
  font-style: normal;
  font-weight: 700;
  font-size: 0.55rem;
  line-height: 1;
  color: #0369a1;
}
.n-mark[data-side="слева"] { left: 2px; }
.n-mark[data-side="справа"] { right: 2px; }
.module span { overflow-wrap: anywhere; }
.module em { font-style: normal; color: var(--copper); }
.module small { color: var(--muted); }
.module:hover, .module:target { border-color: var(--copper); box-shadow: inset 0 10px 0 var(--copper-soft); }
.module[data-feed="сверху"] { border-top: 5px solid var(--feed-ink, #292524); }
.module[data-feed="снизу"] { border-bottom: 5px solid var(--feed-ink, #292524); }
.comb {
  position: absolute;
  z-index: 2;
  height: 4px;
  border-radius: 2px;
  background: var(--ink, #44403c);
  pointer-events: none;
  left: calc(4px + (var(--start) - 1) * 48px);
  width: calc(var(--mods) * 46px + (var(--mods) - 1) * 2px);
}
.comb[data-side="снизу"] { bottom: 8px; }
.comb[data-side="сверху"] { top: auto; bottom: 67px; }
.comb.pe { background: repeating-linear-gradient(90deg, #65a30d 0 6px, #eab308 6px 11px); }
.module[data-kind="УЗО"], .module[data-kind="дифавтомат"] { background: #f8fafc; }
.module[data-kind="реле напряжения"] { background: #fffbeb; }
.module[data-kind="рубильник"] { background: #f5f5f4; }
.room-pick { width: 2.4rem; text-align: center; }
.room-pick input[type="checkbox"], .flags input[type="checkbox"] { width: 1.15rem; height: 1.15rem; }
.phone-label { display: none; }
.flags { margin-top: 8px; }
.flags td, .flags th { text-align: center; }
.flags td:first-child, .flags th:first-child { text-align: left; }
.flags label { display: inline-flex; gap: 8px; align-items: center; justify-content: center; }
.flag-cap { display: none; }
details { margin-top: 8px; }
summary { cursor: pointer; color: var(--muted); margin-bottom: 8px; }
.empty { color: var(--muted); padding: 8px 0; }
.walk-banner {
  background: var(--copper-soft);
  border: 1px solid #fdba74;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  display: grid;
  gap: 8px;
}
.walk-banner strong { font-size: 1.05rem; }
.line-list { display: grid; gap: 8px; }
.line-head { margin: 14px 0 8px; font-size: 1rem; }
.outgoing-form { margin: 8px 0 4px; padding-top: 8px; border-top: 1px solid var(--line); }
.pick-row, .line-card {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: white;
}
.line-card { color: inherit; text-decoration: none; justify-content: flex-start; }
.line-card span { display: grid; }
.pick-row.is-off { border-color: var(--copper); background: var(--copper-soft); }
.line-card.is-done { opacity: 0.72; }
.pick-row .field { min-width: 5.2rem; margin: 0; }
.pick-row button, .walk-banner button { flex: none; }
button:disabled { opacity: 0.45; }
.photo-fallback { display: block; width: 72px; height: 72px; background: #e7e5e4; border-radius: 8px; flex: none; }
.line-card img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; flex: none; }
.photo-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.photo-row figure { margin: 0; }
.photo-row img { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; }
.check-line { flex-direction: row; align-items: center; }
.badge {
  background: var(--copper);
  color: white;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.82rem;
}
.actions-end { display: flex; align-items: end; }
.upload-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-top: 14px; }
.upload-row .field { margin: 0; min-width: 12rem; flex: 1; }
.device-copy { border-top: 1px solid var(--line); padding: 8px 0; }
.device-copy summary { cursor: pointer; display: grid; gap: 2px; }
.kv { display: grid; grid-template-columns: 12rem 1fr; gap: 4px 12px; margin: 8px 0 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
ul.plain { margin: 8px 0 0; padding-left: 1.1rem; }
ul.plain li { margin: 2px 0; }
.site-list { display: grid; gap: 10px; }
.auth { max-width: 440px; }
.auth .field { margin-bottom: 12px; }
.hp { position: absolute; left: -10000px; height: 0; overflow: hidden; }
.person-head, .person-row {
  display: grid;
  grid-template-columns: 1.3fr 11rem auto 5rem 11rem auto;
  gap: 8px;
  align-items: center;
}
.person-head { color: var(--muted); font-size: 0.85rem; padding-bottom: 6px; }
.person-row { padding: 8px 0; border-top: 1px solid var(--line); }
.person-row input:not([type="checkbox"]), .person-row select { width: 100%; }
.site-link {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
}
.site-link:hover { border-color: var(--copper); }
@media (max-width: 800px) {
  .span-2, .span-3, .span-4, .span-5, .span-6, .span-8, .span-10 { grid-column: span 12; }
  .kv { grid-template-columns: 1fr; gap: 0 12px; }
  .kv dt { margin-top: 6px; }
  .sheet { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .top { padding: 12px 14px; }
  .wrap { padding: 16px 12px 48px; }
  h1 { font-size: 1.4rem; }
  .phone-label { display: block; margin-bottom: 2px; color: var(--muted); font-size: 0.78rem; }
  .room-table { display: block; }
  .room-table tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px 10px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }
  .room-table th, .room-table td { display: block; border: 0; padding: 0; }
  .room-table tr.room-head { display: flex; align-items: center; gap: 8px; }
  .room-table tr.room-head th:not(.room-pick) { display: none; }
  .room-pick { grid-column: 1; grid-row: 1 / span 4; align-self: start; width: auto; margin-top: 10px; }
  .room-head .room-pick { grid-row: auto; margin-top: 0; display: flex; align-items: center; gap: 8px; }
  .room-name, .room-floor, .room-notes, .room-delete { grid-column: 2; min-width: 0; }
  .room-delete { justify-self: start; }
  .flags thead { display: none; }
  .flags, .flags tbody { display: block; }
  .flags tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }
  .flags td { display: block; border: 0; padding: 0; text-align: left; }
  .flag-name { grid-column: 1 / -1; font-weight: 650; }
  .flags label { justify-content: flex-start; }
  .flag-cap { display: inline; color: var(--muted); font-size: 0.85rem; }
  .person-head { display: none; }
  .person-row { grid-template-columns: 1fr; }
}
