:root {
    color-scheme: dark;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 16px;
    --canvas: #0d0d10;
    --sidebar: #111115;
    --surface: #17171c;
    --surface-raised: #212128;
    --input: #101014;
    --ink: #f4f1f4;
    --muted: #b9b3be;
    --line: #34323c;
    --control-line: #77717e;
    --primary: #a31b27;
    --primary-hover: #bd2330;
    --accent: #d12b36;
    --link: #ef6e61;
    --focus: #fa806b;
    --tint: #2e1719;
    --danger: #ffb9ac;
    --danger-surface: #3a1719;
    color: var(--ink);
    background: var(--canvas);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
body { margin: 0; }
@media (pointer: coarse) {
    [data-context-action] { -webkit-touch-callout: none; }
}
a { color: var(--link); text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip { position: absolute; left: .75rem; top: -8rem; z-index: 5; background: var(--surface-raised); padding: .75rem; }
.skip:focus { top: .5rem; }

.topbar {
    display: flex; gap: .8rem; align-items: center; justify-content: space-between;
    min-height: 4.25rem; padding: .6rem clamp(.85rem, 3vw, 2rem);
    background: var(--sidebar); border-bottom: 1px solid var(--line);
}
.brand {
    display: flex; align-items: center; gap: .68rem;
    color: var(--ink); text-decoration: none;
}
.brand-art { display: block; width: 3rem; height: auto; flex: none; }
.brand-art, .login-art { mix-blend-mode: lighten; }
@media (prefers-reduced-motion: no-preference) {
    .brand-art, .login-art { animation: stillworks-rotation 48s linear infinite; }
}
@keyframes stillworks-rotation { to { transform: rotate(1turn); } }
.brand-copy { display: grid; gap: .14rem; }
.brand-mark { font-size: 1.25rem; line-height: 1.15; letter-spacing: .075em; text-transform: uppercase; font-weight: 850; }
.brand-description { font-size: .74rem; line-height: 1.25; color: var(--muted); font-weight: 550; }
.actions, .toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.settings-shop-select { max-inline-size: 28rem; }
.layout { display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); min-height: calc(100dvh - 4.25rem); }
.layout.solo { display: block; }
nav {
    display: flex; flex-direction: column;
    background: var(--sidebar); border-right: 1px solid var(--line); padding: 1rem .75rem;
}
.nav-links { flex: 1; min-height: 0; }
.nav-footer { margin-top: auto; }
.nav-links + .nav-footer { border-top: 1px solid var(--line); padding-top: .75rem; }
.nav-footer button { width: 100%; }
.solo nav { max-width: 62rem; margin-inline: auto; border-right: 0; border-bottom: 1px solid var(--line); }
.solo nav:not(.expanded) { display: none; }
nav h2 {
    font-size: .72rem; letter-spacing: .095em; text-transform: uppercase;
    margin: 1.05rem .65rem .3rem; color: var(--muted);
}
nav h2:first-child { margin-top: .25rem; }
nav a { display: block; text-decoration: none; color: var(--ink); padding: .5rem .65rem; border-radius: .28rem; }
nav a:hover { background: var(--surface-raised); }
nav a[aria-current="page"] { background: var(--tint); color: var(--link); font-weight: 700; box-shadow: inset 3px 0 var(--accent); }

main { min-width: 0; width: min(100%, 86rem); margin-inline: auto; padding: clamp(1rem, 3vw, 2.1rem); }
.solo main { max-width: 62rem; }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.65rem, 4vw, 2.4rem); line-height: 1.15; letter-spacing: -.025em; }
h2 { font-size: 1.19rem; margin-bottom: .65rem; }
h3 { font-size: 1rem; }
p { line-height: 1.48; margin-bottom: .6rem; }
.page-heading { display: flex; justify-content: space-between; gap: .7rem 1rem; align-items: start; flex-wrap: wrap; margin-bottom: 1rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: .5rem; padding: 1rem; margin-bottom: .85rem; min-width: 0; }
.muted, .empty { color: var(--muted); }
.empty { margin: .5rem 0; }
.error, .note { padding: .7rem .8rem; border-radius: .3rem; margin: .55rem 0; }
.error { color: var(--danger); background: var(--danger-surface); }
.note { background: var(--tint); }
.toolbar { margin-bottom: .85rem; }

.button, button {
    font: inherit; display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem;
    padding: .46rem .72rem; border-radius: .35rem; border: 1px solid transparent; cursor: pointer;
    font-weight: 650; text-decoration: none; color: #fff; background: var(--primary);
}
.button:hover, button:hover { background: var(--primary-hover); }
.button.secondary, button.secondary { color: var(--ink); background: var(--surface-raised); border-color: var(--control-line); }
.button.secondary:hover, button.secondary:hover { background: var(--tint); }
button:disabled { opacity: .62; cursor: wait; }
.menu-button { display: none; }
.menu-button.compact-menu:not([hidden]) { display: inline-flex; }
label { font-weight: 570; }
input, select, textarea {
    font: inherit; color: var(--ink); min-height: 2.75rem; border: 1px solid var(--control-line); background: var(--input);
    padding: .48rem .55rem; border-radius: .32rem; max-width: 100%; min-width: 0; accent-color: var(--primary);
}
input[type="radio"], input[type="checkbox"] { min-height: auto; }
textarea { min-height: 5.5rem; resize: vertical; }
.field { display: grid; gap: .32rem; min-width: 0; }
.field label { font-size: .92rem; }
form { display: grid; gap: .72rem; }
form.inline { display: flex; flex-wrap: wrap; gap: .55rem; align-items: end; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: .7rem; }
.booking-time-label { font-weight: 570; }
.booking-date-time { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: .32rem; }
.login {
    max-width: 26rem; margin: clamp(1.35rem, 10vh, 5.5rem) auto;
    padding: clamp(1rem, 3vw, 1.9rem); border-top: 3px solid var(--accent);
    box-shadow: 0 1.25rem 4rem #0006;
}
.login-art { display: block; width: min(100%, 7.5rem); height: auto; margin: 0 auto .75rem; }
.login h1 { font-size: clamp(1.4rem, 5vw, 1.9rem); text-align: center; }
.login form { margin-top: 1.3rem; gap: .85rem; }
.login-back { margin-top: .72rem; }
.password-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; }

.table-wrap { overflow-x: auto; }
.service-work-lines { margin: 0; padding-inline-start: 1rem; min-inline-size: 10rem; }
.message-text { white-space: pre-wrap; }
table { border-collapse: collapse; width: 100%; font-size: .94rem; }
th, td { text-align: left; padding: .63rem .55rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; vertical-align: top; }
th { font-weight: 650; color: var(--muted); background: var(--surface-raised); }
tr:last-child td { border-bottom: 0; }
td .button { font-size: .88rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: .85rem; }
.cards .panel { margin: 0; }
.stack { display: grid; gap: .7rem; }
.kv { display: grid; grid-template-columns: minmax(7rem, max-content) 1fr; gap: .4rem .85rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.badge {
    display: inline-block; padding: .24rem .45rem; font-size: .82rem; border: 1px solid var(--line);
    border-radius: .27rem; color: var(--ink); background: var(--surface-raised); font-weight: 650;
}
.arrival-yellow { background: #372a0c; color: #ffe6a0; border-color: #886b28; }
.arrival-green { background: #142d21; color: #bcf2cb; border-color: #487c59; }
.arrival-red { background: #401719; color: #ffc6bb; border-color: #a34e4b; }
.arrival-black { background: #08080a; color: #f5f1f5; border-color: #88818d; }

main:has(> .schedule-page) {
    width: 100%; margin-inline: 0; padding-block-start: .75rem;
    padding-inline: clamp(.75rem, 1.25vw, 1.25rem);
}
.panel.calendar-workspace { padding: 0; border: 0; border-radius: 0; background: transparent; }
.calendar-month-staging { margin-block: .85rem; }
.calendar-header, .calendar-controls { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem 1rem; }
.calendar-header { justify-content: space-between; margin-bottom: .75rem; }
.calendar-jump { display: grid; gap: .35rem; justify-items: end; margin-inline-start: auto; max-width: 100%; }
.calendar-date-wheel { display: flex; gap: .3rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.calendar-date-wheel span { color: var(--muted); font-size: .78rem; }
.calendar-jump :is(button, select) { min-height: 2rem; padding: .25rem .45rem; font-size: .78rem; }
.calendar-next-slot { white-space: nowrap; }
.schedule-switch { gap: .5rem; padding-inline: .45rem; background: transparent; color: var(--muted); }
.schedule-switch:hover { background: var(--surface-raised); }
.schedule-switch[aria-checked="false"] .schedule-label,
.schedule-switch[aria-checked="true"] .wip-label { color: var(--ink); }
.schedule-switch-track {
    position: relative; width: 2.125rem; height: 1.25rem;
    background: var(--surface-raised); border: 1px solid var(--control-line); border-radius: 999px;
}
.schedule-switch-track::after {
    content: ""; position: absolute; top: .125rem; left: .125rem;
    width: .875rem; height: .875rem; border-radius: 50%; background: var(--ink);
}
.schedule-switch[aria-checked="true"] .schedule-switch-track { background: var(--primary); border-color: var(--accent); }
.schedule-switch[aria-checked="true"] .schedule-switch-track::after { transform: translateX(.875rem); }
.daylight-saving-toggle { display: inline-flex; align-items: center; gap: .5rem; width: fit-content; min-height: 2.75rem; cursor: pointer; }
.daylight-saving-toggle input:checked + .schedule-switch-track { background: var(--primary); border-color: var(--accent); }
.daylight-saving-toggle input:checked + .schedule-switch-track::after { transform: translateX(.875rem); }
.daylight-saving-toggle input:focus-visible + .schedule-switch-track { outline: 2px solid var(--focus); outline-offset: 2px; }
.daylight-saving-toggle:has(input:disabled) { opacity: .6; cursor: default; }
.calendar-controls {
    align-items: end; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--line);
}
.calendar-controls [aria-current="true"] { background: var(--tint); border-color: var(--accent); }
.calendar-scroll { overflow-x: auto; }
.calendar { display: grid; gap: .4rem; }
.calendar.week { grid-template-columns: repeat(7, minmax(7rem, 1fr)); }
.calendar.month { grid-template-columns: repeat(var(--calendar-days, 7), minmax(6.6rem, 1fr)); }
.calendar-day { padding: .5rem; min-height: 7.4rem; background: var(--input); border: 1px solid var(--line); border-radius: .3rem; }
.calendar-day h3 { font-size: .87rem; margin-bottom: .48rem; }
.calendar-day :is(a, .month-job) {
    display: block; padding: .35rem .4rem; border-radius: .25rem; background: var(--tint);
    border-inline-start: 3px solid var(--job-status, var(--accent)); margin-bottom: .34rem; color: var(--link);
}
.calendar-day :is(a, .month-job).hoist { background: #232037; color: #dfd1fb; border-inline-start-color: var(--job-status, #a797cf); }
.calendar-day .month-job { width: 100%; text-align: start; font-weight: 400; }
.calendar-day .calendar-time { display: block; font-size: .78rem; }
.personal-calendar .personal-calendar-layers { margin-block: 0 .7rem; }
.personal-calendar-layers summary { color: var(--ink); cursor: pointer; width: fit-content; }
.personal-layer-groups { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; margin-block-start: .45rem; }
.personal-calendar-options { border: 0; margin: 0; min-width: 0; padding: 0; display: flex; flex-wrap: wrap; column-gap: .65rem; }
.personal-calendar-options legend { color: var(--muted); font-size: .8rem; }
.calendar-checkbox { display: inline-flex; gap: .35rem; align-items: center; min-block-size: 2rem; font-size: .82rem; }
.calendar-checkbox input { width: 1rem; min-height: 1rem; accent-color: var(--accent); }
.personal-all-day, .personal-all-day-label { min-block-size: 2rem; border-bottom: 1px solid var(--line); padding: .2rem 0; }
.personal-all-day-label { position: sticky; left: 0; z-index: 3; color: var(--muted); background: var(--surface); text-align: end; font-size: .7rem; padding-inline-end: .45rem; }
.personal-event-chip { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.personal-all-day .personal-event-chip { display: block; min-height: 1.35rem; width: 100%; padding: .12rem .3rem; text-align: start; font-size: .73rem; }
.personal-calendar .personal-event-chip { border-inline-start: 3px solid var(--job-status, var(--event-accent, var(--accent))); }
.calendar-day h3 a.personal-month-day { background: none; border: 0; padding: 0; color: inherit; }
.personal-event-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.personal-request { padding-block: .5rem; border-block-start: 1px solid var(--line); }
.calendar-reminder-alerts { margin-block: .4rem; }
.calendar-reminder { display: flex; align-items: center; gap: .5rem; padding: .25rem .45rem; border-inline-start: 3px solid var(--accent); }
.calendar-device { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; }
.calendar.day .calendar-day { min-height: 3rem; }
.timed-scroll { max-block-size: clamp(19rem, 59vh, 43rem); overflow: auto; }
.calendar.timed {
    --time-slot-height: 1.15rem;
    display: grid; gap: 0 .4rem; grid-template-columns: 3.4rem repeat(var(--calendar-days), minmax(7rem, 1fr));
}
.calendar.timed.has-staging {
    grid-template-columns: minmax(7rem, 1fr) 3.4rem repeat(var(--calendar-days), minmax(7rem, 1fr));
}
.calendar.day.has-staging {
    grid-template-columns: min(10rem, 36%) 3.4rem repeat(var(--calendar-days), minmax(7rem, 1fr));
}
.calendar.timed.resource-lanes {
    grid-template-columns: 3.4rem repeat(var(--calendar-days), minmax(9rem, 1fr));
}
.calendar.timed.resource-lanes.has-staging {
    grid-template-columns: min(10rem, 36%) 3.4rem repeat(var(--calendar-days), minmax(9rem, 1fr));
}
.calendar-day-date { margin: 0; font-size: 1.15rem; }
.time-heading a { display: block; color: inherit; }
.time-heading a:hover { color: var(--accent); }
.check-in-button { min-inline-size: 7rem; }
.visit-target { display: grid; justify-items: start; text-align: start; overflow-wrap: anywhere; }
.check-in-identifier { display: flex; align-items: end; gap: .55rem; }
.check-in-identifier .field { flex: 1 1 0; }
.check-in-identifier button { flex: 0 0 auto; white-space: nowrap; }
.check-in-vin-status:empty { display: none; }
#check-in-camera-inbox { background: var(--surface-raised); border-bottom: 1px solid var(--line); padding: .45rem .75rem; }
#check-in-camera-inbox .actions { justify-content: space-between; gap: .4rem; }
#check-in-camera-inbox .actions + .actions { margin-top: .45rem; }
.visit-camera { width: min(42rem, calc(100% - 1rem)); }
.visit-camera video { display: block; width: 100%; max-height: 62dvh; object-fit: contain; background: #000; }
.visit-camera [role="status"] { min-height: 1.4em; margin: .4rem 0; }
.wip-actions { justify-content: space-between; align-items: end; margin-bottom: .6rem; }
.wip-search { margin: 0; flex: 1 1 22rem; }
.wip-search .field { flex: 1 1 10rem; max-inline-size: 28rem; }
.wip-grid {
    position: relative; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none;
}
.wip-grid::-webkit-scrollbar { display: none; }
.wip-grid table { table-layout: fixed; }
.wip-grid :is(th, td) { block-size: 2.25rem; padding-block: 0; vertical-align: middle; }
.wip-grid :is(th, td):not(:last-child) { border-inline-end: 1px solid var(--line); }
.wip-grid :is(th, td):first-child { padding-inline-start: 1.65rem; }
.wip-grid th { padding-inline-end: .85rem; background: transparent; border-block-end-color: var(--control-line); }
.wip-grid td:first-child { position: relative; }
.wip-grid tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.wip-cell { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wip-balance { text-align: end; font-variant-numeric: tabular-nums; }
.wip-cell .wip-visit-link {
    min-height: 0; padding: 0; background: transparent; border: 0; border-radius: 0;
    color: var(--link); font: inherit; text-decoration: underline;
}
.wip-grid tr[data-job-status] > td:first-child::after {
    content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; inline-size: .8rem;
    border-inline-start: 3px solid var(--job-status, transparent);
    border-block: 3px solid var(--job-status, transparent);
    border-start-start-radius: .45rem; border-end-start-radius: .45rem; pointer-events: none;
}
.resource-lanes .time-heading { overflow: hidden; text-overflow: ellipsis; }
.has-staging :is(.time-corner, .time-hours) { left: auto; }
.calendar.no-open-days { grid-template-columns: minmax(0, 1fr); }
.calendar.timed.has-staging.no-open-days { grid-template-columns: min(10rem, 36%) minmax(0, 1fr); }
.no-open-days.has-staging .staging-lane { grid-column: 1; }
.no-open-days.has-staging .calendar-closed-message { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.calendar-closed-message { margin: 0; padding: .65rem; color: var(--muted); }
[data-job-status="ready"] { --job-status: #50bb76; }
[data-job-status="awaitingParts"] { --job-status: #e4bf39; }
[data-job-status="awaitingApproval"] { --job-status: #b86b50; }
[data-job-status="longBackorder"] { --job-status: #f34552; }
[data-job-status="declined"] { --job-status: #000; }
[data-job-status="awaitingDeposit"] { --job-status: #83808c; }
.staging-lane { display: flex; flex-direction: column; min-width: 0; }
.staging-slots {
    flex: 1; width: 100%; min-block-size: calc(5 * var(--time-slot-height)); padding: 0; border: 0; border-radius: 0;
    --staging-lines: repeating-linear-gradient(to bottom, transparent 0 calc(var(--time-slot-height) - 1px),
        var(--line) calc(var(--time-slot-height) - 1px) var(--time-slot-height));
    background: var(--staging-lines);
}
.staging-slots:hover, .staging-slots:focus-visible { background: var(--tint) var(--staging-lines); }
.staging-slots:focus-visible { outline-offset: -3px; }
.staging-body {
    position: sticky; top: 2.2rem; overflow: auto; padding: .25rem .3rem;
    max-block-size: calc(clamp(19rem, 59vh, 43rem) - 2.2rem);
}
.staging-group + .staging-group:not([hidden]) { margin-top: .5rem; }
.staging-group h3 { margin: .2rem 0 .25rem; font-size: .69rem; font-weight: 600; color: var(--muted); }
.staging-message { margin: .2rem; font-size: .75rem; color: var(--muted); }
.staging-card {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start;
    gap: .04rem .2rem; margin-bottom: .25rem; padding: .25rem .3rem;
    border-radius: .28rem; border-inline-start: 3px solid var(--job-status, var(--accent));
    background: var(--tint); font-size: .75rem; line-height: 1.2; position: relative;
}
.staging-card:has(.staging-resize) {
    min-block-size: min(15rem, calc(3.3rem + var(--planned-slots, 0) * .55rem));
    padding-block-end: .65rem;
}
.staging-length { align-self: end; font-variant-numeric: tabular-nums; }
.staging-card .staging-resize {
    position: absolute; inset-inline-end: .25rem; inset-block-end: 0;
    width: 1.8rem; height: .62rem; min-height: 0; padding: 0; border: 0; background: transparent;
    cursor: ns-resize; touch-action: none;
}
.staging-resize::after { content: ""; display: block; width: 1.1rem; height: 2px; margin: auto; background: var(--muted); }
@media (pointer: coarse) {
    .staging-card:has(.staging-resize) { padding-block-end: 1rem; }
    .staging-card .staging-resize { width: 2.5rem; height: 1rem; }
}
.staging-card :is(a, .staging-job-link) {
    color: var(--ink); font-weight: 600; text-decoration: none; overflow-wrap: anywhere;
}
.staging-card .staging-job-link {
    display: block; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; text-align: start;
    font-size: inherit; line-height: inherit;
}
.staging-card :is(a, .staging-job-link):hover { text-decoration: underline; }
.staging-detail { grid-column: 1 / -1; color: var(--muted); font-size: .68rem; overflow-wrap: anywhere; }
.can-edit .staging-card, .can-edit .staging-card :is(a, button),
.staging-card[data-job-status="calendarJob"], .staging-card[data-job-status="calendarJob"] button {
    cursor: grab; user-select: none;
}
.staging-card.dragging { opacity: .5; }
.staging-card .staging-book {
    grid-area: 1 / 2; min-height: 1.55rem; padding: .09rem .22rem; font-size: .68rem; touch-action: none;
}
@media (pointer: coarse) {
    .staging-card .staging-book { min-height: 2.1rem; }
}
.staging-dialog { width: min(32rem, calc(100% - 2rem)); }
.calendar-job-details h3 { margin-bottom: .35rem; }
.calendar-job-details form { margin: 0; }
.customer-lookup { display: grid; gap: .55rem; margin: .65rem 0; }
.customer-lookup-status { margin: 0; }
[data-job-status="calendarJob"] { --job-status: #8473a9; }
.calendar-feedback { margin: .4rem 0 .7rem; }
.time-heading {
    position: sticky; top: 0; z-index: 4; min-height: 2.2rem; margin: 0; padding: .5rem;
    background: var(--input); border: 1px solid var(--line); border-bottom: 0; border-radius: .3rem .3rem 0 0;
    font-size: .87rem; font-weight: 700; white-space: nowrap;
}
.time-corner {
    z-index: 5; left: 0; border: 0; border-radius: 0; background: var(--surface);
    color: var(--muted); text-align: end;
}
.time-hours {
    position: sticky; left: 0; z-index: 3; background: var(--surface); text-align: end;
}
.time-hours > div { height: calc(var(--label-slots) * var(--time-slot-height)); padding: .2rem .45rem; font-size: .72rem; color: var(--muted); }
:is(.time-column, .staging-lane) {
    position: relative; border: 1px solid var(--line); border-radius: 0 0 .3rem .3rem; background: var(--input);
}
.time-slot {
    display: block; width: 100%; height: var(--time-slot-height); min-height: 0; padding: 0;
    border: 0; border-bottom: 1px dashed var(--line); border-radius: 0; background: transparent; scroll-margin-top: 2.4rem;
}
.time-slot.half-hour-end { border-bottom: 1px solid color-mix(in srgb, var(--line) 78%, var(--muted)); }
.time-slot.hour-end { border-bottom: 1px solid color-mix(in srgb, var(--line) 58%, var(--muted)); }
.time-slot:has(.time-capacity) { position: relative; }
.time-capacity {
    color: #a8f079; font-size: .66rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1;
    pointer-events: none;
}
.time-slot .time-capacity { position: absolute; inset-inline-end: .22rem; inset-block-start: .58rem; }
.time-slot[aria-label*="available for this hour"] > .time-capacity { z-index: 1; }
.time-capacity.full { opacity: .6; }
.day-capacity:not([hidden]) { display: block; margin-top: .22rem; }
.time-slot.unavailable { border-bottom-color: transparent; background: var(--sidebar); }
.time-column.closed { min-height: 3rem; background: var(--sidebar); }
.calendar-closed { position: absolute; top: .5rem; left: .5rem; z-index: 1; font-size: .8rem; color: var(--muted); }
.hours-day {
    display: grid; grid-template-columns: 4.5rem repeat(2, minmax(0, 1fr)); align-items: end; gap: .6rem;
    min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: .35rem; padding: .6rem;
}
.hours-open { display: flex; align-items: center; gap: .35rem; min-height: 2.75rem; }
@media (max-width: 460px) {
    .hours-day { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hours-open { grid-column: 1 / -1; min-height: 1.75rem; }
}
button.time-slot:not(:disabled):hover { background: var(--tint); }
button.time-slot:disabled { opacity: 1; cursor: default; }
button.time-slot:focus-visible { outline-offset: -3px; }
.booking-layer { position: absolute; inset: 0; pointer-events: none; }
.capacity-gutter .booking-layer { inset-inline-end: 1.15rem; }
.timed-booking, .booking-preview, .availability-marker {
    position: absolute; top: var(--booking-top); height: var(--booking-height); min-height: .9rem;
    left: calc(var(--booking-left) + .3rem); width: calc(var(--booking-width) - .6rem); overflow: hidden;
    border-radius: .28rem; background: var(--tint); border-inline-start: 3px solid var(--job-status, var(--booking-accent, var(--accent)));
}
.timed-booking {
    pointer-events: auto; left: calc(var(--booking-left) + 2px); width: calc(var(--booking-width) - 4px);
    border-radius: .22rem .46rem .18rem .18rem; box-shadow: inset 0 0 0 1px #ffffff12;
}
.availability-marker {
    z-index: 3; border: 1px solid var(--focus); border-inline-start-width: 3px;
    background: var(--input); color: var(--ink); white-space: nowrap; text-overflow: ellipsis;
    font-size: .68rem; line-height: 1.25; padding: .04rem .25rem;
}
.timed-booking.hoist { background: #232037; --booking-accent: #a797cf; }
.timed-booking.serviceTruck { background: #192a32; }
.timed-booking .booking-link {
    display: flex; flex-direction: column; height: 100%; overflow: hidden; padding: .12rem .34rem;
    width: 100%; min-height: 0; margin: 0; border: 0; background: transparent; text-align: start;
    color: var(--ink); text-decoration: none; font-size: .75rem; font-weight: 400; line-height: 1.16; align-items: stretch;
}
.booking-tab-title { display: flex; align-items: baseline; gap: .25rem; min-width: 0; }
.timed-booking :is(.booking-asset, .booking-number, .booking-work, .booking-contact) {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; min-height: 0;
}
.timed-booking .booking-asset { flex: 1 1 auto; }
.timed-booking .booking-number { flex: 0 0 auto; }
.timed-booking .booking-number, .timed-booking .booking-contact { color: var(--muted); font-size: .68rem; }
.timed-booking .booking-tab-title, .timed-booking .booking-work, .timed-booking .booking-contact { flex: 0 0 auto; }
.timed-booking.editable-booking { touch-action: none; }
.timed-booking.editable-booking .booking-link { cursor: grab; user-select: none; padding-inline-end: .65rem; }
.timed-booking.dragging { opacity: .45; }
.booking-resize {
    position: absolute; z-index: 1; right: 0; width: 1.3rem; height: .37rem; min-height: 0;
    padding: 0; border: 0; border-radius: 0; background: transparent; cursor: ns-resize;
}
.booking-resize.start { top: 0; }
.booking-resize.end { bottom: 0; }
.booking-resize::after { content: ""; width: 1.1rem; height: 2px; background: var(--muted); border-radius: 2px; }
.booking-resize:hover { background: var(--surface-raised); }
.timed-booking :focus-visible { outline-offset: -2px; }
.booking-preview {
    z-index: 2; padding: .2rem .35rem; border: 1px dashed var(--focus); color: var(--ink);
    background: var(--danger-surface); font-size: .75rem;
}


.slot-preview { background: var(--tint); border-style: solid; }
.estimate-dialog {
    color: var(--ink); width: min(48rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem);
    padding: 1rem; border: 1px solid var(--control-line); border-radius: .5rem; background: var(--surface);
}
.estimate-dialog::backdrop { background: #000a; }
.estimate-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.estimate-dialog-header h2 { margin: 0; font-size: 1.3rem; }
.estimate-dialog > div > .panel { margin-bottom: 0; }


.staff-dialog { width: min(36rem, calc(100% - 2rem)); }
.staff-dialog-body, .staff-dialog-body form { display: grid; gap: .75rem; }
.staff-dialog-body form > button { justify-self: start; }
.staff-checkbox:not([hidden]) { display: flex; align-items: center; gap: .5rem; }
.staff-access-options { min-inline-size: 0; margin: 0; padding: .4rem .75rem .6rem; border: 1px solid var(--line); border-radius: .5rem; }
.staff-access-options legend { padding-inline: .3rem; font-weight: 650; }
.staff-access-options p { margin-bottom: .4rem; }
.staff-access-options .form-grid { gap: .15rem .7rem; }
.staff-access-options .staff-checkbox { min-block-size: 2.5rem; cursor: pointer; }
.staff-access-options input[type="checkbox"] { flex: none; inline-size: 1rem; block-size: 1rem; margin: 0; accent-color: var(--accent); }
.staff-packet { border-top: 1px solid var(--line); padding-top: .75rem; }
.staff-packet h3 { margin-bottom: .45rem; }
.staff-dialog-body > button { justify-self: start; }

.order-sheet.paper {
    color-scheme: light;
    --ink: #222836;
    --muted: #4f5969;
    --rule: #b5c7e6;
    --line: #9ba9c0;
    --input: #fffefa;
    --surface: #f6f7fb;
    --surface-raised: #edf1f8;
    --control-line: #67778f;
    --focus: #89223c;
    --tint: #e3e9f6;
    --link: #9e2532;
    --danger: #7b1525;
    --danger-surface: #fbe5e6;
    --paper-base: #fffefa;
    --paper-rule: #d78c94;
    --paper-gutter: clamp(.8rem, 2.6vw, 2.5rem);
    --paper-gap: clamp(.65rem, 1.35vw, 1.25rem);
    background-color: var(--paper-base);
    background-image: linear-gradient(to right, transparent calc(var(--paper-gutter) - 1px),
        var(--paper-rule) calc(var(--paper-gutter) - 1px) var(--paper-gutter), transparent var(--paper-gutter));
    padding: clamp(1.2rem, 2.5vw, 2.25rem) clamp(1rem, 3vw, 2.4rem) clamp(1.5rem, 3.2vw, 2.8rem)
        calc(var(--paper-gutter) + var(--paper-gap));
    color: var(--ink);
}
.order-sheet.yellow {
    --ink: #292113;
    --muted: #645231;
    --rule: #c0b682;
    --line: #c4a45f;
    --input: #fff8dc;
    --surface: #fbefc5;
    --surface-raised: #f7e6aa;
    --control-line: #8b7546;
    --tint: #f1d992;
    --paper-base: #fff2b8;
    --paper-rule: #c78877;
}
.order-sheet .panel:not(dialog *) {
    background: transparent; border: 0; border-radius: 0; padding: 0; margin: 0 0 1rem;
}
.order-sheet .estimate-dialog { background: var(--surface); }
.order-sheet.order-document { max-inline-size: 52rem; margin-inline: auto; }
.order-body { display: grid; gap: 1.1rem; }
.order-writing, .order-margin { min-inline-size: 0; }
.order-margin { display: grid; justify-self: end; inline-size: min(100%, 17rem); gap: .5rem; font-size: .9rem; }
.order-sheet .order-margin > .panel, .order-sheet .order-margin .estimate-prices > .panel { margin-block-end: 0; }
.invoice-actions { display: grid; gap: .5rem; justify-items: start; margin-block-start: .65rem; }
.invoice-actions form { margin-block-start: .3rem; }
.invoice-items { margin-block-start: .65rem; }
.ageing-invoices { margin: .35rem 0 0; padding: 0; list-style: none; }
.ageing-invoices li { display: flex; flex-wrap: wrap; gap: .25rem .6rem; padding-block: .25rem; }
.order-margin .kv { grid-template-columns: minmax(0, 1fr) max-content; gap: .2rem .65rem; }
.order-margin .kv dd { text-align: end; }
.order-sheet .order-margin .kv > * { border-block-end: 0; }
.order-margin h2 { font-size: 1rem; margin-block-end: .35rem; }
.order-margin > :is(.button, .schedule-switch) { justify-self: start; }
.order-margin .earlier-notes { margin-block-start: 0; }
.order-title, .order-asset-name { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .4rem; }
.order-title { margin-block-end: .5rem; }
.order-title h1 { font-size: clamp(1.3rem, 3vw, 1.85rem); }
.order-profile-tag {
    display: inline-flex; flex: none; align-items: center; min-block-size: 1.32rem; padding: .08rem .38rem;
    border-radius: .7rem; border: 1px solid var(--rule); color: var(--link); background: var(--paper-base);
    font-size: .72rem; line-height: 1; text-decoration: none;
}
.order-profile-tag:hover { background: var(--tint); }
.order-facts { display: grid; gap: .4rem; margin: 0 0 1.2rem; }
.order-facts > div { min-inline-size: 0; }
.order-facts dt { color: var(--muted); font-size: .75rem; }
.order-facts dd { margin: 0; overflow-wrap: anywhere; }
.order-asset-specs { display: grid; gap: .38rem; margin: .6rem 0 .2rem; }
.order-asset-specs > div, .order-facts > div:not(.order-asset-fact) {
    display: grid; grid-template-columns: 7.25rem minmax(0, 1fr); align-items: baseline; gap: .45rem;
    min-block-size: 1.3rem; font-size: .9rem;
}
.order-meter-date { white-space: nowrap; }
.order-asset-id { display: flex; align-items: center; flex-wrap: wrap; gap: .15rem .4rem; margin-block-start: .25rem; }
.order-asset-id-control { position: relative; min-inline-size: 0; }
.order-asset-id-value {
    display: inline-block; min-block-size: 1.6rem; max-inline-size: 100%; padding: 0; border: 0;
    color: var(--link); background: transparent; font: .82rem ui-monospace, monospace;
    overflow-wrap: anywhere; text-align: start; cursor: copy;
}
.order-asset-id-value:hover { background: transparent; text-decoration: underline; }
.order-asset-copy-feedback:not(:empty) {
    position: absolute; inset-inline-start: 0; inset-block-end: calc(100% + .15rem); z-index: 1;
    inline-size: max-content; max-inline-size: min(12rem, calc(100vw - 4rem));
    padding: .25rem .45rem; border-radius: .25rem; background: var(--ink); color: var(--paper-base);
    font-size: .75rem; pointer-events: none;
}
@media (pointer: coarse) {
    .order-profile-tag { min-block-size: 1.8rem; }
    .order-asset-id-value { min-block-size: 2.75rem; }
}
.job-lines { --job-rule-height: 1.5rem; border-block-start: 1px solid var(--rule); }
.order-sheet .job-lines + .panel:not(dialog *) { margin-block-start: .65rem; }
.order-line-heading { display: flex; flex-wrap: wrap; align-items: center; gap: .18rem .6rem; }
.order-line-description { display: flex; align-items: baseline; gap: .3rem; flex: 1 1 8rem; min-inline-size: 0; font-weight: 640; }
.order-line-description > .order-line-cell { flex: 1; }
.order-line-heading form { margin: 0; }
.order-line-hours, .order-line-amount { white-space: nowrap; }
.order-line-hours { text-align: end; }
.order-line-amount { min-inline-size: 4.6rem; text-align: end; font-variant-numeric: tabular-nums; }
.order-line-cell { display: block; min-inline-size: 0; }
.order-line-cell > .line-cell-value {
    display: block; inline-size: 100%; min-block-size: calc(var(--job-rule-height) - 1px); padding: 0 .12rem; border: 0;
    color: inherit; background: transparent; font: inherit; text-align: inherit; overflow-wrap: anywhere; touch-action: manipulation;
}
.order-line-cell > .line-cell-value:hover { background: var(--tint); }
.order-line-cell > .line-cell-input {
    inline-size: 100%; min-block-size: calc(var(--job-rule-height) - 1px); padding: 0 .12rem; border-radius: .2rem;
}
.order-line-hours .order-line-cell { min-inline-size: 4rem; }
.order-line-hours .line-cell-input { inline-size: 5rem; text-align: end; }
.inline-line-feedback { margin: .15rem 0 .25rem; color: var(--danger); font-size: .875rem; }
@media (max-width: 560px) {
    .order-line-heading { column-gap: .4rem; }
    .order-line-description { flex-basis: 7rem; font-size: .93rem; }
    .order-line-hours .order-line-cell { min-inline-size: 2.75rem; }
    .order-line-amount { min-inline-size: 0; }
}
.order-sheet :is(.field, .order-line-heading, .line-part, .kv > *, .note-entry):not(dialog *) {
    border-block-end: 1px solid var(--rule);
}
.order-sheet .field:not(dialog *) { padding-block-end: .32rem; }
.order-sheet .field :is(input, textarea):not(dialog *, [type="checkbox"], [type="radio"], [type="file"]) {
    border: 0; border-block-end: 1px solid var(--control-line); border-radius: 0; background: transparent;
}
.order-sheet .line-part { min-block-size: 1.5rem; padding-block: .15rem; }
.order-sheet .order-line-heading { min-block-size: var(--job-rule-height); }
.order-sheet .blank-job-line {
    display: flex; justify-content: start; width: 100%; min-block-size: var(--job-rule-height);
    padding: 0; border: 0; border-block-end: 1px solid var(--rule); border-radius: 0;
    background: transparent; color: var(--muted); text-align: start; font-weight: 450;
}
.order-sheet .blank-job-line:hover, .order-sheet .blank-job-line:focus-visible { background: var(--tint); }
.line-parts { display: grid; gap: .15rem; margin-inline-start: .75rem; }
.order-line-heading[data-context-action]:hover { background: var(--tint); }
.line-attachment > button {
    padding: .25rem .45rem; min-block-size: 2rem; font-size: .88rem;
}
.line-attachments { display: grid; gap: .2rem; margin: .3rem 0 0 .75rem; }
.line-attachment { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .6rem; }
.line-attachment > button { overflow-wrap: anywhere; text-align: start; }
.attachment-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.attachment-preview { display: grid; gap: .45rem; }
.attachment-display { display: block; max-inline-size: 100%; max-block-size: 43vh; object-fit: contain; }
.photo-frame { position: relative; justify-self: start; max-inline-size: 100%; }
.photo-frame.marking { touch-action: none; cursor: crosshair; }
.photo-mark { position: absolute; border: 3px solid #d51f31; pointer-events: none; }
.attachment-preview [aria-pressed="true"] { border-color: var(--primary); background: var(--tint); }
@media (pointer: coarse) {
    .line-attachment > button { min-block-size: 2.75rem; }
}
.note-dictation { display: grid; gap: .4rem; }
.autosave-status { min-block-size: 1.1rem; }
.autosave-error { color: var(--danger); }
.asset-editor > .autosave-form { margin-block-start: .75rem; }
.inspection-template-choice { margin-block-end: .8rem; }
.inspection-template-choice form { margin-block-start: .5rem; }
.inspection-section { border-block-start: 1px solid var(--rule); padding-block: .55rem; }
.inspection-section > summary { font-weight: 650; cursor: pointer; }
.inspection-check { padding-block: .75rem; }
.inspection-check + .inspection-check { border-block-start: 1px solid var(--rule); }
.inspection-check h3 { margin-block-end: .45rem; }
.inspection-check .form-grid:empty { display: none; }
.inspection-reading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem; align-items: end; }
.inspection-reading > .field:only-child { grid-column: 1 / -1; }
.inspection-check textarea { min-block-size: 3rem; }
.note-dictation-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .55rem; }
.note-mic { gap: .4rem; }
.note-mic.listening { color: #fff; background: var(--primary); }
.note-mic.listening:hover { color: #fff; background: var(--primary-hover); }
.line-part { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.order-sheet:not(.show-estimate-prices) .estimate-prices { display: none; }
.shop-tax-row { align-items: end; }
.earlier-notes { margin-block-start: .45rem; }
.order-sheet .note-entry { padding: .45rem 0 .65rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.order-sheet .note-entry p { margin: .25rem 0 0; }
.scan-main { max-width: 54rem; }
.scan-parts td { font-size: 1rem; }
.scan-parts .form-grid { align-items: end; }
.choices { display: flex; flex-wrap: wrap; gap: .8rem; }
.choices label { display: inline-flex; align-items: center; gap: .32rem; min-height: 2.75rem; }
.media-thumb { max-width: min(100%, 28rem); max-height: 20rem; }

@media (min-width: 791px) {
    .layout:not(.solo) nav { position: sticky; top: 0; align-self: start; height: calc(100dvh - 4.25rem); }
    .nav-links { overflow-y: auto; padding: .25rem; }
}

@media (max-width: 790px) {
    .layout { display: block; }
    .topbar { flex-wrap: wrap; gap: .4rem; }
    .brand { gap: .48rem; }
    .brand-art { width: 2.55rem; }
    .brand-mark { font-size: 1.05rem; }
    .brand-description { font-size: .68rem; }
    .menu-button:not([hidden]) { display: inline-flex; }
    nav:not(.expanded) { display: none; }
    nav { border-right: 0; border-bottom: 1px solid var(--line); }
    .nav-links + .nav-footer { margin-top: .5rem; }
    nav a { min-height: 2.75rem; }
    .page-heading { display: grid; }
    .scan-parts th, .scan-parts td { padding-inline: .4rem; }
}

.booking-asset-fields { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
.booking-asset-fields legend { color: var(--muted); margin-bottom: .4rem; }
.booking-matches:empty { display: none; }
.visit-photo-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); gap: .6rem; }
.visit-photo-list:empty { display: none; }
.visit-photo-list figure { margin: 0; min-inline-size: 0; }
.visit-photo-list img { display: block; max-width: 100%; max-height: 10rem; object-fit: contain; }

.wip-list th[data-wip-column] { position: relative; cursor: grab; touch-action: pan-y; user-select: none; }
.wip-column-resize {
    position: absolute; inset: 0 0 0 auto; inline-size: .7rem;
    cursor: col-resize; touch-action: none;
}
.wip-column-resize:is(:hover, :focus-visible)::after {
    content: ""; position: absolute; inset-block: 0; inset-inline-end: 0;
    border-inline-end: 1px solid var(--focus);
}
.wip-resizing { cursor: col-resize; user-select: none; }
.wip-row-handle {
    position: absolute; inset-block-start: 50%; inset-inline-start: .3rem; translate: 0 -50%;
    inline-size: 1.25rem; min-height: 0; block-size: 1.6rem; padding: 0; border: 0;
    color: var(--muted); background: transparent; cursor: grab; touch-action: none;
}
.wip-row-handle::before {
    content: ""; inline-size: .44rem; block-size: .75rem;
    background: radial-gradient(circle, currentColor 1px, transparent 1.2px) 0 0 / .22rem .25rem;
}
.wip-row-handle:hover { background: var(--surface-raised); }
.wip-list .wip-drag-source { opacity: .45; cursor: grabbing; }
.wip-list th[data-drop-side]::after {
    content: ""; position: absolute; inset-block: 0; inline-size: 3px; background: var(--focus); pointer-events: none;
}
.wip-list th[data-drop-side="before"]::after { inset-inline-start: 0; }
.wip-list th[data-drop-side="after"]::after { inset-inline-end: 0; }
.wip-list tr[data-drop-side="before"] > td { box-shadow: inset 0 2px var(--focus); }
.wip-list tr[data-drop-side="after"] > td { box-shadow: inset 0 -2px var(--focus); }
.wip-drag-preview {
    position: fixed; z-index: 20; translate: 0 .6rem; pointer-events: none;
    padding: .3rem .55rem; border: 1px solid var(--focus); border-radius: .25rem;
    background: var(--surface-raised); color: var(--ink); font-weight: 650;
}
