:root {
    color-scheme: light;
    --ink: #0b1728;
    --muted: #657186;
    --line: #dce2ea;
    --panel: rgba(255, 255, 255, 0.96);
    --accent: #2f7bf4;
    --accent-dark: #1f5dc2;
    --shadow: 0 20px 60px rgba(20, 38, 68, 0.14);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Hiragino Sans", "Yu Gothic UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
}

body {
    color: var(--ink);
    background: #edf1f6;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

.admin-map-link {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: white;
    color: var(--accent-dark);
    font-size: 0.75rem;
    font-weight: 750;
    text-decoration: none;
}

.eyebrow {
    margin: 0;
    color: #7290b3;
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.16em;
}

.brand-mark {
    position: relative;
    width: 58px;
    height: 58px;
    margin-bottom: 22px;
}

.brand-mark span {
    position: absolute;
    width: 25px;
    height: 25px;
    border: 4px solid var(--accent);
    border-radius: 50% 50% 50% 4px;
    transform: rotate(-45deg);
}

.brand-mark span::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 6px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

.brand-mark span:nth-child(1) {
    left: 2px;
    top: 2px;
}

.brand-mark span:nth-child(2) {
    right: 1px;
    top: 12px;
    border-color: #54b989;
}

.brand-mark span:nth-child(2)::after {
    background: #54b989;
}

.brand-mark span:nth-child(3) {
    left: 14px;
    bottom: 0;
    border-color: #f1a84a;
}

.brand-mark span:nth-child(3)::after {
    background: #f1a84a;
}

.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    background: #f6f8fb;
    -webkit-overflow-scrolling: touch;
}

.login-layout {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    padding: max(36px, env(safe-area-inset-top)) 20px max(36px, env(safe-area-inset-bottom));
    overflow: visible;
}

.login-layout::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 10% 10%, rgba(65, 133, 241, 0.12), transparent 34%),
        radial-gradient(circle at 88% 82%, rgba(84, 185, 137, 0.13), transparent 32%),
        linear-gradient(135deg, #f8faff 0%, #eef2f7 100%);
}

.login-card {
    position: relative;
    z-index: 2;
    width: min(100%, 430px);
    margin-block: auto;
    padding: 46px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.login-card h1 {
    margin: 6px 0 10px;
    font-size: clamp(2.15rem, 7vw, 3rem);
    line-height: 1;
    letter-spacing: -0.055em;
}

.login-lead {
    margin: 0 0 32px;
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.8;
}

.login-form {
    display: grid;
    gap: 10px;
}

.login-form label {
    font-size: 0.78rem;
    font-weight: 700;
}

.password-row {
    position: relative;
}

.password-row input {
    width: 100%;
    height: 54px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    outline: none;
    background: #f9fbfd;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.login-destination {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.login-secondary-form {
    margin-top: 12px;
    text-align: center;
}

.login-secondary-form button {
    border: 0;
    background: transparent;
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.login-link-button {
    justify-self: center;
    margin-top: 2px;
    padding: 7px 10px;
    border: 0;
    background: transparent;
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.account-summary {
    display: grid;
    gap: 2px;
    margin: 0;
    color: var(--muted);
    font-size: 0.76rem;
    text-align: right;
}

.account-summary span {
    color: var(--accent-dark);
    font-size: 0.7rem;
    font-weight: 750;
}

.password-row input:focus {
    border-color: var(--accent);
    background: white;
    box-shadow: 0 0 0 4px rgba(47, 123, 244, 0.12);
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    min-width: 54px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.primary-button {
    height: 54px;
    margin-top: 8px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #347ff4, #2463c8);
    box-shadow: 0 12px 24px rgba(47, 123, 244, 0.22);
    color: white;
    font-weight: 750;
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease;
}

.primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(47, 123, 244, 0.28);
}

.primary-button:active {
    transform: translateY(1px);
}

.form-error {
    margin: 2px 0 0;
    color: #c83d3d;
    font-size: 0.8rem;
    line-height: 1.5;
}

.privacy-note {
    margin: 20px 0 0;
    color: #8d98a8;
    font-size: 0.72rem;
    text-align: center;
}

.login-map-pattern {
    position: absolute;
    z-index: 1;
    inset: 0;
    opacity: 0.58;
    pointer-events: none;
}

.route {
    position: absolute;
    display: block;
    width: 500px;
    height: 210px;
    border: 18px solid rgba(123, 151, 184, 0.11);
    border-left-color: transparent;
    border-radius: 50%;
    transform: rotate(-18deg);
}

.route-one {
    left: -150px;
    bottom: 5%;
}

.route-two {
    right: -160px;
    top: 2%;
    transform: rotate(22deg);
}

.route-three {
    right: 8%;
    bottom: -145px;
    width: 420px;
    transform: rotate(-8deg);
}

.pattern-pin {
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50% 50% 50% 3px;
    background: var(--accent);
    box-shadow: 0 8px 18px rgba(28, 75, 141, 0.22);
    transform: rotate(-45deg);
}

.pattern-pin::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

.pin-one {
    left: 10%;
    top: 20%;
}

.pin-two {
    right: 12%;
    bottom: 18%;
    background: #54b989;
}

.pin-three {
    right: 18%;
    top: 22%;
    background: #f1a84a;
}

.map-page {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.app-shell {
    display: grid;
    grid-template-rows: 74px minmax(0, 1fr);
    height: 100%;
}

.app-header {
    position: relative;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 24px;
    border-bottom: 1px solid rgba(19, 42, 70, 0.1);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 30px rgba(25, 51, 86, 0.07);
    backdrop-filter: blur(16px);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark-small {
    width: 39px;
    height: 39px;
    margin: 0;
    transform: scale(0.67);
    transform-origin: left center;
}

.brand-lockup > div:last-child {
    margin-left: -10px;
}

.brand-lockup h1 {
    margin: 2px 0 0;
    font-size: 1.35rem;
    line-height: 1;
    letter-spacing: -0.035em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sync-status {
    margin: 0 6px 0 0;
    color: var(--muted);
    font-size: 0.76rem;
    white-space: nowrap;
}

.icon-button,
.logout-button {
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: white;
    cursor: pointer;
}

.icon-button {
    width: 38px;
    font-size: 1.35rem;
    line-height: 1;
}

.icon-button.is-loading {
    animation: spin 900ms linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.logout-button {
    padding: 0 14px;
    color: #526077;
    font-size: 0.76rem;
    font-weight: 650;
}

.map-workspace {
    position: relative;
    min-height: 0;
    overflow: hidden;
}

.left-panel-stack {
    position: absolute;
    z-index: 800;
    top: 16px;
    bottom: 16px;
    left: 16px;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    width: 330px;
    min-height: 0;
    pointer-events: none;
}

.favorites-panel {
    position: relative;
    z-index: auto;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    flex: 1 1 58%;
    width: 100%;
    min-height: 0;
    overflow: hidden;
    border: 1px solid rgba(24, 48, 78, 0.12);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(33, 53, 78, 0.16);
    pointer-events: auto;
}

.search-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 9px 12px 7px 18px;
    border-bottom: 1px solid #e9edf2;
}

.search-panel-header > strong {
    font-size: 0.95rem;
}

.panel-collapse-button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: #34435a;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.panel-collapse-button:hover,
.panel-collapse-button:focus-visible {
    border-color: rgba(47, 123, 244, 0.46);
    outline: none;
    color: var(--accent-dark);
}

.favorites-panel.is-collapsed {
    flex: 0 0 54px;
    grid-template-rows: auto;
    align-self: stretch;
    width: 100%;
    max-width: 100%;
}

.favorites-panel.is-collapsed > :not(.search-panel-header) {
    display: none !important;
}

.favorites-panel.is-collapsed .search-panel-header {
    border-bottom: 0;
}

.favorites-panel.is-empty {
    flex: 0 0 auto;
    grid-template-rows: auto auto;
}

.favorites-panel.is-empty .favorites-list {
    display: none;
}

.account-panel {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    flex: 1 1 42%;
    width: 100%;
    min-height: 210px;
    overflow: hidden;
    border: 1px solid rgba(24, 48, 78, 0.12);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(33, 53, 78, 0.16);
    pointer-events: auto;
}

.account-panel[hidden] {
    display: none;
}

.account-panel.is-collapsed {
    grid-template-rows: auto;
    flex: 0 0 50px;
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    min-height: 50px;
}

.account-panel.is-collapsed > :not(.account-panel-header) {
    display: none !important;
}

.account-panel.is-collapsed .account-panel-header {
    border-bottom: 0;
}

.place-calendar-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    flex: 0 1 430px;
    width: 100%;
    min-height: 260px;
    overflow: hidden;
    border: 1px solid rgba(24, 48, 78, 0.12);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(33, 53, 78, 0.16);
    pointer-events: auto;
}

.place-calendar-panel.is-collapsed {
    flex: 0 0 54px;
    align-self: stretch;
    min-height: 54px;
    width: 100%;
    max-width: 100%;
}

.place-calendar-panel.is-collapsed .place-calendar-body { display: none; }

.place-calendar-header,
.place-calendar-header > div,
.place-calendar-month-nav,
.place-calendar-agenda-heading,
.place-calendar-event,
.place-calendar-event-actions {
    display: flex;
    align-items: center;
}

.place-calendar-header {
    justify-content: space-between;
    min-height: 52px;
    padding: 8px 10px 8px 16px;
    border-bottom: 1px solid #e9edf2;
}

.place-calendar-header > div { gap: 6px; }
.place-calendar-header > strong { font-size: 0.92rem; }
.place-calendar-header #place-calendar-add {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
}

.place-calendar-body {
    min-height: 0;
    overflow-y: auto;
    padding: 10px 12px 12px;
}

.place-calendar-month-nav {
    justify-content: space-between;
    margin-bottom: 7px;
}

.place-calendar-month-nav button {
    width: 32px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: #edf3fb;
    color: #315173;
    font-size: 1.25rem;
    cursor: pointer;
}

.place-calendar-weekdays,
.place-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.place-calendar-weekdays span {
    padding: 2px 0 4px;
    color: #8995a5;
    font-size: 0.59rem;
    font-weight: 800;
    text-align: center;
}

.place-calendar-day,
.place-calendar-day-spacer {
    position: relative;
    min-height: 31px;
}

.place-calendar-day {
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #26364a;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}

.place-calendar-day.is-today { color: var(--accent); }
.place-calendar-day.is-selected { background: var(--accent); color: #fff; }
.place-calendar-dot {
    position: absolute;
    bottom: 3px;
    left: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #4b8cf5;
    transform: translateX(-50%);
}
.place-calendar-dot.is-located { background: #f39a27; }
.place-calendar-day.is-selected .place-calendar-dot { background: #fff; }

.place-calendar-agenda-heading {
    justify-content: space-between;
    margin-top: 10px;
    padding: 9px 2px 6px;
    border-top: 1px solid #e9edf2;
}
.place-calendar-agenda-heading strong { font-size: 0.73rem; }
.place-calendar-agenda-heading span { color: #8491a2; font-size: 0.55rem; }
.place-calendar-events { display: grid; gap: 5px; }
.place-calendar-empty {
    margin: 8px 0;
    color: #8a96a6;
    font-size: 0.67rem;
    text-align: center;
}
.place-calendar-event {
    gap: 8px;
    min-height: 46px;
    padding: 6px 7px;
    border-radius: 12px;
    background: #f5f8fc;
}
.place-calendar-event-time { width: 40px; color: #3976c4; font-size: 0.66rem; font-weight: 850; }
.place-calendar-event-copy { display: grid; flex: 1; min-width: 0; }
.place-calendar-event-copy strong,
.place-calendar-event-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-calendar-event-copy strong { font-size: 0.68rem; }
.place-calendar-event-copy span { color: #7c899b; font-size: 0.57rem; }
.place-calendar-event-actions { gap: 3px; }
.place-calendar-event-actions button {
    min-width: 27px;
    height: 27px;
    padding: 0 6px;
    border: 1px solid #d9e1eb;
    border-radius: 9px;
    background: #fff;
    color: #53677f;
    font-size: 0.57rem;
    cursor: pointer;
}

.place-calendar-dialog {
    width: min(390px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(18, 35, 57, 0.28);
}
.place-calendar-dialog::backdrop { background: rgba(11, 23, 40, 0.34); }
.place-calendar-dialog form { display: grid; gap: 13px; padding: 24px; }
.place-calendar-dialog h2 { margin: 0 0 3px; font-size: 1.05rem; }
.place-calendar-dialog label { display: grid; gap: 5px; color: #536277; font-size: 0.7rem; font-weight: 750; }
.place-calendar-dialog input[type="text"],
.place-calendar-dialog input[type="datetime-local"] {
    height: 42px;
    padding: 0 11px;
    border: 1px solid #d9e1eb;
    border-radius: 11px;
    font: inherit;
    color: #17263a;
}
.place-calendar-all-day { display: flex !important; align-items: center; gap: 8px !important; }
#place-calendar-use-center {
    height: 38px;
    border: 1px solid rgba(47, 123, 244, 0.3);
    border-radius: 11px;
    background: #eef5ff;
    color: #256bc4;
    font-weight: 750;
    cursor: pointer;
}
.place-calendar-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.place-calendar-dialog-actions button { height: 42px; border: 0; border-radius: 12px; font-weight: 800; cursor: pointer; }
.place-calendar-dialog-actions .primary { background: var(--accent); color: #fff; }

.account-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
    padding: 9px 16px;
    border-bottom: 1px solid #e9edf2;
}

.account-panel-header strong {
    font-size: 0.95rem;
}

.account-panel-header span {
    padding: 3px 8px;
    border-radius: 999px;
    background: #edf3fb;
    color: #5c6c82;
    font-size: 0.64rem;
    font-weight: 800;
}

.account-panel-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.account-panel-header-actions button {
    height: 28px;
    padding: 0 9px;
    border: 1px solid rgba(138, 74, 214, 0.28);
    border-radius: 8px;
    background: #f5effc;
    color: #7137b6;
    font-size: 0.61rem;
    font-weight: 850;
    cursor: pointer;
}

.account-panel-header-actions button:hover,
.account-panel-header-actions button:focus-visible {
    border-color: rgba(138, 74, 214, 0.62);
    outline: none;
    background: #eee2fb;
}

.account-panel-status {
    margin: 0;
    padding: 7px 14px;
    background: #f5f8fc;
    color: #718096;
    font-size: 0.62rem;
    line-height: 1.4;
}

.account-email-search { display: grid; gap: 6px; padding: 10px 14px; font-size: 0.76rem; background: white; }
.account-email-search input { width: 100%; box-sizing: border-box; min-height: 38px; padding: 8px 10px; border: 1px solid #aab6c6; border-radius: 8px; font: inherit; }

.account-panel-status.is-error {
    background: #fff0f1;
    color: #b4313a;
}

.account-panel-toggle {
    display: grid;
    place-items: center;
    width: 28px;
    padding: 0 !important;
    border-radius: 50% !important;
    border-color: rgba(30, 45, 64, 0.18) !important;
    background: #fff !important;
    color: #334155 !important;
    font-size: 1rem !important;
    line-height: 1 !important;
}

.account-list {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.account-entry {
    border-bottom: 1px solid #e8edf3;
}

.account-entry.is-selected {
    background: #f5f9ff;
}

.account-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 58px;
    padding: 9px 13px;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.account-row:hover,
.account-row:focus-visible {
    outline: none;
    background: #f2f6fb;
}

.account-row-text {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.account-row-text strong,
.account-row-text .account-email-open,
.account-row-text small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-row-text strong {
    color: var(--ink);
    font-size: 0.76rem;
}

.account-email-open {
    border: 0;
    padding: 0;
    background: transparent;
    color: #1463cb;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.76rem;
    text-align: left;
    cursor: pointer;
    text-decoration: underline;
}
.account-email-open:focus-visible { outline: 2px solid #1463cb; }

.account-email-row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.account-email-row .account-email-open { min-width: 0; }
.account-pending-image-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    box-sizing: border-box;
    border-radius: 999px;
    background: #d92d32;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.account-row-text small {
    color: #7c8899;
    font-size: 0.61rem;
}

.account-plan-badge {
    min-width: 48px;
    padding: 5px 8px;
    border-radius: 999px;
    color: #fff;
    font-size: 0.61rem;
    font-weight: 850;
    text-align: center;
}

.account-plan-free { background: #6d7b8f; }
.account-plan-pro { background: #2f7bf4; }
.account-plan-admin { background: #8a4ad6; }

.account-details {
    display: grid;
    gap: 10px;
    padding: 2px 13px 13px;
}

.account-metadata {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 9px;
    margin: 0;
    font-size: 0.6rem;
    line-height: 1.4;
}

.account-metadata dt {
    color: #8792a2;
}

.account-metadata dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    color: #405069;
    font-variant-numeric: tabular-nums;
}

.account-plan-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #edf2f7;
}

.account-plan-controls button {
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #617086;
    font-size: 0.66rem;
    font-weight: 850;
    cursor: pointer;
}

.account-plan-controls button.is-current {
    background: #fff;
    box-shadow: 0 2px 7px rgba(25, 41, 66, 0.12);
    color: var(--accent-dark);
}

.account-plan-controls button:disabled {
    opacity: 0.55;
    cursor: wait;
}

.panel-controls {
    padding: 18px 16px 12px;
}

.map-provider-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 9px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #eef2f7;
}

.map-provider-switch button {
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #68758a;
    font-size: 0.68rem;
    font-weight: 800;
    cursor: pointer;
}

.map-provider-switch button.is-active {
    background: white;
    box-shadow: 0 2px 7px rgba(25, 41, 66, 0.12);
    color: var(--ink);
}

.osm-junction-launch-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: 7px;
    margin-top: 9px;
}

.osm-junction-launch-row button {
    width: 100%;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: #4f5f75;
    font-size: 0.7rem;
    font-weight: 800;
    cursor: pointer;
}

.osm-junction-launch-row button.is-active {
    border-color: #7357e6;
    background: #7357e6;
    color: #fff;
}

.osm-junction-launch-row button:disabled {
    opacity: 0.55;
    cursor: default;
}

.map-provider-switch button:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.search-field {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #f7f9fc;
    color: #8490a2;
}

.search-field:focus-within {
    border-color: var(--accent);
    background: white;
    box-shadow: 0 0 0 3px rgba(47, 123, 244, 0.1);
}

.search-field input {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: 0.86rem;
}

.search-field button {
    flex: 0 0 auto;
    height: 30px;
    padding: 0 10px;
    border: 0;
    border-radius: 9px;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 750;
    cursor: pointer;
}

.search-field button:disabled {
    opacity: 0.55;
    cursor: wait;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.layer-launch-row {
    margin-top: 11px;
}

.layer-launch-row button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    color: #41516a;
    font-size: 0.73rem;
    font-weight: 800;
    cursor: pointer;
}

.layer-launch-row button:hover,
.layer-launch-row button:focus-visible {
    border-color: rgba(47, 123, 244, 0.46);
    outline: none;
    color: var(--accent-dark);
}

.filter-chip,
.filter-dot,
.filter-highway {
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease;
}

.filter-chip {
    height: 30px;
    padding: 0 12px;
    border-color: var(--line);
    border-radius: 999px;
    background: white;
    color: #5d6a7d;
    font-size: 0.72rem;
    font-weight: 700;
}

.filter-chip.is-active {
    border-color: var(--ink);
    background: var(--ink);
    color: white;
}

.filter-dot {
    width: 27px;
    height: 27px;
    border: 4px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--line);
}

.filter-dot.is-active,
.filter-highway.is-active {
    transform: translateY(-2px);
    box-shadow: 0 0 0 2px var(--ink), 0 5px 10px rgba(25, 41, 66, 0.16);
}

.dot-yellow { background: #f2c94c; }
.dot-red { background: #ef5b5b; }
.dot-blue { background: #4d8df7; }
.dot-green { background: #3bb273; }

.filter-highway {
    height: 27px;
    padding: 0 7px;
    border: 3px solid white;
    border-radius: 8px;
    background: #20a86b;
    box-shadow: 0 0 0 1px var(--line);
    color: white;
    font-size: 0.62rem;
    font-weight: 800;
}

.panel-summary {
    display: flex;
    align-items: baseline;
    gap: 4px;
    padding: 4px 18px 10px;
    color: #7d8898;
    font-size: 0.72rem;
}

.panel-summary strong {
    color: var(--ink);
    font-size: 1.15rem;
}

.favorites-list {
    min-height: 0;
    padding: 0 10px 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.favorite-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 66px;
    padding: 9px 8px;
    border: 0;
    border-bottom: 1px solid #edf0f4;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.favorite-row:hover,
.favorite-row:focus-visible {
    border-radius: 12px;
    outline: none;
    background: #f3f6fa;
}

.row-pin {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 3px solid white;
    border-radius: 50% 50% 50% 4px;
    box-shadow: 0 2px 7px rgba(25, 41, 66, 0.2);
    color: white;
    font-size: 0.56rem;
    font-weight: 900;
    transform: rotate(-45deg);
}

.row-pin b {
    font-size: 0.56rem;
    font-weight: 900;
    transform: rotate(45deg);
}

.row-pin-yellow { background: #f2c94c; }
.row-pin-orange { background: #f28c28; }
.row-pin-red { background: #ef5b5b; }
.row-pin-pink { background: #ed5d9a; }
.row-pin-magenta { background: #db2997; }
.row-pin-purple { background: #9855d4; }
.row-pin-indigo { background: #5856d6; }
.row-pin-blue { background: #4d8df7; }
.row-pin-cyan { background: #32ade6; }
.row-pin-teal { background: #30b0c7; }
.row-pin-mint { background: #00c7be; }
.row-pin-green { background: #3bb273; }
.row-pin-lime { background: #8fc71f; }
.row-pin-brown { background: #a47745; }
.row-pin-gray { background: #8e8e93; }
.row-pin-black { background: #1c1c1e; }
.row-pin-highway { background: #20a86b; }
.row-pin-search { background: #7357e6; }
.row-pin-junction-entrance { background: #1f9d63; }
.row-pin-junction-exit { background: #ea8618; }
.row-pin-junction-both { background: #1976c9; }
.row-pin-junction-junction { background: #7357e6; }
.row-pin-junction-unknown { background: #667085; }

.row-text {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.row-text strong,
.row-text small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-text strong {
    font-size: 0.86rem;
}

.row-text small {
    color: #7b8696;
    font-size: 0.7rem;
}

.row-arrow {
    color: #a0a9b6;
    font-size: 1.25rem;
}

.favorite-layer-sheet {
    position: absolute;
    z-index: 850;
    top: 16px;
    right: 16px;
    bottom: 16px;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    width: 360px;
    min-height: 0;
    overflow: hidden;
    border: 1px solid rgba(24, 48, 78, 0.12);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(33, 53, 78, 0.2);
}

.favorite-layer-sheet.is-collapsed {
    bottom: auto;
    grid-template-rows: auto;
    width: 218px;
}

.favorite-layer-sheet.is-collapsed > :not(.layer-sheet-header) {
    display: none !important;
}

.favorite-layer-sheet.is-collapsed .layer-sheet-header {
    border-bottom: 0;
}

.favorite-layer-sheet.is-collapsed #add-layer-button,
.favorite-layer-sheet.is-collapsed #delete-layer-button {
    display: none;
}

.favorite-layer-sheet[hidden] {
    display: none !important;
}

.layer-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: 10px 12px 8px 18px;
    border-bottom: 1px solid #e9edf2;
}

.layer-sheet-header > strong {
    font-size: 0.95rem;
}

.layer-sheet-header > div {
    display: flex;
    gap: 5px;
}

.layer-sheet-header button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: #34435a;
    font-size: 1.15rem;
    font-weight: 750;
    cursor: pointer;
}

.layer-sheet-header button[hidden] {
    display: none;
}

.layer-sheet-header button.is-active {
    border-color: #e34d54;
    background: #e34d54;
    color: #fff;
}

.layer-sheet-header button.has-selection {
    border-color: #d83b44;
    background: #d83b44;
    color: #fff;
}

.layer-sheet-header button:disabled {
    opacity: 0.38;
    cursor: default;
}

.layer-protected-action {
    display: grid;
    place-items: center;
    min-width: 42px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid #ccd5e1;
    border-radius: 9px;
    background: #f2f5f8;
    color: #7b8798;
    font-size: 0.64rem;
    font-weight: 800;
}

.layer-sheet-note {
    margin: 0;
    padding: 9px 15px;
    background: #f5f8fc;
    color: #718096;
    font-size: 0.64rem;
    line-height: 1.5;
}

.favorite-layer-list {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.layer-pin-glyph {
    display: block;
    width: 100%;
    height: 100%;
    background: currentColor;
    mask-position: center;
    mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
}

.favorite-layer-section {
    position: relative;
    border-bottom: 1px solid #e8edf3;
    transition: background 120ms ease, opacity 120ms ease;
}

.favorite-layer-section.is-selected {
    background: #e7f1ff;
}

.favorite-layer-section.is-selected > .favorite-layer-row {
    background: #2f7bf4;
}

.favorite-layer-section.is-selected > .favorite-layer-row .layer-labels strong,
.favorite-layer-section.is-selected > .favorite-layer-row .layer-labels small {
    color: #fff;
}

.favorite-layer-section.is-dragging,
.layer-item-selection.is-dragging {
    opacity: 0.45;
}

.favorite-layer-section.is-drop-target {
    background: #dbeaff;
}

.favorite-layer-section.drop-before::before,
.favorite-layer-section.drop-after::after {
    position: absolute;
    z-index: 2;
    right: 8px;
    left: 8px;
    height: 3px;
    border-radius: 99px;
    background: #2f7bf4;
    content: '';
}

.favorite-layer-section.drop-before::before { top: -2px; }
.favorite-layer-section.drop-after::after { bottom: -2px; }

.favorite-layer-row {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px;
    min-height: 66px;
    padding: 7px 8px 7px 10px;
}

.layer-iphone-visibility {
    display: grid;
    place-items: center;
    width: 22px;
    height: 34px;
    cursor: pointer;
}

.layer-iphone-visibility input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #2f7bf4;
    cursor: pointer;
}

.layer-iphone-visibility input:disabled {
    cursor: default;
    opacity: 0.55;
}

.favorite-layer-main {
    display: grid;
    grid-template-columns: 27px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding: 5px 2px;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.favorite-layer-main:focus-visible,
.layer-item-selection:focus-visible {
    outline: 2px solid #2f7bf4;
    outline-offset: 1px;
}

.layer-pin {
    display: grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border-radius: 8px;
    color: #fff;
    font-size: 0.61rem;
    font-weight: 900;
}

.layer-pin-yellow { background: #f2b928; }
.layer-pin-orange { background: #f28c28; }
.layer-pin-red { background: #ef5350; }
.layer-pin-pink { background: #ed5d9a; }
.layer-pin-magenta { background: #db2997; }
.layer-pin-purple { background: #9855d4; }
.layer-pin-indigo { background: #5856d6; }
.layer-pin-blue { background: #4285ee; }
.layer-pin-cyan { background: #32ade6; }
.layer-pin-teal { background: #30b0c7; }
.layer-pin-mint { background: #00c7be; }
.layer-pin-green { background: #2eae70; }
.layer-pin-lime { background: #8fc71f; }
.layer-pin-brown { background: #a47745; }
.layer-pin-gray { background: #8e8e93; }
.layer-pin-black { background: #1c1c1e; }
.layer-pin-highway { background: #159d60; }

.layer-labels {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.layer-labels strong,
.layer-labels small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layer-labels strong {
    font-size: 0.76rem;
}

.layer-labels small {
    color: #7c899a;
    font-size: 0.62rem;
}

.favorite-layer-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.favorite-layer-actions button {
    height: 31px;
    padding: 0 7px;
    border: 1px solid #d9e0e9;
    border-radius: 9px;
    background: #fff;
    color: #4c5d73;
    font-size: 0.61rem;
    font-weight: 800;
    cursor: pointer;
}

.favorite-layer-actions button:disabled {
    opacity: 0.32;
    cursor: default;
}

.favorite-layer-actions .layer-bulk-action {
    padding: 0 6px;
    color: #2a68c8;
}

.favorite-layer-actions .layer-expand-action {
    width: 27px;
    padding: 0;
    color: #65748a;
}

.favorite-layer-actions .layer-distance-action {
    min-width: 38px;
}

.favorite-layer-actions .layer-visibility-action {
    width: 31px;
    padding: 0;
    color: #8a95a4;
    font-size: 0.9rem;
}

.favorite-layer-actions .layer-visibility-action.is-visible {
    border-color: rgba(47, 123, 244, 0.38);
    background: #edf5ff;
    color: var(--accent);
}

.favorite-layer-actions .layer-delete-action {
    border-color: rgba(222, 66, 73, 0.35);
    color: #d53d45;
}

.favorite-layer-items {
    display: grid;
    padding: 0 12px 9px;
}

.favorite-layer-items button,
.favorite-layer-items p {
    min-width: 0;
    margin: 0;
    padding: 8px 7px;
    overflow: hidden;
    border: 0;
    border-top: 1px solid #edf1f5;
    background: transparent;
    color: #59687d;
    font-size: 0.68rem;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.favorite-layer-items button {
    cursor: pointer;
}

.favorite-layer-items button:disabled {
    color: #9aa4b1;
    cursor: default;
}

.favorite-layer-items .layer-item-selection {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    border-radius: 7px;
    transition: background 100ms ease, color 100ms ease;
}

.favorite-layer-items .layer-item-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layer-item-sort-bar {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    align-items: stretch;
    border-bottom: 1px solid #dfe6ef;
    background: #f6f8fb;
}

.favorite-layer-items .layer-item-sort-bar button {
    min-width: 0;
    padding: 7px 8px;
    border: 0;
    border-right: 1px solid #dfe6ef;
    border-top: 0;
    border-radius: 0;
    background: transparent;
    color: #66758a;
    font-size: 0.6rem;
    font-weight: 800;
    text-align: left;
}

.favorite-layer-items .layer-item-sort-bar button:last-child {
    border-right: 0;
}

.favorite-layer-items .layer-item-sort-bar button.is-active {
    background: #e8f1ff;
    color: #1f67cf;
}

.layer-item-type-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 24px;
    border: 1px solid #d7dee8;
    border-radius: 7px;
    background: #f4f6f9;
    color: #7a8798;
    font-size: 0.56rem;
    font-weight: 900;
}

.layer-item-type-icon.is-ic {
    border-color: rgba(21, 157, 96, 0.35);
    background: #e9f8f0;
    color: #117a4b;
}

.layer-item-type-icon.is-junction {
    border-color: rgba(223, 118, 27, 0.36);
    background: #fff2e6;
    color: #b75b0e;
}

.favorite-layer-items .layer-item-selection.is-selected {
    background: #2f7bf4;
    color: #fff;
}

.layer-item-selection.is-selected .layer-item-type-icon {
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.layer-item-protected {
    flex: 0 0 auto;
    color: #8591a2;
    font-size: 0.55rem;
    font-weight: 800;
}

.layer-item-selection.is-selected .layer-item-protected {
    color: rgba(255, 255, 255, 0.82);
}

.layer-dialog {
    width: min(90vw, 390px);
    padding: 0;
    border: 0;
    border-radius: 20px;
    box-shadow: 0 26px 80px rgba(13, 28, 50, 0.3);
}

.layer-dialog::backdrop {
    background: rgba(10, 23, 42, 0.34);
    backdrop-filter: blur(3px);
}

.layer-dialog form {
    display: grid;
    gap: 18px;
    padding: 24px;
}

.layer-dialog h2 {
    margin: 0;
    font-size: 1.12rem;
}

.layer-dialog form > label {
    display: grid;
    gap: 7px;
    color: #526178;
    font-size: 0.72rem;
    font-weight: 750;
}

.layer-dialog input[type="text"],
.layer-dialog select {
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: none;
}

.layer-dialog input[type="text"]:focus,
.layer-dialog select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(47, 123, 244, 0.11);
}

.layer-dialog fieldset {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

.layer-dialog legend {
    margin-bottom: 8px;
    color: #526178;
    font-size: 0.72rem;
    font-weight: 750;
}

.layer-dialog fieldset label {
    min-width: 0;
    cursor: pointer;
}

.layer-dialog fieldset input {
    position: absolute;
    opacity: 0;
}

.layer-color-choice {
    display: grid;
    place-items: center;
    min-width: 0;
    width: 100%;
    height: 34px;
    padding: 0 7px;
    border: 3px solid #fff;
    border-radius: 10px;
    box-shadow: 0 0 0 1px #d9e0e9;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 850;
}

.layer-dialog fieldset input:checked + .layer-color-choice {
    box-shadow: 0 0 0 2px #0b1728;
}

.color-yellow { background: #f2b928; }
.color-orange { background: #f28c28; }
.color-red { background: #ef5350; }
.color-pink { background: #ed5d9a; }
.color-magenta { background: #db2997; }
.color-purple { background: #9855d4; }
.color-indigo { background: #5856d6; }
.color-blue { background: #4285ee; }
.color-cyan { background: #32ade6; }
.color-teal { background: #30b0c7; }
.color-mint { background: #00c7be; }
.color-green { background: #2eae70; }
.color-lime { background: #8fc71f; }
.color-brown { background: #a47745; }
.color-gray { background: #8e8e93; }
.color-black { background: #1c1c1e; }
.color-highway { background: #159d60; }

.layer-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.layer-dialog-actions button {
    height: 40px;
    padding: 0 15px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
}

.layer-dialog-actions .primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.browser-template-dialog {
    width: min(96vw, 1180px);
    max-width: none;
    height: min(90vh, 850px);
    max-height: none;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 24px;
    background: #f6f8fb;
    box-shadow: 0 34px 110px rgba(8, 22, 43, 0.38);
}

.browser-template-dialog::backdrop {
    background: rgba(7, 18, 35, 0.48);
    backdrop-filter: blur(5px);
}

.browser-template-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
}

.browser-template-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    padding: 12px 16px 11px 22px;
    border-bottom: 1px solid #dfe5ed;
    background: #fff;
}

.browser-template-header p {
    margin: 0 0 2px;
    color: #8a4ad6;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.16em;
}

.browser-template-header h2 {
    margin: 0;
    font-size: 1.12rem;
    letter-spacing: -0.025em;
}

.browser-template-header button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0 0 2px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: #42516a;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
}

.browser-template-workspace {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
}

.browser-template-sidebar {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
    border-right: 1px solid #dfe5ed;
    background: #fff;
}

.browser-template-sidebar-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    padding: 10px 12px 8px 16px;
    border-bottom: 1px solid #edf0f4;
}

.browser-template-sidebar-actions strong {
    font-size: 0.78rem;
}

.browser-template-sidebar-actions button {
    height: 30px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    color: var(--accent-dark);
    font-size: 0.65rem;
    font-weight: 850;
    cursor: pointer;
}

.browser-template-sidebar-actions button:disabled {
    opacity: 0.5;
    cursor: wait;
}

.browser-template-status {
    min-height: 32px;
    margin: 0;
    padding: 7px 14px;
    background: #f3f6fa;
    color: #718096;
    font-size: 0.61rem;
    line-height: 1.45;
}

.browser-template-status.is-error {
    background: #fff0f1;
    color: #b4313a;
}

.browser-template-list {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.browser-template-list.is-pending {
    pointer-events: none;
    opacity: 0.72;
}

.browser-template-list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 62px;
    padding: 9px 13px 9px 16px;
    border: 0;
    border-bottom: 1px solid #e9edf2;
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.browser-template-list-row:hover,
.browser-template-list-row:focus-visible {
    outline: none;
    background: #f5f8fc;
}

.browser-template-list-row.is-selected {
    background: #eaf2ff;
    box-shadow: inset 4px 0 0 var(--accent);
}

.browser-template-list-row > span:first-child {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.browser-template-list-row strong,
.browser-template-list-row small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.browser-template-list-row strong {
    font-size: 0.73rem;
}

.browser-template-list-row small {
    color: #7d8999;
    font-size: 0.6rem;
}

.browser-template-list-meta {
    padding: 4px 7px;
    border-radius: 999px;
    background: #dfeaff;
    color: #2766c3;
    font-size: 0.56rem;
    font-weight: 900;
}

.browser-template-list-meta.is-disabled {
    background: #e6e9ed;
    color: #7b8695;
}

.browser-template-list-empty {
    margin: 0;
    padding: 22px 14px;
    color: #8792a2;
    font-size: 0.68rem;
    text-align: center;
}

.browser-template-form {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    min-width: 0;
    min-height: 0;
    background: #f7f9fc;
}

.browser-template-form-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 58px;
    padding: 10px 20px;
    border-bottom: 1px solid #e3e8ef;
    background: #fff;
}

.browser-template-form-heading > div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.browser-template-form-heading strong {
    overflow: hidden;
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.browser-template-form-heading > div > span {
    color: #7c8797;
    font-size: 0.59rem;
}

.browser-template-enabled {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #45556c;
    font-size: 0.68rem;
    font-weight: 800;
    cursor: pointer;
}

.browser-template-enabled input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.browser-template-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 14px;
    min-height: 0;
    padding: 18px 20px 26px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.browser-template-fields label {
    display: grid;
    align-content: start;
    gap: 6px;
    min-width: 0;
    color: #526178;
    font-size: 0.65rem;
    font-weight: 800;
}

.browser-template-wide-field {
    grid-column: 1 / -1;
}

.browser-template-fields input,
.browser-template-fields select,
.browser-template-fields textarea {
    width: 100%;
    border: 1px solid #d8dfe8;
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: var(--ink);
    font-family: inherit;
    font-size: 0.72rem;
}

.browser-template-fields input,
.browser-template-fields select {
    height: 40px;
    padding: 0 11px;
}

.browser-template-fields textarea {
    min-height: 68px;
    padding: 9px 11px;
    resize: vertical;
    line-height: 1.45;
}

.browser-template-fields input:focus,
.browser-template-fields select:focus,
.browser-template-fields textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(47, 123, 244, 0.11);
}

.browser-template-preview-note {
    margin: 0;
    padding: 8px 20px;
    border-top: 1px solid #e3e8ef;
    background: #edf3fb;
    color: #64738a;
    font-size: 0.6rem;
    line-height: 1.5;
}

.browser-template-actions {
    display: grid;
    grid-template-columns: auto minmax(12px, 1fr) auto auto;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #dfe5ed;
    background: #fff;
}

.browser-template-actions button {
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: #4c5c73;
    font-size: 0.68rem;
    font-weight: 850;
    cursor: pointer;
}

.browser-template-actions button.primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.browser-template-actions button.danger {
    border-color: #f1c8cb;
    color: #b4313a;
}

.browser-template-actions button:disabled {
    opacity: 0.45;
    cursor: default;
}

.public-event-admin-dialog {
    width: min(98vw, 1500px);
    max-width: none;
    height: min(92vh, 920px);
    max-height: none;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 24px;
    background: #f6f8fb;
    box-shadow: 0 34px 110px rgba(8, 22, 43, 0.4);
}

.public-event-admin-dialog::backdrop {
    background: rgba(7, 18, 35, 0.5);
    backdrop-filter: blur(5px);
}

.public-event-admin-shell {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
}

.public-event-admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    padding: 12px 16px 11px 22px;
    border-bottom: 1px solid #dfe5ed;
    background: #fff;
}

.public-event-admin-header p {
    margin: 0 0 2px;
    color: #8a4ad6;
    font-size: 0.58rem;
    font-weight: 900;
    letter-spacing: 0.16em;
}

.public-event-admin-header h2 {
    margin: 0;
    font-size: 1.12rem;
    letter-spacing: -0.025em;
}

.public-event-admin-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.public-event-admin-header-actions a,
.public-event-admin-header-actions button {
    display: grid;
    place-items: center;
    height: 40px;
    border: 1px solid var(--line);
    background: #fff;
    color: #42516a;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.public-event-admin-header-actions a {
    padding: 0 14px;
    border-radius: 11px;
    font-size: 0.66rem;
}

.public-event-admin-header-actions button {
    width: 40px;
    padding: 0 0 2px;
    border-radius: 12px;
    font-size: 1.45rem;
    line-height: 1;
}

.public-event-admin-workspace {
    display: grid;
    grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
}

.public-event-import-form {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 0;
    border-right: 1px solid #dfe5ed;
    background: #f8fafd;
}

/* Keep the form footer in its own row even while the optional candidate field
   is hidden. Without explicit rows, CSS Grid auto-placement shifts the footer
   into the scroll row and pushes its buttons below the dialog. */
.public-event-url-box {
    grid-row: 1;
}

.public-event-import-status {
    grid-row: 2;
}

.public-event-candidate-field {
    grid-row: 3;
}

.public-event-form-fields {
    grid-row: 4;
}

.public-event-import-actions {
    grid-row: 5;
}

.public-event-import-form.is-pending {
    cursor: wait;
}

.public-event-url-box {
    display: grid;
    gap: 6px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid #e5eaf1;
    background: #fff;
}

.public-event-url-box > label,
.public-event-candidate-field,
.public-event-form-fields label {
    color: #526178;
    font-size: 0.64rem;
    font-weight: 800;
}

.public-event-url-box > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
}

.public-event-url-box input,
.public-event-url-box button,
.public-event-candidate-field select,
.public-event-form-fields input,
.public-event-form-fields select,
.public-event-form-fields textarea {
    width: 100%;
    border: 1px solid #d8dfe8;
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: var(--ink);
    font-family: inherit;
    font-size: 0.71rem;
}

.public-event-url-box input,
.public-event-url-box button,
.public-event-candidate-field select,
.public-event-form-fields input,
.public-event-form-fields select {
    height: 39px;
    padding: 0 10px;
}

.public-event-url-box button {
    width: auto;
    color: var(--accent-dark);
    font-weight: 850;
    cursor: pointer;
}

.public-event-url-box small {
    color: #8591a2;
    font-size: 0.57rem;
    line-height: 1.45;
}

.public-event-import-status,
.public-event-sheet-status {
    min-height: 32px;
    margin: 0;
    padding: 7px 14px;
    background: #f0f4f9;
    color: #718096;
    font-size: 0.61rem;
    line-height: 1.45;
}

.public-event-import-status.is-error,
.public-event-sheet-status.is-error {
    background: #fff0f1;
    color: #b4313a;
}

.public-event-import-status.is-success {
    background: #edf9f2;
    color: #24714b;
}

.public-event-sheet-status.is-success {
    background: #edf9f2;
    color: #24714b;
}

.public-event-candidate-field {
    display: grid;
    gap: 5px;
    padding: 10px 16px;
    border-bottom: 1px solid #e5eaf1;
    background: #fffaf0;
}

.public-event-candidate-field[hidden] {
    display: none;
}

.public-event-form-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 12px;
    min-height: 0;
    padding: 14px 16px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.public-event-form-fields label {
    display: grid;
    align-content: start;
    gap: 5px;
    min-width: 0;
}

.public-event-form-fields textarea {
    min-height: 86px;
    padding: 9px 10px;
    resize: vertical;
    line-height: 1.5;
}

.public-event-form-fields input:focus,
.public-event-form-fields select:focus,
.public-event-form-fields textarea:focus,
.public-event-url-box input:focus,
.public-event-candidate-field select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(47, 123, 244, 0.11);
}

.public-event-wide-field {
    grid-column: 1 / -1;
}

.public-event-checkbox {
    display: flex !important;
    align-items: center;
    align-self: end;
    height: 39px;
    padding: 0 10px;
    border: 1px solid #d8dfe8;
    border-radius: 10px;
    background: #fff;
}

.public-event-checkbox input {
    width: 18px;
    height: 18px;
    margin: 0 7px 0 0;
    accent-color: var(--accent);
}

.public-event-import-actions {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #dfe5ed;
    background: #fff;
}

.public-event-import-actions button {
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: #4c5c73;
    font-size: 0.68rem;
    font-weight: 850;
    cursor: pointer;
}

.public-event-import-actions button.primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.public-event-import-actions button:disabled,
.public-event-url-box button:disabled {
    opacity: 0.48;
    cursor: wait;
}

.public-event-sheet {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 0;
    background: #fff;
}

.public-event-sheet > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 56px;
    padding: 9px 14px 9px 16px;
    border-bottom: 1px solid #dfe5ed;
}

.public-event-sheet > header > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.public-event-sheet > header strong {
    font-size: 0.8rem;
}

.public-event-sheet > header span {
    padding: 3px 8px;
    border-radius: 999px;
    background: #e9f1ff;
    color: #2d6cc6;
    font-size: 0.58rem;
    font-weight: 850;
}

.public-event-sheet-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    min-width: 0;
}

.public-event-sheet-tools button {
    height: 36px;
    padding: 0 11px;
    border: 1px solid #d8dfe8;
    border-radius: 9px;
    background: #fff;
    color: #526178;
    font-size: 0.62rem;
    font-weight: 850;
    white-space: nowrap;
    cursor: pointer;
}

.public-event-sheet-tools button.primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.public-event-sheet-tools button:disabled {
    opacity: 0.42;
    cursor: default;
}

.public-event-sheet-tools input {
    width: min(230px, 40%);
    height: 36px;
    padding: 0 10px;
    border: 1px solid #d8dfe8;
    border-radius: 10px;
    outline: none;
    font: inherit;
    font-size: 0.67rem;
}

.public-event-sheet-scroll {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
}

.public-event-sheet table {
    min-width: 2700px;
    border-collapse: separate;
    border-spacing: 0;
    color: #26364a;
    font-size: 0.62rem;
    font-variant-numeric: tabular-nums;
}

.public-event-sheet th,
.public-event-sheet td {
    max-width: 260px;
    height: 36px;
    padding: 6px 9px;
    overflow: hidden;
    border-right: 1px solid #e7ebf0;
    border-bottom: 1px solid #e7ebf0;
    background: #fff;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.public-event-sheet td[contenteditable="false"] {
    cursor: cell;
    outline: none;
}

.public-event-sheet td[contenteditable="false"]:focus {
    outline: none;
}

.public-event-sheet td[contenteditable="plaintext-only"],
.public-event-sheet td.is-editing {
    cursor: text;
    outline: none;
}

.public-event-sheet td[contenteditable="plaintext-only"]:focus,
.public-event-sheet td.is-editing:focus {
    position: relative;
    z-index: 2;
    overflow: visible;
    background: #fff !important;
    box-shadow: inset 0 0 0 2px var(--accent);
    text-overflow: clip;
}

.public-event-sheet table.is-range-selecting,
.public-event-sheet table.is-range-selecting td {
    cursor: cell;
    user-select: none;
}

.public-event-sheet td.is-range-selected {
    position: relative;
    background: #dcecff !important;
    box-shadow: inset 0 0 0 1px #70a9ef;
}

.public-event-sheet td.is-range-anchor {
    z-index: 2;
    box-shadow: inset 0 0 0 2px var(--accent);
}

.public-event-sheet td.is-editing {
    background: #fff !important;
    box-shadow: inset 0 0 0 2px var(--accent);
    user-select: text;
}

.public-event-sheet td.is-dirty {
    background: #fff4c2 !important;
    box-shadow: inset 0 -2px #e6a600;
}

.public-event-sheet table.is-saving {
    pointer-events: none;
    opacity: 0.68;
}

.public-event-sheet th {
    position: sticky;
    top: 0;
    z-index: 3;
    height: 38px;
    background: #eef3f9;
    color: #526178;
    font-weight: 900;
}

.public-event-sheet [data-column="__row_number"] {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 54px;
    min-width: 54px;
    max-width: 54px;
    background: #eef3f9 !important;
    color: #627187;
    text-align: center;
    font-weight: 850;
    cursor: default;
    user-select: none;
}

.public-event-sheet th[data-column="__row_number"] {
    z-index: 4;
}

.public-event-select-all {
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    cursor: pointer;
}

.public-event-select-all:hover,
.public-event-select-all:focus-visible {
    outline: none;
    background: #dbe7f5;
}

.public-event-select-all.is-selected {
    background: var(--accent);
    color: #fff;
}

.public-event-sheet [data-column="source_url"] {
    width: 320px;
    min-width: 320px;
}

.public-event-sheet [data-column="title"] {
    width: 250px;
    min-width: 250px;
}

.public-event-sheet [data-column="event_id"] {
    width: 240px;
    min-width: 240px;
}

.public-event-sheet tr:nth-child(even) td {
    background: #fafbfd;
}

.public-event-sheet tr.is-selected td {
    background: #eaf3ff !important;
}

.public-event-sheet tr.is-selected [data-column="__row_number"] {
    background: var(--accent) !important;
    color: #fff;
}

.public-event-sheet tr.is-inactive td {
    color: #8b95a3;
    background: #f3f4f6;
}

@media (max-width: 900px) {
    .public-event-admin-dialog {
        width: calc(100vw - 12px);
        height: calc(100dvh - 12px);
        border-radius: 18px;
    }

    .public-event-admin-workspace {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(360px, 52%) minmax(0, 1fr);
    }

    .public-event-import-form {
        border-right: 0;
        border-bottom: 1px solid #dfe5ed;
    }

    .public-event-admin-header h2 {
        font-size: 0.92rem;
    }
}

.map-stage {
    position: absolute;
    inset: 0;
    isolation: isolate;
    min-width: 0;
    min-height: 0;
    background: #dfe5eb;
}

.map-canvas {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    overflow: hidden;
}

.map-canvas:not(.is-active) {
    visibility: hidden;
    pointer-events: none;
}

.map-scale-indicator {
    position: absolute;
    z-index: 700;
    right: 18px;
    bottom: 18px;
    display: grid;
    justify-items: center;
    gap: 3px;
    width: 86px;
    padding: 7px 8px 6px;
    border: 1px solid rgba(26, 49, 79, 0.13);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 20px rgba(28, 45, 68, 0.13);
    color: #35445a;
    pointer-events: none;
    backdrop-filter: blur(8px);
}

.map-scale-line {
    width: 70px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    border-left: 2px solid currentColor;
}

.map-scale-indicator strong {
    font-size: 0.66rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.map-workspace.is-layer-sheet-open .map-scale-indicator {
    right: 394px;
}

.map-workspace.is-layer-sheet-open .map-action {
    right: 394px;
}

.map-workspace.is-layer-sheet-collapsed .map-action {
    top: 86px;
}

.map-action {
    position: absolute;
    z-index: 700;
    top: 18px;
    right: 18px;
    height: 40px;
    padding: 0 15px;
    border: 1px solid rgba(26, 49, 79, 0.13);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(28, 45, 68, 0.14);
    color: #35445a;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
}

.map-action:disabled {
    opacity: 0.45;
    cursor: default;
}

.mlit-junction-layer-action {
    top: 68px;
}

.junction-layer-action.is-active {
    border-color: #ea8618;
    background: #ea8618;
    color: white;
}

.mlit-junction-layer-action.is-active {
    border-color: #18794e;
    background: #18794e;
    color: white;
}

.area-search-action {
    position: absolute;
    z-index: 710;
    top: 18px;
    left: 50%;
    height: 40px;
    padding: 0 17px;
    border: 1px solid rgba(26, 49, 79, 0.14);
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(28, 45, 68, 0.18);
    color: #23344c;
    font-size: 0.74rem;
    font-weight: 750;
    cursor: pointer;
    transform: translateX(-50%);
}

.area-search-action:hover,
.area-search-action:focus-visible {
    border-color: rgba(47, 123, 244, 0.5);
    outline: none;
    color: var(--accent);
}

.area-search-action[hidden] {
    display: none !important;
}

.data-attribution {
    position: absolute;
    z-index: 710;
    right: 10px;
    bottom: 8px;
    padding: 5px 8px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 3px 12px rgba(28, 45, 68, 0.12);
    color: #536179;
    font-size: 0.62rem;
    font-weight: 700;
    text-decoration: none;
}

.data-attribution:hover,
.data-attribution:focus-visible {
    color: var(--accent-dark);
    text-decoration: underline;
}

.data-attribution[hidden] {
    display: none !important;
}

.mlit-attribution {
    bottom: 38px;
}

.oneway-attribution {
    bottom: 68px;
}

.oneway-debug-panel {
    position: absolute;
    z-index: 720;
    top: 72px;
    left: 50%;
    display: grid;
    gap: 10px;
    width: min(520px, calc(100% - 64px));
    max-height: min(54vh, 560px);
    padding: 15px;
    overflow: auto;
    border: 1px solid rgba(26, 49, 79, 0.17);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 14px 42px rgba(28, 45, 68, 0.2);
    color: #263850;
    transform: translateX(-50%);
    backdrop-filter: blur(12px);
}

.oneway-debug-panel[hidden] {
    display: none !important;
}

.oneway-debug-panel header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.oneway-debug-panel header div {
    display: grid;
    gap: 3px;
}

.oneway-debug-panel header strong {
    font-size: 0.84rem;
}

.oneway-debug-panel header span,
.oneway-debug-panel > p {
    color: #67758a;
    font-size: 0.68rem;
    line-height: 1.5;
}

.oneway-debug-panel > p {
    margin: 0;
}

.oneway-debug-panel header button {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #f5f7fa;
    color: #425269;
    font-size: 1rem;
    cursor: pointer;
}

.oneway-debug-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 8px 9px;
    border-radius: 10px;
    background: #f4f6f9;
    color: #526177;
    font-size: 0.62rem;
    font-weight: 750;
}

.oneway-debug-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.oneway-debug-legend i {
    width: 18px;
    height: 4px;
    border-radius: 999px;
}

.oneway-color-explicit { background: #e23d35; }
.oneway-color-link { background: #e88724; }
.oneway-color-service { background: #8b55d9; }
.oneway-color-other { background: #159c9c; }

.oneway-debug-details {
    display: grid;
    gap: 8px;
}

.oneway-debug-details[hidden] {
    display: none !important;
}

.oneway-debug-details > strong {
    font-size: 0.76rem;
    overflow-wrap: anywhere;
}

.oneway-debug-details dl {
    display: grid;
    grid-template-columns: minmax(92px, 0.42fr) minmax(0, 1fr);
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    font: 0.68rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.oneway-debug-details dt,
.oneway-debug-details dd {
    margin: 0;
    padding: 6px 8px;
    border-bottom: 1px solid #e8ecf1;
    overflow-wrap: anywhere;
}

.oneway-debug-details dt {
    background: #f5f7fa;
    color: #44536a;
    font-weight: 750;
}

.oneway-debug-details dd {
    color: #17263a;
}

.empty-state {
    position: absolute;
    z-index: 650;
    top: 50%;
    left: 50%;
    display: grid;
    gap: 8px;
    width: min(88%, 390px);
    padding: 22px;
    border: 1px solid rgba(23, 46, 73, 0.1);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(35, 53, 75, 0.14);
    text-align: center;
    transform: translate(-50%, -50%);
}

.empty-state[hidden] {
    display: none !important;
}

.empty-state strong {
    font-size: 0.92rem;
}

.empty-state span {
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.65;
}

.pin-popup {
    display: grid;
    gap: 6px;
    padding: 2px 2px 4px;
}

.pin-popup strong {
    color: var(--ink);
    font-size: 0.93rem;
}

.pin-popup p {
    margin: 0;
    color: #5f6c7f;
    font-size: 0.76rem;
    line-height: 1.55;
}

.pin-popup small {
    color: #929baa;
    font-size: 0.66rem;
}

.popup-color {
    justify-self: start;
    padding: 3px 7px;
    border-radius: 999px;
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
}

.popup-yellow { background: #c69612; }
.popup-red { background: #d94a4a; }
.popup-blue { background: #3978df; }
.popup-green { background: #26965a; }
.popup-highway { background: #168552; }

@media (max-width: 760px) {
    .browser-template-dialog {
        width: calc(100vw - 12px);
        height: calc(100dvh - 12px);
        border-radius: 18px;
    }

    .browser-template-workspace {
        grid-template-columns: 150px minmax(0, 1fr);
    }

    .browser-template-sidebar-actions {
        align-items: stretch;
        flex-direction: column;
        gap: 6px;
    }

    .browser-template-fields {
        grid-template-columns: minmax(0, 1fr);
        padding: 14px;
    }

    .browser-template-wide-field {
        grid-column: auto;
    }

    .browser-template-actions {
        grid-template-columns: 1fr 1fr;
    }

    .browser-template-actions > span {
        display: none;
    }

    .app-shell {
        grid-template-rows: 66px minmax(0, 1fr);
    }

    .app-header {
        padding: 0 12px;
    }

    .brand-lockup h1 {
        font-size: 1.1rem;
    }

    .brand-lockup .eyebrow,
    .sync-status,
    .account-summary {
        display: none;
    }

    .logout-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }

    .map-workspace {
        display: block;
    }

    .left-panel-stack {
        top: auto;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        left: 10px;
        width: auto;
        height: min(58vh, 520px);
        height: min(58dvh, 520px);
    }

    .favorites-panel {
        width: 100%;
        max-height: none;
        border-radius: 19px;
        box-shadow: 0 14px 38px rgba(33, 53, 78, 0.2);
    }

    .favorites-panel.is-empty {
        flex: 0 0 auto;
    }

    .favorites-panel.is-collapsed,
    .favorites-panel.is-empty.is-collapsed {
        flex: 0 0 54px;
        width: 100%;
        max-width: 100%;
        max-height: none;
    }

    .account-panel {
        min-height: 165px;
        border-radius: 19px;
    }

    .favorite-layer-sheet {
        top: 10px;
        right: 10px;
        bottom: auto;
        width: min(360px, calc(100vw - 20px));
        height: min(62vh, 520px);
        height: min(62dvh, 520px);
        border-radius: 19px;
    }

    .favorite-layer-sheet.is-collapsed {
        width: 218px;
        height: auto;
    }

    .panel-controls {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        padding: 11px 12px 7px;
    }

    .osm-junction-launch-row {
        grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
        margin: 0;
    }

    .osm-junction-launch-row button {
        width: auto;
        padding: 0 7px;
    }

    .filter-row {
        gap: 6px;
        margin: 0;
    }

    .layer-launch-row {
        margin: 0;
    }

    .layer-launch-row button {
        width: 44px;
        padding: 0;
        font-size: 0;
    }

    .layer-launch-row button span {
        font-size: 1rem;
    }

    .map-provider-switch {
        width: 118px;
        margin: 0;
    }

    .filter-dot {
        width: 25px;
        height: 25px;
    }

    .panel-summary {
        padding: 0 14px 5px;
    }

    .favorites-list {
        padding: 0 8px calc(14px + env(safe-area-inset-bottom));
    }

    .favorite-row {
        min-height: 60px;
    }

    .map-action {
        top: 12px;
        right: 12px;
    }

    .map-scale-indicator {
        top: 62px;
        right: 12px;
        bottom: auto;
    }

    .map-workspace.is-layer-sheet-open .map-scale-indicator {
        right: 12px;
    }

    .map-workspace.is-layer-sheet-open .map-action {
        top: calc(min(62dvh, 520px) + 20px);
        right: 12px;
    }

    .map-workspace.is-layer-sheet-collapsed .map-action {
        top: 80px;
    }


    .area-search-action {
        top: 12px;
    }

}

@media (max-width: 480px) {
    .login-layout {
        padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
    }

    .login-card {
        padding: 34px 24px;
        border-radius: 24px;
    }

    .login-card .brand-mark {
        margin-bottom: 18px;
    }

    .header-actions {
        gap: 6px;
    }

    .panel-controls {
        grid-template-columns: 1fr;
    }

    .osm-junction-launch-row button {
        width: 100%;
    }

    .oneway-debug-panel {
        top: 64px;
        width: calc(100% - 24px);
        max-height: 48dvh;
        padding: 12px;
    }

    .layer-launch-row button {
        width: 100%;
        font-size: 0.73rem;
    }

    .map-provider-switch {
        width: auto;
    }

    .filter-row {
        justify-content: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
