:root {
  color-scheme: light;
  --bg: #f4f2ed;
  --surface: #ffffff;
  --ink: #1f2a2e;
  --muted: #667277;
  --line: #d8d8d0;
  --green: #1f7a5a;
  --blue: #386b8f;
  --red: #b8483f;
  --amber: #c8852c;
  --teal-soft: #dceee8;
  --blue-soft: #e5edf3;
  --red-soft: #f7e2df;
  --shadow: 0 14px 35px rgba(39, 46, 49, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.1;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.global-search {
  display: grid;
  grid-template-columns: auto minmax(180px, 360px);
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.global-search input,
.suggestion-form textarea,
.field input,
.field select,
.editor-panel textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.global-search input {
  min-height: 40px;
  padding: 0 12px;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select {
  min-height: 34px;
  padding: 0 10px;
  color: var(--ink);
  font-weight: 500;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(360px, 0.88fr) minmax(280px, 340px);
  min-height: 0;
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px;
  overflow: auto;
  border-color: var(--line);
}

.rail-left {
  border-right: 1px solid var(--line);
}

.rail-right {
  border-left: 1px solid var(--line);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.panel h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}

.count-pill,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.icon-button {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 20px;
  line-height: 1;
}

.task-list,
.instruction-list,
.room-tasks,
.pick-list {
  display: grid;
  gap: 8px;
}

.task-item,
.instruction-item {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.task-item strong,
.instruction-item strong {
  font-size: 12px;
}

.task-item span,
.instruction-item span,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.task-item[data-priority="high"] {
  border-color: #e4a29b;
  background: var(--red-soft);
}

.task-item[data-priority="medium"] {
  border-color: #e6c28c;
  background: #fff4e2;
}

.map-stage {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 8px;
  gap: 9px;
  overflow: hidden;
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.segmented button {
  min-height: 29px;
  padding: 0 9px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.segmented button.active {
  background: var(--ink);
  color: #fff;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-task {
  background: var(--amber);
}

.dot-warning {
  background: var(--red);
}

.dot-ok {
  background: var(--green);
}

.dot-consult {
  background: #4b79a8;
}

.dot-lab {
  background: #1f7a5a;
}

.dot-care {
  background: #8a5a9c;
}

.floor-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  gap: 5px;
  min-width: min(100%, 330px);
}

.floor-tabs button {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 2px 8px;
  min-height: 42px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.floor-tabs button strong {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
}

.floor-tabs button span {
  font-size: 12px;
  font-weight: 800;
}

.floor-tabs button small {
  color: var(--muted);
  font-size: 11px;
}

.floor-tabs button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.floor-tabs button.active strong {
  background: #fff;
  color: var(--ink);
}

.floor-tabs button.active small {
  color: rgba(255, 255, 255, 0.72);
}

.map-frame {
  position: relative;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.map-canvas {
  position: relative;
  width: min(100%, 780px);
  min-width: 560px;
  margin: 0 auto;
  aspect-ratio: 2732 / 2651;
}

.map-frame img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.room-overlay,
.draw-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.room-overlay {
  pointer-events: none;
}

.draw-overlay {
  display: none;
  pointer-events: none;
}

.map-frame.editor-active .room-overlay {
  opacity: 0.35;
}

.map-frame.editor-active .draw-overlay {
  display: block;
  pointer-events: auto;
  cursor: crosshair;
}

.room-shape {
  pointer-events: auto;
  fill: rgba(56, 107, 143, 0.16);
  stroke: rgba(56, 107, 143, 0.78);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
  transition: fill 160ms ease, stroke 160ms ease;
  cursor: pointer;
}


.room-shape.type-consult {
  fill: rgba(75, 121, 168, 0.18);
  stroke: #4b79a8;
}

.room-shape.type-lab {
  fill: rgba(31, 122, 90, 0.2);
  stroke: #1f7a5a;
}

.room-shape.type-acute {
  fill: rgba(184, 72, 63, 0.18);
  stroke: #b8483f;
}

.room-shape.type-care {
  fill: rgba(138, 90, 156, 0.18);
  stroke: #8a5a9c;
}

.room-shape.type-reception {
  fill: rgba(200, 133, 44, 0.2);
  stroke: #c8852c;
}

.room-shape.type-hall,
.room-shape.type-toilet,
.room-shape.type-storage,
.room-shape.type-other {
  fill: rgba(102, 114, 119, 0.12);
  stroke: #667277;
}

.room-shape:hover,
.room-shape.active {
  fill: rgba(31, 122, 90, 0.24);
  stroke: var(--green);
}

.room-shape.warning {
  fill: rgba(184, 72, 63, 0.18);
  stroke: var(--red);
}

.room-shape.has-task {
  fill: rgba(200, 133, 44, 0.2);
  stroke: var(--amber);
}

.room-label {
  pointer-events: none;
  fill: var(--ink);
  font-size: 20px;
  font-weight: 800;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 5px;
  stroke-linejoin: round;
}

.draft-shape,
.saved-shape {
  fill: rgba(31, 122, 90, 0.2);
  stroke: var(--green);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.draft-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 3;
  stroke-dasharray: 12 10;
  vector-effect: non-scaling-stroke;
}

.draft-point {
  fill: var(--green);
  stroke: #fff;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.saved-shape {
  fill: rgba(56, 107, 143, 0.2);
  stroke: var(--blue);
}

.saved-label {
  pointer-events: none;
  fill: var(--ink);
  font-size: 20px;
  font-weight: 850;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 5px;
  stroke-linejoin: round;
}

.room-panel h2 {
  margin: 0 0 6px;
  font-size: 19px;
  letter-spacing: 0;
}

.quick-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.quick-actions button,
.suggestion-form button,
.editor-actions button,
.editor-mode button,
.primary-action {
  min-height: 34px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-weight: 750;
}

.quick-actions button:nth-child(1) {
  background: var(--green);
}

.quick-actions button:nth-child(2) {
  background: var(--red);
}

.status-grid {
  display: grid;
  gap: 7px;
  margin: 8px 0 0;
}

.status-grid div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.status-grid dt {
  color: var(--muted);
  font-size: 12px;
}

.status-grid dd {
  margin: 0;
  font-size: 12px;
  font-weight: 750;
  text-align: right;
}

.suggestion-form {
  display: grid;
  gap: 8px;
}

.suggestion-form textarea,
.editor-panel textarea {
  min-height: 76px;
  resize: vertical;
  padding: 8px;
}

.editor-panel {
  display: grid;
  gap: 12px;
}

.editor-panel[hidden] {
  display: none;
}

.editor-mode,
.editor-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.editor-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.editor-mode button,
.editor-actions button {
  background: var(--blue-soft);
  color: var(--ink);
}

.editor-mode button.active {
  background: var(--ink);
  color: #fff;
}

.editor-panel textarea {
  min-height: 130px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(20px);
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
  box-shadow: var(--shadow);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 300px 1fr;
  }

  .rail-right {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .global-search {
    grid-template-columns: 1fr;
  }

  .workspace,
  .rail-right {
    grid-template-columns: 1fr;
  }

  .rail-left,
  .rail-right {
    border: 0;
  }

  .map-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
}


.field-grid-compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.editor-actions.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.supply-panel {
  border-color: #b8d8cb;
  background: #fbfffd;
}

.supply-items {
  display: grid;
  gap: 6px;
}

.supply-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  font-size: 12px;
}

.pick-list {
  gap: 6px;
}

.pick-row {
  display: grid;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.pick-row strong {
  font-size: 12px;
}

.pick-row span {
  color: var(--muted);
  font-size: 12px;
}


.instruction-item {
  width: 100%;
  color: var(--ink);
  text-align: left;
}

.instruction-item.active {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.instruction-detail {
  display: grid;
  gap: 10px;
}

.instruction-detail h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.instruction-meta,
.linked-rooms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.instruction-meta span,
.linked-rooms button {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.instruction-facts {
  display: grid;
  gap: 6px;
  margin: 0;
}

.instruction-facts div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
}

.instruction-facts dt {
  color: var(--muted);
  font-size: 12px;
}

.instruction-facts dd {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.instruction-detail p {
  margin: 0;
}

.instruction-detail ol {
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
  font-size: 12px;
}

.instruction-detail li + li {
  margin-top: 5px;
}

.instruction-note {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid #e6c28c;
  border-radius: 7px;
  background: #fff4e2;
  color: var(--ink);
  font-size: 12px;
}


.map-frame {
  display: grid;
  justify-items: center;
  align-items: start;
}

.map-toolbar {
  align-items: flex-start;
}

.map-stage {
  align-content: start;
}

@media (min-width: 1400px) {
  .map-canvas {
    width: min(100%, 860px);
  }
}

@media (max-width: 980px) {
  .map-canvas {
    min-width: 520px;
  }
}


.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.catalog-open-button,
.instruction-launch {
  min-height: 36px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.catalog-open-button {
  padding: 0 12px;
}

.instruction-launch {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px;
  text-align: left;
}

.instruction-launch span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 600;
}

.catalog-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(31, 42, 46, 0.42);
}

.catalog-overlay[hidden] {
  display: none;
}

.catalog-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(1180px, 100%);
  height: min(820px, calc(100vh - 44px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.catalog-header,
.catalog-search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.catalog-header h2 {
  margin: 0;
  font-size: 22px;
}

.catalog-search-row {
  align-items: end;
}

.catalog-search {
  display: grid;
  flex: 1;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.catalog-search input {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
}

.catalog-body {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(420px, 1fr);
  min-height: 0;
}

.catalog-results,
.catalog-detail {
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.catalog-results {
  border-right: 1px solid var(--line);
  background: #fbfaf7;
}

.instruction-item small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.catalog-detail {
  align-content: start;
  gap: 14px;
}

.catalog-detail h3 {
  font-size: 26px;
}

.catalog-detail p,
.catalog-detail ol {
  max-width: 72ch;
  font-size: 15px;
  line-height: 1.5;
}

@media (max-width: 880px) {
  .catalog-body {
    grid-template-columns: 1fr;
  }

  .catalog-results {
    max-height: 240px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .catalog-search-row {
    align-items: stretch;
    flex-direction: column;
  }
}


.presence-panel {
  border-color: #d6c191;
  background: #fffdf6;
}

.room-shape.status-neutral {
  fill: rgba(102, 114, 119, 0.08);
  stroke: rgba(102, 114, 119, 0.68);
}

.room-shape.status-supply-now {
  fill: rgba(184, 72, 63, 0.34);
  stroke: #b8483f;
}

.room-shape.status-supply-soon {
  fill: rgba(230, 184, 72, 0.36);
  stroke: #c8852c;
}

.room-shape.status-supply-today {
  fill: rgba(31, 122, 90, 0.26);
  stroke: #1f7a5a;
}

.room-shape.status-fault {
  fill: rgba(128, 84, 52, 0.34);
  stroke: #805434;
}

.room-shape.status-person {
  fill: rgba(56, 107, 143, 0.26);
  stroke: #386b8f;
}

.marker-label {
  pointer-events: none;
  fill: var(--ink);
  font-size: 17px;
  font-weight: 900;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 5px;
  stroke-linejoin: round;
}

.quick-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}


.supply-task {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.supply-task strong,
.supply-task span {
  grid-column: 1;
}

.complete-supply {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

.pick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}


.picture-frame-overlay {
  position: fixed;
  inset: 0;
  z-index: 24;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 26, 29, 0.72);
}

.picture-frame-overlay[hidden] {
  display: none;
}

.picture-frame-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: calc(100vw - 12px);
  height: calc(100vh - 12px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: #f9f8f4;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  overflow: hidden;
}

.picture-frame-header,
.picture-frame-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.picture-frame-header h2 {
  margin: 0;
  font-size: 22px;
}

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

.frame-action-button {
  min-height: 32px;
  padding: 0 11px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.frame-action-button.active {
  background: var(--ink);
  color: #fff;
}

.picture-frame-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.picture-frame-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
}

.picture-frame-tabs button strong {
  color: var(--blue);
}

.picture-frame-tabs button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.picture-frame-tabs button.active strong {
  color: #fff;
}

.picture-frame-stage {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(4px, 1vw, 12px);
  overflow: hidden;
}

.picture-frame-canvas {
  position: relative;
  flex: 0 0 auto;
  margin: auto;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
}

.picture-frame-canvas img,
.picture-frame-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.picture-frame-canvas img {
  display: block;
  object-fit: fill;
}

.picture-frame-svg {
  pointer-events: none;
}

.frame-room-shape {
  pointer-events: none;
  stroke-width: 5;
}

.picture-frame-svg .marker-label {
  font-size: 26px;
  stroke-width: 7px;
}

.picture-frame-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.frame-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.frame-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.frame-neutral {
  background: rgba(102, 114, 119, 0.68);
}

.frame-supply {
  background: #c8852c;
}

.frame-fault {
  background: #b8483f;
}

.frame-person {
  background: #386b8f;
}

@media (max-width: 760px) {
  .picture-frame-tabs {
    grid-template-columns: 1fr;
  }

  .picture-frame-header,
  .picture-frame-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}


.instruction-extra,
.instruction-warning {
  display: grid;
  gap: 8px;
  max-width: 72ch;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.instruction-extra ul,
.instruction-warning ul {
  margin: 0;
  padding-left: 20px;
}

.instruction-extra article {
  display: grid;
  gap: 2px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.instruction-extra article:first-of-type {
  border-top: 0;
}

.instruction-extra article span {
  color: var(--muted);
}

.instruction-warning {
  border-color: #e6c28c;
  background: #fff4e2;
}

.image-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  max-width: 900px;
}

.image-slot {
  display: grid;
  place-items: center;
  min-height: 118px;
  padding: 10px;
  border: 1px dashed #aab4b8;
  border-radius: 7px;
  background: #f7f8f7;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 750;
}


.access-gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(31, 42, 46, 0.52);
  backdrop-filter: blur(10px);
}

.access-gate[hidden] {
  display: none;
}

.access-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.access-card h2 {
  margin: 0;
  font-size: 24px;
}

.gate-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.role-grid button,
.actor-pill {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.role-grid button.active,
.actor-pill {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.glove-options {
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.glove-options div,
.glove-options label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.glove-options select {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

@media (max-width: 520px) {
  .role-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


.delivered-supply {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.delivered-supply h3 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.delivered-task {
  grid-template-columns: 1fr auto;
  align-items: center;
  opacity: 0.72;
}

.delivered-task strong,
.delivered-task span {
  grid-column: 1;
}

.reopen-supply {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}


.presence-dot {
  pointer-events: none;
  stroke: #fff;
  stroke-width: 5px;
  filter: drop-shadow(0 3px 5px rgba(31, 42, 46, 0.25));
  vector-effect: non-scaling-stroke;
}

.presence-label {
  pointer-events: none;
  fill: #fff;
  font-size: 23px;
  font-weight: 950;
  letter-spacing: 0;
  paint-order: stroke;
  stroke: rgba(31, 42, 46, 0.38);
  stroke-width: 2px;
  stroke-linejoin: round;
}

.picture-frame-svg .presence-label {
  font-size: 30px;
}


.dot-supply-now,
.frame-supply-now {
  background: #b8483f;
}

.dot-supply-soon,
.frame-supply-soon {
  background: #c8852c;
}

.dot-supply-today,
.frame-supply-today {
  background: #1f7a5a;
}

.dot-fault,
.frame-fault {
  background: #805434;
}

.fault-task {
  border-color: #b89578;
  background: #f1e5dc;
  grid-template-columns: 1fr auto;
  align-items: center;
}

.fault-task strong,
.fault-task span {
  grid-column: 1;
}

.resolve-fault {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  background: #805434;
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}


.fault-cross {
  pointer-events: none;
  fill: #805434;
  font-size: 58px;
  font-weight: 950;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 8px;
  stroke-linejoin: round;
}

.fault-map-label {
  pointer-events: none;
  fill: #805434;
  font-size: 15px;
  font-weight: 900;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 5px;
  stroke-linejoin: round;
}

.fault-queue-panel {
  border-color: #c6a58d;
  background: #fffaf6;
}

.picture-frame-svg .fault-cross {
  font-size: 72px;
}




.device-panel {
  border-color: #b7cbd8;
  background: #f8fbfd;
}

.device-list {
  display: grid;
  gap: 7px;
}

.device-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.device-card strong,
.device-card span,
.device-card small {
  display: block;
}

.device-card strong {
  font-size: 13px;
}

.device-card span,
.device-card small {
  color: var(--muted);
  font-size: 11px;
}

.device-card[data-status="available"] {
  border-color: #9ac7b5;
  background: #f2fbf7;
}

.device-card[data-status="in-use"] {
  border-color: #e6c28c;
  background: #fff6e6;
}

.device-card[data-status="fault"] {
  border-color: #e4a29b;
  background: var(--red-soft);
}

.device-actions {
  display: flex;
  gap: 5px;
}

.device-actions button {
  min-height: 30px;
  padding: 0 9px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
}

.device-actions .fault-device {
  background: var(--red);
}


.capability-filter {
  display: grid;
  grid-template-columns: auto minmax(130px, 190px);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.capability-filter select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
}

.room-shape.capability-yes {
  fill: rgba(31, 122, 90, 0.38);
  stroke: #1f7a5a;
  stroke-width: 4;
}

.room-shape.capability-no {
  fill: rgba(184, 72, 63, 0.34);
  stroke: #b8483f;
  stroke-width: 4;
}

.dot-capability-yes {
  background: #1f7a5a;
}

.dot-capability-no {
  background: #b8483f;
}


.catalog-open-button.subtle {
  background: var(--blue-soft);
  color: var(--ink);
}

.free-presence-point {
  pointer-events: none;
}

.free-presence-dot {
  stroke-width: 6px;
}

.frame-devices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.frame-device {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.frame-device[data-status="available"] {
  border-color: #9ac7b5;
  background: #f2fbf7;
  color: #1f7a5a;
}

.frame-device[data-status="in-use"] {
  border-color: #e6c28c;
  background: #fff6e6;
  color: #8a5b14;
}

.frame-device[data-status="fault"] {
  border-color: #e4a29b;
  background: var(--red-soft);
  color: var(--red);
}


.pick-quantity {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 24px;
  margin-right: 8px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}
