/* ==========================================================================
   RoadMapper · autojuhi töölaud
   Design tokens + component styles. Markup lives in resources/views/components/ui.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
    --brand: #174c3d;
    --brand-hover: #1f5f4c;
    --brand-soft: #e3eddc;
    --brand-ink: #d3ed9e;

    --ink: #16302a;
    --ink-2: #3d5249;
    --muted: #5d6f66;

    --bg: #f3f5ef;
    --surface: #fff;
    --surface-2: #eef2ea;
    --line: #d6ded2;
    --line-strong: #a9b9ad;

    --green-bg: #e3eddc;
    --green-ink: #3d6420;
    --blue-bg: #e2e9f6;
    --blue-ink: #34508a;
    --violet-bg: #efe7f7;
    --violet-ink: #5b3a86;
    --grey-bg: #eceff0;
    --grey-ink: #48565c;
    --orange: #d9822b;
    --orange-bg: #fbeee0;
    --orange-ink: #8f4d0c;
    --note-bg: #fbf4e3;
    --note-ink: #4f3b10;
    --danger: #b3412f;
    --danger-bg: #faece7;
    --danger-line: #e0a99a;

    --radius: 12px;
    --radius-sm: 8px;
    --pill: 999px;
    --border: 1.5px;

    --s1: 4px;
    --s2: 8px;
    --s3: 12px;
    --s4: 16px;
    --s5: 24px;

    --btn: 50px;
    --btn-sm: 44px;
    --nav-h: 64px;
    --gutter: 16px;

    --shadow: 0 1px 2px #16302a12, 0 2px 8px #16302a0a;
    --shadow-pop: 0 12px 32px #16302a2e;
    --focus: 0 0 0 3px #174c3d26;

    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    font-synthesis: none;
    -webkit-text-size-adjust: 100%;
}

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

html, body { margin: 0; }

body {
    min-height: 100dvh;
    font-size: 16px;
    line-height: 1.45;
    background: var(--bg);
}

button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea, label, summary { -webkit-tap-highlight-color: transparent; }
button { border: 0; background: none; cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .45; cursor: default; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid #8db14a; outline-offset: 2px; }

h1, h2, h3 { margin: 0; }
h2 { font-size: 24px; line-height: 1.2; letter-spacing: -.3px; font-weight: 750; }
h3 { font-size: 18px; line-height: 1.3; font-weight: 700; }
p { margin: 0; line-height: 1.5; }

[x-cloak] { display: none !important; }
.d-none, .hided, [hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 1.5; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

.icon { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- App shell ---------- */
.app { display: flex; flex-direction: column; min-height: 100dvh; }
.content { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: var(--s4) var(--gutter) var(--s5); }
.page--narrow { max-width: 680px; margin: 0 auto; }

.bottom-nav {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    justify-content: center;
    gap: var(--s1);
    min-height: var(--nav-h);
    padding: 6px 8px max(6px, env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line);
    box-shadow: 0 -2px 12px #16302a0d;
}
.bottom-nav__item {
    position: relative;
    flex: 1;
    max-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 52px;
    padding: 6px 4px;
    border-radius: var(--radius);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
}
.bottom-nav__item .icon { width: 22px; height: 22px; }
.bottom-nav__item.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 750; }
.bottom-nav__count {
    position: absolute;
    top: 4px;
    left: calc(50% + 6px);
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: var(--pill);
    background: var(--orange);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}

/* ---------- Page head ---------- */
.back { margin: 0 0 var(--s3); }
.page-head { margin: 0 0 var(--s3); }
.page-head h2 { display: flex; align-items: center; gap: 8px; margin-top: 2px; overflow-wrap: anywhere; }
.page-head__sub { margin-top: 4px; font-size: 15px; color: var(--muted); }
.page-head .job-tags { margin: var(--s2) 0 0; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--green-ink); }
.section-label { margin: var(--s4) 0 var(--s2); font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.panel > .section-label:first-child { margin-top: 0; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--btn);
    padding: 10px 14px;
    border: var(--border) solid transparent;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .12s, border-color .12s;
}
.btn .icon { width: 19px; height: 19px; }
.btn--block { width: 100%; }
.btn--sm { min-height: var(--btn-sm); padding: 8px 14px; font-size: 14.5px; }
.btn--sm .icon { width: 18px; height: 18px; }
.btn--wrap { white-space: normal; }

.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn--primary:active { transform: translateY(1px); }
.btn--secondary { background: var(--surface); border-color: var(--line-strong); color: var(--brand); }
.btn--secondary:hover { background: var(--brand-soft); border-color: var(--brand); }
.btn--danger { background: var(--surface); border-color: var(--danger-line); color: var(--danger); }
.btn--danger:hover { background: var(--danger-bg); }
.btn--text { min-height: var(--btn-sm); padding: 8px 4px; border: 0; background: none; color: var(--brand); font-size: 14.5px; }
.btn--text:hover { text-decoration: underline; text-underline-offset: 3px; }

.icon-btn {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: var(--btn-sm);
    height: var(--btn-sm);
    border: var(--border) solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--brand);
}
.icon-btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.icon-btn .icon { width: 19px; height: 19px; }
.icon-btn.is-copied { background: var(--brand); border-color: var(--brand); color: #fff; }
.icon-btn--danger { border-color: var(--danger-line); color: var(--danger); }
.icon-btn--danger:hover { border-color: var(--danger); background: var(--danger-bg); }
.icon-btn--solid-danger { border-color: var(--danger); background: var(--danger); color: #fff; }

.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--s2); margin: var(--s3) 0; }
.action-grid > .btn { gap: 6px; padding: 10px 6px; font-size: 14.5px; }
.stack { display: grid; gap: var(--s2); margin-top: var(--s3); }
.sticky-action {
    position: sticky;
    bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
    z-index: 3;
    display: grid;
    gap: var(--s2);
    margin-top: var(--s2);
    padding: 10px 0;
    background: linear-gradient(to top, var(--bg) 75%, transparent);
}

/* ---------- Tags ---------- */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 10px 0 8px;
    border-radius: var(--radius-sm);
    background: var(--green-bg);
    color: var(--green-ink);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}
.tag .icon { width: 16px; height: 16px; stroke-width: 2.2; }
.tag--blue { background: var(--blue-bg); color: var(--blue-ink); }
.tag--violet { background: var(--violet-bg); color: var(--violet-ink); }
.tag--grey { background: var(--grey-bg); color: var(--grey-ink); }
.tag--orange { background: var(--orange); color: #fff; }
.tag--danger { background: var(--danger-bg); color: var(--danger); }
.tag--plate { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.tag--plate strong { font-size: 13px; font-weight: 800; letter-spacing: .8px; font-variant-numeric: tabular-nums; }
.tag--small { height: 22px; padding: 0 8px; font-size: 11px; letter-spacing: .4px; text-transform: uppercase; }

.job-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; margin: 0 0 10px; }

/* ---------- Segmented control ---------- */
.seg { display: flex; gap: 3px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.seg__item {
    flex: 1;
    min-height: 38px;
    padding: 6px 12px;
    border-radius: 9px;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 650;
    white-space: nowrap;
}
.seg__item:hover { background: #ffffff80; }
.seg__item.is-active { background: var(--brand); color: #fff; box-shadow: 0 1px 3px #174c3d40; }

/* ---------- Panels & boxes ---------- */
.panel {
    margin: var(--s3) 0;
    padding: var(--s4);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.panel > h3 { margin-bottom: var(--s2); }
.panel--dashed { border-style: dashed; box-shadow: none; }

.inset { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }

.notice { display: flex; align-items: flex-start; gap: 10px; margin-top: var(--s3); padding: 10px 12px; border-radius: var(--radius-sm); background: var(--note-bg); color: var(--note-ink); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.notice .icon { width: 18px; height: 18px; margin-top: 1px; }
.notice--success { background: var(--green-bg); color: var(--green-ink); font-weight: 650; }
.notice--danger { background: var(--danger-bg); color: var(--danger); font-weight: 650; }
.notice--info { background: var(--brand-soft); color: #3c5530; }

.empty {
    grid-column: 1 / -1;
    padding: 40px 16px;
    text-align: center;
    line-height: 1.7;
    font-size: 15px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.record-line { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--surface-2); font-size: 15px; line-height: 1.45; }
.record-line:last-child { border-bottom: 0; }
.record-line > span { min-width: 0; color: var(--muted); }
.record-line > strong { min-width: 0; text-align: right; font-weight: 650; overflow-wrap: anywhere; }

.avatar {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 14px;
    font-weight: 750;
}
.avatar--brand { width: 44px; height: 44px; background: var(--brand); color: var(--brand-ink); font-size: 15px; }

/* ---------- Forms ---------- */
.field { margin: 14px 0 0; }
.panel > .field:first-child, .panel > h3 + .field, .auth-card .field:first-of-type, .date-grid > .field { margin-top: 0; }
.field > label, .field__label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 650; color: var(--ink-2); }
.field__hint { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.field__error, .form-error { margin: 10px 0 0; font-size: 14px; font-weight: 600; color: var(--danger); }

/* :where() keeps these base styles at single-class weight so components can override them. */
.input, .content :where(input:not([type=checkbox], [type=radio], [type=file], [type=hidden]), select, textarea) {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding: 12px 14px;
    font-size: 16px;
    color: var(--ink);
    background: var(--surface);
    border: var(--border) solid var(--line-strong);
    border-radius: var(--radius);
}
.input:focus, .content :where(input, select, textarea):focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.content :where(textarea) { min-height: auto; resize: vertical; }
.content :where(input, textarea)::placeholder { color: #8b998f; }
.content :where(input.is-invalid) { border-color: var(--danger); }

.date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }

.search-field { position: relative; margin: 0 0 var(--s3); }
.search-field .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-field input { padding-left: 44px; }

.photo-picker { position: relative; overflow: hidden; cursor: pointer; }
.photo-picker input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.photo-picker:focus-within { outline: 3px solid #8db14a; outline-offset: 2px; }
.upload-progress { display: block; width: 100%; height: 6px; margin-top: var(--s2); accent-color: var(--brand); }
.photo-picker .upload-progress { position: absolute; left: 8px; right: 8px; bottom: 4px; width: auto; height: 4px; margin: 0; }
.count { display: inline-block; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--pill); background: var(--brand); color: #fff; font-size: 12px; font-weight: 800; line-height: 22px; text-align: center; }
.chat-preview__head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.chat-preview__head .section-label { margin: 0; }

/* ---------- Task list ---------- */
.list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: var(--s3); }
.driver-id { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.driver-id b { display: block; font-size: 18px; line-height: 1.2; }
.driver-id span:not(.avatar) { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s3) 0; }
.filters .seg { flex: 1 1 auto; }

.period { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-bottom: var(--s2); }
.period__label { font-size: 15px; font-weight: 700; color: var(--ink-2); }
.period__panel { width: 100%; margin: 0 0 var(--s2); }
.range-chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s3); }
.chip {
    flex: 1;
    min-height: var(--btn-sm);
    padding: 8px 14px;
    border-radius: var(--pill);
    background: var(--surface);
    border: var(--border) solid var(--line);
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 650;
}
.chip:hover { border-color: var(--line-strong); }
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: var(--s3); align-items: start; }

.work-card {
    position: relative;
    display: block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.work-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; border-radius: var(--radius) 0 0 var(--radius); background: var(--line-strong); }
.work-card.is-active-job::before { background: var(--brand); }
.work-card.is-overdue::before { background: var(--danger); }
.work-card.is-done::before { background: var(--green-ink); }
.work-card__open { display: block; padding: 14px 14px 10px 18px; border-radius: var(--radius) var(--radius) 0 0; }
.work-card__open:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.work-card__client { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.work-card__client h3 { font-size: 19px; line-height: 1.25; overflow-wrap: anywhere; }
.work-card__when { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; font-size: 16px; font-weight: 700; }
.work-card__when .icon { width: 18px; height: 18px; color: var(--brand); }
.work-card.is-overdue .work-card__when { color: var(--danger); }
.work-card.is-overdue .work-card__when .icon { color: var(--danger); }
.work-card__when .time { font-weight: 800; font-variant-numeric: tabular-nums; }
.sep { color: var(--muted); font-weight: 500; }
.work-card .job-tags { margin-bottom: 0; }
.work-card__addr { display: flex; align-items: center; gap: 10px; padding: 0 14px 10px 18px; }
.work-card__nav { display: grid; grid-template-columns: 1fr auto; gap: var(--s2); padding: 0 14px 14px 18px; }
.work-card__nav > :only-child { grid-column: 1 / -1; }
.work-card.is-new { border-color: #e9b27a; box-shadow: 0 0 0 3px #f6dcc0, var(--shadow); }
.work-card.is-new::before { background: var(--orange); }
.card-gear { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.equipment-name { font-size: 15.5px; font-weight: 700; }
.attachment-summary { margin-top: 3px; font-size: 14px; font-weight: 600; color: var(--green-ink); }
.work-edit { position: relative; }
.work-edit__toggle { width: var(--btn); height: 100%; min-height: 46px; color: var(--ink-2); }
.work-edit__toggle.is-open { background: var(--ink); border-color: var(--ink); color: #fff; }
.work-edit__menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 8; display: grid; gap: 2px; min-width: 230px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.work-edit__menu a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 15px; font-weight: 650; color: var(--ink); }
.work-edit__menu a .icon { color: var(--brand); }
.work-edit__menu a:hover { background: var(--surface-2); }

.dot { width: 9px; height: 9px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--brand); background: var(--brand); }
.dot--hollow { background: transparent; }
.addr-text { flex: 1; min-width: 0; }
.addr-text small { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.addr-text span { display: block; font-size: 15.5px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }

.nav-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); min-width: 0; }
.nav-pair .btn { min-height: 46px; }
.nav-pair img { width: 20px; height: 20px; border-radius: 5px; }

/* ---------- Task detail ---------- */
.when-box {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: 16px;
}
.when-box .icon { width: 19px; height: 19px; color: var(--brand); }
.when-box.is-overdue { border-color: var(--danger-line); background: var(--danger-bg); color: var(--danger); }
.when-box.is-overdue .icon { color: var(--danger); }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin: var(--s3) 0; }
.detail-grid > .panel { margin: 0; }

.equipment { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.equipment + .equipment { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px dashed var(--line); }
.equipment__main { min-width: 0; flex: 1; }
.equipment__main strong { display: block; font-size: 19px; line-height: 1.3; }
.equipment__main p { margin-top: 2px; font-size: 14px; color: var(--muted); }
.equipment__main small { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.equipment .tag { margin-top: 6px; }

.service-line { display: flex; align-items: center; gap: 8px; margin-top: var(--s2); padding: 9px 12px; border-radius: var(--radius-sm); background: var(--grey-bg); font-size: 14px; font-weight: 600; color: var(--grey-ink); }
.service-line.is-operator { background: var(--violet-bg); color: var(--violet-ink); }
.service-line .icon { width: 18px; height: 18px; }
.equipment-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); padding-top: var(--s3); border-top: 1px dashed var(--line); }
.equipment-actions .btn { flex: 1 1 auto; width: auto; }
.detail-actions { grid-template-columns: repeat(3, 1fr); }
.extra-row__qty { font-variant-numeric: tabular-nums; white-space: nowrap; }
.change-entry { padding: 8px 0; font-size: 14px; line-height: 1.5; border-top: 1px solid var(--surface-2); overflow-wrap: anywhere; }
.change-entry small { font-size: 12px; }
.worktime { margin-top: var(--s3); }
.worktime__log { margin-bottom: var(--s2); font-size: 14px; color: var(--muted); }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.stop small { display: block; font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.stop__line { display: flex; align-items: flex-start; gap: 8px; margin: 2px 0 10px; }
.stop__line strong { flex: 1; min-width: 0; font-size: 19px; line-height: 1.35; overflow-wrap: anywhere; }
.stop__line .icon-btn { margin-top: -4px; }
.other-stop { margin-top: var(--s3); padding-top: var(--s2); border-top: 1px dashed var(--line); }
.other-stop > summary { display: flex; align-items: center; gap: 6px; min-height: 40px; cursor: pointer; font-size: 14px; font-weight: 650; color: var(--brand); list-style: none; }
.other-stop > summary::-webkit-details-marker { display: none; }
.other-stop > summary .icon { width: 18px; height: 18px; transition: transform .15s; }
.other-stop[open] > summary .icon { transform: rotate(180deg); }
.other-stop[open] .stop { margin-top: 6px; }

.contact-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: var(--s3);
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.contact-row__name { flex: 1; min-width: 0; }
.contact-row__name small { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.contact-row__name b { display: block; font-size: 15px; overflow-wrap: anywhere; }
.contact-row__name span { display: block; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.file-list { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s3); }
.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    min-height: var(--btn-sm);
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-2);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-2);
    cursor: pointer;
}
.file-chip:hover { border-color: var(--brand); }
.file-chip span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.file-chip i { font-size: 18px; color: var(--brand); }

.register-list { display: grid; gap: var(--s2); }
.register-item { width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); text-align: left; font-size: 15px; font-weight: 600; }
.register-item[aria-expanded=true] { background: var(--brand-soft); }
.register-item__rows { display: block; margin-top: 6px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.register-item__rows > span { display: block; }
.register-icon { display: inline-flex; align-items: center; gap: 6px; }

.qr-code { display: block; margin: 0 auto; width: 200px; max-width: 100%; }

.signature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.signature-grid .field__label { margin-bottom: 6px; }

/* ---------- Chat ---------- */
.chat-head { display: flex; align-items: center; gap: 10px; }
.chat { display: flex; flex-direction: column; gap: var(--s2); margin-top: 14px; }
.bubble {
    max-width: 88%;
    padding: 11px 14px;
    border-radius: 16px 16px 16px 4px;
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: 15px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    align-self: flex-start;
}
.bubble--mine { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: var(--brand); border-color: var(--brand); color: #fff; }
.bubble--unread { border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange-bg); font-weight: 650; }
.bubble__meta { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.bubble--mine .bubble__meta { color: #cfe3d3; }
.bubble img { display: block; max-width: 220px; border-radius: var(--radius-sm); cursor: zoom-in; }
.bubble .emoji { font-size: 1.4em; vertical-align: middle; }
.chat-preview { display: block; }
.chat-preview .chat { margin-top: var(--s2); max-height: 260px; overflow: hidden; }
.chat-preview .bubble { font-size: 14px; }

.composer {
    position: sticky;
    bottom: calc(var(--nav-h) + 8px);
    z-index: 3;
    display: flex;
    align-items: flex-end;
    gap: var(--s2);
    margin-top: var(--s4);
    padding: var(--s2);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.composer textarea { flex: 1; min-height: 48px; max-height: 160px; padding: 12px; border: 0; box-shadow: none; resize: none; field-sizing: content; }
.composer textarea:focus { box-shadow: none; }
.composer .btn, .composer .photo-picker { flex-shrink: 0; width: var(--btn); height: var(--btn); padding: 0; }
.composer .upload-progress { position: absolute; left: 12px; right: 12px; bottom: 2px; width: auto; margin: 0; height: 4px; }

/* ---------- Extra rows ---------- */
.extra-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--surface-2); }
.extra-row:first-child { padding-top: 0; }
.extra-row:last-child { padding-bottom: 0; border-bottom: 0; }
.extra-row.is-editing { margin: 0 -10px; padding: 12px 10px; border-radius: var(--radius-sm); background: var(--brand-soft); border-bottom-color: transparent; }
.extra-row__main { flex: 1; min-width: 0; }
.extra-row__name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 15.5px; font-weight: 700; }
.extra-row__meta { margin-top: 2px; font-size: 13.5px; color: var(--muted); }
.extra-row__note { margin-top: 2px; font-size: 13px; color: var(--muted); font-style: italic; }
.extra-row__actions { display: flex; gap: 6px; }

.search-select { position: relative; }
.search-select__list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 20;
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-pop);
}
.search-select__option { display: block; width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-sm); text-align: left; font-size: 15px; color: var(--ink); }
.search-select__option:hover, .search-select__option.is-active { background: var(--surface-2); }
.search-select__option.is-active { font-weight: 700; color: var(--brand); }
.search-select__option.is-placeholder { color: var(--muted); }
.search-select__empty { padding: 10px 12px; font-size: 14px; color: var(--muted); }

/* ---------- Scanner ---------- */
.scanner { position: relative; overflow: hidden; width: 100%; max-width: 640px; margin: var(--s3) auto 0; aspect-ratio: 3 / 4; max-height: calc(100dvh - 260px); background: #102a24; border-radius: var(--radius); line-height: 0; }
.scanner #video-container { position: relative; width: 100%; height: 100%; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner__buttons { position: absolute; left: 0; right: 0; bottom: 14px; z-index: 2; display: flex; justify-content: center; gap: 10px; }
.scanner__button { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #ffffff26; box-shadow: inset 0 0 0 1.5px #ffffff59; color: #fff; cursor: pointer; backdrop-filter: blur(4px); }
.scanner__button .icon { width: 24px; height: 24px; }
.scanner__button.active { background: #fff; color: var(--brand); }
.scanner__button.disabled { opacity: .4; }
.scan-result { position: absolute; inset: 0; z-index: 3; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: #102a24b3; line-height: 1.4; color: #fff; text-align: center; }
.scan-result__badge { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; animation: pop .35s cubic-bezier(.2, .9, .3, 1.3); }
.scan-result__badge .icon { width: 52px; height: 52px; stroke-width: 2.6; }
.scan-result--ok .scan-result__badge { background: var(--brand-ink); color: var(--brand); }
.scan-result--error .scan-result__badge { background: var(--danger); color: #fff; }
.scan-result__label { padding: 10px 18px; border-radius: var(--radius); background: #102a24e6; font-size: 17px; font-weight: 700; }
.scan-result__label span { display: block; margin-top: 4px; font-size: 22px; letter-spacing: 1px; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

.scanner--picker { display: grid; place-items: center; aspect-ratio: 4 / 3; max-height: 440px; }
.scanner--picker video { position: absolute; inset: 0; }
.scan-target { position: absolute; width: 56%; aspect-ratio: 1; border: 3px solid var(--brand-ink); border-radius: 18px; box-shadow: 0 0 0 100vmax #0006; pointer-events: none; }
.scanner__hint { position: absolute; bottom: 14px; padding: 6px 12px; border-radius: var(--pill); background: #102a24e6; color: #fff; font-size: 14px; font-weight: 600; line-height: 1.4; }
.replacement-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.replacement-grid > .panel { margin: 0; }
.new-equipment { border: 1.5px solid var(--brand); background: #f3f8ee; }
@media (max-width: 600px) { .replacement-grid { grid-template-columns: 1fr; } .scanner--picker { aspect-ratio: auto; height: calc(100dvh - 330px); } }

/* ---------- Car list ---------- */
.gear-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s2); margin-top: var(--s3); }
.gear-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--ink);
}
.gear-result:hover { border-color: var(--brand); }
.gear-result__main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.gear-result__main > .icon { color: var(--brand); }
.gear-result strong { display: block; font-size: 16px; letter-spacing: .5px; }
.gear-result small { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.gear-result > .icon { color: var(--muted); }

/* ---------- Settings ---------- */
.settings-id { display: flex; align-items: center; gap: 12px; }
.settings-id h3 { margin: 0; }
.lang-seg .seg__item { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.lang-seg img { width: 20px; height: 14px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px #0000001a; }

.act-card { display: block; margin-bottom: 10px; padding: 14px 14px 14px 18px; }
.act-card .work-card__when { margin-bottom: 0; }

/* ---------- Workday ---------- */
.dayoff { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: var(--s2); padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; color: var(--ink-2); }
.workday-hours { margin: 14px 0 0; padding: 14px 16px; border-radius: var(--radius); background: var(--brand); color: #fff; font-size: 18px; font-weight: 750; text-align: center; }
.week-summary h3 { margin-bottom: 2px; }
.week-summary > p { margin: 0 0 var(--s2); }
.week-row { display: grid; grid-template-columns: minmax(76px, auto) 1fr auto; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px; border-bottom: 1px solid var(--surface-2); font-size: 15px; text-align: left; font-variant-numeric: tabular-nums; color: var(--ink); }
button.week-row:hover { background: var(--surface-2); }
.week-day { font-weight: 600; text-transform: capitalize; color: var(--ink-2); }
.week-range { font-size: 13.5px; color: var(--muted); }
.week-range em { margin-left: 4px; padding: 1px 6px; border-radius: var(--pill); background: var(--surface-2); font-size: 11.5px; font-style: normal; font-weight: 650; }
.week-row.is-weekend .week-day { font-weight: 500; color: var(--muted); }
.week-row.is-current { background: var(--brand-soft); border-radius: var(--radius-sm); border-bottom-color: transparent; }
.week-total { min-height: 0; margin-top: 4px; padding-top: 12px; border-bottom: 0; border-top: 2px solid var(--line); font-weight: 750; grid-template-columns: 1fr auto; }

/* ---------- Photos ---------- */
.photo-actions { margin-top: 0; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.photo-thumb { padding: 0; overflow: hidden; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.photo-thumb img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-thumb span { display: block; padding: 8px 10px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.photo-full { display: block; max-width: 100%; max-height: calc(100dvh - 260px); margin: 12px auto; object-fit: contain; background: var(--surface-2); border-radius: var(--radius); }
@media (max-width: 600px) { .photo-grid { grid-template-columns: 1fr 1fr; gap: var(--s2); } }

/* ---------- Work report (act) ---------- */
body.no-scroll { overflow: hidden; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.act-details h3 { margin-bottom: 4px; }
.sign-mode { margin: var(--s3) 0 var(--s2); }
.sign-pad__canvas { display: block; width: 100%; aspect-ratio: 12 / 5; background: #fff; border: 2px dashed var(--line-strong); border-radius: var(--radius); touch-action: none; cursor: crosshair; }
.sign-pad__tools { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2); margin-top: var(--s2); }
.sign-pad.is-full { position: fixed; inset: 0; z-index: 3000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s3); padding: var(--s4); background: var(--bg); }
.sign-pad.is-full .sign-pad__canvas { width: min(calc(100vw - 32px), calc((100dvh - 150px) * 2.4), 1100px); }
.sign-pad.is-full .sign-pad__tools { width: min(100%, 520px); }
.sign-pad__head { text-align: center; }
.sign-pad__head b { display: block; font-size: 18px; }
.sign-pad__head span { font-size: 13px; color: var(--muted); }
@media (orientation: landscape) and (max-height: 500px) { .sign-pad.is-full { gap: 6px; padding: 8px; } .sign-pad__head span { display: none; } }
.sign-name { min-height: 100px; margin-top: var(--s2); padding: 24px 14px; font-family: "Segoe Script", "Brush Script MT", cursive; font-style: italic; font-size: 32px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow-wrap: anywhere; }
.signed-image { display: block; width: 100%; height: 130px; margin: 10px 0; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.signed-by { display: flex; align-items: center; gap: 8px; color: var(--green-ink); }
.check-label { display: flex; align-items: flex-start; gap: 12px; margin: 18px 0; font-size: 15px; line-height: 1.5; cursor: pointer; }
.check-label input { width: 22px; height: 22px; margin: 0; flex-shrink: 0; accent-color: var(--brand); }
.act-signatures > .btn { margin-top: var(--s3); }

/* ---------- Signature pad ---------- */
.svg-holder { position: relative; overflow: hidden; background: #fff; border: 2px dashed var(--line-strong); border-radius: var(--radius); }
.svg-holder svg { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; touch-action: none; }
.svg-holder .buttons { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; }
.svg-holder.fullscreen { position: fixed; inset: 0; z-index: 1002; border: 0; border-radius: 0; background: var(--bg); }
.svg-holder.fullscreen .svg-container { position: absolute; top: 50%; left: 50%; width: 100%; transform: translate(-50%, -50%); background: #fff; }
.svg-holder.fullscreen .buttons { top: max(12px, env(safe-area-inset-top)); right: 12px; }

/* ---------- Busy state ----------
   Livewire 4 puts data-loading on the element that started a request (the tapped button, a submitted form);
   public/js/app.js puts .is-navigating on a tapped wire:navigate link. The tapped control swaps its icon
   for a spinner and ignores further taps until the request is done. */
:is(.btn, .icon-btn, .seg__item, .chip, .bell, .gear-result, .file-chip, .register-item)[data-loading],
form[data-loading] button[type=submit],
:is(.btn, .bottom-nav__item, .gear-result, .work-card__open, .icon-btn).is-navigating {
    pointer-events: none;
    cursor: progress;
}
:is(.btn, .icon-btn, .bell)[data-loading]:disabled,
form[data-loading] button[type=submit]:disabled { opacity: 1; }
:is(.seg__item, .chip)[data-loading] { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
:is(.btn, .icon-btn, .bell, .seg__item, .chip)[data-loading] > .icon,
form[data-loading] button[type=submit] > .icon,
:is(.btn, .bottom-nav__item, .icon-btn).is-navigating > .icon,
.btn[data-loading] > img, .btn.is-navigating > img { display: none; }
:is(.btn, .icon-btn, .bell, .seg__item, .chip)[data-loading]::before,
form[data-loading] button[type=submit]::before,
:is(.btn, .bottom-nav__item, .icon-btn).is-navigating::before {
    content: "";
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border: 2.5px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.bottom-nav__item.is-navigating::before { width: 20px; height: 20px; margin: 1px; }
:is(.gear-result, .file-chip, .register-item)[data-loading],
:is(.gear-result, .work-card__open).is-navigating { opacity: .55; transition: opacity .15s; }
.bell[data-loading] span { display: none; }

/* ---------- Feedback: toast, loader, offline, lightbox ---------- */
.toast {
    position: fixed;
    left: 50%;
    /* Clears the bottom nav plus a sticky action button or chat composer. */
    bottom: calc(var(--nav-h) + 84px);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: min(92vw, 480px);
    padding: 13px 18px;
    transform: translateX(-50%);
    border-radius: var(--radius);
    background: #13362c;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 28px #0004;
}
.toast--danger { background: var(--danger); }
.toast--warning { background: var(--orange-ink); }
.toast .icon { width: 18px; height: 18px; }

.loader { position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; background: #0a1d1733; backdrop-filter: blur(2px); }
.spinner { width: 44px; height: 44px; border: 4px solid #ffffff66; border-top-color: var(--brand); border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 10px var(--surface), var(--shadow-pop); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.offline { display: flex; align-items: center; gap: 10px; margin: 0 0 var(--s3); padding: 10px 14px; border-radius: var(--radius); background: var(--danger); color: #fff; font-size: 14px; font-weight: 700; }

.bell { position: relative; display: grid; place-items: center; flex-shrink: 0; width: var(--btn-sm); height: var(--btn-sm); border-radius: 50%; border: var(--border) solid #efc79c; background: var(--orange-bg); color: var(--orange-ink); }
.bell .icon { width: 22px; height: 22px; }
.bell span { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: var(--pill); background: var(--orange); color: #fff; font-size: 12px; font-weight: 800; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }

.job-notice { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 50%; z-index: 2100; display: flex; align-items: stretch; width: min(calc(100% - 20px), 460px); overflow: hidden; transform: translate(-50%, -140%); transition: transform .3s cubic-bezier(.2, .9, .3, 1.2); background: #13362c; color: #fff; border-radius: var(--radius); box-shadow: 0 12px 36px #0006; }
.job-notice.is-open { transform: translate(-50%, 0); }
.job-notice__body { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 6px 12px 14px; text-align: left; color: #fff; }
.job-notice__icon { display: grid; place-items: center; flex-shrink: 0; width: 42px; height: 42px; border-radius: var(--radius); background: var(--orange); }
.job-notice__text { min-width: 0; }
.job-notice__text small { display: block; font-size: 12px; font-weight: 700; letter-spacing: .4px; color: #b9d4c7; }
.job-notice__text b { display: block; font-size: 16.5px; line-height: 1.3; }
.job-notice__text span { display: block; overflow: hidden; font-size: 13px; color: #d6e6de; white-space: nowrap; text-overflow: ellipsis; }
.job-notice__close { width: 48px; flex-shrink: 0; font-size: 24px; color: #b9d4c7; }
.job-notice__close:hover { background: #ffffff14; color: #fff; }
@media (prefers-reduced-motion: reduce) { .job-notice { transition: none; } }

.push-prompt { margin: 0 0 var(--s3); }
.push-prompt .btn { min-height: var(--btn-sm); border-color: #efc79c; background: var(--orange-bg); color: var(--orange-ink); }
.push-prompt .btn:hover { border-color: var(--orange); background: #f8e2c8; }

#lightbox { display: none; position: fixed; inset: 0; z-index: 2500; padding: .5em; background: #0a1d17d9; backdrop-filter: blur(4px); cursor: zoom-out; }
#lightbox span { display: block; width: 100%; height: 100%; background-position: center; background-repeat: no-repeat; background-size: contain; }

/* ---------- Auth (login) ---------- */
.auth { display: grid; place-items: center; min-height: 100dvh; padding: var(--s4); background: radial-gradient(circle at 20% 0%, #24604e 0, transparent 55%), var(--brand); }
.auth-card { width: min(100%, 440px); padding: 28px 24px; background: var(--surface); border-radius: 20px; box-shadow: 0 24px 60px #0a1d1766; }
.auth-card__logo { display: block; width: 160px; height: auto; margin: -8px auto 12px; }
.auth-card h2 { margin-bottom: 6px; }
.auth-card .btn { margin-top: var(--s4); }
.auth-card .iti { width: 100%; }
.code-input { text-align: center; letter-spacing: 12px; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.code-input::placeholder { letter-spacing: normal; font-size: 16px; font-weight: 500; }
.code-input::-webkit-outer-spin-button, .code-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.code-input[type=number] { -moz-appearance: textfield; }
.auth .input, .auth :where(input:not([type=hidden])) {
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    font-size: 16px;
    color: var(--ink);
    background: var(--surface);
    border: var(--border) solid var(--line-strong);
    border-radius: var(--radius);
}
.auth input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.auth .iti input { padding-left: 56px; }
.auth input.is-invalid { border-color: var(--danger); }
.auth .alerts:empty { display: none; }
.auth .alert { margin-top: var(--s3); padding: 10px 12px; border-radius: var(--radius-sm); background: var(--danger-bg); color: var(--danger); font-size: 14px; font-weight: 650; }
.auth .toast { bottom: 24px; }

/* ---------- Wide screens ---------- */
@media (min-width: 700px) {
    .bottom-nav__item { flex-direction: row; gap: 8px; font-size: 14px; }
    .bottom-nav__count { left: auto; right: calc(50% - 44px); }
}
@media (min-width: 900px) {
    :root { --gutter: 28px; }
    .content { padding-top: var(--s5); }
}

/* ---------- Phone ---------- */
@media (max-width: 600px) {
    :root { --gutter: 12px; --nav-h: 60px; --btn: 50px; }
    body { font-size: 15.5px; }
    .content { padding: 10px var(--gutter) var(--s4); }
    h2 { font-size: 22px; }
    .back { margin-bottom: var(--s2); }
    .back .btn { min-height: 40px; padding: 6px 12px 6px 8px; font-size: 14px; }
    .panel { margin: 10px 0; padding: 14px; }
    .section-label { margin: var(--s3) 0 6px; }
    .list-head { padding-bottom: var(--s2); border-bottom: 1px solid var(--line); }
    .driver-id b { font-size: 16px; }
    .filters { gap: 6px; }
    .seg__item { min-height: 38px; padding: 6px 8px; font-size: 13.5px; }
    .period { justify-content: space-between; }
    .work-grid, .detail-grid, .gear-results, .signature-grid { grid-template-columns: 1fr; }
    .work-grid, .detail-grid { gap: 10px; }
    .work-card__open { padding: 12px 12px 8px 16px; }
    .work-card__client h3 { font-size: 17.5px; }
    .work-card__addr { padding: 0 12px 8px 16px; }
    .work-card__nav { padding: 0 12px 12px 16px; }
    .stop__line strong, .equipment__main strong { font-size: 17.5px; }
    .when-box { padding: 9px 12px; font-size: 15px; }
    .contact-row { padding: 8px 10px; }
    .action-grid > .btn { font-size: 13.5px; gap: 5px; }
    .date-grid { gap: var(--s2); }
    .record-line { gap: 10px; padding: 7px 0; font-size: 14px; }
    .bubble { max-width: 94%; }
    .composer { bottom: calc(var(--nav-h) + 6px); }
    .toast { bottom: calc(var(--nav-h) + 76px); }
    .scanner { aspect-ratio: auto; height: calc(100dvh - 250px); max-height: none; }
}
@media (max-width: 374px) {
    :root { --gutter: 10px; }
    .action-grid { grid-template-columns: 1fr; }
    .bottom-nav__item { font-size: 11.5px; }
    .record-line { flex-direction: column; gap: 0; }
    .record-line > strong { text-align: left; }
    .job-tags .tag { height: 26px; padding: 0 8px 0 6px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .pulse, .spinner, .scan-result__badge { animation: none; }
}
@media print {
    .bottom-nav, button, .sticky-action, .toast, .back { display: none !important; }
    .panel { box-shadow: none; break-inside: avoid; }
}
