@font-face {
  font-family: 'Hanken Grotesk';
  src: url('../assets/fonts/hanken-grotesk-latin-variable.woff2') format('woff2-variations');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: 'Hanken Grotesk';
  src: url('../assets/fonts/hanken-grotesk-latin-variable-italic.woff2') format('woff2-variations');
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* Welcoming Operations Desk. Legacy aliases remain so feature code can move
     onto this system without changing business logic or rendering paths. */
  --font-sans: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: var(--font-sans);
  --ink: #2b2925;
  --ink-deep: #211f1b;
  --ink-soft: #49453e;
  --paper: #f7f4ea;
  --paper-light: #ffffff;
  --paper-dark: #eee9da;
  --atlas-paper: #fbf7e8;
  --rule: #ddd6c5;
  --rule-dark: #a9a08f;
  --text: #2b2925;
  --muted: #686154;
  --muted-light: #81796b;
  --selection-yellow: #ffed71;
  --selection-yellow-strong: #f0d935;
  --selection-yellow-soft: #fff8c9;
  --ochre: var(--selection-yellow);
  --ochre-dark: #f0d935;
  --ochre-pale: var(--selection-yellow-soft);
  --terracotta: #b95a45;
  --action-blue: #2f7278;
  --action-blue-strong: #20575d;
  --action-blue-soft: #e8f3f2;
  --teal: var(--action-blue);
  --teal-dark: var(--action-blue-strong);
  --teal-pale: var(--action-blue-soft);
  --green: #2f6e55;
  --orange: #8b5c12;
  --red: #a13d32;
  --white: #ffffff;
  --success-surface: #e8f3ed;
  --warning-surface: #fff2d4;
  --warning-rule: rgba(139, 92, 18, 0.35);
  --danger-surface: #f9e9e5;
  --info-surface: #e8f3f2;
  --shadow: 0 12px 30px rgba(43, 41, 37, 0.09), 0 2px 5px rgba(43, 41, 37, 0.05);
  --shadow-deep: 0 24px 64px rgba(43, 41, 37, 0.18), 0 4px 12px rgba(43, 41, 37, 0.08);
  --shadow-control: 0 4px 10px rgba(43, 41, 37, 0.12);
  --shadow-float: 0 18px 46px rgba(43, 41, 37, 0.16), 0 3px 9px rgba(43, 41, 37, 0.08);
  --shadow-marker: 0 8px 20px rgba(43, 41, 37, 0.2);
  --radius-xs: 10px;
  --radius-sm: 12px;
  --radius-md: 14px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 18px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --page-gutter: clamp(20px, 3vw, 44px);
  --panel-inset: clamp(18px, 2vw, 28px);
  --type-body-size: 17px;
  --type-control-size: 16px;
  --type-supporting-size: 15px;
  --type-metadata-size: 14px;
  --type-panel-size: 18px;
  --type-subheadline-size: 29px;
  --type-display-fluid: clamp(36px, 3vw, 52px);
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --motion-feedback: 120ms;
  --motion-control: 180ms;
  --motion-layout: 260ms;
  --motion-focal: 280ms;
  --motion-fast: var(--motion-feedback);
  --motion-base: var(--motion-control);
  --motion-slow: var(--motion-focal);
  --focus: 0 0 0 3px rgba(240, 217, 53, 0.52), 0 0 0 5px rgba(43, 41, 37, 0.2);
}

/* Unified Provested operations surfaces */
.workspace-signin {
  display: grid;
  gap: 10px;
  min-height: 72px;
  place-items: center;
  padding: 18px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--white);
}

.workspace-signin > span,
.workspace-config-warning span,
.workspace-security-card small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.workspace-config-warning,
.workspace-security-card,
.workspace-account-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.workspace-config-warning strong,
.workspace-config-warning span,
.workspace-security-card strong,
.workspace-security-card small {
  display: block;
}

.workspace-security-card,
.workspace-account-note {
  padding: 12px;
  color: var(--ink-soft);
  border-radius: 8px;
  background: var(--teal-pale);
}

.workspace-security-card svg,
.workspace-account-note svg {
  width: 18px;
  min-width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.emergency-access-toggle {
  display: inline-flex;
  gap: 8px;
  width: max-content;
  align-items: center;
  padding: 4px 0;
  color: var(--muted);
  border: 0;
  background: transparent;
  font: 700 13px var(--font-sans);
}

.emergency-access-toggle:hover { color: var(--ink); }
.emergency-access-toggle svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.emergency-login-fields {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
}

.emergency-login-fields[hidden] { display: none; }

.operations-home,
.qc-dashboard,
.broadcasts-surface,
.tasks-surface,
.console-surface {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.operations-home__register,
.console-register {
  display: grid;
  grid-template-columns: minmax(260px, .72fr) minmax(520px, 1.28fr);
  gap: 30px;
  align-items: end;
  padding: 24px 28px;
  color: var(--paper-light);
  border-radius: 12px;
  background: var(--ink);
  box-shadow: var(--shadow);
}

.operations-home__register h2,
.console-register h2 {
  max-width: 15ch;
  margin: 0;
  color: inherit;
  font: 600 31px/1 var(--font-sans);
  letter-spacing: -.03em;
}

.operations-home__register p,
.console-register p {
  max-width: 58ch;
  margin: 9px 0 0;
  color: rgba(246, 240, 227, .72);
  font-size: 14px;
}

.operations-home__register dl,
.console-register dl,
.qc-scoreboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

.operations-home__register dl > div,
.console-register dl > div {
  min-width: 0;
  padding: 3px 16px;
  border-left: 1px solid rgba(246, 240, 227, .18);
}

.operations-home__register dt,
.console-register dt,
.operations-home__register dd,
.console-register dd {
  margin: 0;
}

.operations-home__register dt,
.console-register dt {
  color: rgba(246, 240, 227, .62);
  font: 500 13px var(--font-mono);
  text-transform: uppercase;
}

.operations-home__register dd,
.console-register dd {
  overflow: hidden;
  margin-top: 5px;
  color: var(--white);
  font: 700 23px/1 var(--font-sans);
  text-overflow: ellipsis;
}

.operations-home__register dd span { color: rgba(246, 240, 227, .5); font-size: 15px; }

.operations-home__broadcasts,
.operations-home__grid > section,
.operations-home__quality,
.qc-ledger,
.qc-ranking,
.broadcasts-surface > section,
.console-grid > section {
  min-width: 0;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--paper-light);
}

.operations-home__broadcasts > header,
.operations-home__grid > section > header,
.qc-ledger > header,
.qc-ranking > header,
.console-grid > section > header,
.section-register {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 17px 19px;
  border-bottom: 1px solid var(--rule);
}

.operations-home h3,
.qc-dashboard h3,
.broadcasts-surface h2,
.broadcasts-surface h3,
.console-surface h3 {
  margin: 0;
  color: var(--ink);
  font: 800 15px/1.3 var(--font-sans);
}

.operations-home header p,
.qc-dashboard header p,
.broadcasts-surface header p,
.console-surface header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.dashboard-broadcast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 15px 19px;
  border-bottom: 1px solid rgba(205, 191, 174, .65);
}

.dashboard-broadcast:last-child { border-bottom: 0; }
.dashboard-broadcast strong,
.dashboard-broadcast span { display: block; }
.dashboard-broadcast strong { color: var(--ink); font-size: 14px; }
.dashboard-broadcast span { max-width: 78ch; margin-top: 4px; color: var(--text); font-size: 14px; }
.dashboard-broadcast time { color: var(--muted); font: 500 13px var(--font-mono); }

.operations-home__grid {
  display: grid;
  grid-template-columns: minmax(260px, .78fr) minmax(360px, 1.22fr) minmax(230px, .62fr);
  gap: 18px;
  align-items: start;
}

.operations-home__grid .home-schedule-list { padding: 12px 19px 18px; }

.dashboard-task {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(205, 191, 174, .65);
}

.dashboard-task:last-child { border-bottom: 0; }
.dashboard-task strong,
.dashboard-task small { display: block; }
.dashboard-task strong { color: var(--ink); font-size: 14px; }
.dashboard-task small { margin-top: 2px; color: var(--muted); font-size: 13px; }

.task-priority {
  width: max-content;
  padding: 3px 6px;
  color: var(--ink-soft);
  border-radius: 99px;
  background: var(--paper-dark);
  font: 500 13px var(--font-mono);
  text-transform: uppercase;
}

.task-priority--urgent { color: #7d2b20; background: #f7ddd5; }
.task-priority--high { color: #7b420f; background: #f8dfc5; }
.task-priority--low { color: var(--teal-dark); background: var(--teal-pale); }

.operations-home__quality { padding: 18px; }
.operations-home__quality > strong { display: block; margin-top: 22px; color: var(--ink); font: 700 42px/1 var(--font-sans); }
.operations-home__quality > strong span { color: var(--muted); font: 500 14px var(--font-sans); }
.operations-home__quality > p { margin: 8px 0 0; color: var(--text); font-size: 14px; }
.operations-home__quality > small { display: block; margin: 3px 0 16px; color: var(--muted); font-size: 13px; }

.work-form {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--rule-dark);
  border-radius: 12px;
  background: var(--paper-light);
  box-shadow: 0 18px 42px rgba(20, 43, 64, .12);
}

.work-form__heading,
.work-form__actions {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.work-form__heading h3 { font-size: 16px; }
.work-form__heading p { max-width: 70ch; margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.work-form__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; }
.work-form label,
.emergency-form label,
.rollback-panel form label { display: grid; gap: 5px; color: var(--ink-soft); font-size: 13px; font-weight: 800; }
.work-form input,
.work-form select,
.work-form textarea,
.emergency-form input,
.rollback-panel input,
.console-user-row select,
.task-card select,
.heading-week-select select,
.export-builder input,
.export-builder select {
  width: 100%;
  min-height: 39px;
  padding: 8px 10px;
  color: var(--text);
  border: 1px solid var(--rule-dark);
  border-radius: 6px;
  background: var(--white);
  font: 500 13px var(--font-sans);
}

.work-form textarea { min-height: 80px; resize: vertical; }
.work-form__actions { justify-content: flex-end; }

.qc-scoreboard {
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--ink);
  overflow: hidden;
}

.qc-scoreboard > div {
  display: grid;
  gap: 5px;
  padding: 18px 20px;
  color: var(--paper-light);
  border-left: 1px solid rgba(246, 240, 227, .17);
}

.qc-scoreboard > div:first-child { border-left: 0; }
.qc-scoreboard span,
.qc-scoreboard small { color: rgba(246, 240, 227, .62); font-size: 13px; }
.qc-scoreboard strong { color: var(--white); font: 600 32px/1 var(--font-sans); }
.qc-scoreboard .is-attention { background: rgba(213, 101, 71, .18); }

.qc-dashboard__grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(250px, .65fr); gap: 18px; align-items: start; }
.qc-table-wrap { overflow: auto; }
.qc-table-wrap table { width: 100%; border-collapse: collapse; }
.qc-table-wrap th,
.qc-table-wrap td { padding: 11px 13px; border-bottom: 1px solid rgba(205, 191, 174, .62); text-align: left; font-size: 13px; vertical-align: top; }
.qc-table-wrap th { color: var(--muted); font: 500 13px var(--font-mono); text-transform: uppercase; }
.qc-table-wrap td strong,
.qc-table-wrap td small { display: block; }
.qc-table-wrap td strong { color: var(--ink); font-size: 13px; }
.qc-table-wrap td small { margin-top: 2px; color: var(--muted); font-size: 13px; }
.qc-attention,
.qc-clear { display: inline-block; padding: 3px 6px; border-radius: 99px; font-size: 13px; font-weight: 800; }
.qc-attention { color: #7d2b20; background: #f7ddd5; }
.qc-clear { color: var(--teal-dark); background: var(--teal-pale); }
.qc-ranking ol { margin: 0; padding: 0; list-style: none; }
.qc-ranking li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 11px 16px; border-bottom: 1px solid rgba(205, 191, 174, .62); }
.qc-ranking li strong,
.qc-ranking li small { display: block; }
.qc-ranking li strong { color: var(--ink); font-size: 13px; }
.qc-ranking li small { margin-top: 2px; color: var(--muted); font-size: 13px; }
.qc-ranking li em { color: var(--ink); font: 600 18px var(--font-sans); font-style: normal; }
.qc-source-note { display: flex; gap: 9px; padding: 14px 16px; color: var(--teal-dark); background: var(--teal-pale); }
.qc-source-note svg { width: 18px; min-width: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.qc-source-note strong,
.qc-source-note small,
.qc-source-note a { display: block; }
.qc-source-note strong { font-size: 13px; }
.qc-source-note small { margin-top: 2px; color: var(--ink-soft); font-size: 13px; }
.qc-source-note a { margin-top: 7px; color: var(--teal-dark); font-size: 13px; font-weight: 800; text-underline-offset: 3px; }

.broadcasts-surface > section { overflow: hidden; }
.broadcast-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.broadcast-grid--past { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.broadcast-card { display: grid; gap: 12px; min-height: 190px; align-content: start; padding: 19px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.broadcast-card__meta,
.broadcast-card footer { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.broadcast-card__meta span { padding: 3px 6px; color: var(--teal-dark); border-radius: 99px; background: var(--teal-pale); font: 500 13px var(--font-mono); text-transform: uppercase; }
.broadcast-card__meta time,
.broadcast-card footer { color: var(--muted); font-size: 13px; }
.broadcast-card h3 { font: 600 21px/1.05 var(--font-sans); letter-spacing: -.02em; }
.broadcast-card p { margin: 0; color: var(--text); font-size: 14px; line-height: 1.6; white-space: pre-line; }
.broadcast-card footer { align-self: end; margin-top: auto; padding-top: 11px; border-top: 1px solid var(--rule); }
.broadcast-card--past { min-height: 170px; opacity: .78; }

.task-board { display: grid; grid-template-columns: repeat(4, minmax(225px, 1fr)); gap: 12px; align-items: start; overflow: auto; }
.task-column { min-width: 0; border: 1px solid var(--rule); border-radius: 12px; background: var(--paper-dark); }
.task-column > header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--rule); }
.task-column > header h3 { margin: 0; color: var(--ink); font-size: 14px; }
.task-column > header span { display: grid; width: 23px; height: 23px; place-items: center; color: var(--ink); border-radius: 50%; background: var(--ochre-pale); font: 500 13px var(--font-mono); }
.task-column > div { display: grid; gap: 8px; padding: 8px; }
.task-card { display: grid; gap: 10px; padding: 13px; border-radius: 9px; background: var(--paper-light); box-shadow: 0 5px 12px rgba(20, 43, 64, .09); }
.task-card h4 { margin: 0; color: var(--ink); font-size: 14px; }
.task-card p { margin: 0; color: var(--text); font-size: 13px; line-height: 1.55; }
.task-card dl { display: grid; gap: 5px; margin: 0; }
.task-card dl div { display: flex; gap: 8px; justify-content: space-between; }
.task-card dt,
.task-card dd { margin: 0; color: var(--muted); font-size: 13px; }
.task-card label { display: grid; gap: 4px; color: var(--ink-soft); font-size: 13px; font-weight: 800; }
.task-column__empty { padding: 22px 10px; color: var(--muted); font-size: 13px; text-align: center; }

.console-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(290px, .75fr); gap: 18px; align-items: start; }
.console-grid .rollback-panel { grid-column: 1 / -1; }
.console-user-list,
.emergency-list { display: grid; }
.console-user-row,
.emergency-row { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(150px, auto); gap: 11px; align-items: center; padding: 11px 15px; border-bottom: 1px solid rgba(205, 191, 174, .65); }
.console-user-row strong,
.console-user-row small,
.emergency-row strong,
.emergency-row small { display: block; }
.console-user-row strong,
.emergency-row strong { color: var(--ink); font-size: 13px; }
.console-user-row small,
.emergency-row small { margin-top: 2px; color: var(--muted); font-size: 13px; }
.emergency-row > span { color: var(--teal-dark); }
.emergency-row svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.emergency-form { display: grid; gap: 9px; padding: 14px; }
.console-limit-note { margin: 14px; padding: 11px; color: var(--muted); border-radius: 7px; background: var(--paper-dark); font-size: 13px; }
.rollback-panel { padding-bottom: 18px; }
.rollback-target { display: flex; gap: 14px; align-items: center; justify-content: space-between; margin: 16px 18px 10px; padding: 13px; color: var(--ink-soft); border-radius: 8px; background: var(--teal-pale); font-size: 13px; }
.rollback-panel details { margin: 0 18px 13px; color: var(--muted); font-size: 13px; }
.rollback-panel details ol { display: grid; gap: 5px; padding-left: 20px; }
.rollback-panel details li { display: flex; justify-content: space-between; }
.rollback-panel form { display: grid; grid-template-columns: minmax(230px, 1fr) auto; gap: 10px; align-items: end; padding: 0 18px; }
.danger-button { color: var(--red); border-color: rgba(201, 94, 73, .45); }

.export-builder { display: grid; gap: 16px; margin: -4px -4px 22px; padding: 20px; color: var(--paper-light); border-radius: 11px; background: var(--ink); }
.export-builder h2 { margin: 0; color: inherit; font: 600 27px/1 var(--font-sans); }
.export-builder p { margin: 6px 0 0; color: rgba(246, 240, 227, .68); font-size: 14px; }
.export-builder form { display: grid; gap: 13px; }
.export-builder fieldset { padding: 0; border: 0; }
.export-builder legend { margin-bottom: 7px; color: rgba(246, 240, 227, .72); font-size: 13px; font-weight: 800; }
.export-category-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.export-category-grid label,
.export-archive { display: inline-flex; gap: 7px; align-items: center; padding: 7px 9px; color: var(--paper-light); border: 1px solid rgba(246, 240, 227, .22); border-radius: 6px; font-size: 13px; }
.export-category-grid input,
.export-archive input { width: auto; min-height: 0; accent-color: var(--ochre); }
.export-options { display: grid; grid-template-columns: 150px 150px 130px minmax(200px, 1fr); gap: 9px; align-items: end; }
.export-options > label:not(.export-archive) { display: grid; gap: 5px; color: rgba(246, 240, 227, .72); font-size: 13px; font-weight: 800; }
.heading-week-select { min-width: 88px; }
.heading-week-select select { min-height: 37px; }

@media (max-width: 1250px) {
  .operations-home__register,
  .console-register { grid-template-columns: 1fr; }
  .operations-home__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operations-home__quality { grid-column: 1 / -1; }
  .task-board { grid-template-columns: repeat(2, minmax(250px, 1fr)); }
  .broadcast-grid--past { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 940px) {
  .operations-home__register dl,
  .console-register dl,
  .qc-scoreboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operations-home__grid,
  .qc-dashboard__grid,
  .console-grid { grid-template-columns: 1fr; }
  .operations-home__quality,
  .console-grid .rollback-panel { grid-column: auto; }
  .work-form__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .broadcast-grid,
  .broadcast-grid--past { grid-template-columns: 1fr; }
  .export-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 690px) {
  .operations-home__register,
  .console-register { padding: 20px; }
  .operations-home__register dl,
  .console-register dl,
  .qc-scoreboard,
  .work-form__grid,
  .task-board,
  .export-options { grid-template-columns: 1fr; }
  .operations-home__register dl > div,
  .console-register dl > div,
  .qc-scoreboard > div { border-top: 1px solid rgba(246, 240, 227, .17); border-left: 0; }
  .operations-home__register dl > div:first-child,
  .console-register dl > div:first-child,
  .qc-scoreboard > div:first-child { border-top: 0; }
  .dashboard-broadcast,
  .dashboard-task,
  .console-user-row,
  .emergency-row { grid-template-columns: 1fr; }
  .rollback-panel form { grid-template-columns: 1fr; }
  .work-form__actions { flex-direction: column-reverse; }
  .work-form__actions .button { width: 100%; }
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper-dark);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: #e7dfd3;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

::selection {
  color: var(--paper-light);
  background: var(--teal-dark);
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: var(--paper-dark);
}

::-webkit-scrollbar-thumb {
  border: 3px solid var(--paper-dark);
  border-radius: 999px;
  background: var(--rule-dark);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  color: var(--ink);
  border-radius: var(--radius-xs);
  background: var(--ochre);
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  height: 100dvh;
  flex-direction: column;
  min-height: 0;
  align-self: start;
  overflow: hidden;
  color: rgba(255, 253, 249, 0.82);
  background: var(--ink);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 94px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-home {
  display: grid;
  padding: 4px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
}

.sidebar-home .brand-mark {
  transition: border-color 180ms ease, background 180ms ease, transform 180ms var(--ease);
}

.sidebar-home:hover .brand-mark,
.sidebar-home:focus-visible .brand-mark {
  border-color: rgba(231, 178, 79, 0.48);
  background: rgba(231, 178, 79, 0.12);
  transform: translateY(-1px);
}

.sidebar__brand .brand-mark {
  width: 44px;
  height: 44px;
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--ochre);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar__brand .brand-mark svg {
  width: 25px;
  height: 25px;
}

.sidebar__nav {
  display: grid;
  min-height: 0;
  flex: 1;
  align-content: start;
  gap: 5px;
  overflow-y: auto;
  padding: 24px 11px;
}

.sidebar__nav button {
  position: relative;
  display: grid;
  gap: 7px;
  min-height: 78px;
  align-items: center;
  justify-items: center;
  padding: 10px 6px;
  color: rgba(255, 253, 249, 0.68);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms var(--ease);
}

.sidebar__nav button:hover,
.sidebar__nav button.is-active {
  color: var(--paper-light);
  border-color: rgba(231, 178, 79, 0.35);
  background: rgba(231, 178, 79, 0.14);
}

.sidebar__nav button:hover {
  transform: translateY(-1px);
}

.sidebar__nav button.is-active {
  color: var(--ochre);
}

.sidebar__nav svg {
  width: 36px;
  height: 36px;
  padding: 8px;
  color: currentColor;
  border: 1px solid rgba(255, 253, 249, 0.16);
  border-radius: 10px;
  background: rgba(255, 253, 249, 0.06);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms var(--ease);
}

.sidebar__nav button:hover svg {
  border-color: rgba(231, 178, 79, 0.35);
  background: rgba(231, 178, 79, 0.12);
  transform: translateY(-1px);
}

.sidebar__nav button.is-active svg {
  color: var(--ink);
  border-color: var(--ochre);
  background: var(--ochre);
}

.sidebar__nav span {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sidebar__footer {
  margin-top: auto;
  padding: 16px 11px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar__footer button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 4px;
  color: rgba(255, 253, 249, 0.58);
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
}

.sidebar__footer button:hover {
  color: var(--paper-light);
}

.sidebar__footer svg {
  width: 17px;
  height: 17px;
}

.workspace {
  min-width: 0;
  background: var(--paper);
}

.topbar {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 14px 30px;
  border-bottom: 1px solid rgba(20, 43, 64, 0.16);
  background: rgba(251, 248, 241, 0.88);
}

.topbar-brand,
.topbar-actions,
.user-chip,
.view-heading-actions,
.sync-note,
.draft-status,
.map-toolbar-actions,
.map-footer,
.editor-toolbar,
.editor-toolbar-actions,
.editor-footer,
.setup-step,
.text-button,
.button,
.portal-switch {
  display: flex;
  align-items: center;
}

.topbar-brand {
  min-width: 0;
  gap: 11px;
  padding: 3px 6px 3px 3px;
  color: inherit;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
}

.topbar-brand .brand-mark {
  transition: border-color 180ms ease, background 180ms ease, transform 180ms var(--ease);
}

.topbar-brand:hover .brand-mark,
.topbar-brand:focus-visible .brand-mark {
  border-color: rgba(42, 129, 123, 0.45);
  background: var(--teal-pale);
  transform: translateY(-1px);
}

.topbar-brand strong {
  display: block;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.topbar-brand span:not(.brand-mark):not(.avatar) {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.brand-mark {
  display: inline-grid;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--ink);
  border: 1px solid rgba(20, 43, 64, 0.18);
  border-radius: 9px;
  background: var(--ochre-pale);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.topbar-actions {
  justify-content: flex-end;
  gap: 8px;
}

.portal-switch {
  min-height: 38px;
  padding: 0 13px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  background: transparent;
  font-size: 15px;
  font-weight: 800;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}

.portal-switch:hover {
  color: var(--ink);
  border-color: var(--rule);
}

.portal-switch[aria-pressed='true'] {
  color: var(--ink);
  border-color: var(--rule);
  background: var(--paper-light);
}

.portal-switch[hidden],
.organization-switcher[hidden],
.setup-step[hidden] {
  display: none;
}

.topbar-icon,
.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius-xs);
  background: transparent;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms var(--ease);
}

.topbar-icon:hover,
.icon-button:hover {
  color: var(--ink);
  border-color: var(--rule-dark);
  background: var(--paper-light);
  transform: translateY(-1px);
}

.icon-button.is-active {
  color: var(--paper-light);
  border-color: var(--teal-dark);
  background: var(--teal-dark);
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
  transform: none;
}

.topbar-icon svg,
.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.user-chip {
  gap: 8px;
  min-height: 38px;
  padding: 3px 7px;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  background: transparent;
  font-size: 15px;
  font-weight: 800;
  transition: border-color 160ms ease, background 160ms ease;
}

.user-chip:hover {
  border-color: var(--rule);
  background: var(--paper-light);
}

.avatar {
  display: inline-grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--ink);
  border-radius: 50%;
  background: var(--ochre);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  text-align: center;
}

main {
  min-height: calc(100vh - 76px);
  padding: 29px 30px 38px;
}

.portal-view[hidden] {
  display: none;
}

.view-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}

.view-heading h1 {
  max-width: 740px;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(32px, 3.2vw, 52px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.view-heading p {
  max-width: 620px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.view-heading-actions {
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.sync-note,
.draft-status {
  gap: 7px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.sync-dot,
.draft-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.draft-dot {
  background: var(--orange);
}

.button {
  min-height: 40px;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  font-size: 15px;
  font-weight: 800;
  transition: transform 180ms var(--ease), background 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}

.button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.button--primary {
  color: var(--paper-light);
  border-color: var(--ink);
  background: var(--ink);
  box-shadow: 0 8px 18px rgba(20, 43, 64, 0.14);
}

.button--primary:hover {
  background: var(--ink-soft);
}

.button--outline {
  color: var(--ink);
  border-color: var(--rule-dark);
  background: transparent;
}

.button--outline:hover {
  border-color: var(--ink);
  background: var(--paper-light);
}

.button--full {
  width: 100%;
  margin-top: 7px;
}

.button-icon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
}

.staff-layout {
  position: relative;
  display: block;
}

.map-workspace,
.admin-map-workspace,
.setup-rail,
.admin-inspector {
  min-width: 0;
  border: 1px solid var(--rule);
  background: var(--paper-light);
}

.map-workspace {
  overflow: hidden;
  border-radius: var(--radius-md);
}

.map-toolbar-row {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(250px, 360px) auto;
  min-height: 64px;
  align-items: center;
  gap: 16px;
  padding: 10px 14px 10px 18px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-light);
}

.map-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
}

.map-tab,
.map-edge-tab {
  min-height: 34px;
  padding: 0 13px;
  color: var(--muted);
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.map-tab:hover,
.map-edge-tab:hover,
.map-tab.is-active {
  color: var(--ink);
  background: var(--ochre-pale);
}

.map-tab.is-active {
  font-weight: 500;
}

.map-tab:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.map-toolbar-actions {
  gap: 2px;
}

.map-edge-tab {
  min-height: 30px;
  padding: 0 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.map-stage,
.admin-map-stage {
  position: relative;
  overflow: hidden;
  background-color: var(--paper);
  background-image: radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.62), transparent 26%), radial-gradient(circle at 86% 84%, rgba(205, 191, 174, 0.18), transparent 32%), repeating-linear-gradient(0deg, rgba(20, 43, 64, 0.018) 0, rgba(20, 43, 64, 0.018) 1px, transparent 1px, transparent 5px);
}

.map-stage {
  height: clamp(300px, calc(100vh - 340px), 760px);
  min-height: 0;
}

.app-shell[data-portal='staff'] main {
  padding-top: clamp(18px, 3vh, 29px);
  padding-bottom: clamp(20px, 3vh, 38px);
}

.app-shell[data-portal='staff'] .view-heading {
  margin-bottom: clamp(14px, 2vh, 22px);
}

.map-layer,
.admin-map-layer {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
  will-change: transform;
  transition: transform 420ms var(--ease);
}

.map-stage.is-pannable,
.admin-map-stage.is-pannable {
  cursor: grab;
}

.map-stage.is-navigating,
.admin-map-stage.is-navigating {
  cursor: grabbing;
}

.map-stage.is-navigating .map-layer,
.admin-map-stage.is-navigating .admin-map-layer {
  transition: none;
}

.map-stage::before,
.admin-map-stage::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: '';
  background-image: linear-gradient(rgba(20, 43, 64, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(20, 43, 64, 0.035) 1px, transparent 1px);
  background-size: 45px 45px;
  opacity: 0.6;
}

.floorplan {
  position: absolute;
  inset: 7% 5% 4%;
  z-index: 1;
  width: 90%;
  height: 89%;
  overflow: visible;
}

.plan-border {
  fill: rgba(255, 253, 249, 0.34);
  stroke: rgba(20, 43, 64, 0.22);
  stroke-width: 1.5;
}

.plan-wall {
  fill: rgba(251, 248, 241, 0.47);
  stroke: #274255;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.plan-faint {
  fill: none;
  stroke: rgba(49, 80, 100, 0.18);
  stroke-width: 1.2;
}

.plan-door {
  fill: none;
  stroke: var(--terracotta);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.74;
}

.plan-path {
  fill: none;
  stroke: var(--ochre);
  stroke-width: 3;
  stroke-dasharray: 3 8;
  stroke-linecap: round;
  opacity: 0.78;
}

.plan-label {
  fill: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.04em;
}

.plan-label--large {
  fill: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.plan-compass {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.1;
  opacity: 0.72;
}

.plan-compass path:first-of-type {
  fill: var(--ochre);
  stroke: var(--ink);
}

.map-search {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--rule-dark);
  border-radius: var(--radius-xs);
  background: var(--white);
}

.map-search svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.map-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--ink);
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
}

.map-search input::placeholder {
  color: var(--muted);
}

.map-label--north {
  position: absolute;
  top: 27px;
  left: 50%;
  z-index: 3;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  transform: translateX(-50%);
}

.map-note {
  position: absolute;
  z-index: 3;
  display: grid;
  gap: 3px;
  padding: 7px 9px;
  color: var(--ink-soft);
  border-top: 1px solid rgba(20, 43, 64, 0.2);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.45;
}

.map-note strong {
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.map-note--left {
  bottom: 27px;
  left: 29px;
}

.map-note--right {
  right: 28px;
  bottom: 28px;
}

.map-legend {
  position: absolute;
  right: 26px;
  bottom: 102px;
  z-index: 3;
  display: grid;
  gap: 7px;
  min-width: 138px;
  padding: 11px 12px;
  color: var(--ink-soft);
  border: 1px dashed rgba(20, 43, 64, 0.38);
  border-radius: var(--radius-xs);
  background: rgba(251, 248, 241, 0.82);
  font-size: 14px;
}

.map-legend strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.map-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-key {
  display: inline-block;
  width: 13px;
  height: 10px;
  flex: 0 0 auto;
  border: 1px dashed var(--teal-dark);
  border-radius: 2px;
  background: rgba(42, 129, 123, 0.12);
}

.section-key--empty {
  border-color: var(--muted-light);
  background: rgba(137, 147, 152, 0.08);
}

.status-mark,
.legend-pin {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.status-mark--available,
.legend-pin--placed {
  color: var(--green);
  background: rgba(52, 137, 98, 0.24);
}

.status-mark--in-use {
  color: var(--orange);
  border-radius: 2px;
  background: rgba(215, 122, 47, 0.22);
  transform: rotate(45deg);
}

.status-mark--issue {
  color: var(--red);
  background: rgba(201, 94, 73, 0.22);
}

.status-mark--offline,
.legend-pin--unplaced {
  color: var(--muted-light);
  background: rgba(137, 147, 152, 0.18);
}

.map-controls,
.editor-controls {
  position: absolute;
  left: 26px;
  bottom: 27px;
  z-index: 5;
  display: grid;
  overflow: hidden;
  width: 37px;
  border: 1px solid var(--rule-dark);
  border-radius: var(--radius-xs);
  background: rgba(251, 248, 241, 0.92);
  box-shadow: 0 8px 18px rgba(20, 43, 64, 0.08);
}

.map-controls button,
.editor-controls button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--ink);
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  font-size: 19px;
  line-height: 1;
}

.map-controls button:last-child,
.editor-controls button:last-child {
  border-bottom: 0;
}

.map-controls button:hover,
.editor-controls button:hover {
  color: var(--teal-dark);
  background: var(--ochre-pale);
}

.map-controls svg,
.editor-controls svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.map-markers,
.admin-map-markers {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.map-empty-search {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  display: grid;
  gap: 4px;
  min-width: 210px;
  padding: 16px;
  border: 1px dashed var(--rule-dark);
  border-radius: var(--radius-sm);
  background: rgba(251, 248, 241, 0.9);
  text-align: center;
  transform: translate(-50%, -50%);
}

.map-empty-search strong {
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 600;
}

.map-empty-search span {
  color: var(--muted);
  font-size: 14px;
}

.map-marker,
.admin-marker {
  position: absolute;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  color: var(--ink);
  border: 2px solid var(--white);
  border-radius: 50% 50% 50% 4px;
  background: var(--green);
  box-shadow: 0 8px 16px rgba(20, 43, 64, 0.22);
  pointer-events: auto;
  transform: translate(-50%, -100%) rotate(-45deg);
  transition: transform 200ms var(--ease), box-shadow 200ms ease, filter 180ms ease;
}

.map-marker::after,
.admin-marker::after {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: currentColor;
  content: '';
}

.map-marker:hover,
.map-marker.is-selected,
.admin-marker:hover,
.admin-marker.is-selected {
  z-index: 2;
  box-shadow: 0 12px 24px rgba(20, 43, 64, 0.3), 0 0 0 6px rgba(231, 178, 79, 0.28);
  filter: saturate(1.15);
  transform: translate(-50%, -100%) rotate(-45deg) scale(1.13);
}

.map-marker svg,
.admin-marker svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: var(--white);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  transform: rotate(45deg);
}

.map-marker[data-status='in-use'],
.admin-marker[data-status='in-use'] {
  background: var(--orange);
}

.map-marker[data-status='issue'],
.admin-marker[data-status='issue'] {
  background: var(--red);
}

.map-marker[data-status='offline'],
.admin-marker[data-status='offline'] {
  background: var(--muted-light);
}

.map-marker-label {
  position: absolute;
  top: -25px;
  left: 27px;
  display: none;
  min-width: max-content;
  padding: 5px 8px;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius-xs);
  background: var(--paper-light);
  box-shadow: 0 8px 18px rgba(20, 43, 64, 0.14);
  font-size: 14px;
  font-weight: 800;
  transform: rotate(45deg);
  transform-origin: bottom left;
}

.map-marker:hover .map-marker-label,
.map-marker.is-selected .map-marker-label,
.admin-marker:hover .map-marker-label,
.admin-marker.is-selected .map-marker-label {
  display: block;
}

.map-footer {
  min-height: 48px;
  justify-content: space-between;
  gap: 14px;
  padding: 0 18px;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  background: var(--paper-light);
  font-size: 14px;
}

.map-footer > span:first-child,
.map-scale {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.map-footer svg,
.text-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.map-scale {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 13px;
}

.text-button {
  gap: 7px;
  padding: 6px 0;
  color: var(--teal-dark);
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 800;
}

.text-button:hover {
  color: var(--ink);
}

.details-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 12;
  display: flex;
  width: min(390px, calc(100% - 32px));
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: 0 22px 55px rgba(13, 32, 50, 0.24);
  animation: details-panel-in 220ms var(--ease) both;
}

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

@keyframes details-panel-in {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

.details-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 23px 22px 17px;
  border-bottom: 1px solid var(--rule);
}

.details-panel__header h2,
.details-panel__header h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.details-panel__eyebrow,
.drawer-label,
.rail-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.panel-close {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
}

.panel-close:hover {
  color: var(--ink);
  border-color: var(--rule);
  background: var(--paper);
}

.panel-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.details-panel__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 21px 22px;
}

.device-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}

.device-glyph {
  display: inline-grid;
  width: 45px;
  height: 45px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 11px;
  background: var(--ochre-pale);
}

.device-glyph svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.device-summary strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.device-summary span {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 14px;
}

.detail-list {
  display: grid;
  margin: 0;
}

.detail-row {
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 9px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(205, 191, 174, 0.7);
}

.detail-row svg {
  width: 18px;
  height: 18px;
  color: var(--ink-soft);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.detail-row dt {
  color: var(--muted);
  font-size: 14px;
}

.detail-row dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.details-panel__footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 20px;
}

.details-panel__footer .button {
  width: 100%;
}

.panel-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 10px 11px;
  color: var(--muted);
  border: 1px dashed var(--rule);
  border-radius: var(--radius-xs);
  background: var(--paper);
  font-size: 14px;
  line-height: 1.45;
}

.panel-note svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--teal-dark);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.location-panel__header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.details-panel__body--room {
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.location-device-summary {
  display: flex;
  flex: 0 0 auto;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.location-device-summary strong {
  color: var(--ink);
  font-size: 14px;
}

.location-device-summary span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: right;
}

.room-device-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--rule-dark) transparent;
  scrollbar-width: thin;
}

.room-device-list::-webkit-scrollbar {
  width: 8px;
}

.room-device-list::-webkit-scrollbar-thumb {
  border: 2px solid var(--white);
  border-radius: 6px;
  background: var(--rule-dark);
}

.room-device-list--single {
  overflow: visible;
}

.room-device-card {
  padding: 19px 18px 17px;
  border-bottom: 1px solid var(--rule);
  background: var(--white);
}

.room-device-card:last-child {
  border-bottom: 0;
}

.room-device-card__heading {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
}

.room-device-card__heading .device-glyph {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.room-device-card__heading .device-glyph svg {
  width: 21px;
  height: 21px;
}

.room-device-card__heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.device-status-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 13px;
}

.room-device-card__facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 13px;
  margin: 15px 0 0;
  border-top: 1px solid rgba(205, 191, 174, 0.7);
}

.room-device-card__facts > div {
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid rgba(205, 191, 174, 0.55);
}

.room-device-card__facts > div:nth-last-child(1):nth-child(odd) {
  grid-column: 1 / -1;
}

.room-device-card__facts dt {
  color: var(--muted);
  font-size: 13px;
}

.room-device-card__facts dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.room-device-card__note {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.room-device-card__note svg,
.room-device-card__report svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.room-device-card__report {
  margin-top: 9px;
}

.location-empty {
  display: grid;
  min-height: 280px;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 28px;
  text-align: center;
}

.location-empty > span,
.location-prompt__mark {
  display: grid;
  width: 45px;
  height: 45px;
  margin-bottom: 5px;
  place-items: center;
  color: var(--teal-dark);
  border: 1px solid var(--rule);
  border-radius: 11px;
  background: var(--ochre-pale);
}

.location-empty svg,
.location-prompt__mark svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.location-empty h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 600;
}

.location-empty p {
  max-width: 240px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.location-prompt > div {
  display: grid;
  justify-items: center;
}

.location-prompt__count {
  margin-top: 14px;
  color: var(--teal-dark);
  font-family: var(--font-mono);
  font-size: 13px;
}

.empty-panel {
  display: grid;
  flex: 1;
  place-items: center;
  padding: 24px;
  text-align: center;
}

.empty-panel h2 {
  margin: 0 0 7px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 26px;
  font-weight: 600;
}

.empty-panel p {
  max-width: 235px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}
