/* Keep the coordinator deliberately light and local: no remote fonts, images,
   or theme assets are fetched at runtime. */
.site-header { display: flex; align-items: center; gap: .75rem; }
.status-badge.ok { color: #176648; }
.status-badge.stale { color: #963e37; }
.status-badge.suppressed { color: #496456; }

[hidden] { display: none !important; }

:root { color-scheme: light dark; }
body { background: #f8faf8; color: #193329; }
.site-header { max-width: 1100px; margin: auto; padding: .75rem 1rem; }
.brand-mark { width: 2.3rem; height: 2.5rem; object-fit: contain; background: none; border-radius: 0; }
.site-header h1 { margin: 0; font-size: 1.5rem; line-height: 1.2; }
.task-nav { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid #a5b5aa; margin-bottom: 1rem; }
.task-nav a { min-height: 44px; padding: .65rem .85rem; color: inherit; text-decoration: none; }
.task-nav a[aria-current="page"] { font-weight: 700; border-bottom: 3px solid #176648; }
:focus-visible { outline: 3px solid #176648; outline-offset: 2px; }
#dashboard table { display: block; overflow-x: auto; max-width: 100%; }
.admin-grid { display: block; }
@media (prefers-color-scheme: dark) {
  body { background: #12211b; color: #e3eee7; }
  .task-nav { border-color: #80988a; }
  .task-nav a[aria-current="page"] { border-color: #83d6a7; }
  :focus-visible { outline-color: #83d6a7; }
}

/* Task hierarchy: the existing coordinator operations remain unchanged. */
:root { --surface: #fff; --canvas: #f3f6f2; --ink: #193329; --line: #d9e3da; --control-line: #66776b; --control-focus: #176648; --subtle: #496456; }
body { background: var(--canvas); color: var(--ink); }
body > main { max-width: 1600px; margin: 0 auto; padding: 0 1.25rem 3rem; }
.site-header { max-width: none; padding: 1rem 1.5rem; border-bottom: 1px solid var(--line); background: var(--surface); }
#dashboard .workspace { display: grid; grid-template-columns: 210px minmax(0,1fr); gap: 1.5rem; align-items: start; }
.task-nav { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: .3rem; border: 0; margin: 1.5rem 0; }
.task-nav a { display: flex; align-items: center; border-radius: .65rem; padding: .6rem .8rem; line-height: 1.3; }
.task-nav a[aria-current="page"] { background: #dceee2; border: 0; color: #164b34; }
.workspace-content { min-width: 0; }
.workspace-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 1.25rem 0; }
.workspace-toolbar > div { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.workspace-toolbar button { margin: 0; width: auto; padding: .55rem .9rem; }
.workspace-label { color: var(--subtle); font-size: .85rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
#dashboard section[data-page] { background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; padding: clamp(1rem, 2.3vw, 2rem); margin-bottom: 1rem; min-width: 0; overflow-wrap: anywhere; }
#dashboard section[data-page] > h2 { scroll-margin-top: 1rem; }
.group-nav { display: flex; flex-wrap: wrap; gap: .45rem; margin: .5rem 0 1.25rem; }
.group-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: .55rem .8rem; border: 1px solid var(--control-line); border-radius: .5rem; text-decoration: none; color: var(--ink); }
.group-nav a[aria-current="page"] { font-weight: 700; border: 2px solid var(--control-focus); background: var(--canvas); }
.delivery-summary { border-left: 4px solid var(--control-focus); background: var(--canvas); padding: .75rem 1rem; margin: .7rem 0 1.2rem; line-height: 1.55; }
.delivery-summary[data-state="partial"], .delivery-summary[data-state="stale"] { border-color: #9a6430; }
.delivery-summary[data-state="error"] { border-color: #963e37; }
#dashboard table[tabindex]:focus-visible { outline: 3px solid var(--control-focus); outline-offset: 2px; }
#dashboard section[data-page] h2 { font-size: clamp(1.55rem, 2.5vw, 2rem); margin-bottom: .65rem; }
#dashboard section[data-page] h3 { font-size: 1.15rem; margin-top: 1.6rem; }
#dashboard table { font-size: .9rem; }
#dashboard th { white-space: nowrap; }
#dashboard td { overflow-wrap: anywhere; }
#dashboard td.installation-actions { min-width: 16rem; white-space: nowrap; }
.installation-action-buttons { display: flex; align-items: center; gap: .75rem; }
#dashboard .installation-action-buttons button { flex: 0 0 auto; width: auto; min-height: 44px; margin: 0; white-space: nowrap; }
#dashboard form { max-width: 860px; }
#dashboard input, #dashboard select { background: var(--surface); max-width: 100%; min-width: 0; }
.prepare-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.prepare-actions button { margin: 0; }
#prepare-form label { min-width: 0; }
#prepare-form select, #prepare-form input { width: 100%; }
#prepare-form, #prepare-form label, #prepare-new-context { min-width: 0; max-width: 100%; }
#prepare-summary, #prepare-qr-summary { overflow-wrap: anywhere; white-space: normal; }
#prepare-qr-image { display: block; width: 450px; max-width: 100%; height: auto; background: #fff; }
#dashboard small { color: var(--subtle); }
.capacity-banner { border: 1px solid var(--line); }
@media (max-width: 760px) {
  body > main { padding: 0 .8rem 2rem; }
  .site-header { padding: .75rem 1rem; }
  #dashboard .workspace { display: block; }
  .task-nav { position: static; flex-direction: row; flex-wrap: wrap; margin: .7rem 0; padding: .2rem 0 .5rem; border-bottom: 1px solid var(--line); }
  .task-nav a { flex: 0 1 auto; }
  .workspace-toolbar { align-items: flex-start; flex-direction: column; margin: 1rem 0; }
  #dashboard section[data-page] { padding: 1rem; }
  #dashboard .grid { display: block; }
  #dashboard table { font-size: .8rem; }
}
@media (prefers-color-scheme: dark) {
  :root { --surface: #1b2b23; --canvas: #101b16; --ink: #e5eee7; --line: #40594a; --control-line: #91a799; --control-focus: #83d6a7; --subtle: #bbd0c0; }
  .task-nav a[aria-current="page"] { background: #294c38; color: #e4f5e9; }
  #dashboard input, #dashboard select { color: var(--ink); }
}
@media (min-width: 761px) {
  #dashboard section[data-page] > .grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1.5rem; }
}
.capacity-banner.ok { background: #dfefe4; color: #17422d; }
.capacity-banner.near-capacity { background: #fff0c7; color: #513d12; }
.capacity-banner.refusing { background: #fce0dd; color: #651f1b; }
.capacity-banner.unknown { background: #e8eee9; color: #263f31; }
.capacity-banner.stale { border-style: dashed; }
.overview-status { border-left: 4px solid #176648; background: var(--canvas); padding: .75rem 1rem; margin: .85rem 0 1.2rem; }
.overview-status[data-state="partial"], .overview-status[data-state="stale"] { border-color: #9a6430; }
.overview-status[data-state="error"] { border-color: #963e37; }
.overview-links { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.overview-links a { display: inline-flex; align-items: center; min-height: 44px; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: .5rem; color: #164b34; text-decoration: none; font-weight: 600; }
.overview-links a:hover { text-decoration: underline; }
@media (prefers-color-scheme: dark) {
  .capacity-banner.ok { background: #254c35; color: #e1f6e6; }
  .capacity-banner.near-capacity { background: #564527; color: #fff0cb; }
  .capacity-banner.refusing { background: #572e30; color: #ffe1db; }
  .capacity-banner.unknown { background: #293b30; color: #e9f2eb; }
  .overview-links a { color: #b5e4c5; }
}
/* Tables retain a horizontal scroll region when populated; empty messages do not. */
#dashboard table { width: 100%; overflow-x: auto; }
#dashboard table:empty { display: none; }
.empty-state:not(:empty) { padding: 1rem; border: 1px dashed var(--line); border-radius: .7rem; color: var(--subtle); }
.staff-access, .danger-zone { border: 1px solid var(--line); border-radius: .7rem; padding: 1rem; margin-top: 1.5rem; }
.staff-access summary { cursor: pointer; font-weight: 700; }
.danger-zone { border-color: #ac7169; }
#dashboard .danger-action { background: transparent; color: #963e37; border: 1px solid #ac7169; width: auto; }
@media (prefers-color-scheme: dark) { #dashboard .danger-action { color: #ffc1b6; } }
@media (max-width: 760px) {
  #dashboard table:not(:empty) { border: 1px solid var(--line); border-radius: .5rem; }
  #dashboard table:not(:empty)::after { content: 'Swipe table for more →'; display: table-caption; caption-side: bottom; color: var(--subtle); padding: .4rem; }
}
.scroll-hint { display: none; }
@media (max-width: 760px) { .scroll-hint:not([hidden]) { display: block; padding: .4rem 0; color: var(--subtle); } }

/* Sign-in is a separate, narrow task; keep bootstrap visibly subordinate. */
#login { max-width: 32rem; margin: clamp(2rem, 8vh, 6rem) auto; padding: clamp(1.25rem, 4vw, 2.5rem); background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; box-shadow: 0 16px 48px #122b1b12; }
.skip-link { position: absolute; left: 1rem; top: -5rem; z-index: 100; padding: .7rem 1rem; background: var(--surface); color: var(--ink); border: 2px solid #176648; border-radius: .4rem; }
.skip-link:focus { top: .5rem; }
#login .btn-success, #dashboard .btn-success { background-color: #176648; border-color: #176648; color: #fff; }
#dashboard .btn-outline-success { color: #164b34; border-color: #176648; }
#dashboard .btn-outline-success:hover { color: #fff; background-color: #176648; }
/* Bootstrap Reboot is intentionally not a second form framework. Preserve the
   existing nonconverted controls until their focused page-group slices. */
#dashboard form label, #login label { display: block; margin: .65rem 0; font-weight: 600; }
#dashboard form label:has(input[type="checkbox"]) { display: flex; align-items: center; gap: .5rem; }
#dashboard form label small { display: block; margin-top: .2rem; line-height: 1.45; font-weight: 400; }
#dashboard input:not([type="checkbox"]), #dashboard select, #login input { width: 100%; min-height: 44px; padding: .55rem .7rem; border: 1px solid var(--control-line); border-radius: .5rem; color: var(--ink); background: var(--surface); }
#dashboard .form-control:focus, #dashboard .form-select:focus { box-shadow: none; background: var(--surface); color: var(--ink); border-color: var(--control-focus); }
#dashboard input:focus-visible, #dashboard select:focus-visible, #login input:focus-visible { border-color: var(--control-focus); outline: 3px solid var(--control-focus); outline-offset: 2px; }
#dashboard input:disabled, #dashboard select:disabled, #login input:disabled { background: var(--canvas); border-style: dashed; cursor: not-allowed; }
#dashboard input[type="checkbox"] { width: 1.15rem; height: 1.15rem; accent-color: #176648; }
#dashboard button:not(.btn), #login button:not(.btn) { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .55rem .85rem; border: 1px solid #176648; border-radius: .5rem; background: #176648; color: #fff; font-weight: 600; cursor: pointer; }
#dashboard button.secondary, #login button.secondary { border-color: var(--line); background: var(--canvas); color: var(--ink); }
#dashboard button.danger-action:not(.btn) { background: transparent; color: #963e37; border-color: #ac7169; }
@media (prefers-color-scheme: dark) { #dashboard button.danger-action:not(.btn) { color: #ffc1b6; } }
#dashboard button:disabled, #login button:disabled { opacity: .6; cursor: not-allowed; }
#dashboard details { margin: .75rem 0; }
#dashboard summary { cursor: pointer; min-height: 44px; padding: .5rem 0; }
#dashboard ul { padding-left: 1.5rem; }
#dashboard th, #dashboard td { padding: .5rem .65rem; border-bottom: 1px solid var(--line); vertical-align: top; }
#dashboard table { border-collapse: collapse; }
@media (prefers-color-scheme: dark) {
  .status-badge.ok { color: #83d6a7; }
  .status-badge.stale { color: #ffc1b6; }
  .status-badge.suppressed { color: #bbd0c0; }
  #dashboard .btn-outline-success { color: #b5e4c5; border-color: #83d6a7; }
  #dashboard .btn-outline-success:hover { background-color: #376a49; }
  #dashboard input:not([type="checkbox"]), #dashboard select, #login input { color-scheme: dark; }
}
#login .login-eyebrow { color: var(--subtle); font-size: .8rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; margin-bottom: .4rem; }
#login h2 { margin-bottom: .5rem; }
#login .login-intro { color: var(--subtle); }
#login button { display: block; width: 100%; min-height: 44px; }
#login input { min-height: 44px; }
#login .first-setup { margin-top: 1.6rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
#login .first-setup h3 { font-size: 1rem; margin-bottom: .35rem; }
#login .first-setup p { color: var(--subtle); font-size: .9rem; }
#login #login-status:not(:empty), #login #setup-status:not(:empty) { color: var(--ink); padding: .7rem; border-left: 3px solid #648b36; background: var(--canvas); }
@media (max-width: 760px) {
  .workspace-toolbar > div { width: 100%; }
  #login { margin: 1.5rem auto; }
}

/* A native disclosure keeps the same five route links reachable on narrow screens. */
.page-navigation { position: sticky; top: 1rem; }
#dashboard .page-navigation { margin: 0; }
.page-navigation > summary { display: none; }
@media (max-width: 760px) {
  body > main { padding-inline: .5rem; }
  .page-navigation { position: static; border-bottom: 1px solid var(--line); }
  .page-navigation > summary { display: list-item; font-weight: 600; overflow-wrap: normal; }
  .task-nav { flex-direction: column; margin: 0 0 .5rem; border: 0; }
  .task-nav a { width: 100%; overflow-wrap: normal; }
  #dashboard section[data-page] { padding: .75rem .5rem; }
  #dashboard section[data-page] :is(h3, h4, label, summary, button),
  .overview-links a, .group-nav a { overflow-wrap: normal; }
  .overview-status, .delivery-summary { padding-inline: .5rem; }
  .empty-state:not(:empty), .staff-access, .danger-zone { padding: .5rem; }
  .overview-links, .group-nav, .prepare-actions { flex-direction: column; align-items: stretch; }
  .overview-links a, .group-nav a { width: 100%; }
  #dashboard form button, #dashboard .prepare-actions button,
  #dashboard .workspace-toolbar button, #dashboard .danger-action,
  #prepare-review-panel button, #prepare-qr button { width: 100%; white-space: normal; }
}
/* At enlarged phone widths, give the full Administration heading room rather
   than reducing its type or splitting a word. */
@media (max-width: 400px) {
  body > main { padding-inline: .25rem; }
  #dashboard section[data-page="administration"] { padding-inline: 0; }
  #dashboard #passkeys-title { overflow-wrap: normal; }
}

.delivery-metrics { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.delivery-metrics dt { font-size: .9rem; }
.delivery-metrics dd { margin: .25rem 0 0; font-weight: 700; overflow-wrap: anywhere; }
.delivery-metrics > div:last-child { grid-column: 1 / -1; border-top: 1px solid var(--control-focus); padding-top: .75rem; }
@media (max-width: 48rem) { .delivery-metrics { grid-template-columns: 1fr; gap: .75rem; } }
