/* ==========================================================================
   LeaveOnTime – main stylesheet (brand: navy #003366 + green #0FF660)
   ========================================================================== */

:root {
    --accent: #0ff660;
    --on-accent: #002147;
    --accent-hover: color-mix(in srgb, var(--accent) 85%, #fff);
    --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
    --accent-ring: color-mix(in srgb, var(--accent) 35%, transparent);
    --accent-text: var(--accent);

    --navy: #003366;
    --bg: #001a36;
    --chrome: #001f40;
    --surface: #002a57;
    --surface-2: #003366;
    --surface-3: #0a4078;
    --glass: rgba(0, 38, 79, .9);
    --border: rgba(255, 255, 255, .1);
    --border-strong: rgba(255, 255, 255, .2);
    --text: #f2f7ff;
    --text-2: #c9d7ec;
    --muted: #8aa3c6;
    --danger: #ff6b78;
    --danger-soft: rgba(255, 107, 120, .14);
    --warn: #ffc24b;
    --warn-soft: rgba(255, 194, 75, .14);
    --ok: #0ff660;

    --radius-lg: 20px;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .25);
    --shadow: 0 2px 6px rgba(0, 0, 0, .2), 0 16px 40px -12px rgba(0, 0, 0, .5);
    --shadow-lg: 0 30px 70px -15px rgba(0, 0, 0, .65);

    --header-h: 60px;
    --footer-h: 34px;
    --sidebar-w: 360px;
    --gap: 14px;
    --ease: cubic-bezier(.2, .8, .2, 1);

    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    color-scheme: dark;
    -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; }
body { background: var(--bg); font-size: 14px; line-height: 1.5; color: var(--text); }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; color: var(--text); }
p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }
::selection { background: var(--accent); color: var(--on-accent); }

.icon { width: 18px; height: 18px; flex-shrink: 0; }
.icon-sm { width: 14px; height: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mt { margin-top: 28px; }
.spacer { flex: 1; }
.standalone-only { display: none !important; }
.is-standalone .standalone-only { display: inline-grid !important; }
[data-refresh].is-spinning .icon { animation: spin .8s linear infinite; }

/* ---------- Brand ---------- */

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.brand-icon { height: 34px; width: auto; display: block; }
.brand-logo { height: 34px; width: auto; max-width: 180px; object-fit: contain; display: block; }
.brand-lg { font-size: 20px; }
.brand-lg .brand-icon { height: 40px; }

/* ---------- Buttons ---------- */

.btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
    font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none;
    transition: background .15s, border-color .15s, box-shadow .15s, transform .1s, color .15s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-ring); }
.btn:disabled { cursor: default; opacity: .6; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 24px -12px var(--accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(255, 255, 255, .07); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn-block { width: 100%; }
.btn-lg { height: 50px; font-size: 15px; border-radius: 12px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-sm .icon { width: 15px; height: 15px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.spinner {
    display: none; width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
.btn .spinner { position: absolute; left: 50%; top: 50%; margin: -9px 0 0 -9px; }
.btn.is-loading .btn-label { visibility: hidden; }
.btn.is-loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
    display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
    border: 0; background: transparent; color: inherit; cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .1); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn-sm { width: 32px; height: 32px; border-radius: 8px; }
.icon-btn-sm .icon { width: 16px; height: 16px; }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- Forms ---------- */

.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input {
    width: 100%; height: 44px; padding: 0 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong); background: rgba(0, 16, 36, .45); color: var(--text);
    font: inherit; font-size: 14.5px; transition: border-color .15s, box-shadow .15s, background .15s;
}
.textarea { height: auto; padding: 12px 14px; resize: vertical; min-height: 84px; line-height: 1.45; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238aa3c6' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 36px; }
select.input option { background: var(--surface); }
.input:hover { border-color: rgba(255, 255, 255, .32); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.input::placeholder { color: #6f89ad; }
.input[readonly] { color: var(--text-2); }

.input-wrap { position: relative; }
.input-wrap > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; transition: color .15s; }
.input-wrap .input { padding-left: 42px; height: 50px; }
.input-wrap:focus-within > .icon { color: var(--accent); }
.input-wrap .input:has(+ .input-action) { padding-right: 46px; }
.input-action {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 38px; height: 38px; border: 0; border-radius: 8px; background: transparent; color: var(--muted);
    display: grid; place-items: center; cursor: pointer;
}
.input-action:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.input-action .when-shown, .input-action.is-shown .when-hidden { display: none; }
.input-action.is-shown .when-shown { display: grid; }
.input-action span { display: grid; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.span-2 { grid-column: span 2; }

.color-field { display: flex; gap: 8px; }
.color-field input[type="color"] { width: 44px; height: 44px; padding: 4px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: transparent; cursor: pointer; }

/* Toggle switch */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { position: relative; flex-shrink: 0; width: 44px; height: 26px; border-radius: 999px; background: rgba(255, 255, 255, .18); transition: background .2s var(--ease); }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform .2s var(--ease), background .2s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(18px); background: var(--on-accent); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 4px var(--accent-ring); }
.switch-text { display: flex; flex-direction: column; font-weight: 600; font-size: 14px; color: var(--text); line-height: 1.3; }
.switch-text small { font-weight: 400; font-size: 12.5px; color: var(--muted); }
.switch-sm { gap: 10px; }
.switch-sm .switch-track { width: 36px; height: 22px; }
.switch-sm .switch-thumb { width: 16px; height: 16px; }
.switch-sm input:checked + .switch-track .switch-thumb { transform: translateX(14px); }
.switch-sm .switch-text { font-size: 13px; font-weight: 500; }

.alert { padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; white-space: pre-line; }
.alert-error { background: var(--danger-soft); color: #ffb3ba; border: 1px solid rgba(255, 107, 120, .3); }

.search-box { position: relative; }
.search-box > .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box input { width: 100%; height: 44px; padding: 0 42px 0 40px; border-radius: 12px; font: inherit; border: 1px solid var(--border-strong); background: rgba(0, 16, 36, .45); color: var(--text); transition: .15s; }
/* Native clear button (Chrome/Edge): we draw our own, which works on phones too. */
.search-box input::-webkit-search-cancel-button,
[data-place-move] input::-webkit-search-cancel-button { display: none; }
.clear-btn { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .09); color: var(--muted); cursor: pointer; }
.clear-btn:hover { background: rgba(255, 255, 255, .18); color: var(--text); }
.clear-btn[hidden] { display: none; }
.clear-btn .icon { width: 14px; height: 14px; }
.search-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }

/* Chips, segmented controls */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--border-strong);
    background: transparent; color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; transition: .15s;
}
.chip:hover { border-color: rgba(255, 255, 255, .35); color: var(--text); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.icon-chip { width: 38px; padding: 0; display: inline-grid; place-items: center; }
.segmented { display: flex; padding: 4px; gap: 4px; border-radius: 12px; background: rgba(0, 16, 36, .5); border: 1px solid var(--border); }
.segmented button { flex: 1; height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.segmented button.is-active { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented button:disabled { opacity: .4; cursor: default; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: rgba(255, 255, 255, .08); color: var(--text-2); white-space: nowrap; }
.badge-ok { background: var(--accent-soft); color: var(--accent); }
.badge-accent { background: var(--accent); color: var(--on-accent); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: rgba(120, 180, 255, .14); color: #a9ccff; }
.badge-muted { background: rgba(255, 255, 255, .06); color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }

/* ==========================================================================
   Login & share landing
   ========================================================================== */

.page-login { background: var(--navy); }
.login-layout { display: flex; min-height: 100vh; min-height: 100dvh; }
.login-visual {
    position: relative; flex: 0 0 70%; overflow: hidden; background: #001226;
    background-image:
        radial-gradient(1000px 520px at 15% 110%, color-mix(in srgb, var(--accent) 40%, transparent), transparent 60%),
        radial-gradient(900px 500px at 100% 0%, #0a4a8f, transparent 60%),
        linear-gradient(160deg, #002a57, #001226);
}
.login-slides, .login-slide { position: absolute; inset: 0; }
.login-slide { background-size: cover; background-position: center; opacity: 0; transform: scale(1.08); transition: opacity 1.4s ease, transform 9s linear; }
.login-slide.is-active { opacity: 1; transform: scale(1); }
.login-visual-overlay {
    position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 48px 56px; color: #fff;
    background: linear-gradient(180deg, rgba(0, 18, 38, .2) 0%, rgba(0, 18, 38, 0) 40%, rgba(0, 26, 54, .85) 100%);
}
.login-visual-copy h2 { color: #fff; font-size: clamp(28px, 3.2vw, 46px); font-weight: 800; line-height: 1.08; max-width: 14em; letter-spacing: -.03em; }
.login-visual-copy p { margin-top: 12px; font-size: 16px; color: var(--text-2); }

.login-panel { flex: 1 1 30%; min-width: 380px; display: flex; flex-direction: column; justify-content: center; padding: 40px clamp(28px, 3vw, 56px) 24px; background: var(--navy); }
.login-card { width: 100%; max-width: 380px; margin: auto; }
.login-brand { margin-bottom: 36px; }
.login-brand .brand-logo { height: 44px; max-width: 220px; }
.login-brand .brand-icon { height: 44px; }
.login-card h1 { font-size: 28px; font-weight: 800; }
.login-card > .muted { margin-top: 6px; font-size: 15px; }
.login-form { display: flex; flex-direction: column; gap: 18px; margin-top: 28px; }
.login-form .input { background: rgba(0, 16, 36, .35); }
.login-form .switch { margin: 2px 0 4px; }
.login-foot { text-align: center; font-size: 12.5px; color: var(--muted); padding-top: 24px; }

.install-hint { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 22px; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: 12px; background: rgba(0, 16, 36, .3); cursor: pointer; text-align: left; color: var(--text); }
.install-hint:hover { border-color: var(--accent); }
.install-hint .icon { color: var(--accent); width: 22px; height: 22px; }
.install-hint span { display: flex; flex-direction: column; font-size: 13.5px; }
.install-hint small { color: var(--muted); font-size: 12px; }

.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

@media (max-width: 1200px) {
    .login-visual { flex-basis: auto; flex-grow: 1; }
    .login-panel { flex: 0 0 440px; }
}
@media (max-width: 860px) {
    .login-visual { display: none; }
    .login-panel { flex: 1; min-width: 0; padding: max(32px, env(safe-area-inset-top)) 24px max(20px, env(safe-area-inset-bottom)); }
    .login-brand { display: flex; justify-content: center; margin-bottom: 32px; }
    .login-brand.brand { flex-direction: column; gap: 12px; font-size: 22px; }
    .login-brand .brand-icon { height: 64px; }
    .login-brand .brand-logo { height: 64px; max-width: 70%; }
    .login-card h1, .login-card > .muted { text-align: center; }
}

.page-share, .page-install { min-height: 100vh; background: radial-gradient(900px 500px at 10% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%), var(--navy); }
.share-wrap, .install-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 32px 16px; }
.share-card, .install-card { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 36px; display: flex; flex-direction: column; gap: 16px; }
.install-card { max-width: 560px; }
.share-card { text-align: center; align-items: center; }
.share-card h1, .install-card h1 { font-size: 24px; font-weight: 800; line-height: 1.2; }
.share-brand { margin-bottom: 8px; }
.share-avatar { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; font-weight: 800; background: var(--accent); color: var(--on-accent); box-shadow: 0 12px 30px -10px var(--accent); }
.share-actions { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.share-fine { max-width: 30em; }

.checklist { list-style: none; margin: 0; padding: 14px 16px; border-radius: 12px; background: rgba(0, 16, 36, .4); display: grid; gap: 6px; font-size: 13.5px; }
.checklist li { display: flex; align-items: center; gap: 10px; }
.checklist .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.checklist .bad { color: var(--danger); }
.checklist .bad .dot { background: var(--danger); }

/* ==========================================================================
   App shell: header & footer
   ========================================================================== */

.page-app, .page-admin { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; overscroll-behavior: none; }
.page-app { position: fixed; inset: 0; width: 100%; }

.topbar {
    position: relative; z-index: 1100;
    /* Safe areas (installed app / notch) are added on top of the bar height, never taken from it. */
    flex: 0 0 auto; height: calc(var(--header-h) + env(safe-area-inset-top, 0px)); box-sizing: border-box;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: env(safe-area-inset-top, 0px) max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px));
    background: var(--chrome); color: var(--text); border-bottom: 1px solid var(--border);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 6px; min-width: 0; }
.topbar .brand { margin-left: 4px; }
.topbar .brand-icon { height: 30px; }
.topbar .brand-logo { height: 32px; }
.topbar-tag { margin-left: 6px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--accent-soft); color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }

.tz-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: rgba(255, 255, 255, .03); color: var(--text); cursor: pointer; transition: background .15s, border-color .15s; }
.tz-btn:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .3); }
.tz-btn .icon { color: var(--accent); width: 17px; height: 17px; }
.tz-time { font-weight: 700; font-variant-numeric: tabular-nums; }
.tz-name { color: var(--muted); font-size: 13px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 8px 0 4px; border-radius: 12px; border: 0; background: transparent; color: var(--text); cursor: pointer; }
.user-btn:hover, .user-menu.is-open .user-btn { background: rgba(255, 255, 255, .08); }
.user-btn-name { font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--accent); color: var(--on-accent); font-size: 12.5px; font-weight: 800; }
.dropdown {
    position: absolute; right: 0; top: calc(100% + 8px); width: 260px; padding: 6px; z-index: 5;
    background: var(--surface); color: var(--text); border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--border-strong);
    opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right; pointer-events: none; transition: opacity .15s, transform .15s var(--ease);
}
.user-menu.is-open .dropdown { opacity: 1; transform: none; pointer-events: auto; }
.dropdown-head { display: flex; flex-direction: column; padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown-head span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.dropdown-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 9px; border: 0; background: none; color: var(--text-2); font-weight: 500; text-align: left; cursor: pointer; }
.dropdown-item:hover { background: rgba(255, 255, 255, .07); color: var(--text); }
.dropdown-item .icon { color: var(--muted); }
.dropdown-item.danger, .dropdown-item.danger .icon { color: var(--danger); }
.dropdown form { margin: 6px 0 0; border-top: 1px solid var(--border); padding-top: 6px; }

.footbar {
    position: relative; z-index: 1100;
    flex: 0 0 auto; height: calc(var(--footer-h) + env(safe-area-inset-bottom, 0px)); box-sizing: border-box;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 0 max(16px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(16px, env(safe-area-inset-left, 0px));
    background: var(--chrome); color: var(--muted); font-size: 12px; border-top: 1px solid var(--border);
}
.footbar-meta { font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.footbar .sep { margin: 0 8px; opacity: .5; }

/* ==========================================================================
   Map page
   ========================================================================== */

.stage { position: relative; flex: 1 1 0; min-height: 0; overflow: hidden; overflow: clip; isolation: isolate; background: #d9d9d9; }
#map { position: absolute; inset: 0; z-index: 1; background: #dcdcdc; }
#map .leaflet-tile-pane { filter: grayscale(1) contrast(1.05) brightness(1.02); }
.is-picking #map { cursor: crosshair; }
.is-picking .leaflet-grab { cursor: crosshair; }

.leaflet-container { font-family: inherit; }
.leaflet-bar { border: 0 !important; border-radius: 12px !important; box-shadow: var(--shadow) !important; overflow: hidden; }
.leaflet-bar a { width: 40px !important; height: 40px !important; line-height: 40px !important; background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
.leaflet-bar a:hover { background: var(--surface-3) !important; }
.locate-btn { display: grid !important; place-items: center; }
.locate-btn svg { width: 19px; height: 19px; }
.locate-btn.is-busy svg { animation: spin 1s linear infinite; color: var(--accent); }
.leaflet-control-attribution { border-radius: 8px 0 0 0; font-size: 11px; background: rgba(0, 31, 64, .8) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--text-2) !important; }
.leaflet-right, .leaflet-left { transition: transform .35s var(--ease); }

.lot-pin span { position: absolute; left: 3px; top: 0; width: 26px; height: 26px; border-radius: 50% 50% 50% 0; background: var(--navy); transform: rotate(-45deg); border: 3px solid var(--accent); box-shadow: 0 6px 14px -4px rgba(0, 0, 0, .6); animation: pin-drop .35s var(--ease); display: grid; place-items: center; }
.lot-pin b { transform: rotate(45deg); color: #fff; font-size: 11px; font-weight: 800; }
.pin-b span { background: var(--accent); border-color: var(--navy); }
.pin-b b { color: var(--on-accent); }
@keyframes pin-drop { from { transform: translateY(-16px) rotate(-45deg); opacity: 0; } }
.me-dot { position: relative; }
.me-dot span { position: absolute; inset: 2px; border-radius: 50%; background: #3b9bff; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.me-dot span::after { content: ''; position: absolute; inset: -9px; border-radius: 50%; background: rgba(59, 155, 255, .35); animation: me-pulse 2s ease-out infinite; z-index: -1; }
@keyframes me-pulse { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(1.9); opacity: 0; } }
.me-heading { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; transition: transform .6s ease, opacity .3s; }
.me-heading::before { content: ''; position: absolute; left: -9px; top: -30px; border-left: 9px solid transparent; border-right: 9px solid transparent; border-bottom: 20px solid rgba(59, 155, 255, .55); }
.me-dot.has-heading .me-heading { opacity: 1; }
.me-accuracy { fill: #3b9bff; fill-opacity: .1; stroke: #3b9bff; stroke-opacity: .35; stroke-width: 1; }
.locate-btn.is-following { color: #3b9bff !important; }
.route-glow { filter: blur(3px); }

.map-popup .leaflet-popup-content-wrapper { background: var(--surface); color: var(--text); border-radius: 14px; box-shadow: var(--shadow-lg); }
.map-popup .leaflet-popup-tip { background: var(--surface); }
.map-popup .leaflet-popup-content { margin: 12px 14px; min-width: 190px; }
.leaflet-container .map-popup a.leaflet-popup-close-button { top: 6px; right: 6px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font: 400 22px/1 system-ui, sans-serif; color: var(--muted); }
.leaflet-container .map-popup a.leaflet-popup-close-button:hover, .leaflet-container .map-popup a.leaflet-popup-close-button:focus-visible { background: var(--surface-2, rgba(127,127,127,.15)); color: var(--text); }
.map-popup .popup-name { padding-right: 22px; }
.popup-name { font-weight: 700; margin-bottom: 10px; }
.popup-actions { display: flex; gap: 6px; }

.back-to-form {
    position: absolute; z-index: 1050; bottom: 16px; left: 50%; transform: translateX(-50%);
    display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px;
    background: var(--accent); color: var(--on-accent); border: 0; font: inherit; font-size: 13.5px; font-weight: 700;
    box-shadow: var(--shadow-lg); cursor: pointer; white-space: nowrap;
}
.back-to-form[hidden] { display: none; }
.back-to-form .icon { width: 17px; height: 17px; }

.pick-banner {
    position: absolute; z-index: 1050; top: 16px; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--accent); box-shadow: var(--shadow-lg); white-space: nowrap; max-width: calc(100% - 24px);
}
.pick-banner > .icon { color: var(--accent); }
.pick-banner span { overflow: hidden; text-overflow: ellipsis; }

/* Sidebars */
.sidebar {
    position: absolute; top: var(--gap); bottom: var(--gap); z-index: 1000; width: var(--sidebar-w);
    display: flex; flex-direction: column;
    background: var(--glass); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
    border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow);
    transition: transform .35s var(--ease), opacity .25s;
}
.sidebar-left { left: var(--gap); transform: translateX(calc(-100% - var(--gap) * 2)); opacity: 0; }
.sidebar-right { right: var(--gap); transform: translateX(calc(100% + var(--gap) * 2)); opacity: 0; }
.left-open .sidebar-left, .right-open .sidebar-right { transform: none; opacity: 1; }
.left-open .leaflet-left { transform: translateX(calc(var(--sidebar-w) + var(--gap))); }
.right-open .leaflet-right { transform: translateX(calc(-1 * (var(--sidebar-w) + var(--gap)))); }
/* The map credit stays in the corner: only the buttons move aside for the sidebar. */
.leaflet-bottom.leaflet-right .leaflet-control-attribution { transition: transform .35s var(--ease); }
.right-open .leaflet-bottom.leaflet-right .leaflet-control-attribution { transform: translateX(calc(var(--sidebar-w) + var(--gap))); }
.is-picking .sidebar { opacity: .35; pointer-events: none; }

.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 12px 6px 16px; }
.sidebar-head h3 { font-size: 16px; font-weight: 700; padding-left: 4px; }
.sidebar-body { flex: 1; overflow-y: auto; padding: 8px 16px 20px; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }
.sidebar-body::-webkit-scrollbar { width: 8px; }
.sidebar-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); border-radius: 8px; }
.section-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 6px 0 -4px; }

.tabs { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: rgba(0, 16, 36, .5); overflow-x: auto; scrollbar-width: none; }
.tab { height: 32px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--surface-3); color: var(--text); }
.view { display: none; flex-direction: column; gap: 12px; }
.view.is-active { display: flex; animation: fade-up .25s var(--ease); }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } }

.clock-card { background: linear-gradient(135deg, var(--surface-2), var(--surface)); }
.clock-card .small { color: var(--muted); }
.clock-time { font-size: 38px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.15; margin: 4px 0 2px; }
.clock-date { color: var(--text-2); }

.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 24px 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); }
.empty-state .icon { width: 28px; height: 28px; color: var(--accent); margin-bottom: 6px; opacity: .8; }
.empty-state p { font-weight: 600; color: var(--text); }
.empty-state small { font-size: 12.5px; }

.notice-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.notice-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); flex-shrink: 0; }
.notice-text { display: flex; flex-direction: column; flex: 1; font-size: 12.5px; color: var(--text-2); }
.notice-text strong { color: var(--text); font-size: 13.5px; }
.notice-dismiss { color: var(--muted); flex-shrink: 0; }
.notice-dismiss:hover { color: var(--text); }
.notice-inline { padding: 12px; border-radius: 12px; background: var(--warn-soft); color: var(--text); font-size: 13px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.notice-geo { width: 100%; flex-direction: row; align-items: center; border: 0; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.notice-geo svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--warn); }

/* Lists */
.card-list { display: flex; flex-direction: column; gap: 8px; }
.trip-card {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; text-align: left; cursor: pointer;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); transition: border-color .15s, background .15s;
}
.trip-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.trip-card.is-selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.trip-card.is-soon .trip-leave strong { color: var(--accent); }
.trip-mode { width: 40px; height: 40px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; color: #fff; background: rgba(0, 16, 36, .5); border: 1px solid var(--border); }
.trip-mode .mode-icon { width: 22px; height: 22px; }
.trip-mode.lg { width: 48px; height: 48px; }
.trip-mode.lg .mode-icon { width: 26px; height: 26px; }
.trip-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.trip-main strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-main small { color: var(--muted); font-size: 12.5px; }
.trip-leave { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.trip-leave small { color: var(--muted); font-size: 11px; }
.trip-leave strong { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }

.route-card, .place-card, .share-card-item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 12px; }
.route-card.is-paused { opacity: .6; }
.route-top { display: flex; gap: 12px; align-items: flex-start; }
.route-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.route-main small { font-size: 12.5px; color: var(--text-2); }
.route-main small.muted { color: var(--muted); }
.route-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.route-actions { display: flex; align-items: center; gap: 2px; }
.place-card { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.place-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.place-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.place-main small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-form { display: flex; flex-direction: column; gap: 10px; border-color: var(--accent); }
.share-card-item { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.share-card-item > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.share-card-item small { font-size: 12.5px; }

/* Place search suggestions */
.place-field { position: relative; }
[data-place-move] .input { padding-right: 42px; }
.suggest { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); max-height: 320px; overflow-y: auto; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); }
.suggest-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--text); text-align: left; cursor: pointer; }
.suggest-item:hover { background: var(--surface-3); }
.suggest-item > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.suggest-item strong { font-size: 13.5px; }
.suggest-item small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: rgba(0, 16, 36, .5); color: var(--accent); flex-shrink: 0; }
.suggest-icon .icon { width: 16px; height: 16px; }
.suggest-note { padding: 10px 12px; font-size: 12.5px; color: var(--text-2); line-height: 1.4; }
.suggest-loading { display: flex; align-items: center; gap: 8px; padding: 10px; color: var(--muted); font-size: 13px; }
.suggest-loading .spinner, .preview-loading .spinner, .tz-loading .spinner { display: block; width: 16px; height: 16px; }

/* Route editor */
.route-form { display: flex; flex-direction: column; gap: 16px; }
.editor-head { display: flex; align-items: center; gap: 8px; margin: -4px 0 -2px -6px; }
.editor-head h3 { font-size: 17px; }
.stops { position: relative; display: flex; flex-direction: column; gap: 10px; padding-left: 36px; }
.stops::before { content: ''; position: absolute; left: 13px; top: 22px; bottom: 22px; border-left: 2px dashed var(--border-strong); }
.stop { position: relative; }
.stop-dot { position: absolute; left: -36px; top: 10px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.stop-a { background: var(--navy); color: #fff; border: 2px solid var(--accent); }
.stop-b { background: var(--accent); color: var(--on-accent); }
.stop-input { position: relative; }
.stop-input .input { padding-right: 74px; }
.stop-input .clear-btn { right: 38px; }
.stop-input .icon-btn { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.stop-input .icon-btn:hover { color: var(--accent); }
.stop.is-device .input { color: var(--accent); font-weight: 600; cursor: pointer; }
.device-toggle { margin: -2px 0; }
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mode-option { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--border); background: rgba(0, 16, 36, .35); color: var(--text-2); font-size: 11.5px; font-weight: 600; cursor: pointer; text-align: center; line-height: 1.2; transition: .15s; }
.mode-option span { display: grid; place-items: center; color: #fff; }
.mode-option .mode-icon { width: 26px; height: 26px; }
.mode-option:hover { border-color: var(--border-strong); color: var(--text); }
.mode-option.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.day-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 4px; }
.day-chip { height: 40px; border-radius: 10px; border: 1px solid var(--border-strong); background: transparent; color: var(--text-2); font-weight: 700; cursor: pointer; }
.day-chip span { display: none; }
.day-chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.picker-field { display: flex; align-items: center; gap: 10px; width: 100%; height: 46px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: rgba(0, 16, 36, .45); color: var(--text); font-weight: 600; font-size: 15px; cursor: pointer; text-align: left; transition: border-color .15s; }
.picker-field:hover { border-color: rgba(255, 255, 255, .35); }
.picker-field:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.picker-field .icon { color: var(--accent); }
.picker-field.is-empty { color: var(--muted); font-weight: 500; }
details.more summary { cursor: pointer; color: var(--text-2); font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.preview-card { border-radius: var(--radius); padding: 14px; background: linear-gradient(160deg, var(--surface-2), var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); display: flex; flex-direction: column; gap: 10px; }
.preview-top { display: flex; justify-content: space-between; gap: 12px; }
.preview-top div { display: flex; flex-direction: column; }
.preview-top div:last-child { text-align: right; }
.preview-top small { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.preview-top strong { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.preview-top div:first-child strong { color: var(--accent); }
.preview-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.editor-actions { display: flex; gap: 8px; position: sticky; z-index: 5; bottom: -20px; margin: 0 -16px; padding: 12px 16px; background: var(--surface); border-top: 1px solid var(--border); }
.editor-actions .btn-primary { flex: 1; }
.sidebar-left:has([data-view="editor"].is-active) #push-card { display: none; }

/* Trip details */
.detail { display: flex; flex-direction: column; gap: 14px; }
.detail-head { display: flex; align-items: center; gap: 12px; }
.detail-head > div { flex: 1; min-width: 0; }
.detail-head h4 { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-ends { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 15px; font-weight: 600; }
.trip-ends span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.end-pin { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-style: normal; font-size: 11px; font-weight: 800; background: var(--navy); color: #fff; flex: none; }
.end-pin.end-b { background: var(--accent); color: var(--on-accent); }
.fix-times summary { cursor: pointer; font-weight: 600; }
.fix-times[open] { gap: 8px; }
.big-time { display: flex; flex-direction: column; padding: 16px; border-radius: var(--radius); background: var(--accent); color: var(--on-accent); }
.big-time small { font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; opacity: .8; }
.big-time strong { font-size: 44px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.big-time span { font-weight: 600; }
.big-time.late { background: var(--warn); color: #2b1d00; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; display: flex; flex-direction: column; }
.timeline li { position: relative; padding: 0 0 12px 22px; font-size: 13.5px; color: var(--text-2); }
.timeline li::before { content: ''; position: absolute; left: 0; top: 5px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--muted); }
.timeline li:not(:last-child)::after { content: ''; position: absolute; left: 5px; top: 17px; bottom: 2px; border-left: 2px solid var(--border-strong); }
.timeline li span { display: inline-block; min-width: 46px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.timeline li.is-goal::before { background: var(--accent); border-color: var(--accent); }
.timeline em { color: var(--muted); font-style: normal; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; }
.facts span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(0, 16, 36, .5); font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.facts .warn { color: var(--warn); background: var(--warn-soft); }
.legs { list-style: none; margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(0, 16, 36, .4); display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.legs span { display: inline-block; min-width: 46px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.legs b { padding: 1px 6px; border-radius: 6px; background: var(--surface-3); color: var(--text); font-size: 12px; }
.legs .live { color: var(--accent); font-style: normal; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.review { display: flex; flex-direction: column; gap: 10px; border-color: var(--accent); }
.detail-actions { display: flex; flex-direction: column; gap: 8px; }
.share-welcome { display: flex; flex-direction: column; gap: 10px; border-color: var(--accent); }
.share-from { display: flex; align-items: center; gap: 10px; }
.share-from > div { display: flex; flex-direction: column; }
.share-from small { color: var(--muted); }
.share-welcome blockquote { margin: 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: rgba(0, 16, 36, .45); border-radius: 0 10px 10px 0; font-size: 14px; white-space: pre-line; }

/* Share modal */
.share-link { display: flex; gap: 8px; }
.share-targets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.share-targets [data-share-native] { grid-column: 1 / -1; }
#share-form { display: flex; flex-direction: column; gap: 14px; }

/* ==========================================================================
   Date & time picker
   ========================================================================== */

.picker { position: fixed; inset: 0; z-index: 3500; }
.picker-backdrop { position: absolute; inset: 0; background: rgba(0, 10, 24, .35); opacity: 0; transition: opacity .2s; }
.picker-panel {
    position: absolute; width: 340px; max-width: calc(100vw - 24px); display: flex; flex-direction: column; gap: 12px; padding: 16px;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: var(--shadow-lg);
    opacity: 0; transform: translateY(8px) scale(.98); transition: opacity .18s, transform .18s var(--ease);
}
.picker.is-open .picker-backdrop { opacity: 1; }
.picker.is-open .picker-panel { opacity: 1; transform: none; }
.picker.is-sheet .picker-backdrop { background: rgba(0, 10, 24, .6); }
.picker.is-sheet .picker-panel { left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-width: none; border-radius: 22px 22px 0 0; padding: 18px 18px max(18px, env(safe-area-inset-bottom)); transform: translateY(100%); }
.picker.is-sheet.is-open .picker-panel { transform: none; }
.picker.is-sheet .picker-panel::before { content: ''; width: 40px; height: 4px; border-radius: 4px; background: var(--border-strong); align-self: center; margin: -6px 0 2px; }
.picker-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.picker-head strong { font-size: 15px; }
.picker-summary { color: var(--accent); font-weight: 700; font-size: 14px; text-align: right; }
.picker-chips { display: flex; gap: 6px; }
.picker-chips .chip { height: 30px; font-size: 12.5px; }
.picker-body { display: flex; flex-direction: column; gap: 12px; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.cal-nav .icon-btn { font-size: 20px; }
.cal-title { font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-dow span { font-size: 11.5px; color: var(--muted); font-weight: 700; padding: 4px 0; }
.cal-day { aspect-ratio: 1; max-height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; }
.cal-day:hover:not(:disabled) { background: var(--surface-3); }
.cal-day.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-day.is-selected { background: var(--accent); color: var(--on-accent); }
.cal-day:disabled { color: rgba(255, 255, 255, .22); cursor: default; }
.wheels { position: relative; display: flex; justify-content: center; align-items: center; gap: 6px; height: 120px; border-radius: 14px; background: rgba(0, 16, 36, .45); overflow: hidden; }
.wheel { position: relative; z-index: 2; width: 72px; height: 120px; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); }
.wheel::-webkit-scrollbar { display: none; }
.wheel-item, .wheel-pad { height: 40px; }
.wheel-item { display: grid; place-items: center; font-size: 22px; font-weight: 700; color: var(--muted); scroll-snap-align: center; cursor: pointer; font-variant-numeric: tabular-nums; }
.wheel-item.is-active { color: var(--text); }
.wheel-sep { position: relative; z-index: 2; font-size: 22px; font-weight: 800; }
.wheel-highlight { position: absolute; z-index: 1; left: 12px; right: 12px; top: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.picker-foot { display: flex; align-items: center; gap: 8px; }

/* ==========================================================================
   Modals, timezone list, toasts
   ========================================================================== */

.modal { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 10, 24, .6); backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s; }
.modal-dialog { position: relative; width: 100%; max-width: 520px; max-height: calc(100dvh - 32px); overflow-y: auto; display: flex; flex-direction: column; gap: 16px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(12px) scale(.98); transition: opacity .2s, transform .2s var(--ease); }
.modal.is-open .modal-backdrop { opacity: 1; }
.modal.is-open .modal-dialog { opacity: 1; transform: none; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-head h2 { font-size: 19px; }
.modal-head .muted { margin-top: 4px; font-size: 13.5px; }
.modal-head .icon-btn { margin: -6px -8px 0 0; color: var(--muted); }
.modal-wide { max-width: 680px; }
.stats-toolbar .input { width: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
body.modal-open { overflow: hidden; }

.tz-current { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); }
.tz-current > div { display: flex; flex-direction: column; min-width: 0; }
.tz-current strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tz-list { height: 300px; overflow-y: auto; margin: 0 -8px; padding: 0 8px; }
.tz-loading { display: grid; place-items: center; height: 100%; color: var(--muted); }
.tz-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; background: none; color: var(--text); cursor: pointer; text-align: left; }
.tz-option span:first-child { display: flex; flex-direction: column; min-width: 0; }
.tz-option small { color: var(--muted); font-size: 12px; }
.tz-option:hover { background: var(--surface-3); }
.tz-option.is-selected { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.tz-offset { font-size: 12.5px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tz-empty { padding: 24px; text-align: center; }

.toast-stack { position: fixed; z-index: 4000; left: 50%; bottom: calc(var(--footer-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { max-width: min(440px, calc(100vw - 32px)); padding: 11px 16px; border-radius: 12px; background: #f2f7ff; color: #001a36; font-weight: 600; font-size: 13.5px; box-shadow: var(--shadow-lg); white-space: pre-line; opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s var(--ease); border-left: 5px solid #0bbf4a; }
.toast.is-visible { opacity: 1; transform: none; }
.toast-error { border-left-color: #e5484d; }
.toast-info { border-left-color: #3b9bff; }

/* ==========================================================================
   Admin
   ========================================================================== */

.admin-layout { flex: 1; min-height: 0; display: flex; overflow: hidden; }
.admin-nav { flex: 0 0 240px; padding: 24px 14px; border-right: 1px solid var(--border); background: var(--chrome); display: flex; flex-direction: column; gap: 4px; }
.admin-nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--text-2); font-weight: 600; }
.admin-nav-item .icon { color: var(--muted); }
.admin-nav-item:hover { background: rgba(255, 255, 255, .06); }
.admin-nav-item.is-active { background: var(--accent-soft); color: var(--accent); }
.admin-nav-item.is-active .icon { color: var(--accent); }
.admin-main { flex: 1; overflow-y: auto; padding: 32px clamp(16px, 4vw, 48px) 48px; }
.admin-panel { display: none; flex-direction: column; gap: 20px; }
.admin-panel.is-active { display: flex; animation: fade-up .3s var(--ease); }
.panel-head h1 { font-size: 26px; font-weight: 800; }
.panel-head .muted { margin-top: 4px; }
.panel-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.admin-panel .card { padding: 24px; }
.admin-panel .card h2 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.admin-panel .card h2 + .muted { margin: -10px 0 16px; }
.card-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.card-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card-flush { padding: 0 !important; overflow: hidden; }
.hint { font-size: 12.5px; color: var(--muted); }
.hint-warn { color: var(--warn); }
.code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 12.5px; padding: 10px 12px; border-radius: 10px; background: rgba(0, 16, 36, .55); border: 1px solid var(--border); word-break: break-all; color: var(--text-2); }

.media-uploader { display: flex; align-items: center; gap: 20px; }
.media-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.logo-preview { flex: 0 0 160px; height: 96px; border-radius: 12px; display: grid; place-items: center; padding: 12px; background: repeating-conic-gradient(#0a3a6e 0% 25%, #073260 0% 50%) 50% / 16px 16px; border: 1px solid var(--border); }
.logo-preview img { max-height: 72px; object-fit: contain; }
.app-icon-preview { flex: 0 0 96px; }
.app-icon-preview img { width: 96px; height: 96px; border-radius: 22px; object-fit: cover; box-shadow: var(--shadow); display: block; }

.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 20px; border: 2px dashed var(--border-strong); border-radius: var(--radius); background: rgba(0, 16, 36, .35); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone > .icon { width: 30px; height: 30px; color: var(--accent); margin-bottom: 4px; }
.dropzone small { color: var(--muted); }
.dropzone.is-uploading { pointer-events: none; opacity: .85; }
.progress { width: 240px; height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; margin-top: 10px; display: block; }
.progress-bar { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 20px; }
.image-grid:empty { display: none; }
.image-tile { margin: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: rgba(0, 16, 36, .35); transition: opacity .2s; }
.image-tile img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.image-tile figcaption { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 12px; }
.image-tile.is-inactive img { filter: grayscale(1); opacity: .45; }
#bg-empty { margin-top: 20px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 12px 16px; background: rgba(0, 16, 36, .35); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(255, 255, 255, .03); }
.table tbody tr[data-trip-row] { cursor: pointer; }
.table .actions { text-align: right; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.user-cell { display: flex; align-items: center; gap: 12px; }
.user-cell > span:last-child { display: flex; flex-direction: column; }
.user-cell small { font-size: 12.5px; }
.role { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(255, 255, 255, .07); color: var(--text-2); }
.role-admin { background: var(--accent-soft); color: var(--accent); }
.role-guest { background: rgba(120, 180, 255, .14); color: #a9ccff; }
.delta-early { color: #a9ccff; }
.delta-ok { color: var(--ok); }
.delta-late { color: var(--warn); }

/* Stats */
.stats-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.kpi { padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.kpi small { color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi strong { font-size: 28px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi span { color: var(--text-2); font-size: 12px; }
.chart-card h2 { margin-bottom: 4px !important; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 160px; padding-top: 12px; border-bottom: 1px solid var(--border-strong); }
.bar { position: relative; flex: 1; display: flex; align-items: flex-end; height: 100%; }
.bar i { display: block; width: 100%; min-height: 0; border-radius: 4px 4px 0 0; background: var(--accent); transition: opacity .15s; }
.bar.is-late i { background: var(--warn); }
.bar:hover i { opacity: .8; }
.bar[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 6px 9px; border-radius: 8px; background: #f2f7ff; color: #001a36; font-size: 12px; font-weight: 600; z-index: 5; pointer-events: none; box-shadow: var(--shadow); }
.bar-labels { display: flex; gap: 2px; margin-top: 6px; }
.bar-labels span { flex: 1; text-align: center; font-size: 11px; color: var(--muted); overflow: hidden; white-space: nowrap; }
.hbar { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.hbar-track { flex: 1; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.hbar-track i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.event-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; font-size: 13px; }
.event-list li { display: flex; gap: 10px; padding: 8px 10px; border-radius: 8px; background: rgba(0, 16, 36, .4); }
.event-list time { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.event-list code { color: var(--text-2); font-size: 12px; word-break: break-all; }
.health { display: flex; gap: 10px; flex-wrap: wrap; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
    :root { --sidebar-w: min(400px, calc(100vw - 20px)); --header-h: 56px; --gap: 10px; }
    .left-open .leaflet-left, .right-open .leaflet-right { transform: none; }
    .right-open .leaflet-bottom.leaflet-right .leaflet-control-attribution { transform: none; }
    .user-btn-name, .tz-name { display: none; }
    .user-btn .icon-sm { display: none; }
    .tz-btn { padding: 0 10px; }
    .sidebar { top: auto; max-height: calc(100% - 2 * var(--gap)); height: calc(100% - 2 * var(--gap)); }

    .admin-layout { flex-direction: column; }
    .admin-nav { flex: 0 0 auto; flex-direction: row; overflow-x: auto; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--border); }
    .admin-nav-item { white-space: nowrap; }
    .admin-main { padding-top: 24px; }
    .card-row, .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
}

@media (max-width: 520px) {
    .topbar .brand-name { display: none; }
    .footbar { font-size: 11px; }
    .footbar-meta { display: none; }
    .media-uploader { flex-direction: column; align-items: flex-start; }
    .share-card, .install-card { padding: 24px; }
    .share-targets { grid-template-columns: 1fr 1fr; }
    .kpi strong { font-size: 24px; }
}

/* ==========================================================================
   Phones: bottom navigation, bottom sheets, bigger touch targets
   ========================================================================== */

.mobile-nav { display: none; }

@media (max-width: 900px) {
    .page-app { --footer-h: 64px; }
    .page-app .footbar { display: none; }
    .mobile-nav {
        position: relative; z-index: 1200; display: flex; align-items: stretch; justify-content: space-around;
        flex: 0 0 auto; height: calc(64px + env(safe-area-inset-bottom, 0px)); box-sizing: border-box;
        padding: 0 max(6px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(6px, env(safe-area-inset-left, 0px));
        background: var(--chrome); border-top: 1px solid var(--border);
    }
    .mnav-item {
        flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        border: 0; background: none; color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer; min-width: 0;
    }
    .mnav-item .icon { width: 22px; height: 22px; }
    .mnav-item.is-active { color: var(--accent); }
    .mnav-plan {
        flex: 0 0 auto; align-self: center; width: 56px; height: 56px; margin-top: -22px; border-radius: 18px; border: 4px solid var(--chrome);
        background: var(--accent); color: var(--on-accent); display: grid; place-items: center; cursor: pointer;
        box-shadow: 0 10px 24px -8px var(--accent);
    }
    .mnav-plan .icon { width: 26px; height: 26px; stroke-width: 2.5; }

    /* Panels become bottom sheets */
    .sidebar {
        left: 0 !important; right: 0 !important; bottom: 0; top: auto; width: 100%; height: 86%; max-height: none;
        border-radius: 22px 22px 0 0; border-bottom: 0; opacity: 1;
        transform: translateY(105%); box-shadow: 0 -20px 50px -10px rgba(0, 0, 0, .55);
        background: rgba(0, 38, 79, .97);
    }
    .sidebar-right { height: 74%; }
    .sidebar.is-dragging { transition: none; }
    .left-open .sidebar-left, .right-open .sidebar-right { transform: none; }
    .sidebar-head { position: relative; padding: 22px 12px 8px 14px; touch-action: none; }
    .sidebar-head::before { content: ''; position: absolute; top: 8px; left: 50%; width: 42px; height: 5px; margin-left: -21px; border-radius: 5px; background: rgba(255, 255, 255, .25); }
    .sidebar-body { padding: 6px 14px 24px; }
    .is-picking .sidebar { transform: translateY(105%); }

    /* Bigger, thumb-friendly controls */
    .btn { height: 46px; font-size: 15px; }
    .btn-sm { height: 40px; font-size: 14px; }
    .icon-btn-sm { width: 40px; height: 40px; }
    .chip { height: 40px; font-size: 14px; padding: 0 15px; }
    .tab { height: 38px; font-size: 14px; padding: 0 14px; }
    .input, .search-box input, select.input, textarea.input { font-size: 16px; height: 48px; }
    .textarea { height: auto; }
    .picker-field { height: 52px; font-size: 16px; }
    .segmented button { height: 42px; font-size: 14px; }
    .mode-option { padding: 12px 4px; font-size: 12px; }
    .day-chip { height: 46px; font-size: 15px; }
    .trip-card { padding: 14px 12px; }
    .suggest-item { padding: 11px 10px; }
    .cal-day { max-height: 46px; font-size: 15px; }
    .editor-actions { bottom: -24px; margin: 0 -14px; padding: 12px 14px; }
    .leaflet-bottom { bottom: 0; }
    .pick-banner { top: 12px; }
    .toast-stack { bottom: calc(var(--footer-h) + 20px + env(safe-area-inset-bottom)); }
    .modal { align-items: end; padding: 0; }
    .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
    .kpi { padding: 12px; }
    .segmented button { white-space: nowrap; padding: 0 10px; }
    .admin-nav { scrollbar-width: none; }
    .admin-nav::-webkit-scrollbar { display: none; }
    .stats-toolbar .input { flex: 1 1 140px; }
    .modal-dialog { max-width: none; border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); max-height: 92dvh; transform: translateY(40px); }
}

/* ==========================================================================
   Changelog page
   ========================================================================== */

.page-changelog { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(900px 500px at 90% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%), var(--bg); }
.page-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px; height: calc(var(--header-h) + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 12px 0; background: var(--chrome); border-bottom: 1px solid var(--border); }
.changelog-wrap { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 36px 16px 64px; }
.changelog-hero { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 32px; }
.changelog-hero h1 { font-size: clamp(30px, 6vw, 40px); font-weight: 800; }
.release-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.release-timeline::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; border-left: 2px solid var(--border-strong); }
.release { position: relative; padding: 0 0 30px 34px; }
.release-marker { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--muted); }
.release.is-latest .release-marker { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft); }
.release-major .release-marker { border-color: var(--accent); }
.release-meta { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.release-version { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.release.is-latest .release-version { color: var(--accent); }
.release-meta time { color: var(--muted); font-size: 13px; }
.release-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.release-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.release-head h2 { font-size: 17px; }
.release-body { color: var(--text-2); font-size: 14.5px; }
.release-body p { margin: 0 0 8px; }
.release-body ul { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; }
.release-body li::marker { color: var(--accent); }
.changelog-admin-item { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; }
.changelog-admin-item .release-body { margin-top: 6px; }
.footbar-version { color: var(--muted); }
.footbar-version:hover { color: var(--accent); }

@media (hover: none) {
    #map-coords { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (max-width: 380px) { .hide-sm { display: none; } }

/* Travel mode line icons */
.mode-icon { width: 20px; height: 20px; flex-shrink: 0; display: inline-block; vertical-align: -5px; }
.mode-icon-sm { width: 16px; height: 16px; vertical-align: -3px; color: var(--text); }
.facts .mode-icon { width: 16px; height: 16px; }
.mode-cell { display: inline-flex; align-items: center; gap: 8px; color: #fff; }

.how summary { cursor: pointer; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.how p { margin-top: 6px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.legs em { color: var(--muted); font-style: normal; }
.leaflet-marker-draggable { cursor: grab; }

/* Trip evaluation */
.eval { display: flex; flex-direction: column; gap: 8px; }
.eval ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--text-2); }
.eval li { position: relative; padding-left: 16px; }
.eval li::before { content: ''; position: absolute; left: 0; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.eval .eval-ok::before { background: var(--ok); }
.eval .eval-warn::before { background: var(--warn); }
.eval .eval-info::before { background: #7fb6ff; }

/* ==========================================================================
   Compact trips, trip strip on the map, compact trip panel
   ========================================================================== */

.trip-card { padding: 9px 10px; gap: 10px; }
.trip-card .trip-mode { width: 36px; height: 36px; border-radius: 10px; }
.trip-main small { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.trip-leave strong { font-size: 18px; }
.empty-state.compact { padding: 16px 12px; }
.history { margin-top: 4px; }
.history summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 8px 2px; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.history summary::-webkit-details-marker { display: none; }
.history summary::after { content: '›'; margin-left: auto; font-size: 18px; transition: transform .2s; }
.history[open] summary::after { transform: rotate(90deg); }
.history .trip-card { margin-bottom: 6px; opacity: .85; }

.trip-strip { display: none; }

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: var(--radius); background: var(--accent); color: var(--on-accent); }
.hero small { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .8; }
.hero strong { font-size: 34px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.hero span { font-weight: 700; font-size: 14px; }
.hero.late { background: var(--warn); color: #2b1d00; }
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.steps3 div { padding: 8px 10px; border-radius: 10px; background: rgba(0, 16, 36, .45); display: flex; flex-direction: column; }
.steps3 small { font-size: 11px; color: var(--muted); font-weight: 600; }
.steps3 b { font-size: 16px; font-variant-numeric: tabular-nums; }
.steps3 .goal b { color: var(--accent); }
.action-row { display: flex; gap: 8px; }
.action-row .btn-primary { flex: 1; }
.icon-btn-box { flex: 0 0 auto; width: 46px; height: 46px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-2); }
.more-info summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); padding: 4px 0; }
.more-info[open] summary { margin-bottom: 8px; }
.more-info > * + * { margin-top: 8px; }
.detail { gap: 12px; }

@media (max-width: 900px) {
    /* Upcoming trips float along the bottom of the map */
    .trip-strip {
        position: absolute; z-index: 900; left: 0; right: 0; bottom: 10px;
        display: flex; gap: 10px; padding: 4px 14px; overflow-x: auto; scroll-snap-type: x mandatory;
        scrollbar-width: none; transition: opacity .2s, transform .25s var(--ease);
    }
    .trip-strip::-webkit-scrollbar { display: none; }
    .left-open .trip-strip, .right-open .trip-strip, .is-picking .trip-strip,
    .editor-on-map .trip-strip { opacity: 0; transform: translateY(20px); pointer-events: none; }
    .strip-card, .strip-empty {
        flex: 0 0 auto; scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; text-align: left;
        width: min(78vw, 290px); padding: 12px 14px; border-radius: 16px; cursor: pointer; color: var(--text);
        background: rgba(0, 38, 79, .96); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
    }
    .strip-card.is-soon { border-color: var(--accent); }
    .strip-card.is-selected { box-shadow: inset 0 0 0 2px var(--accent), var(--shadow); }
    .strip-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
    .strip-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
    .strip-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(0, 16, 36, .6); flex-shrink: 0; }
    .strip-icon .mode-icon { width: 18px; height: 18px; }
    .strip-time { display: flex; align-items: baseline; gap: 8px; }
    .strip-time small { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
    .strip-time b { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
    .strip-card.is-soon .strip-time b { color: var(--accent); }
    .strip-time em { font-style: normal; font-size: 13px; color: var(--text-2); font-weight: 600; }
    .strip-sub { font-size: 12.5px; color: var(--muted); }
    .strip-empty { flex-direction: row; align-items: center; gap: 12px; width: 100%; }
    .strip-empty .icon { width: 26px; height: 26px; color: var(--accent); }
    .strip-empty span { display: flex; flex-direction: column; }
    .strip-empty small { color: var(--muted); }

    /* Sheets size to their content; the map stays visible and usable above them */
    .sidebar-left, .sidebar-right { height: auto; max-height: 72%; }
    .sidebar-left:has([data-view="editor"].is-active), .sidebar.is-expanded { max-height: 90%; height: 90%; }
    .sidebar-right .clock-card { display: none; }
    .sidebar-right .sidebar-head { padding-bottom: 0; }
    .sidebar-right .sidebar-head h3 { display: none; }
    .sidebar-right .sidebar-body { padding-top: 0; }
    .view[data-view="trips"] > [data-new-route] { display: none; }
    .leaflet-top.leaflet-right { top: 8px; }
}

@media (max-width: 900px) {
    /* One-line notifications banner on phones */
    .notice-card { padding: 8px 10px; gap: 10px; }
    .notice-card .notice-icon { width: 30px; height: 30px; border-radius: 8px; }
    .notice-card .notice-icon .icon { width: 16px; height: 16px; }
    .notice-card [data-push-text] { display: none; }
    #push-card:has([data-push-enable][hidden]) [data-push-text] { display: block; }
    /* Details panel: close button in the corner instead of its own row */
    .sidebar-right .sidebar-head { position: absolute; top: 0; left: 0; right: 0; height: 22px; padding: 0; z-index: 2; }
    .sidebar-right .sidebar-head [data-toggle-sidebar] { position: absolute; right: 8px; top: 12px; }
    .sidebar-right .sidebar-body { padding-top: 26px; }
    .sidebar-right .detail-head { padding-right: 40px; }
}

/* Timezone switch banner */
.tz-banner { position: fixed; z-index: 3200; left: 50%; top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 10px); transform: translateX(-50%);
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: min(560px, calc(100vw - 20px)); padding: 10px 12px;
    background: var(--surface); border: 1px solid var(--accent); border-radius: 14px; box-shadow: var(--shadow-lg); font-size: 13.5px; }
.tz-banner span { flex: 1 1 200px; }

/* Account & auth pages */
.auth-form { width: 100%; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.auth-card { text-align: left; align-items: stretch; }
.auth-card h1 { text-align: left; }
.auth-legal { text-align: center; margin-top: 4px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-2); line-height: 1.45; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--accent); flex-shrink: 0; }
.login-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.login-signup { margin-top: 18px; text-align: center; color: var(--text-2); }
.legal h2 { font-size: 18px; margin: 26px 0 8px; }
.legal p, .legal li { color: var(--text-2); line-height: 1.6; }
.legal ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.legal-callout { margin: 18px 0; padding: 16px 18px; border-radius: var(--radius); background: var(--warn-soft); border: 1px solid rgba(255, 194, 75, .4); }
.legal-callout p { margin-top: 6px; color: var(--text); }
.account { display: flex; flex-direction: column; gap: 22px; }
.account h2 { font-size: 18px; margin-bottom: 10px; }
.account-notice { margin: 0; }
.current-plan { display: flex; flex-direction: column; gap: 14px; }
.cp-head { display: flex; justify-content: space-between; gap: 12px; }
.cp-head h2 { margin: 2px 0; font-size: 24px; }
.cp-credits { text-align: right; }
.cp-credits strong { display: block; font-size: 26px; color: var(--accent); }
.meters { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.meter { padding: 10px 12px; border-radius: 12px; background: rgba(0, 16, 36, .45); }
.meter-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-2); }
.meter-top small { color: var(--muted); font-weight: 400; }
.meter-bar { height: 6px; border-radius: 4px; background: rgba(255, 255, 255, .1); margin-top: 8px; overflow: hidden; }
.meter-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.meter-bar i.is-full { background: var(--warn); }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.save-badge { font-size: 10.5px; padding: 1px 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); margin-left: 4px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.plan-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.plan-card.is-featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.plan-card.is-current { opacity: .85; }
.plan-card h3 { font-size: 18px; }
.plan-card ul { list-style: none; margin: 6px 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--text-2); flex: 1; }
.plan-card li::before { content: '✓'; color: var(--accent); margin-right: 8px; font-weight: 800; }
.plan-price strong { font-size: 30px; font-weight: 800; }
.plan-price span { color: var(--muted); margin-left: 4px; }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.pack { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); cursor: pointer; text-align: left; }
.pack:hover:not(:disabled) { border-color: var(--accent); }
.pack:disabled { opacity: .5; cursor: default; }
.pack span { font-size: 20px; font-weight: 800; color: var(--accent); }
.pack small { color: var(--muted); }

/* Admin billing */
.plan-admin-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.plan-admin.is-off { opacity: .6; }
.plan-prices { display: flex; gap: 18px; margin: 4px 0 12px; font-size: 15px; }
.plan-limits { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.plan-limits span { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 10px; background: rgba(0, 16, 36, .45); }
.plan-limits small { color: var(--muted); font-size: 11.5px; }
.margin-table td, .margin-table th { padding: 8px 10px; }
.margin-ok { color: var(--ok); }
.margin-warn { color: var(--warn); }
.margin-bad { color: var(--danger); }
.margin-box { border-top: 1px solid var(--border); padding-top: 12px; }
.modal-sub { font-size: 15px; margin: 6px 0 -4px; }
.plan-flags { flex-direction: column; justify-content: center; gap: 10px; }
.sms-table { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.sms-row { display: flex; align-items: center; gap: 8px; }
.sms-row .input { max-width: 120px; }
.kpis-sm .kpi strong { font-size: 18px; }
.up-sub { font-size: 14px; margin: 16px 0 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.up-sub .muted { font-weight: 400; font-size: 12.5px; }
.override-grid { display: flex; flex-direction: column; gap: 8px; }
.override-row { display: grid; grid-template-columns: 1fr 110px auto; align-items: center; gap: 10px; }
.override-row > label:first-child { font-size: 13px; color: var(--text-2); }
.override-row > label:first-child small { display: block; }
.override-row .input:disabled { opacity: .4; }
@media (max-width: 560px) {
    .override-row { grid-template-columns: 1fr auto; }
    .override-row > label:first-child { grid-column: 1 / -1; }
}
.sticky-save { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 40%); display: flex; justify-content: flex-end; }
#integrations-form { display: flex; flex-direction: column; gap: 20px; }
#integrations-form code { font-size: 11.5px; color: var(--text-2); }

[data-tolls] { margin-top: 10px; }
.leaflet-fade-anim .leaflet-popup { transition: opacity .25s; }
.leaflet-zoom-anim .leaflet-zoom-animated { transition-timing-function: cubic-bezier(.2, .8, .2, 1); }

.plan-admin { min-width: 0; overflow: hidden; }
.plan-admin .panel-head-row { flex-wrap: nowrap; }

.icon-btn-box.danger { color: var(--danger); }
.sms-text { white-space: normal !important; min-width: 220px; max-width: 360px; font-size: 12.5px; color: var(--text-2); }
.small-title { font-size: 15px; margin-bottom: 8px; }
.sms-history ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sms-history li { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 10px; background: rgba(0, 16, 36, .45); font-size: 13px; }

/* Swipe a trip left to delete */
.swipe-row { position: relative; border-radius: var(--radius); overflow: hidden; }
.swipe-row + .swipe-row, .history .swipe-row { margin-top: 0; }
.history .swipe-row { margin-bottom: 6px; }
.swipe-row .swipe-card { position: relative; z-index: 1; transition: transform .25s var(--ease); touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.swipe-row.is-dragging .swipe-card { transition: none; }
.swipe-action { position: absolute; inset: 0; display: flex; justify-content: flex-end; background: var(--danger); border-radius: var(--radius); }
.swipe-action button { width: 96px; border: 0; background: transparent; color: #fff; font-weight: 700; font-size: 13px; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.swipe-action .icon { width: 20px; height: 20px; }
.swipe-row.is-leaving { opacity: .4; pointer-events: none; transition: opacity .2s; }

/* Save place form: evenly spread, centred icon choices and equal buttons */
.place-form [data-icon-row] { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.place-form .chip.icon-chip { width: 100%; height: 44px; padding: 0; border-radius: 12px; display: grid; place-items: center; }
.place-form .chip.icon-chip .icon { display: block; width: 20px; height: 20px; }
.place-form .btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.place-form .btn-row .btn { width: 100%; }
.chip.icon-chip .icon { display: block; }
@media (max-width: 900px) { .chip.icon-chip { padding: 0; } }

/* Phones: map attribution at the very bottom, trip cards just above it */
@media (max-width: 900px) {
    .trip-strip { bottom: 22px; }
    .leaflet-bottom.leaflet-left { bottom: 0; left: 0; }
    .leaflet-bottom.leaflet-left .leaflet-control-attribution { margin: 0; border-radius: 0 8px 0 0; font-size: 10.5px; padding: 1px 6px; }
}

.segmented button { white-space: nowrap; }
.save-badge { white-space: nowrap; display: inline-block; }
.section-head .segmented { flex: 0 0 auto; }
@media (max-width: 400px) { .section-head .segmented button { padding: 0 8px; font-size: 13px; } .save-badge { font-size: 10px; } }

/* Plan & billing uses the full width */
.changelog-wrap.account { max-width: none; padding: 32px clamp(16px, 4vw, 56px) 56px; }
.account .plan-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.account .pack-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.account .meters { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Side panels: scroll with wheel/touch, but never show scrollbars; no sideways scrolling */
.sidebar, .sidebar-body, .sidebar .suggest { overflow-x: hidden; }
.sidebar-body, .sidebar .suggest, .sidebar .tabs { scrollbar-width: none; -ms-overflow-style: none; }
.sidebar-body::-webkit-scrollbar, .sidebar .suggest::-webkit-scrollbar, .sidebar .tabs::-webkit-scrollbar { display: none; width: 0; height: 0; }
.sidebar-body > *, .view > *, .detail > * { min-width: 0; max-width: 100%; }

/* Trip panel actions always fit the panel width */
.action-row { flex-wrap: nowrap; min-width: 0; }
.action-row .btn-primary { min-width: 0; padding: 0 12px; overflow: hidden; text-overflow: ellipsis; }
.action-row .icon-btn-box { flex: 0 0 42px; width: 42px; height: 46px; }
.detail-head h4 { min-width: 0; }
.editor-actions { max-width: none; }

/* ==========================================================================
   Trip editor fits the panel without scrolling
   ========================================================================== */
.pair-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chip-row-tight { flex-wrap: nowrap; gap: 4px; }
.chip-row-tight .chip { flex: 1 1 0; min-width: 0; padding: 0; text-align: center; }
.mode-grid { grid-template-columns: repeat(3, 1fr); }

@media (min-width: 901px) {
    .route-form { gap: 10px; }
    .route-form .field { gap: 5px; }
    .route-form .field > label { font-size: 12px; }
    .editor-head { margin: -6px 0 -4px -6px; }
    .editor-head h3 { font-size: 16px; }
    .stops { gap: 6px; }
    .stop-dot { top: 7px; }
    .stops .input { height: 40px; font-size: 14px; }
    .device-toggle .switch-text { font-size: 12px; }
    .mode-grid { grid-template-columns: repeat(6, 1fr); gap: 4px; }
    .mode-option { padding: 7px 2px 6px; font-size: 10.5px; gap: 3px; border-radius: 10px; }
    .mode-option .mode-icon { width: 20px; height: 20px; }
    [data-tolls] { margin-top: 6px; }
    [data-tolls] .switch-text { font-size: 12.5px; }
    .route-form .segmented { padding: 3px; }
    .route-form .segmented button { height: 32px; font-size: 13px; }
    .route-form .picker-field { height: 40px; font-size: 14px; }
    .route-form .chip { height: 30px; font-size: 12.5px; }
    .route-form .chip-row { gap: 4px; }
    .route-form #f-route-name { height: 38px; font-size: 14px; }
    .day-chip { height: 34px; }
    .preview-card { padding: 10px 12px; gap: 6px; }
    .preview-top strong { font-size: 24px; }
    .preview-card .facts span { padding: 3px 8px; font-size: 12px; }
    .preview-card p.small { margin: 0; }
    .editor-actions { padding: 10px 16px; }
    .editor-actions .btn { height: 42px; }
    details.more summary { margin-bottom: 6px; }
    #sidebar-left .sidebar-head { padding-top: 12px; padding-bottom: 4px; }
    #sidebar-left .sidebar-body { padding-top: 6px; }
}

.title-input { flex: 1; min-width: 0; height: 36px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; background: transparent;
    color: var(--text); font: inherit; font-size: 16px; font-weight: 700; }
.title-input::placeholder { color: var(--text-2); font-weight: 700; }
.title-input:hover { border-color: var(--border); }
.title-input:focus { outline: none; border-color: var(--accent); background: rgba(0, 16, 36, .45); }
.preview-card p.small .muted { font-weight: 400; }
@media (min-width: 901px) {
    .route-form [data-repeat-type] .chip { padding: 0 9px; }
    .preview-card .preview-top small { font-size: 10.5px; }
}

.route-placeholder { animation: dash-move 1s linear infinite; }
@keyframes dash-move { to { stroke-dashoffset: -16; } }

/* Live arrival estimate while on the way */
.live-eta { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(0, 16, 36, .5); border: 1px solid var(--border-strong); }
.live-eta span { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.live-eta div { display: flex; flex-direction: column; }
.live-eta small { color: var(--text-2); font-size: 12.5px; }
.live-eta.late { border-color: rgba(255, 194, 75, .5); }
.live-eta.late span { background: var(--warn-soft); color: var(--warn); }

/* Places: swipe rows and the edit form */
#place-list .swipe-row + .swipe-row { margin-top: 8px; }
.place-where { display: flex; flex-direction: column; gap: 6px; }
.place-where [data-place-address] { font-size: 12.5px; color: var(--text-2); }
.btn-row .push-right { margin-left: auto; }
.btn.danger { color: var(--danger); }

/* "Same as last time?" in the trip editor */
.reuse-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 6px 0; border-radius: 12px; border: 1px dashed var(--border-strong); background: rgba(15, 246, 96, .06); }
.reuse-card > span { color: var(--accent); display: grid; place-items: center; }
.reuse-card > span .icon { width: 18px; height: 18px; }
.reuse-card div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.reuse-card b { font-size: 13px; }
.reuse-card small { font-size: 12px; color: var(--text-2); }

/* Live trip: on time + progress */
.live-eta { flex-direction: column; align-items: stretch; }
.live-eta .live-top { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.live-eta .live-bar { display: block; }
.live-eta .live-top > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.live-top b { font-size: 15px; }
.live-eta.ok .live-top b { color: var(--accent); }
.live-eta.late .live-top b { color: var(--warn); }
.live-pct { display: flex; flex-direction: column; align-items: flex-end; font-size: 20px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.live-pct small { font-size: 11px; font-weight: 600; color: var(--muted); }
/* Values change on every position fix: keep each on one line so the box never changes height. */
.live-top > div > b, .live-top > div > small, .strip-live-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-live-text { display: block; }
.live-pct { min-width: 3.4em; }
.live-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; margin-top: 8px; }
.live-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width .6s var(--ease); }
.live-eta.late .live-bar i, .strip-live.late .live-bar i { background: var(--warn); }
.strip-live { display: block; font-size: 12.5px; color: var(--text-2); }
.strip-live b { color: var(--accent); }
.strip-live.late b { color: var(--warn); }
.strip-live .live-bar { margin-top: 5px; height: 4px; }

/* Admin: cron setup */
.cron-status { margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; }
.cron-status.ok { background: rgba(15, 246, 96, .1); color: var(--accent); }
.cron-status.bad { background: var(--warn-soft); color: var(--warn); }
.copy-row { display: flex; gap: 8px; align-items: stretch; }
.copy-row .code { flex: 1; min-width: 0; word-break: break-all; }
.steps-list { margin: 10px 0 6px; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }

/* Check the pin before saving a searched place */
.pin-confirm {
    position: absolute; z-index: 1050; top: 16px; left: 50%; transform: translateX(-50%); width: min(420px, calc(100% - 24px));
    display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 16px;
    background: var(--surface); border: 1px solid var(--accent); box-shadow: var(--shadow-lg);
}
.pin-confirm-text { display: flex; gap: 10px; align-items: flex-start; }
.pin-confirm-text > .icon { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.pin-confirm-text span { display: flex; flex-direction: column; min-width: 0; }
.pin-confirm-text small { color: var(--text-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pin-confirm .btn-row .btn-primary { flex: 1; }
.is-pinning .trip-strip { opacity: 0; pointer-events: none; }
@media (max-width: 900px) {
    .pin-confirm { top: auto; bottom: calc(var(--footer-h) + 14px + env(safe-area-inset-bottom)); }
    .is-pinning .sidebar { transform: translateY(105%); }
}

/* Editor: time to park */
.park-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; flex-wrap: nowrap; }
.park-row label { margin: 0; font-size: 13px; }
/* Same size and column as the "Remind me" chips below */
.park-row .chip-row { flex: 0 0 calc(50% - 5px); width: calc(50% - 5px); }
.park-row[hidden] { display: none; }

/* Place form: icon buttons */
.icon-actions { display: flex; align-items: center; gap: 8px; }
.icon-actions .push-right { margin-left: auto; }
.icon-btn-box.is-primary { background: var(--accent); border-color: var(--accent); color: #002147; }
.icon-btn-box.is-primary:hover { filter: brightness(1.08); }
.icon-actions .icon-btn-box .icon { width: 20px; height: 20px; }

.live-tip { margin-top: 8px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 12px; text-align: left; cursor: pointer; text-decoration: underline dotted; }

/* Admin: cron runs console */
.console { border-radius: var(--radius); background: #000d1c; border: 1px solid var(--border); overflow: hidden; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.console-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.console-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.console-dot.is-live { background: var(--accent); box-shadow: 0 0 0 0 rgba(15, 246, 96, .6); animation: consolePulse 1.8s infinite; }
@keyframes consolePulse { 70% { box-shadow: 0 0 0 7px rgba(15, 246, 96, 0); } 100% { box-shadow: 0 0 0 0 rgba(15, 246, 96, 0); } }
.console-body { max-height: 68vh; overflow: auto; }
.console-table { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 1.35; }
.console-table th { position: sticky; top: 0; background: #001326; color: var(--muted); font-weight: 600; text-align: left; padding: 5px 8px; white-space: nowrap; z-index: 1; }
.console-table td { padding: 3px 8px; border-top: 1px solid rgba(255, 255, 255, .04); white-space: nowrap; color: #c9d7ec; font-variant-numeric: tabular-nums; }
.console-table .num { text-align: right; }
.console-table td.sum { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 460px; color: var(--muted); }
.console-table tr.run { cursor: pointer; }
.console-table tr.run:hover td { background: rgba(255, 255, 255, .04); }
.console-table tr.run.is-new td { animation: consoleNew 2.5s ease-out; }
@keyframes consoleNew { from { background: rgba(15, 246, 96, .18); } to { background: transparent; } }
.console-table .z { color: rgba(201, 215, 236, .3); }
.console-table .st-ok { color: var(--accent); }
.console-table .st-error { color: var(--danger); font-weight: 700; }
.console-table .st-skipped { color: var(--warn); }
.console-table .st-running { color: #7cc4ff; }
.console-table tr.log td { white-space: pre-wrap; padding: 6px 8px 10px 24px; background: rgba(255, 255, 255, .025); color: #9fb3cf; }
.console-table tr.log .ln { display: block; }
.console-table tr.log .ln b { display: inline-block; min-width: 64px; color: rgba(159, 179, 207, .5); font-weight: 400; }
.console-table tr.log .ln.err { color: var(--danger); }
.console-table tr.log .meta { display: block; margin-top: 6px; color: rgba(159, 179, 207, .6); }
.console-more { width: 100%; padding: 10px; border: 0; border-top: 1px solid var(--border); background: #001326; color: var(--text-2); font: inherit; font-size: 12px; cursor: pointer; }

/* Stops on the way */
.stop-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stop-tools .device-toggle { margin: 0; }
.add-stop { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px dashed var(--border-strong); border-radius: 999px;
    background: none; color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.add-stop .icon { width: 14px; height: 14px; }
.add-stop[hidden] { display: none; }
.stop.stop-mid { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; }
.stop-mid .place-field { flex: 1 1 auto; min-width: 0; }
.stop-mid .icon-btn { flex: 0 0 auto; }
.stop-dot.stop-m { background: #fff; color: #003366; border-color: #fff; }
.stay-select { flex: 0 0 78px; width: 78px; padding: 0 4px; height: 48px; font-size: 13px; }
.pin-m span { background: #fff; border-color: #003366; }
.pin-m b { color: #003366; }
.stop-times { list-style: none; margin: 8px 0; padding: 0 0 0 10px; border-left: 2px dashed var(--border-strong); display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.stop-times li { display: flex; gap: 10px; align-items: baseline; }
.stop-times b { min-width: 92px; font-variant-numeric: tabular-nums; color: var(--text); }
.stop-times span { color: var(--text-2); min-width: 0; }
.stop-times em { font-style: normal; color: var(--muted); }
.stop-times .stop-num { display: inline-grid; place-items: center; width: 17px; height: 17px; margin-right: 5px; border-radius: 50%; background: #fff; color: #003366; font-style: normal; font-size: 10.5px; font-weight: 800; }
.stop-times .is-done { opacity: .5; }
.stop-times .is-here span { color: var(--accent); }
.extend-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.extend-row small { color: var(--muted); font-size: 12.5px; }
.extend-row .chip-row { flex: 0 0 52%; }

/* Trips list: next trip on top, one stack newest first, finished at the bottom */
.list-tools { display: flex; justify-content: flex-end; }
.segmented-sm button { height: 30px; font-size: 12.5px; padding: 0 12px; }
.next-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin: 2px 0 6px; }
#trip-next:empty { display: none; }
.trip-card.is-next { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 10px 30px -12px rgba(15, 246, 96, .45); background: linear-gradient(180deg, rgba(15, 246, 96, .08), transparent), var(--surface); }
.trip-card.is-finished > * { opacity: .6; }   /* fade the content, not the card: the red delete layer stays hidden */
.trip-card.is-finished .trip-leave strong { font-size: 16px; }
.badge-done { background: rgba(255, 255, 255, .08); color: var(--text-2); }
.list-divider { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.list-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
