
        /* Layout per sida – färger/tokens/toppnav kommer gemensamt från css/theme.css */
        html, body {
            height: 100%;
            margin: 0;
            padding: 0;
            overflow: hidden;
            color: var(--text-dark);
        }

        /* HUD-baren ligger ovanför standard-navet */
        /* Z-SKALA Planner3 (lägst → högst): karta/Leaflet 1 · drawer-reopen 1040 ·
           drawer 1050 · timeline 1060 (överlappar ej drawern geometriskt) ·
           overlay-vyer (driver/packning/onepage) 1080 · HUD 1100 · navbar 1200 ·
           review/QR 2000 · timespan-modaler (order/lunch/magi/varning) 2600 ·
           streetview 2700 (kan öppnas inifrån ordermodal) · snackbar 99999.
           Leaflet-zoom ligger topright (zoomControl:false + egen kontroll) så att
           drawern aldrig täcker den. */
        .top-navbar {
            z-index: 1200;
        }

        .brand-version-tag {
            font-size: 0.65rem;
            font-weight: 800;
            background: linear-gradient(135deg, #0284c7, #38bdf8);
            color: #fff;
            padding: 2px 7px;
            border-radius: 6px;
            letter-spacing: 0.5px;
            text-transform: uppercase;
        }

        .store-pill {
            background: rgba(255, 255, 255, 0.10);
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 20px;
            padding: 4px 12px;
            font-size: 0.76rem;
            color: #e2e8f0;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        /* Secondary Floating Dispatch HUD Bar */
        .dispatch-hud-bar {
            position: fixed;
            top: 66px;
            left: 18px;
            right: 18px;
            height: 52px;
            background: var(--hud-bg);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid var(--hud-border);
            border-radius: 14px;
            box-shadow: var(--shadow-hud);
            z-index: 1100;
            padding: 0 14px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        }

        /* Date Controls in HUD */
        .hud-date-controls {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .btn-hud-icon {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.15);
            color: #e2e8f0;
            border-radius: 8px;
            width: 32px;
            height: 32px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.15s ease;
            font-size: 0.8rem;
        }

        .btn-hud-icon:hover {
            background: rgba(255, 255, 255, 0.2);
            color: #ffffff;
            border-color: #38bdf8;
        }

        .hud-date-input {
            background: rgba(0, 0, 0, 0.35);
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 8px;
            color: #ffffff;
            font-weight: 700;
            font-size: 0.84rem;
            padding: 5px 10px;
            width: 125px;
            text-align: center;
            cursor: pointer;
        }

        .hud-date-input:focus {
            outline: none;
            border-color: #0284c7;
        }

        .btn-hud-fetch {
            background: linear-gradient(135deg, #0284c7, #0369a1);
            color: #ffffff;
            border: none;
            border-radius: 8px;
            padding: 6px 14px;
            font-weight: 700;
            font-size: 0.82rem;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            cursor: pointer;
            box-shadow: 0 3px 10px rgba(2, 132, 199, 0.35);
            transition: all 0.15s ease;
        }

        .btn-hud-fetch:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 14px rgba(2, 132, 199, 0.5);
            color: #fff;
        }

        /* Manuell Dagsstart Control in HUD */
        .hud-start-time-control {
            display: flex;
            align-items: center;
            gap: 6px;
            background: rgba(255, 255, 255, 0.08);
            border: 1px solid rgba(255, 255, 255, 0.15);
            border-radius: 8px;
            padding: 2px 8px;
            height: 32px;
        }

        .hud-time-label {
            font-size: 0.72rem;
            font-weight: 700;
            color: #cbd5e1;
            margin: 0;
            display: flex;
            align-items: center;
            gap: 4px;
            white-space: nowrap;
        }

        .hud-time-input {
            background: rgba(0, 0, 0, 0.45);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: #ffffff;
            font-size: 0.82rem;
            font-weight: 800;
            border-radius: 6px;
            padding: 2px 6px;
            width: 82px;
            cursor: pointer;
            text-align: center;
            color-scheme: dark;
        }

        .hud-time-input:focus {
            outline: none;
            border-color: #38bdf8;
            box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.3);
        }

        /* Lunch Control in HUD */
        .hud-lunch-control {
            display: flex;
            align-items: center;
            gap: 6px;
            background: rgba(245, 158, 11, 0.14);
            border: 1px solid rgba(245, 158, 11, 0.35);
            border-radius: 8px;
            padding: 2px 9px;
            height: 32px;
            cursor: pointer;
            transition: all 0.15s ease;
            user-select: none;
        }

        .hud-lunch-control:hover {
            background: rgba(245, 158, 11, 0.28);
            border-color: #f59e0b;
            transform: translateY(-1px);
        }

        .hud-lunch-summary {
            font-size: 0.78rem;
            font-weight: 700;
            color: #fde68a;
            white-space: nowrap;
        }

        /* Live KPI Chips in Center of HUD */
        .hud-kpi-group {
            display: flex;
            align-items: center;
            gap: 12px;
            color: #ffffff;
        }

        .hud-kpi-chip {
            display: flex;
            align-items: baseline;
            gap: 5px;
            background: rgba(255, 255, 255, 0.06);
            padding: 3px 10px;
            border-radius: 8px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            font-size: 0.78rem;
        }

        .hud-kpi-label {
            color: #94a3b8;
            font-weight: 600;
            text-transform: uppercase;
            font-size: 0.65rem;
        }

        .hud-kpi-val {
            font-weight: 800;
            color: #38bdf8;
            font-size: 0.90rem;
        }

        /* Mode Switcher Buttons (Cockpit, Timeline, Montörsläge, Packning, Onepage) */
        .hud-view-switcher {
            display: inline-flex;
            gap: 3px;
            background: rgba(0, 0, 0, 0.4);
            padding: 3px;
            border-radius: 10px;
            border: 1px solid rgba(255, 255, 255, 0.08);
        }

        .btn-view-switch {
            background: transparent;
            border: none;
            color: #94a3b8;
            font-size: 0.76rem;
            font-weight: 700;
            padding: 5px 11px;
            border-radius: 8px;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            cursor: pointer;
            transition: all 0.15s ease;
            white-space: nowrap;
        }

        .btn-view-switch:hover {
            color: #ffffff;
            background: rgba(255, 255, 255, 0.08);
        }

        .btn-view-switch.active {
            background: #0284c7;
            color: #ffffff;
            box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
        }

        /* Full-Canvas Map Viewport */
        #map {
            width: 100vw;
            height: 100vh;
            position: absolute;
            top: 0;
            left: 0;
            z-index: 1;
        }

        /* Mission Drawer (Floating Left Sidebar) */
        .mission-drawer {
            position: fixed;
            top: 126px;
            left: 18px;
            bottom: 96px;
            width: 380px;
            background: var(--hud-bg);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid var(--hud-border);
            border-radius: var(--card-radius);
            box-shadow: var(--shadow-hud);
            z-index: 1050;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
        }

        .mission-drawer.minimized {
            transform: translateX(-410px);
            opacity: 0;
            pointer-events: none;
        }

        /* Drawer Reopen Floating Button */
        .btn-drawer-reopen {
            position: fixed;
            top: 126px;
            left: 18px;
            z-index: 1040;
            background: var(--hud-bg);
            backdrop-filter: blur(12px);
            border: 1px solid var(--hud-border);
            color: #ffffff;
            border-radius: 10px;
            padding: 8px 14px;
            font-size: 0.82rem;
            font-weight: 700;
            cursor: pointer;
            box-shadow: var(--shadow-hud);
            display: none;
            align-items: center;
            gap: 7px;
        }

        .btn-drawer-reopen.show {
            display: flex;
        }

        .mission-drawer-header {
            padding: 12px 16px;
            border-bottom: 1px solid var(--hud-border);
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: rgba(0, 0, 0, 0.25);
            flex-shrink: 0;
        }

        .mission-drawer-title {
            font-weight: 800;
            font-size: 0.85rem;
            color: #ffffff;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        /* Magic Optimizer Button */
        .btn-magic-opt {
            background: linear-gradient(135deg, #f59e0b, #d97706);
            color: #ffffff;
            border: none;
            border-radius: 10px;
            padding: 10px;
            font-weight: 800;
            font-size: 0.84rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            cursor: pointer;
            box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
            transition: all 0.2s ease;
            width: 100%;
        }

        .btn-magic-opt:hover:not(:disabled) {
            transform: translateY(-1px);
            box-shadow: 0 6px 18px rgba(245, 158, 11, 0.55);
            color: #ffffff;
        }

        .btn-magic-opt:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            box-shadow: none;
        }

        /* Mission Stops Scrollable List */
        .mission-stops-list {
            padding: 12px;
            overflow-y: auto;
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            gap: 8px;
            list-style: none;
            margin: 0;
        }

        .stop-cockpit-card {
            background: rgba(255, 255, 255, 0.96);
            border-radius: 12px;
            border: 1px solid #cbd5e1;
            padding: 10px 12px;
            display: flex;
            align-items: flex-start;
            gap: 10px;
            transition: all 0.15s ease;
            position: relative;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
        }

        .stop-cockpit-card:hover {
            transform: translateX(2px);
            border-color: #0284c7;
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
        }

        .stop-cockpit-card.start-hub {
            background: #ecfdf5;
            border-color: #a7f3d0;
        }

        .stop-cockpit-card.conflict {
            background: #fff5f5;
            border-color: #fecaca;
        }

        .stop-cockpit-card.locked {
            border-color: #fde68a;
            background: #fffdf5;
        }

        .stop-badge-icon {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 800;
            font-size: 0.85rem;
            color: #fff;
            background: #0284c7;
            flex-shrink: 0;
            box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4);
        }

        .stop-cockpit-card.start-hub .stop-badge-icon {
            background: #10b981;
            box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
        }

        .stop-cockpit-card.conflict .stop-badge-icon {
            background: #ef4444;
            box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
        }

        .stop-cockpit-card.is-new .stop-badge-icon {
            background: #16a34a;
            box-shadow: 0 2px 6px rgba(22, 163, 74, 0.45);
        }

        .stop-info-body {
            flex-grow: 1;
            min-width: 0;
        }

        .stop-card-addr {
            font-weight: 700;
            font-size: 0.86rem;
            color: #0f172a;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            cursor: pointer;
            display: inline-block;
            max-width: 210px;
        }

        .stop-card-addr:hover {
            color: #0284c7;
            text-decoration: underline;
        }

        .stop-card-meta {
            font-size: 0.74rem;
            color: #64748b;
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 2px;
        }

        .tag-chip {
            font-size: 0.68rem;
            font-weight: 700;
            padding: 1px 6px;
            border-radius: 4px;
            background: #f1f5f9;
            color: #334155;
            border: 1px solid #e2e8f0;
        }

        .tag-chip.atertag {
            background: #f3e8ff;
            color: #7e22ce;
            border-color: #e9d5ff;
        }

        .tag-chip.conflict {
            background: #fee2e2;
            color: #dc2626;
            border-color: #fca5a5;
        }

        .tag-chip.paid-timeslot {
            background: #ecfdf5;
            color: #047857;
            border-color: #a7f3d0;
            font-weight: 700;
        }

        /* NY-markering: stopp som mergats in via diff-dialogen efter "Ladda sparad rutt".
           Grön ram + badge – syns i både cockpit-stapeln och Startläget. */
        .tag-chip.new-since-save {
            background: #dcfce7;
            color: #166534;
            border-color: #4ade80;
            font-weight: 800;
        }

        /* Backrep-markering: återbesök där varan redan finns hos kunden.
           Orange ram + badge – syns i både cockpit-stapeln och Startläget. */
        .tag-chip.backrep {
            background: #fff7ed;
            color: #c2410c;
            border-color: #fdba74;
            font-weight: 800;
        }

        /* Tjänste-chips i cockpit-kortet: wrappande, alltid fullt läsbara */
        .stop-services-chips {
            display: flex;
            flex-wrap: wrap;
            gap: 4px;
            margin-top: 6px;
        }

        .svc-chip {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 0.72rem;
            font-weight: 700;
            line-height: 1.25;
            padding: 3px 8px;
            border-radius: 20px;
            border: 1px solid #e2e8f0;
            background: #f1f5f9;
            color: #0f172a;
            white-space: normal;
            word-break: break-word;
        }

        .svc-chip i { font-size: 0.66rem; }
        .svc-chip.svc-delivery { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
        .svc-chip.svc-install { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }
        .svc-chip.svc-pickup { background: #f5f3ff; border-color: #ddd6fe; color: #6d28d9; }
        .svc-chip.svc-extra { background: #fffbeb; border-color: #fde68a; color: #92400e; }
        .svc-chip.svc-transport { background: #f0fdfa; border-color: #99f6e0; color: #0f766e; }

        .stop-cockpit-card.has-paid-timeslot {
            border-left: 4px solid #10b981 !important;
        }

        .stop-cockpit-card.is-new {
            border: 2px dashed #22c55e;
            box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22), 0 2px 6px rgba(0, 0, 0, 0.15);
        }

        .stop-cockpit-card.is-new:hover {
            border-color: #16a34a;
        }

        /* Backrep: orange kort + sifferplupp så återbesök sticker ut i stapeln */
        .stop-cockpit-card.is-backrep {
            background: #fff7ed;
            border-color: #fb923c;
        }

        .stop-cockpit-card.is-backrep:hover {
            border-color: #ea580c;
        }

        .stop-cockpit-card.is-backrep .stop-badge-icon {
            background: #ea580c;
            box-shadow: 0 2px 6px rgba(234, 88, 12, 0.45);
        }

        /* Drag & Reorder Styles */
        .stop-cockpit-card.draggable {
            cursor: grab;
        }

        .stop-cockpit-card.dragging,
        .stop-cockpit-lunch.dragging,
        .stop-cockpit-depot.dragging {
            opacity: 0.45;
            transform: scale(0.98);
            border: 2px dashed #0284c7 !important;
        }

        .stop-cockpit-card.drag-over-top,
        .stop-cockpit-lunch.drag-over-top,
        .stop-cockpit-depot.drag-over-top {
            border-top: 4px solid #22c55e !important;
            box-shadow: 0 -6px 14px rgba(34, 197, 94, 0.45) !important;
            background-image: linear-gradient(to bottom, rgba(34,197,94,0.18), transparent 38%) !important;
        }

        .stop-cockpit-card.drag-over-bottom,
        .stop-cockpit-lunch.drag-over-bottom,
        .stop-cockpit-depot.drag-over-bottom {
            border-bottom: 4px solid #22c55e !important;
            box-shadow: 0 6px 14px rgba(34, 197, 94, 0.45) !important;
            background-image: linear-gradient(to top, rgba(34,197,94,0.18), transparent 38%) !important;
        }

        /* Tydlig textetikett mitt på släppmålet medan man drar
           (sätts via data-drop-label i setupDragAndDrop). */
        .stop-cockpit-card.drag-over-top::after,
        .stop-cockpit-lunch.drag-over-top::after,
        .stop-cockpit-depot.drag-over-top::after,
        .stop-cockpit-card.drag-over-bottom::after,
        .stop-cockpit-lunch.drag-over-bottom::after,
        .stop-cockpit-depot.drag-over-bottom::after {
            content: attr(data-drop-label);
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            background: #16a34a;
            color: #fff;
            font-size: 0.72rem;
            font-weight: 800;
            padding: 2px 10px;
            border-radius: 20px;
            white-space: nowrap;
            box-shadow: 0 2px 8px rgba(0,0,0,0.35);
            pointer-events: none;
            z-index: 5;
        }

        .stop-cockpit-card.drag-over-top::after,
        .stop-cockpit-lunch.drag-over-top::after,
        .stop-cockpit-depot.drag-over-top::after {
            top: -13px;
        }

        .stop-cockpit-card.drag-over-bottom::after,
        .stop-cockpit-lunch.drag-over-bottom::after,
        .stop-cockpit-depot.drag-over-bottom::after {
            bottom: -13px;
        }

        /* Gula släppfält runt lunch/depå i vänsterlistan – visas medan
           ett stopp dras (samma idé som Startlägets gula fält). */
        .drawer-drop-hint {
            list-style: none;
            border: 2px dashed #f59e0b;
            background: rgba(245, 158, 11, 0.14);
            color: #fde68a;
            border-radius: 12px;
            padding: 8px 12px;
            font-weight: 800;
            font-size: 0.8rem;
            text-align: center;
            cursor: copy;
        }

        .drawer-drop-hint.drag-over {
            background: rgba(245, 158, 11, 0.38);
            border-color: #fbbf24;
            color: #ffffff;
            box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.35);
        }

        .card-reorder-controls {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 2px;
            margin-right: 2px;
            color: #94a3b8;
            flex-shrink: 0;
            padding-top: 2px;
        }

        .drag-handle {
            cursor: grab;
            padding: 2px;
            font-size: 0.85rem;
            line-height: 1;
            color: #94a3b8;
            transition: color 0.15s ease;
        }

        .drag-handle:active {
            cursor: grabbing;
        }

        .drag-handle:hover {
            color: #0284c7;
        }

        .nudge-btns {
            display: flex;
            flex-direction: column;
            gap: 1px;
            background: #f1f5f9;
            border-radius: 4px;
            padding: 1px;
            border: 1px solid #e2e8f0;
        }

        .btn-nudge {
            background: #ffffff;
            border: none;
            padding: 0;
            margin: 0;
            color: #64748b;
            font-size: 0.8rem;
            line-height: 1;
            cursor: pointer;
            /* WCAG: 32x32 träffyta (var 18x14) – uppfyller WCAG 2.2 AA (24px) */
            width: 32px;
            height: 32px;
            min-width: 32px;
            min-height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 6px;
            transition: all 0.15s ease;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        }

        .btn-nudge:hover:not(:disabled) {
            background: #0284c7;
            color: #ffffff;
        }

        .btn-nudge:disabled {
            opacity: 0.3;
            cursor: not-allowed;
            background: transparent;
            box-shadow: none;
        }

        /* WCAG: synlig fokusring i hela planeraren */
        #mission-drawer button:focus-visible,
        #mission-drawer [tabindex]:focus-visible,
        .hud-date-controls button:focus-visible,
        .hud-view-switcher button:focus-visible,
        .views-overlay-layer button:focus-visible {
            outline: 3px solid #0284c7;
            outline-offset: 2px;
        }

        /* Lunch Item in Drawer */
        .stop-cockpit-lunch {
            background: #fffdf5;
            border: 1px solid #fde68a;
            border-left: 4px solid #f59e0b;
            border-radius: 12px;
            padding: 8px 10px;
            display: flex;
            align-items: center;
            gap: 8px;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
            transition: all 0.15s ease;
            position: relative;
        }

        .stop-cockpit-lunch:hover {
            border-color: #f59e0b;
            transform: translateX(2px);
        }

        .stop-cockpit-lunch.draggable {
            cursor: grab;
        }

        .lunch-badge-icon {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: #f59e0b;
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.75rem;
            flex-shrink: 0;
            box-shadow: 0 2px 5px rgba(245, 158, 11, 0.4);
        }

        /* Depåstopp (Avlämning / Butiksretur) */
        .stop-cockpit-depot {
            background: #f8fafc;
            border: 1px dashed #94a3b8;
            border-left: 4px solid #0284c7;
            border-radius: 12px;
            padding: 8px 10px;
            display: flex;
            align-items: center;
            gap: 8px;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.10);
            transition: all 0.15s ease;
            position: relative;
        }

        .stop-cockpit-depot:hover {
            border-color: #0284c7;
            background: #f0f9ff;
            transform: translateX(2px);
        }

        .stop-cockpit-depot.draggable {
            cursor: grab;
        }

        .depot-badge-icon {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: #0284c7;
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.75rem;
            flex-shrink: 0;
            box-shadow: 0 2px 5px rgba(2, 132, 199, 0.4);
        }

        /* Timespan Button Badge in Stop Card */
        .btn-timespan-badge {
            background: #f0f9ff;
            border: 1px solid #bae6fd;
            color: #0284c7;
            font-size: 0.72rem;
            font-weight: 700;
            border-radius: 6px;
            padding: 2px 7px;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            cursor: pointer;
            transition: all 0.15s ease;
            text-decoration: none;
        }

        .btn-timespan-badge:hover {
            background: #e0f2fe;
            border-color: #0284c7;
            color: #0369a1;
            transform: translateY(-1px);
        }

        .btn-timespan-badge.empty {
            background: #f8fafc;
            border: 1px dashed #cbd5e1;
            color: #64748b;
        }

        .btn-timespan-badge.empty:hover {
            background: #f1f5f9;
            border-color: #0284c7;
            color: #0284c7;
        }

        .btn-timespan-badge.conflict {
            background: #fef2f2;
            border: 1px solid #fca5a5;
            color: #dc2626;
            animation: pulseConflict 2s infinite ease-in-out;
        }

        @keyframes pulseConflict {
            0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
            50% { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15); }
        }

        .btn-timespan-badge.paid-slot {
            background: #ecfdf5;
            border: 1.5px solid #10b981;
            color: #065f46;
            box-shadow: 0 1px 4px rgba(16, 185, 129, 0.18);
        }

        .btn-timespan-badge.paid-slot:hover {
            background: #d1fae5;
            border-color: #059669;
            color: #047857;
            transform: translateY(-1px);
        }

        .btn-timespan-badge.paid-slot.conflict {
            background: #fef2f2;
            border-color: #ef4444;
            color: #dc2626;
        }

        .tl-segment.job.paid-slot {
            border: 2px solid #10b981 !important;
            box-shadow: 0 0 6px rgba(16, 185, 129, 0.45);
        }

        /* Timespan Modal Styles */
        .timespan-modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(15, 23, 42, 0.82);
            backdrop-filter: blur(8px);
            z-index: 2600;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        .timespan-modal-overlay.show {
            display: flex;
        }

        /* Hela ordern-modal (återanvänder timespan-overlay-mönstret) */
        #order-modal-overlay .timespan-modal-box { width: min(620px, 100%); max-height: 90vh; display: flex; flex-direction: column; }
        #order-modal-body { overflow-y: auto; }
        #order-modal-body .order-section { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
        #order-modal-body .order-section-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; font-weight: 800; margin-bottom: 6px; }

        .timespan-modal-box {
            background: #ffffff;
            border-radius: 18px;
            width: min(520px, 100%);
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
            overflow: hidden;
            animation: modalPopIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        }

        @keyframes modalPopIn {
            from { opacity: 0; transform: scale(0.95); }
            to { opacity: 1; transform: scale(1); }
        }

        .preset-span-chip {
            padding: 6px 10px;
            border-radius: 8px;
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            font-size: 0.78rem;
            font-weight: 700;
            color: #334155;
            cursor: pointer;
            transition: all 0.15s ease;
        }

        .preset-span-chip:hover {
            background: #0284c7;
            color: #ffffff;
            border-color: #0284c7;
            transform: translateY(-1px);
        }

        /* Bottom Visual Day Timeline Dock (Gantt-style) */
        .visual-timeline-dock {
            position: fixed;
            bottom: 14px;
            left: 18px;
            right: 18px;
            height: 72px;
            background: var(--hud-bg);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid var(--hud-border);
            border-radius: 14px;
            box-shadow: var(--shadow-hud);
            z-index: 1060;
            padding: 8px 16px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .timeline-header-info {
            display: flex;
            align-items: center;
            justify-content: space-between;
            color: #94a3b8;
            font-size: 0.72rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .timeline-track-wrap {
            position: relative;
            width: 100%;
            height: 32px;
            background: rgba(0, 0, 0, 0.45);
            border-radius: 8px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            overflow: hidden;
            display: flex;
            align-items: center;
        }

        /* Timeline segments */
        .tl-segment {
            height: 100%;
            position: absolute;
            top: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #ffffff;
            font-size: 0.72rem;
            font-weight: 800;
            cursor: pointer;
            transition: filter 0.15s ease;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            padding: 0 4px;
            border-right: 1px solid rgba(255, 255, 255, 0.25);
        }

        .tl-segment:hover {
            filter: brightness(1.25);
            z-index: 10;
        }

        .tl-segment.drive {
            background: repeating-linear-gradient(45deg, #0284c7, #0284c7 6px, #0369a1 6px, #0369a1 12px);
            opacity: 0.85;
        }

        .tl-segment.job {
            background: linear-gradient(135deg, #6366f1, #4f46e5);
            box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
        }

        .tl-segment.lunch {
            background: linear-gradient(135deg, #f59e0b, #d97706);
            color: #ffffff;
        }

        .tl-segment.depot {
            background: linear-gradient(135deg, #0284c7, #0369a1);
            color: #ffffff;
        }

        .tl-segment.wait {
            background: repeating-linear-gradient(45deg, #94a3b8, #94a3b8 6px, #64748b 6px, #64748b 12px);
            border-top: 1px dashed #e2e8f0;
            border-bottom: 1px dashed #e2e8f0;
            color: #0f172a;
            opacity: 0.95;
        }

        .tl-segment.conflict {
            background: repeating-linear-gradient(45deg, #ef4444, #ef4444 6px, #dc2626 6px, #dc2626 12px);
        }

        /* Views Overlay Container */
        .views-overlay-layer {
            position: fixed;
            top: 126px;
            left: 18px;
            right: 18px;
            bottom: 18px;
            z-index: 1080;
            display: none;
            overflow-y: auto;
            background: rgba(15, 23, 42, 0.94);
            backdrop-filter: blur(18px);
            -webkit-backdrop-filter: blur(18px);
            border: 1px solid var(--hud-border);
            border-radius: 18px;
            box-shadow: var(--shadow-hud);
            padding: 24px;
            animation: fadeInView 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .views-overlay-layer.active {
            display: block;
        }

        /* STARTLÄGE: stor planeringsyta före karta/rutt */
        #overlay-start {
            display: none;
        }
        #overlay-start.active {
            display: block;
        }
        .start-toolbar {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            align-items: stretch;
            background: rgba(0, 0, 0, 0.30);
            border: 1px solid var(--hud-border);
            border-radius: 14px;
            padding: 10px 12px;
        }
        .start-tool-btn {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            border-radius: 10px;
            padding: 8px 14px;
            font-weight: 800;
            font-size: 0.84rem;
            cursor: pointer;
            border: 1px solid rgba(255, 255, 255, 0.18);
            background: rgba(255, 255, 255, 0.08);
            color: #e2e8f0;
            transition: all 0.15s ease;
            min-height: 44px;
        }
        .start-tool-btn:hover {
            background: rgba(255, 255, 255, 0.16);
            color: #fff;
        }
        .start-tool-btn.is-on {
            background: linear-gradient(135deg, #f59e0b, #d97706);
            border-color: #f59e0b;
            color: #fff;
            box-shadow: 0 3px 10px rgba(245, 158, 11, 0.4);
        }
        .start-tool-btn.is-info-on {
            background: #0284c7;
            border-color: #38bdf8;
            color: #fff;
            box-shadow: 0 3px 10px rgba(2, 132, 199, 0.4);
        }
        /* Strategi-väljaren i Startläge-toolbaren är ett native <select>:
           själva knappen behåller toolbarens mörka look, men alternativen i
           listan renderas mot vit bakgrund och behöver därför mörk text
           (annars blir det nästan vitt på vitt och går inte att läsa). */
        select.start-tool-btn option {
            color: #0f172a;
            background: #ffffff;
        }
        .start-vehicle-tabs {
            display: none;
            align-items: center;
            gap: 6px;
        }
        .start-vehicle-tabs.show {
            display: inline-flex;
        }
        /* Inbäddad "Så tänker magikern"-sammanfattning i startläget */
        .start-magic-card {
            background: #fffdf5;
            border: 1px solid #fde68a;
            border-left: 5px solid #f59e0b;
            border-radius: 14px;
            padding: 10px 14px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
            font-size: 0.84rem;
            color: #0f172a;
        }
        .start-magic-card ul {
            margin: 0;
            padding-left: 1.1rem;
        }
        .start-magic-card li {
            margin-bottom: 2px;
        }
        /* Hover-förklaring på +35 min-regeln (magikerns crew-straff) */
        .magic-crew-tip {
            text-decoration: underline dotted;
            text-underline-offset: 2px;
            cursor: help;
        }
        .start-summary-chips {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }
        .start-stops-grid {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            align-items: stretch;
            gap: 12px;
            list-style: none;
            margin: 0;
            padding: 0;
        }
        /* Bokningskorten: max 420 px, varje rad centreras var för sig */
        .start-stops-grid > .start-stop-card {
            flex: 0 1 420px;
            min-width: min(360px, 100%);
        }
        /* Lunch-/depåkort i startläget: avdelare på EGEN rad (radbrytare före/efter
           läggs av renderStartList). JS (fitStartMealSpan) sätter flex-basis till
           exakt korthögens bredd så de blir lika långa som den bredaste raden. */
        .start-stops-grid > .stop-cockpit-lunch,
        .start-stops-grid > .stop-cockpit-depot {
            flex: 0 1 420px;
            min-width: min(360px, 100%);
        }
        /* Osynlig radbrytare: 100 % bredd utan maxbredd = tar alltid egen rad och
           tvingar fram radbrytning före/efter lunch/depå */
        .start-rowbreak {
            flex: 1 0 100%;
            height: 0 !important;
            min-height: 0 !important;
            padding: 0 !important;
            margin: 0 !important;
            border: 0 !important;
            list-style: none;
            overflow: hidden;
        }
        .start-stop-card {
            background: rgba(255, 255, 255, 0.97);
            border: 1px solid #cbd5e1;
            border-left: 5px solid #0284c7;
            border-radius: 14px;
            padding: 12px 14px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
            display: flex;
            gap: 10px;
            align-items: flex-start;
        }
        .start-stop-card.locked {
            border-left-color: #f59e0b;
            background: #fffdf5;
        }
        .start-stop-card.is-paid {
            border-left-color: #10b981;
        }
        .start-stop-card.is-new {
            border: 2px dashed #22c55e;
            box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25), 0 2px 8px rgba(0, 0, 0, 0.18);
        }
        .start-stop-card.is-backrep {
            border-left-color: #f97316;
            background: #fff7ed;
        }
        .start-stop-card.dragging {
            opacity: 0.45;
            border: 2px dashed #0284c7 !important;
        }
        .start-stop-card.drag-over,
        .start-stops-grid > .stop-cockpit-lunch.drag-over,
        .start-stops-grid > .stop-cockpit-depot.drag-over {
            outline: 3px solid #38bdf8;
            outline-offset: 2px;
        }
        /* Explicita släppfält vid lunch/depå – visas medan ett stopp dras.
           Egen rad vardera (lätta att träffa); bredden följer korthögen via breaks. */
        .start-drop-hint {
            flex: 1 0 100%;
            list-style: none;
            border: 2px dashed #f59e0b;
            background: rgba(245, 158, 11, 0.12);
            color: #fde68a;
            border-radius: 12px;
            padding: 10px 14px;
            font-weight: 800;
            font-size: 0.85rem;
            text-align: center;
        }
        .start-drop-hint.drag-over {
            background: rgba(245, 158, 11, 0.35);
            border-color: #fbbf24;
            color: #ffffff;
        }
        .start-num-badge {
            width: 38px;
            height: 38px;
            border-radius: 50%;
            background: #0284c7;
            color: #fff;
            font-weight: 800;
            font-size: 1rem;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4);
        }
        .start-stop-card.locked .start-num-badge {
            background: #f59e0b;
            box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
        }
        .start-stop-card.is-new .start-num-badge {
            background: #16a34a;
            box-shadow: 0 2px 6px rgba(22, 163, 74, 0.45);
        }
        .start-stop-card.is-backrep .start-num-badge {
            background: #ea580c;
            box-shadow: 0 2px 6px rgba(234, 88, 12, 0.45);
        }
        .start-card-actions {
            display: flex;
            flex-direction: column;
            gap: 4px;
            flex-shrink: 0;
        }
        .btn-start-nudge {
            background: #f1f5f9;
            border: 1px solid #cbd5e1;
            color: #334155;
            width: 40px;
            height: 40px;
            min-width: 40px;
            min-height: 40px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 0.9rem;
        }
        .btn-start-nudge:hover:not(:disabled) {
            background: #0284c7;
            border-color: #0284c7;
            color: #fff;
        }
        .btn-start-nudge:disabled {
            opacity: 0.3;
            cursor: not-allowed;
        }

        @keyframes fadeInView {
            from { opacity: 0; transform: translateY(8px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Driver Companion View */
        .driver-hero-card {
            background: #ffffff;
            border-radius: 18px;
            border: 2px solid #0284c7;
            padding: 24px;
            box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
            max-width: 680px;
            margin: 0 auto 24px;
        }

        .driver-action-btn {
            padding: 14px;
            border-radius: 12px;
            font-weight: 800;
            font-size: 1rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            text-decoration: none;
            border: none;
            cursor: pointer;
            transition: all 0.15s ease;
        }

        .btn-nav-large {
            background: #10b981;
            color: #ffffff;
            box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
        }

        .btn-nav-large:hover {
            background: #059669;
            color: #ffffff;
            transform: translateY(-1px);
        }

        .btn-call-large {
            background: #0284c7;
            color: #ffffff;
            box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
        }

        .btn-call-large:hover {
            background: #0369a1;
            color: #ffffff;
            transform: translateY(-1px);
        }

        .driver-checklist-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 14px;
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 10px;
            margin-bottom: 8px;
            font-weight: 600;
            font-size: 0.88rem;
        }

        /* Uppdragsrad i Montörsläge – VAD ska göras på stoppet */
        .driver-task-line {
            background: #eff6ff;
            border: 1px solid #bfdbfe;
            border-left: 4px solid #0284c7;
            border-radius: 10px;
            padding: 9px 12px;
            margin-bottom: 12px;
            font-size: 0.9rem;
            color: #0f172a;
            line-height: 1.45;
        }

        .driver-task-line strong {
            color: #0369a1;
        }

        /* Förenklat Montörsläge – lugn topp + få stora knappar (mobilfokus) */
        .driver-simplified .driver-topbar {
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            padding: 10px 12px;
            margin-bottom: 12px;
        }
        .driver-simplified .driver-topbar-row {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.9rem;
        }
        .driver-simplified .driver-stop-label {
            font-weight: 800;
            color: #0f172a;
        }
        .driver-simplified .driver-eta {
            font-weight: 800;
            color: #047857;
            white-space: nowrap;
        }
        .driver-simplified .driver-progress {
            height: 6px;
            background: #e2e8f0;
            border-radius: 999px;
            overflow: hidden;
            margin-top: 8px;
        }
        .driver-simplified .driver-progress-fill {
            height: 100%;
            background: linear-gradient(90deg, #0284c7, #10b981);
            border-radius: 999px;
        }
        .driver-simplified .driver-window {
            margin-top: 8px;
            font-size: 0.82rem;
            font-weight: 700;
            color: #0369a1;
        }
        .driver-simplified .driver-window.paid {
            color: #047857;
        }
        .driver-simplified .driver-complete-btn {
            min-height: 56px;
            border-radius: 14px;
        }
        .driver-simplified .driver-secondary-row {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            padding: 12px 4px 2px;
        }
        .driver-simplified .driver-link-btn {
            background: none;
            border: none;
            color: #475569;
            font-size: 0.85rem;
            font-weight: 700;
            padding: 10px 6px;
            min-height: 44px;
            text-decoration: underline;
            text-underline-offset: 3px;
            cursor: pointer;
        }
        .driver-simplified .driver-link-btn:active {
            color: #0284c7;
        }
        .driver-simplified .driver-link-sep {
            color: #cbd5e1;
        }
        /* Ordernummer-chippet är klickbart – öppnar hela ordern */
        .driver-order-chip {
            appearance: none;
            -webkit-appearance: none;
            font: inherit;
            cursor: pointer;
            text-decoration: underline;
            text-underline-offset: 2px;
        }
        .driver-order-chip:active {
            background: #dbeafe;
            border-color: #93c5fd;
        }
        /* Fastlåst Klar-fält – ligger ALLTID i botten av det synliga kortet.
           Fäst absolut mot kortet (position:relative) så det INTE spänner
           hela overlay-bredden. På mobil gäller motsvarande regel i
           planner-responsive.css. */
        .driver-simplified .driver-hero-card {
            position: relative;
        }
        .driver-simplified .driver-sticky-action {
            position: absolute;
            z-index: 20;
            left: 24px;
            right: 24px;
            bottom: 0;
            margin: 0;
            padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px));
            background: rgba(255, 255, 255, 0.97);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-top: 1px solid #e2e8f0;
            border-radius: 0 0 14px 14px;
        }
        .driver-simplified .driver-sticky-inner {
            max-width: 640px;
            margin: 0 auto;
        }
        /* Luft under kortet så det fastlåsta fältet aldrig täcker innehåll.
           Två stora knappar = ~120px höjd. */
        .driver-hero-card.driver-simplified {
            padding-bottom: 170px;
        }
        /* QR-knapp som primär, stor lika med Klar-knappen */
        .btn-qr-primary {
            background: linear-gradient(135deg, #7c3aed, #5b21b6);
            border: 2px solid #5b21b6;
            color: #ffffff;
            box-shadow: 0 4px 14px rgba(91, 33, 182, 0.4);
            border-radius: 14px;
            min-height: 56px;
        }
        .btn-qr-primary:hover {
            background: linear-gradient(135deg, #8d52ff, #7c3aed);
            transform: translateY(-1px);
        }
        .driver-simplified .driver-sticky-action .driver-secondary-row {
            padding: 6px 4px 0;
        }
        /* Låt webbläsaren sköta vertikal scroll direkt – horisontell swipe går till JS snabbare */
        #overlay-driver .driver-hero-card {
            touch-action: pan-y;
        }

        /* Kundbetyg / QR-popup i Montörsläge */
        .review-qr-overlay {
            position: fixed;
            inset: 0;
            z-index: 2000;
            background: rgba(2, 6, 23, 0.72);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            display: none;
            align-items: center;
            justify-content: center;
            padding: 18px;
        }
        .review-qr-overlay.show { display: flex; }
        .review-qr-box {
            background: #ffffff;
            border-radius: 20px;
            max-width: 420px;
            width: 100%;
            padding: 26px 24px 20px;
            text-align: center;
            box-shadow: 0 25px 60px rgba(0,0,0,0.5);
            border: 3px solid #facc15;
            animation: fadeInView 0.22s ease;
            max-height: 92vh;
            overflow-y: auto;
        }
        .review-qr-code-wrap {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: #fff;
            border: 2px solid #e2e8f0;
            border-radius: 16px;
            padding: 14px;
            margin: 12px auto;
            min-width: 232px;
            min-height: 232px;
        }
        .review-qr-code-wrap img, .review-qr-code-wrap canvas { display: block; }

        /* LIFO Packing List View */
        .packing-container {
            max-width: 860px;
            margin: 0 auto;
        }

        .packing-step-card {
            background: #ffffff;
            border-radius: 14px;
            border: 1px solid #cbd5e1;
            padding: 14px 18px;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        }

        .packing-badge {
            width: 42px;
            height: 42px;
            border-radius: 12px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            font-weight: 800;
            background: #f1f5f9;
            color: #0f172a;
            border: 1px solid #cbd5e1;
            line-height: 1;
        }

        /* Onepage View Inside Overlay */
        .onepage-doc-card {
            background: #ffffff;
            border-radius: 14px;
            padding: 24px;
            max-width: 960px;
            margin: 0 auto;
            color: #0f172a;
        }

        /* Onepage: desktop-tabell vs mobil-kort (kort dolda på desktop) */
        .onepage-mobile-cards {
            display: none;
        }
        .onepage-table-desktop {
            width: 100%;
            margin-bottom: 1.5rem;
            font-size: 0.88rem;
        }
        .onepage-summary-chips {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }
        .onepage-chip {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            background: #f1f5f9;
            border: 1px solid #e2e8f0;
            border-radius: 20px;
            padding: 3px 10px;
            font-size: 0.76rem;
            font-weight: 700;
            color: #334155;
            white-space: nowrap;
        }
        /* Onepage: extra per-stop info – hålls kompakt men läsbar i utskrift */
        .onepage-housing,
        .onepage-ordernr {
            font-size: 0.76rem;
        }
        .onepage-notes {
            font-size: 0.78rem;
            color: #334155;
            white-space: normal;
            line-height: 1.25;
        }

        /* Street View Modal Overlay */
        .sv-modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(15, 23, 42, 0.8);
            backdrop-filter: blur(10px);
            /* Över timespan-modaler (2600): Street View kan öppnas inifrån ordermodalen */
            z-index: 2700;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        .sv-modal-overlay.show {
            display: flex;
        }

        .sv-modal-box {
            background: #ffffff;
            border-radius: 18px;
            width: min(840px, 100%);
            max-height: 90vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
        }

        /* Toast / Snackbar (Unified Style) */
        #snackbar {
            visibility: hidden;
            min-width: 280px;
            max-width: 480px;
            background: rgba(15, 23, 42, 0.95);
            color: #ffffff;
            border-radius: 12px;
            padding: 14px 20px;
            position: fixed;
            z-index: 99999;
            left: 50%;
            bottom: 24px;
            font-size: 0.88rem;
            font-weight: 600;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
            border: 1px solid rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            display: flex;
            align-items: center;
            gap: 12px;
            opacity: 0;
            transform: translateX(-50%) translateY(16px);
            transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
            pointer-events: none;
        }

        #snackbar.show {
            visibility: visible;
            opacity: 1;
            transform: translateX(-50%) translateY(0);
            pointer-events: auto;
        }

        /* Print Mode Styles */
        /* === MOBIL: Ingen ruttplanerare/Cockpit – endast körvyer (Montörsläge, Packlista, Onepage) === */
        /* På mobil är "Hämta" (hämta bokningar + omoptimering) planerarens jobb på
           datorn – montören ska bara ladda den sparade rutten. */
        #btn-hud-load {
            display: none;
        }

        @media (max-width: 767.98px) {
            #btn-view-cockpit {
                display: none !important;
            }

            #btn-fetch-day {
                display: none !important;
            }

            #btn-hud-load {
                display: inline-flex !important;
            }

            .visual-timeline-dock,
            .mission-drawer,
            .btn-drawer-reopen {
                display: none !important;
            }
        }

        @media print {
            @page {
                size: A4 landscape;
                margin: 4mm 8mm;
            }

            body, html {
                background: #ffffff !important;
                color: #000000 !important;
                overflow: visible !important;
                height: auto !important;
                margin: 0 !important;
                padding: 0 !important;
                padding-top: 0 !important;
            }

            .top-navbar,
            .dispatch-hud-bar,
            .mission-drawer,
            .btn-drawer-reopen,
            .visual-timeline-dock,
            #map,
            #snackbar,
            #ik-feedback-trigger-btn,
            #ikFeedbackDebugModal,
            #overlay-driver,
            #overlay-packing,
            #overlay-start {
                display: none !important;
            }

            #overlay-onepage {
                position: static !important;
                top: 0 !important;
                left: 0 !important;
                right: 0 !important;
                bottom: auto !important;
                display: block !important;
                background: #ffffff !important;
                border: none !important;
                box-shadow: none !important;
                padding: 0 !important;
                margin: 0 !important;
                border-radius: 0 !important;
                overflow: visible !important;
            }

            .onepage-doc-card {
                box-shadow: none !important;
                padding: 0 !important;
                margin: 0 !important;
                max-width: 100% !important;
                border-radius: 0 !important;
            }

            .d-print-none {
                display: none !important;
            }

            /* Utskrift använder ALLTID desktop-tabellen – de responsiva reglerna
               (@media max-width utan mediatyp) gäller även i print och skulle
               annars dölja tabellen på smala skärmar/mobil (mobilkorten är
               d-print-none) vilket gav tom utskrift. */
            table.onepage-table-desktop {
                display: table !important;
            }
            .onepage-mobile-cards {
                display: none !important;
            }
        }
    