:root {
    --bg: #0b1017;
    --bg-2: #121821;
    --card: #171f2a;
    --line: rgba(255,255,255,0.08);
    --text: #f4f7fb;
    --muted: #9aa6b5;
    --gold: #f5c518;
    --gold-dim: rgba(245,197,24,0.14);
    --ok: #3dd68c;
    --bad: #ff5c7c;
    --info: #5b9dff;
    --radius: 16px;
    --tap: 52px;
}
* { box-sizing: border-box; }
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    color-scheme: dark;
}
html, body {
    margin: 0;
    min-height: 100%;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    overflow-x: hidden;
}
body {
    -webkit-tap-highlight-color: transparent;
}
a { color: var(--gold); }
h1, h2, h3 { margin: 0 0 12px; letter-spacing: 0.02em; }
.wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
}
.app-shell {
    padding-bottom: calc(88px + env(safe-area-inset-bottom) + var(--kb, 0px));
    padding-right: max(52px, calc(env(safe-area-inset-right) + 36px));
}
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: nowrap;
}
.topbar .brand { min-width: 0; flex: 1 1 auto; }
.brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.btn-logout {
    width: auto;
    min-height: 44px;
    padding: 8px 12px;
    flex: 0 0 auto;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
}
button.brand {
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    min-height: 44px;
    text-align: left;
    font: inherit;
}
.brand-mark {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(145deg, #f5c518, #c9a00a);
    color: #111;
    display: grid;
    place-items: center;
    font-weight: 900;
}
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
}
.org-card { padding: 20px 18px 18px; }
.btn {
    min-height: var(--tap);
    border: 0;
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    width: 100%;
}
.btn.btn-logout,
.topbar .btn,
.dash-head .btn {
    width: auto;
    min-height: 44px;
    padding: 8px 12px;
    flex: 0 0 auto;
}
.btn-gold { background: var(--gold); color: #111; }
.btn-ok { background: var(--ok); color: #062016; }
.btn-bad { background: var(--bad); color: #fff; }
.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn, .nav button, .tabs button, .mercer-pick { touch-action: manipulation; }
.btn:active { filter: brightness(0.92); }
.row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: stretch;
}
.row > * { flex: 1 1 140px; min-width: 0; }
.row > .btn { width: auto; }
input, select, textarea {
    width: 100%;
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #0d131b;
    color: var(--text);
    padding: 10px 12px;
    font-size: 16px;
    max-width: 100%;
}
textarea { min-height: 88px; resize: vertical; }
label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 6px; font-weight: 700; text-transform: uppercase; }
.muted { color: var(--muted); font-size: 13px; }
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    background: var(--gold-dim);
    color: var(--gold);
}
.pill.match { background: rgba(61,214,140,0.16); color: var(--ok); }
.pill.bad { background: rgba(255,92,124,0.16); color: var(--bad); }
.overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.72);
    display: none;
    align-items: flex-end;
    z-index: 50;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
.overlay.show { display: flex; }
.sheet {
    background: #1b2430;
    border-radius: 22px 22px 16px 16px;
    padding: 20px;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    border: 1px solid var(--line);
    max-height: min(88dvh, 640px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
.nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: rgba(16, 23, 32, 0.96);
    border-top: 1px solid var(--line);
    padding: 4px 8px calc(8px + env(safe-area-inset-bottom));
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
    z-index: 40;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.nav button {
    background: none;
    border: 0;
    color: var(--muted);
    font-weight: 800;
    font-size: 12px;
    min-height: 48px;
    padding: 8px 4px;
}
.nav button.active { color: var(--gold); }
.hidden { display: none !important; }
.seg {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
}
.seg button {
    width: auto;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #101720;
    color: var(--muted);
    border: 1px solid var(--line);
    font-weight: 800;
    font-size: 14px;
}
.seg button.active {
    background: var(--gold-dim);
    color: var(--gold);
    border-color: var(--gold);
}
.pick-list {
    max-height: 280px;
    overflow: auto;
    padding-right: 4px;
}
.pick-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #101720;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}
.pick-row.is-on {
    border-color: var(--gold);
    background: var(--gold-dim);
}
.inbox-task {
    background: #101720;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 10px;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.timer {
    font-size: clamp(28px, 9vw, 42px);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-align: center;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.check-row {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.check-row input { width: 28px; height: 28px; min-height: 28px; }
.check-manage {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}
.check-manage.is-hidden .check-manage-text { color: var(--muted); }
.check-manage-text .pill { margin-right: 8px; font-weight: 800; }
.check-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}
.check-edit {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.check-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.check-pack {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #101720;
    margin: 0 0 12px;
    overflow: hidden;
}
.check-pack-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    flex-wrap: wrap;
}
.check-pack-toggle {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: none;
    border: 0;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    flex: 1;
    min-width: 0;
    padding: 0;
}
.check-pack-chevron {
    color: var(--gold);
    font-weight: 800;
    min-width: 1.2em;
    line-height: 1.4;
}
.check-pack-body {
    padding: 0 14px 14px;
    border-top: 1px solid var(--line);
}
.check-pack.is-collapsed .check-pack-body { display: none; }
.check-rollout { margin-top: 12px; }
.check-rollout-panel {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}
.pick-row input {
    width: 22px;
    min-height: 22px;
    height: 22px;
    flex: 0 0 auto;
}
#tab-checklist.lead-readonly .check-global-edit { display: none !important; }
.msg { padding: 8px 0; font-size: 14px; }
.msg.me { color: var(--gold); }
.gps-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 10px;
}
.tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 14px;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}
.tabs button {
    background: #101720;
    border: 1px solid var(--line);
    color: var(--muted);
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 700;
    white-space: nowrap;
}
.tabs button.active { color: #111; background: var(--gold); }
.stars button { width: auto; min-height: 40px; background: none; border: 0; font-size: 22px; cursor: pointer; }
.error { color: var(--bad); font-size: 13px; }
.okmsg { color: var(--ok); font-size: 13px; }
button.card {
    font: inherit;
    color: inherit;
    text-align: left;
    width: 100%;
    display: block;
    appearance: none;
    -webkit-appearance: none;
}
.card.here { border-color: rgba(61,214,140,0.45); }
.gps-line {
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.45;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.task-edit {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}
.task-text {
    white-space: pre-wrap;
    margin: 6px 0 0;
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
}
tr.pick { cursor: pointer; }
tr.pick:hover { background: rgba(255,255,255,0.03); }
tr.is-on { background: rgba(245,197,24,0.10); }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 6px 8px 6px 12px;
    background: var(--gold-dim);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}
.chip button {
    width: auto;
    min-height: 28px;
    padding: 2px 8px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,92,124,0.18);
    color: var(--bad);
    font-weight: 800;
    cursor: pointer;
}
.overview-mercer {
    background: #101720;
    margin: 0 0 12px;
}
.overview-mercer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.overview-mercer-head .btn {
    width: auto;
    flex: 0 0 auto;
}
.overview-shops {
    margin: 10px 0 0;
    padding: 0 0 0 18px;
}
.overview-shops li {
    margin: 10px 0;
    overflow-wrap: anywhere;
    list-style: disc;
}
.overview-shop > summary {
    cursor: pointer;
    list-style: none;
}
.overview-shop > summary::-webkit-details-marker { display: none; }
.overview-shop-line {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}
.overview-tasks {
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
}
.overview-task {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 6px 10px;
    margin: 4px 0;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    overflow-wrap: anywhere;
}
.overview-task-group {
    margin: 12px 0 0;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}
.overview-task-completed {
    background: rgba(61,214,140,0.08);
}
.overview-empty-tasks {
    margin: 6px 0 0;
}
.org-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0 10px;
}
.stat-tile {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #161e29 0%, #101720 100%);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px 14px 14px;
    min-height: 84px;
}
.stat-tile::before {
    content: "";
    position: absolute;
    left: 14px;
    right: 40%;
    top: 0;
    height: 2px;
    border-radius: 0 0 2px 2px;
    background: linear-gradient(90deg, var(--gold), transparent);
    opacity: 0.85;
}
.stat-tile strong {
    display: block;
    color: var(--gold);
    font-size: 30px;
    line-height: 1.05;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}
.stat-tile span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.org-heading {
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin: 22px 0 10px;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}
.org-hint {
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: none;
    font-weight: 600;
    color: rgba(154, 166, 181, 0.8);
}
.team-lead-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 280px));
    gap: 10px;
    margin: 0 0 20px;
}
.lead-card {
    appearance: none;
    -webkit-appearance: none;
    display: block;
    width: 100%;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    background: #101720;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 14px 12px 16px;
    min-height: 122px;
    box-shadow: inset 3px 0 0 var(--accent, var(--gold));
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.lead-card:hover {
    border-color: rgba(245, 197, 24, 0.28);
    transform: translateY(-1px);
}
.lead-card.is-on {
    border-color: var(--accent, var(--gold));
    background: var(--gold-dim);
    background: color-mix(in srgb, var(--accent, var(--gold)) 12%, #101720);
}
.lead-card:focus-visible,
.mercer-pick:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}
.lead-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
}
.lead-card h3 {
    margin: 0;
    font-size: 14px;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.25;
}
.lead-card .muted { margin: 3px 0 0; }
.person-mark {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gold-dim);
    background: color-mix(in srgb, var(--accent, var(--gold)) 18%, #101720);
    color: var(--accent, var(--gold));
    font-weight: 800;
    letter-spacing: 0.04em;
}
.person-mark-sm {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    font-size: 12px;
}
.area-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 10px;
}
.area-chip {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.area-chip-more {
    color: var(--accent, var(--gold));
    background: var(--gold-dim);
    background: color-mix(in srgb, var(--accent, var(--gold)) 16%, transparent);
}
.assignment-grid {
    display: grid;
    gap: 16px;
    margin-top: 8px;
}
@media (min-width: 960px) {
    .assignment-grid {
        grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
        align-items: start;
    }
}
.roster-pane label { margin-bottom: 8px; }
#rosterFilter { margin: 0 0 12px; }
.mercer-roster {
    max-height: min(70vh, 720px);
    overflow: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(245, 197, 24, 0.35) transparent;
}
.mercer-roster::-webkit-scrollbar { width: 8px; }
.mercer-roster::-webkit-scrollbar-thumb {
    background: rgba(245, 197, 24, 0.28);
    border-radius: 999px;
}
.roster-group {
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 4px 0 8px;
    padding: 8px 2px 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent, var(--muted));
    background: linear-gradient(180deg, var(--card) 70%, transparent);
}
.mercer-pick {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    min-height: 64px;
    margin-bottom: 8px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #101720;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    font-weight: 700;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.mercer-pick:hover { border-color: rgba(255,255,255,0.16); }
.mercer-pick-body {
    flex: 1 1 auto;
    min-width: 0;
}
.mercer-pick-body strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mercer-pick.is-on {
    border-color: var(--accent, var(--gold));
    background: var(--gold-dim);
    background: color-mix(in srgb, var(--accent, var(--gold)) 12%, #101720);
}
.mercer-pick .pill {
    flex: 0 0 auto;
    min-width: 36px;
    justify-content: center;
    margin-top: 2px;
}
.shop-minis {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.shop-mini {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}
.shop-mini-more {
    color: var(--accent, var(--gold));
    background: var(--gold-dim);
    background: color-mix(in srgb, var(--accent, var(--gold)) 16%, transparent);
}
.shop-mini-empty {
    background: transparent;
    padding-left: 0;
    font-weight: 600;
}
.assign-pane {
    background: #101720;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    min-height: 280px;
}
.assign-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    min-height: 240px;
    padding: 24px 16px;
    border: 1px dashed var(--line);
    border-radius: 14px;
    color: var(--text);
}
.assign-empty-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: var(--gold-dim);
    color: var(--gold);
    font-size: 22px;
    font-weight: 800;
}
.assign-empty-mark::after { content: "←"; }
@media (max-width: 959px) {
    .assign-empty-mark::after { content: "↑"; }
}
.assign-empty strong { font-size: 16px; }
.assign-hero {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}
.assign-hero h3 {
    margin: 0 0 4px;
    letter-spacing: 0;
    text-transform: none;
}
@media (max-width: 900px) {
    .org-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
    .org-stats { grid-template-columns: 1fr 1fr; }
    .org-heading { gap: 4px 10px; }
}
.task-on-shop {
    margin: 8px 0 0;
    padding: 0 0 0 18px;
}
.task-on-shop li { margin: 8px 0; }
.task-on-shop strong, .shop-name, h2, h3 {
    overflow-wrap: anywhere;
}
.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}
.actions .btn {
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
}
.chat-compose {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-top: 10px;
}
.chat-compose input { flex: 1 1 auto; min-width: 0; }
.chat-compose .btn {
    width: auto;
    flex: 0 0 auto;
    min-width: 88px;
}
.chat-log {
    max-height: min(40vh, 360px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
.table-scroll, #liveList, #ratingTable, #searchOut, #taskRows {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}
.map-box {
    width: 100%;
    height: min(72vh, 640px);
    min-height: 420px;
    border-radius: 12px;
}
.overview-live {
    margin-top: 4px;
    color: var(--ok);
    font-size: 13px;
    font-weight: 700;
}
.overview-live[hidden] { display: none; }
#liveList table tr.is-live td {
    background: rgba(245, 197, 24, 0.08);
}
.live-clock {
    color: var(--gold);
    font-variant-numeric: tabular-nums;
}
.live-pin {
    background: none;
    border: 0;
}
.live-pin span {
    display: block;
    width: 22px;
    height: 22px;
    margin: 3px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 4px rgba(245, 197, 24, 0.35), 0 8px 16px rgba(0, 0, 0, 0.35);
}
.leaflet-tooltip.live-tip {
    background: #111;
    color: var(--gold);
    border: 1px solid rgba(245, 197, 24, 0.45);
    border-radius: 8px;
    font-weight: 800;
    font-size: 12px;
    padding: 4px 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.leaflet-tooltip.live-tip::before { display: none; }
.heat-heading {
    margin: 16px 0 8px;
    font-size: 14px;
    color: var(--muted);
}
.heat-heading:first-child { margin-top: 0; }
.heat-scroll {
    overflow: auto;
    max-width: 100%;
    max-height: min(70vh, 720px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    background: #1a1a1a;
    -webkit-overflow-scrolling: touch;
}
table.heat-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
    color: #111;
}
table.heat-table th,
table.heat-table td {
    border: 1px solid #c5c5c5;
    border-bottom: 1px solid #c5c5c5;
    padding: 4px 6px;
    text-align: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
table.heat-table thead th {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #3c3c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: none;
    min-width: 52px;
}
table.heat-table th.heat-week,
table.heat-table td.heat-week {
    position: sticky;
    left: 0;
    z-index: 5;
    width: 44px;
    min-width: 44px;
    background: #666;
    color: #fff;
    font-weight: 700;
}
table.heat-table thead th.heat-week { z-index: 6; background: #3c3c3c; }
table.heat-table th.heat-title,
table.heat-table td.heat-title {
    position: sticky;
    left: 44px;
    z-index: 5;
    min-width: 260px;
    max-width: 320px;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    background: #434343;
    color: #fff;
    font-weight: 600;
}
table.heat-table.no-week th.heat-title,
table.heat-table.no-week td.heat-title { left: 0; }
table.heat-table thead th.heat-title { z-index: 6; background: #3c3c3c; }
table.heat-table .heat-cell {
    font-weight: 800;
    min-width: 52px;
}
table.heat-table .heat-100 { background: #6aa84f; color: #111; }
table.heat-table .heat-mid { background: #ffd966; color: #111; }
table.heat-table .heat-low { background: #fff2cc; color: #111; }
table.heat-table .heat-0 { background: #fff; color: #111; }
table.heat-table .heat-na { background: #eee; color: #888; }
table.heat-table .heat-total-high { background: #e69138; color: #111; }
table.heat-table .heat-total-mid { background: #9fc5e8; color: #111; }
table.heat-table .heat-total-low { background: #cfe2f3; color: #111; }
.dash-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 8px 0 16px;
}
.dash-head .row {
    width: auto;
    flex: 0 1 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.dash-head .row > * { flex: 0 1 auto; }
body.kb-open .nav {
    transform: translateY(110%);
    pointer-events: none;
}
body.kb-open .app-shell {
    padding-bottom: calc(16px + env(safe-area-inset-bottom) + var(--kb, 0px));
}
.login-shell {
    max-width: 420px;
    padding-top: calc(32px + env(safe-area-inset-top));
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
body.login-page {
    min-height: 100dvh;
    background:
        radial-gradient(1200px 480px at 50% -80px, rgba(245, 197, 24, 0.16), transparent 60%),
        radial-gradient(700px 400px at 100% 100%, rgba(91, 157, 255, 0.08), transparent 55%),
        var(--bg);
}
.login-stage {
    min-height: 100dvh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(28px + env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom));
}
.login-panel {
    width: min(440px, 100%);
    background: rgba(23, 31, 42, 0.92);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 28px 24px 24px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}
.login-brand .brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 20px;
}
.login-name {
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
    font-size: 15px;
}
.login-kicker {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    margin-top: 2px;
}
.login-panel h1 {
    font-size: 1.55rem;
    margin: 0 0 8px;
    letter-spacing: 0;
}
.login-panel form > div {
    margin-bottom: 14px;
}
.login-dests {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 16px 0 20px;
}
.login-dest {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 12px 11px;
    background: rgba(13, 19, 27, 0.65);
    min-height: 74px;
    color: inherit;
    text-decoration: none;
    display: block;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font: inherit;
}
.login-dest:hover,
.login-dest:focus-visible {
    border-color: rgba(245, 197, 24, 0.55);
}
.login-panel input:focus {
    outline: 2px solid var(--gold);
    border-color: var(--gold);
}
.login-dest strong {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
}
.login-dest span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}
.login-dest.on {
    border-color: rgba(245, 197, 24, 0.45);
    background: var(--gold-dim);
}
.login-dest.dim {
    opacity: 0.42;
}
.login-pass-wrap {
    position: relative;
}
.login-pass-wrap input {
    padding-right: 72px;
}
.login-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    min-height: 36px;
    padding: 6px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}
.login-eye:hover,
.login-eye:focus-visible {
    color: var(--gold);
}
.login-panel .error {
    min-height: 18px;
    margin: 0 0 12px;
}
.login-qr {
    text-align: center;
    margin: 0 0 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}
.login-qr img {
    display: block;
    width: min(220px, 100%);
    height: auto;
    margin: 10px auto 0;
}
.login-qr .muted { color: #444; }
#totpToken {
    text-align: center;
    letter-spacing: 0.4em;
    font-size: 1.35rem;
    font-weight: 800;
}
body.gate-pending > * {
    visibility: hidden;
}
@media (min-width: 560px) {
    .actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .dash-head { flex-wrap: wrap; }
    .dash-head .row { width: 100%; justify-content: space-between; }
    .card { padding: 14px; }
}
@media (max-width: 520px) {
    .stack-on-phone { flex-direction: column; }
    .stack-on-phone > * { flex: 1 1 auto; width: 100%; }
    .timer { letter-spacing: 0.02em; }
    h2 { font-size: 1.2rem; }
    .login-dests { grid-template-columns: 1fr; }
    .login-dest { min-height: 0; }
    .login-panel { padding: 22px 18px 20px; }
}

/* Huskeliste — højre fane + skuffe med kalender */
.memo-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 65;
}
.memo-root.open .memo-backdrop { display: block; }
.memo-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    height: 100dvh;
    width: min(92vw, 430px);
    z-index: 70;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}
.memo-root.open .memo-drawer {
    transform: translateX(0);
    pointer-events: auto;
}
.memo-tab {
    position: fixed;
    right: 0;
    top: 22%;
    z-index: 46;
    pointer-events: auto;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: var(--gold);
    color: #111;
    border-radius: 16px 0 0 16px;
    min-width: 40px;
    min-height: 148px;
    padding: 18px 8px 18px 10px;
    font: inherit;
    font-weight: 800;
    letter-spacing: 0.08em;
    box-shadow: -6px 8px 24px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: right 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.memo-root.open .memo-tab {
    right: min(92vw, 430px);
    z-index: 72;
}
.memo-tab span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    display: block;
    font-size: 15px;
    line-height: 1;
}
.memo-tab .memo-badge {
    position: absolute;
    top: 8px;
    left: 6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #111;
    color: var(--gold);
    font-size: 11px;
    font-weight: 800;
    display: grid;
    place-items: center;
}
.memo-tab .memo-badge[hidden] { display: none !important; }
.memo-panel {
    height: 100%;
    background: #07090d;
    border-left: 1px solid rgba(245, 197, 24, 0.28);
    display: flex;
    flex-direction: column;
    padding: calc(12px + env(safe-area-inset-top)) 14px calc(12px + env(safe-area-inset-bottom));
    padding-right: max(14px, env(safe-area-inset-right));
    pointer-events: auto;
    overflow: hidden;
}
.memo-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.memo-head h2 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--gold);
}
.memo-head .btn {
    width: auto;
    min-height: 40px;
    padding: 6px 12px;
    flex: 0 0 auto;
}
.memo-cal {
    background: #10151c;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 8px 8px 10px;
    margin-bottom: 8px;
    flex: 0 0 auto;
}
.memo-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.memo-cal-nav h3 {
    margin: 0;
    font-size: 0.95rem;
    text-transform: capitalize;
}
.memo-cal-nav .btn {
    width: 36px;
    min-height: 36px;
    padding: 0;
    flex: 0 0 36px;
}
.memo-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.memo-cal-grid .dow {
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
    padding: 4px 0;
}
.memo-day {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text);
    min-height: 32px;
    border-radius: 8px;
    padding: 2px 0 6px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
}
.memo-day.out { color: #4d5866; }
.memo-day.today { box-shadow: inset 0 0 0 1px rgba(245, 197, 24, 0.55); }
.memo-day.picked {
    background: var(--gold);
    color: #111;
}
.memo-day.has::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 4px;
    width: 5px;
    height: 5px;
    margin-left: -2.5px;
    border-radius: 50%;
    background: var(--gold);
}
.memo-day.picked.has::after { background: #111; }
.memo-list {
    flex: 1 1 auto;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 140px;
}
.memo-group { margin: 0 0 14px; }
.memo-group h3 {
    margin: 0 0 8px;
    font-size: 0.82rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.memo-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
}
.memo-item.done .memo-body {
    text-decoration: line-through;
    color: var(--muted);
}
.memo-item input[type="checkbox"] {
    width: 24px;
    height: 24px;
    min-height: 24px;
    margin-top: 2px;
    flex: 0 0 24px;
}
.memo-body { flex: 1; min-width: 0; font-size: 15px; line-height: 1.35; }
.memo-meta { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.memo-item .btn {
    width: auto;
    min-height: 36px;
    padding: 4px 10px;
    flex: 0 0 auto;
}
.memo-compose {
    flex: 0 0 auto;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}
.memo-compose textarea { min-height: 52px; }
.memo-compose .row { margin-top: 8px; }
.memo-compose .btn-gold { margin-top: 8px; }
body.memo-open { overflow: hidden; }
body.kb-open .memo-tab { top: 12%; }
body.kb-open .memo-panel {
    padding-bottom: calc(12px + env(safe-area-inset-bottom) + var(--kb, 0px));
}
