:root {
  color-scheme: light;
  --ink: #211f1a;
  --muted: #645e51;
  --canvas: #f6f5f1;
  --paper: #fff;
  --line: #e1ded4;
  --gold: #f2ca4d;
  font: 1rem/1.5 system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.wrap { width: min(100% - 2rem, 68rem); margin-inline: auto; }
.top { background: #1c1b18; color: #fff; border-bottom: 3px solid var(--gold); }
.top-inner { display: flex; align-items: center; justify-content: space-between; min-height: 4rem; gap: .75rem; }
.staff-page { padding-block: 2rem; max-width: 42rem; }
.staff-page h1 { margin-bottom: 1rem; }
.signin-fields { padding: 0; margin: 0; border: 0; min-width: 0; }
#signin-enrollment { display: grid; gap: .65rem; }
#signin-enrollment p { color: var(--muted); }
#signin-qr { display: block; max-width: 100%; height: auto; image-rendering: pixelated; }
#signin-form button { margin-top: .3rem; }
.staff-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; color: var(--ink); }
.passkey-form { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem; margin-block: .9rem; }
.passkey-form label { flex: 1 1 14rem; }
.passkey-item { display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding-block: .6rem; border-top: 1px solid var(--line); }
.passkey-item span { overflow-wrap: anywhere; }
#staff-invite-output { display: block; margin-top: .8rem; }
#history-details { margin-top: 1rem; }
#history-details dt { font-weight: 650; }
#history-details dd { margin: 0 0 .55rem; overflow-wrap: anywhere; white-space: pre-wrap; }
#history-details details + details { margin-top: .5rem; }
.brand { display: flex; align-items: center; padding: .5rem 0; }
.brand img { display: block; width: clamp(8.5rem, 22vw, 11rem); max-height: 2.4rem; }
.environment { color: #ffe7a1; font-size: .875rem; border: 1px solid #665633; border-radius: .375rem; padding: .2rem .65rem; white-space: nowrap; }
.page-title { padding: 2.6rem 0 1.4rem; display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.045em; line-height: 1.1; }
.page-title p, .editor-title p { margin-top: .45rem; color: var(--muted); }
button, input, select, textarea { font: inherit; color: inherit; }
button, .button-link { min-height: 2.75rem; padding: .45rem .9rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--paper); font-weight: 650; cursor: pointer; }
button:hover, .button-link:hover { border-color: var(--muted); background: #fbfaf6; }
.button-link { display: grid; align-content: center; color: inherit; text-align: center; text-decoration: none; }
.primary { background: var(--gold); border-color: #c8a739; white-space: nowrap; }
.primary:hover { background: #eac041; }
.office-views { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .85rem; }
.office-views button[aria-pressed="true"] { border-color: #c8a739; background: #fff2c6; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid #4563a7; outline-offset: 2px; }
.lead-panel { background: var(--paper); border: 1px solid var(--line); border-radius: .85rem; overflow: hidden; }
.toolbar { padding: 1rem 1.2rem .55rem; display: grid; gap: .35rem; }
label { font-size: .875rem; font-weight: 650; }
input, select, textarea { width: 100%; min-width: 0; border: 1px solid #cfcabc; border-radius: .5rem; background: #fff; padding: .55rem .65rem; }
input, select { min-height: 2.75rem; }
textarea { resize: vertical; }
.toolbar input { max-width: 30rem; }
#list-status { padding: 0 1.2rem .8rem; color: var(--muted); min-height: 2.3rem; }
.lead-row, .list-head { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.15fr) minmax(0, .8fr) minmax(9rem, auto); align-items: center; gap: .75rem 1rem; padding: .9rem 1.2rem; }
.list-head { padding-block: .55rem; color: var(--muted); background: #faf9f5; font-size: .875rem; font-weight: 650; }
.leads { list-style: none; padding: 0; margin: 0; }
.lead-row { border-top: 1px solid var(--line); }
.lead-row strong { display: block; }
.lead-row > * { min-width: 0; overflow-wrap: anywhere; }
.lead-meta { color: var(--muted); font-size: .875rem; }
.lead-row button { white-space: nowrap; }
.card-actions { display: grid; gap: .4rem; }
.list-footer:has(button:not([hidden])) { padding: .85rem 1.2rem; border-top: 1px solid var(--line); }
dialog { padding: 0; border: 1px solid var(--line); border-radius: .9rem; background: var(--paper); color: var(--ink); width: min(100% - 1.5rem, 40rem); max-height: calc(100dvh - 1.5rem); }
dialog::backdrop { background: rgb(27 24 17 / .65); }
#lead-form, #reopen-form, #booking-form, #readiness-form, .installation-panel, .task-panel { padding: clamp(1rem, 4vw, 1.5rem); }
.editor-title { display: flex; align-items: start; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.editor-title h2 { line-height: 1.25; overflow-wrap: anywhere; }
.icon-button { font-size: 1.3rem; min-width: 2.75rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.form-grid label { display: grid; gap: .25rem; }
.booking-check { display: flex; align-items: center; gap: .55rem; }
.booking-check input { width: 1.2rem; min-height: 1.2rem; height: 1.2rem; }
.readiness-checks { display: grid; gap: .8rem; }
.readiness-label { width: fit-content; border-radius: .35rem; padding: .18rem .5rem; background: #f2efe8; font-size: .8rem; font-weight: 700; }
.readiness-label.ready { background: #e7f4e9; color: #20532c; }
.readiness-label.due { background: #fff1c4; color: #624604; }
.readiness-label.overdue { background: #fce9e7; color: #932021; }
.booking-note { color: var(--muted); margin-bottom: .9rem; }
.wide { grid-column: 1 / -1; }
.editor-status { min-height: 1.6rem; margin: .7rem 0 .2rem; color: var(--muted); overflow-wrap: anywhere; }
.error { color: #a31d21 !important; }
.editor-actions { display: flex; justify-content: end; gap: .55rem; }
.installation-actions { margin-top: .85rem; }
#installation-history summary { font-weight: 650; cursor: pointer; }
#installation-history li + li { margin-top: .4rem; }
.installation-photos { margin-top: 1.1rem; border-top: 1px solid var(--line); padding-top: .7rem; }
.installation-photos summary { cursor: pointer; font-weight: 650; }
.installation-photos h3 { margin: .8rem 0 .35rem; font-size: 1rem; }
.photo-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.25rem, 1fr)); list-style: none; padding: 0; gap: .6rem; margin: .5rem 0; }
.photo-gallery:empty { display: none; }
.photo-gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .45rem; background: var(--canvas); }
.tasks-panel { padding: 1rem; }
.task-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.task-groups h2 { font-size: 1rem; margin-bottom: .35rem; }
.task-list { list-style: none; padding: 0; margin: .4rem 0 0; }
.task-item { display: flex; align-items: center; justify-content: space-between; gap: .65rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.task-item > div { min-width: 0; overflow-wrap: anywhere; }
.next-task { margin-top: .25rem; }
#tasks-status:not(:empty) { margin-bottom: .6rem; }
@media (max-width: 42rem) {
  .top-inner:has(.staff-actions:not([hidden])) { flex-wrap: wrap; padding-bottom: .65rem; }
  .staff-actions { flex-basis: 100%; }
  .task-groups { grid-template-columns: 1fr; }
  .page-title { padding-top: 1.6rem; align-items: start; }
  .list-head { display: none; }
  .lead-row { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .lead-row .person { grid-row: 2; }
  .lead-row .territory { grid-row: 3; grid-column: 1; }
  .lead-row .card-actions { grid-row: 1 / span 3; grid-column: 2; align-self: center; }
  .lead-row .card-actions button { max-width: 10rem; white-space: normal; }
}
@media (max-width: 31rem) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .page-title p { font-size: .875rem; }
  .lead-row, .toolbar, #list-status { padding-inline: .85rem; }
  .lead-row .button-link { max-width: 8.5rem; }
}
