/* KPOT Signage — license dashboard styles.
 *
 * No build step and no external resources: the site's Content-Security-Policy
 * allows styles only from this origin, so everything lives here and uses the
 * system font stack. Colours are custom properties on :root with a dark set
 * under prefers-color-scheme. The 3 px blue rule along the top of the page is
 * the same blue as the progress bar the tablets draw under every slide. */

:root {
  color-scheme: light dark;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-2: #eaf0f7;
  --ink: #0f1f3d;
  --ink-2: #4b5b78;
  --ink-3: #7a879e;
  --line: #d8e0eb;
  --line-strong: #b9c5d6;

  --accent: #3b9dff;
  --accent-ink: #1c6fd6;
  --accent-soft: #e3f0ff;
  --danger: #b42318;
  --danger-soft: #fde4e1;
  --danger-ink: #ffffff;

  --toast-bg: #0f1f3d;
  --toast-fg: #f3f6fa;
  --backdrop: rgba(8, 16, 32, 0.55);
  --shadow-pop: 0 12px 32px rgba(15, 31, 61, 0.18);

  --st-active-fg: #0b6e57;
  --st-active-bg: #d9f3ea;
  --st-active-dot: #119b7a;
  --st-expiring-fg: #7a5200;
  --st-expiring-bg: #fff0c2;
  --st-expiring-dot: #d99a00;
  --st-expired-fg: #a32015;
  --st-expired-bg: #fde3e0;
  --st-expired-dot: #d33a2b;
  --st-suspended-fg: #3e4c68;
  --st-suspended-bg: #e2e8f2;
  --st-suspended-dot: #5b6b8a;
  --st-revoked-fg: #6e1414;
  --st-revoked-bg: #f1d6d6;
  --st-revoked-dot: #8e1f1f;
  --st-issued-fg: #1c6fd6;
  --st-issued-bg: transparent;
  --st-issued-dot: #3b9dff;

  --radius: 6px;
  --radius-lg: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1526;
    --surface: #141e33;
    --surface-2: #1b2740;
    --ink: #e7edf7;
    --ink-2: #a9b6ce;
    --ink-3: #74829c;
    --line: #273450;
    --line-strong: #37466a;

    --accent: #3b9dff;
    --accent-ink: #7fbfff;
    --accent-soft: #15325a;
    --danger: #ff7a6e;
    --danger-soft: #4a1c1a;
    --danger-ink: #1a0604;

    --toast-bg: #e7edf7;
    --toast-fg: #0d1526;
    --backdrop: rgba(0, 4, 12, 0.7);
    --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5);

    --st-active-fg: #6fddbb;
    --st-active-bg: #0f3b33;
    --st-active-dot: #35c99d;
    --st-expiring-fg: #ffd166;
    --st-expiring-bg: #3f2e07;
    --st-expiring-dot: #f0b429;
    --st-expired-fg: #ff8a7e;
    --st-expired-bg: #4a1a16;
    --st-expired-dot: #ff6a5a;
    --st-suspended-fg: #b9c6de;
    --st-suspended-bg: #26344d;
    --st-suspended-dot: #8a9bbb;
    --st-revoked-fg: #ff9a9a;
    --st-revoked-bg: #4c1d1d;
    --st-revoked-dot: #d35050;
    --st-issued-fg: #7fbfff;
    --st-issued-bg: transparent;
    --st-issued-dot: #3b9dff;
  }
}

/* ---------- base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent-ink);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

code,
.key,
.mono {
  font-family: var(--mono);
  font-size: 0.95em;
}

p {
  margin: 0 0 10px;
}

.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;
}

[hidden] {
  display: none !important;
}

/* ---------- loading rule along the top ---------- */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 60;
  background: var(--accent-soft);
  overflow: hidden;
}

.progress::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -35%;
  width: 35%;
  background: var(--accent);
  animation: progress-slide 1.1s ease-in-out infinite;
}

@keyframes progress-slide {
  from { left: -35%; }
  to { left: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .progress::after {
    animation: none;
    left: 0;
    width: 100%;
  }
}

/* ---------- top bar ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-top: 3px solid var(--accent);
  border-bottom: 1px solid var(--line);
}

.top-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
  min-height: 52px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  padding: 10px 0;
}

.brand-name {
  font-weight: 650;
  font-size: 16px;
}

.brand-sub {
  color: var(--ink-2);
  font-size: 14px;
}

.nav {
  display: flex;
  gap: 2px;
}

.nav a {
  display: inline-block;
  padding: 6px 10px;
  border-radius: var(--radius);
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}

.nav a:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.nav a[aria-current="page"] {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.user {
  margin-left: auto;
  position: relative;
}

.user summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius);
  color: var(--ink-2);
  max-width: 260px;
}

.user summary::-webkit-details-marker {
  display: none;
}

.user summary:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.user-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role {
  font-size: 12px;
  color: var(--ink-3);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 7px;
  line-height: 18px;
}

.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  padding: 6px;
  z-index: 30;
}

.user-menu a,
.user-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  background: none;
  border-radius: var(--radius);
  color: var(--ink);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.user-menu a:hover,
.user-menu button:hover {
  background: var(--surface-2);
}

.user-menu .user-menu-head {
  padding: 8px 10px 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

@media (max-width: 680px) {
  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    margin: 0 -16px;
    padding: 0 16px 8px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .brand-sub {
    display: none;
  }
}

/* ---------- page and sections ---------- */

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px 72px;
  outline: none;
}

@media (min-width: 720px) {
  .page {
    padding: 32px 24px 96px;
  }
}

.view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.view-title {
  font-size: 22px;
  font-weight: 650;
  line-height: 1.25;
  margin: 0;
  /* a location name with no break opportunity must not widen the page on a phone */
  overflow-wrap: anywhere;
}

.view-lede {
  color: var(--ink-2);
  margin: 4px 0 0;
  max-width: 64ch;
}

.view-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.section {
  margin-top: 32px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.section-title {
  font-size: 16px;
  font-weight: 650;
  margin: 0;
}

.section-note {
  color: var(--ink-2);
  font-size: 13px;
  margin: 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.panel-body {
  padding: 16px;
}

@media (min-width: 720px) {
  .panel-body {
    padding: 20px;
  }
}

.muted {
  color: var(--ink-2);
}

.small {
  font-size: 12.5px;
}

.prose {
  max-width: 68ch;
  overflow-wrap: anywhere;
}

.prose p:last-child {
  margin-bottom: 0;
}

.back-link {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 13px;
}

.back-link:hover {
  color: var(--accent-ink);
  text-decoration: underline;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  background: var(--surface-2);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-ink);
  filter: brightness(1.08);
}

@media (prefers-color-scheme: dark) {
  .btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #061a33;
  }

  .btn-primary:hover {
    background: var(--accent);
  }
}

.btn-danger {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--surface);
}

.btn-danger:hover {
  background: var(--danger-soft);
}

.btn-danger-solid {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--danger-ink);
}

.btn-danger-solid:hover {
  background: var(--danger);
  filter: brightness(1.08);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--accent-ink);
}

.btn-ghost:hover {
  background: var(--accent-soft);
}

.btn-sm {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12.5px;
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ---------- forms ---------- */

.field {
  display: grid;
  gap: 5px;
  margin-bottom: 14px;
}

.field:last-child {
  margin-bottom: 0;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.field-hint {
  font-size: 12.5px;
  color: var(--ink-3);
}

.field-error {
  font-size: 12.5px;
  color: var(--danger);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--ink-3);
}

.input[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--danger);
}

.textarea {
  min-height: 84px;
  resize: vertical;
}

.select {
  appearance: auto;
}

.input-narrow {
  max-width: 120px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 500;
}

.check input {
  margin: 3px 0 0;
  accent-color: var(--accent-ink);
}

.check-text {
  font-weight: 400;
}

.form-error {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius);
  padding: 8px 10px;
  margin-bottom: 14px;
  font-size: 13px;
}

.form-row {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }

  .form-row-3 {
    grid-template-columns: 2fr 2fr 1fr;
  }
}

.form-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* ---------- counts strip / filter chips ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chip {
  --dot: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 12px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.chip:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.chip[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot);
  flex: none;
}

.chip-count {
  font-weight: 650;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.chip[aria-pressed="true"] .chip-count {
  color: var(--accent-ink);
}

.chip-all {
  --dot: transparent;
}

.chip-all .chip-dot {
  display: none;
}

.chip-active { --dot: var(--st-active-dot); }
.chip-expiring { --dot: var(--st-expiring-dot); }
.chip-expired { --dot: var(--st-expired-dot); }
.chip-suspended { --dot: var(--st-suspended-dot); }
.chip-revoked { --dot: var(--st-revoked-dot); }
.chip-issued { --dot: var(--st-issued-dot); }

.toolbar {
  display: flex;
  gap: 10px 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.search {
  flex: 1 1 220px;
  max-width: 420px;
}

/* ---------- tables ---------- */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table th,
.table td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.table th {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table-licenses {
  min-width: 860px;
}

.table-devices {
  min-width: 760px;
}

.table-admins {
  min-width: 720px;
}

.table-audit {
  min-width: 760px;
}

.row-link {
  cursor: pointer;
}

.row-link:hover td {
  background: var(--surface-2);
}

.cell-main {
  font-weight: 500;
}

.cell-main a {
  color: var(--ink);
  text-decoration: none;
}

.cell-main a:hover {
  color: var(--accent-ink);
  text-decoration: underline;
}

.cell-sub {
  display: block;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 2px;
  font-weight: 400;
}

.num {
  font-variant-numeric: tabular-nums;
}

.nowrap {
  white-space: nowrap;
}

.actions-cell {
  white-space: nowrap;
}

.actions-cell .btn + .btn {
  margin-left: 4px;
}

.empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--ink-2);
}

.empty-title {
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.empty .btn {
  margin-top: 12px;
}

.loading {
  padding: 28px 16px;
  color: var(--ink-2);
  text-align: center;
}

.error-box {
  padding: 16px;
  border: 1px solid var(--danger);
  border-radius: var(--radius-lg);
  background: var(--danger-soft);
  color: var(--ink);
}

.error-box .btn {
  margin-top: 10px;
}

/* ---------- status pill ---------- */

.pill {
  --pill-fg: var(--ink-2);
  --pill-bg: var(--surface-2);
  --pill-dot: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--pill-bg);
  color: var(--pill-fg);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pill-dot);
}

.st-active { --pill-fg: var(--st-active-fg); --pill-bg: var(--st-active-bg); --pill-dot: var(--st-active-dot); }
.st-expiring { --pill-fg: var(--st-expiring-fg); --pill-bg: var(--st-expiring-bg); --pill-dot: var(--st-expiring-dot); }
.st-expired { --pill-fg: var(--st-expired-fg); --pill-bg: var(--st-expired-bg); --pill-dot: var(--st-expired-dot); }
.st-suspended { --pill-fg: var(--st-suspended-fg); --pill-bg: var(--st-suspended-bg); --pill-dot: var(--st-suspended-dot); }
.st-revoked { --pill-fg: var(--st-revoked-fg); --pill-bg: var(--st-revoked-bg); --pill-dot: var(--st-revoked-dot); }
.st-issued { --pill-fg: var(--st-issued-fg); --pill-bg: var(--st-issued-bg); --pill-dot: var(--st-issued-dot); }

.pill.st-issued {
  border-color: var(--st-issued-dot);
}

.pill-lg {
  font-size: 13.5px;
  padding: 4px 12px 4px 10px;
}

/* ---------- license key ---------- */

.keycell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

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

.key-lg {
  display: block;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
  margin: 4px 0 12px;
}

@media (min-width: 480px) {
  .key-lg {
    font-size: 30px;
  }
}

.key-box {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}

.key-hidden {
  color: var(--ink-2);
}

/* ---------- detail view ---------- */

.detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 6px;
}

.detail-head .view-title {
  margin-right: 4px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px 24px;
  margin: 0;
}

.facts dt {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 2px;
}

.facts dd {
  margin: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.facts .cell-sub {
  font-weight: 400;
}

.tablet-note {
  --note: var(--ink-3);
  border-left: 3px solid var(--note);
  background: var(--surface-2);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 12px 16px;
  max-width: 72ch;
  /* prints the location name and the administrator's reason, which may be one long token */
  overflow-wrap: anywhere;
}

.tablet-note p {
  margin-bottom: 6px;
}

.tablet-note p:last-child {
  margin-bottom: 0;
}

.tablet-note.st-active,
.tablet-note.st-expiring,
.tablet-note.st-expired,
.tablet-note.st-suspended,
.tablet-note.st-revoked,
.tablet-note.st-issued {
  --note: var(--pill-dot);
}

.note-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.detail-grid {
  display: grid;
  /* minmax(0, …): a bare 1fr is minmax(auto, 1fr), which lets the 760px devices table widen the column past the viewport */
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

@media (min-width: 900px) {
  .detail-grid {
    grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr);
    align-items: start;
  }
}

.reason-box {
  margin-top: 16px;
}

/* ---------- timeline (audit on a license) ---------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.timeline li:last-child {
  border-bottom: 0;
}

@media (min-width: 640px) {
  .timeline li {
    grid-template-columns: 170px minmax(0, 1fr);
  }
}

.timeline-when {
  color: var(--ink-2);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.timeline-what {
  font-weight: 500;
}

.timeline-meta {
  display: block;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 400;
  overflow-wrap: anywhere;
}

/* ---------- login ---------- */

.login {
  max-width: 400px;
  margin: 40px auto 0;
}

.login .panel-body {
  padding: 24px;
}

.login-title {
  font-size: 20px;
  font-weight: 650;
  margin: 0 0 4px;
}

.login-note {
  font-size: 12.5px;
  color: var(--ink-2);
  margin: 14px 0 0;
}

/* ---------- setup ---------- */

.cmd {
  position: relative;
  margin: 0;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  white-space: pre;
  color: var(--ink);
}

.cmd-block {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.cmd-block:last-child {
  margin-bottom: 0;
}

.cmd-caption {
  font-size: 13px;
  color: var(--ink-2);
}

.cmd-tools {
  display: flex;
  justify-content: flex-end;
}

.kv {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.kv th,
.kv td {
  text-align: left;
  vertical-align: top;
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--line);
}

.kv tr:last-child th,
.kv tr:last-child td {
  border-bottom: 0;
}

.kv th {
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  width: 220px;
}

.kv td {
  overflow-wrap: anywhere;
}

.setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

@media (min-width: 900px) {
  .setup-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
}

.health-ok {
  color: var(--st-active-fg);
  font-weight: 600;
}

.health-bad {
  color: var(--danger);
  font-weight: 600;
}

.rules {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-2);
}

/* ---------- dialogs ---------- */

.dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-pop);
}

.dialog::backdrop {
  background: var(--backdrop);
}

.dialog-form {
  margin: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 32px);
}

.dialog-head {
  padding: 18px 20px 0;
  /* the title and intro print the location name */
  overflow-wrap: anywhere;
}

.dialog-title {
  font-size: 17px;
  font-weight: 650;
  margin: 0 0 4px;
}

.dialog-intro {
  color: var(--ink-2);
  margin: 0 0 12px;
}

.dialog-body {
  padding: 4px 20px;
  overflow-y: auto;
}

.dialog-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding: 16px 20px 20px;
}

.steps {
  margin: 0 0 12px;
  padding-left: 20px;
}

.steps li {
  margin-bottom: 4px;
}

/* ---------- toasts ---------- */

.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 70;
  display: grid;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--toast-bg);
  color: var(--toast-fg);
  border-left: 3px solid var(--accent);
  box-shadow: var(--shadow-pop);
  font-size: 13.5px;
}

.toast-error {
  border-left-color: #ff6a5a;
}

.toast-text {
  flex: 1;
  overflow-wrap: anywhere;
}

.toast-close {
  flex: none;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  padding: 0 2px;
}

.toast-close:hover {
  opacity: 1;
}

/* ---------- misc ---------- */

.inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent-ink);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.notice {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink-2);
}

.notes-form .textarea {
  min-height: 72px;
}

.mt-12 {
  margin-top: 12px;
}

.mt-16 {
  margin-top: 16px;
}
