@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* ============================================================
   Design tokens
   ============================================================ */
:root {
    --color-green: #00a01e;
    --color-green-dark: #006e1e;
    --color-green-light: #e8f8eb;
    --color-red: #dc3545;
    --color-red-light: #fdedef;
    --color-yellow: #f59e0b;
    --color-orange: #f59e0b;
    --color-orange-dark: #b45309;
    --color-orange-light: #fef3c7;
    --color-text: #1a1a1a;
    --color-text-secondary: #64748b;
    --color-border: #e2e8f0;
    --color-surface: rgba(255, 255, 255, 0.88);
    --color-surface-solid: #ffffff;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.14), 0 4px 12px rgba(0, 0, 0, 0.08);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 100px;

    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: 180ms ease;
}

/* ============================================================
   Base
   ============================================================ */
html, body {
    font-family: var(--font);
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* box-sizing scoped — exclude OpenLayers internals */
/* All floating UI components use border-box. New components inheriting the
   `floating-` prefix are picked up automatically — no need to extend the list. */
[class^="floating-"],
[class*=" floating-"],
.top-gradient {
    box-sizing: border-box;
}
[class^="floating-"] *,
[class*=" floating-"] * {
    box-sizing: border-box;
}

/* ============================================================
   Map — fullscreen canvas
   ============================================================ */
.map-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* Subtle top gradient so floating UI is readable over any map tile */
.top-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.08) 0%, transparent 100%);
    z-index: 2;
    pointer-events: none;
}

/* ============================================================
   Floating: Brand pill (top-left)
   ============================================================ */
.floating-brand {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 1500;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 8px 16px 8px 10px;
    height: 40px;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-md);
    pointer-events: none;
    user-select: none;
}

.floating-brand img {
    height: 24px;
    width: 24px;
}

.floating-brand span {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.01em;
    color: var(--color-text);
    white-space: nowrap;
}


/* ============================================================
   Floating: Controls panel (top center)
   ============================================================ */
.floating-controls {
    position: absolute;
    top: 16px;
    left: 50%;
    z-index: 1500;
    display: flex;
    width: fit-content;
    align-items: center;
    background: var(--color-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-md);
    overflow: visible;
    padding: 4px;
    height: 40px;
    white-space: nowrap;
    transform: translateX(-50%);
    transition: width 0.25s ease;
}

@keyframes pill-slide-in {
    from {
        opacity: 0;
        transform: translate(-50%, -16px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.floating-controls--slidein {
    animation: pill-slide-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.control-group {
    padding: 2px 4px;
    display: flex;
    align-items: center;
    min-width: 0;
    position: relative;
}

/* Subtle highlight on the pill when an inner control has focus */
.floating-controls:focus-within {
    box-shadow: var(--shadow-md), 0 0 0 2px rgba(0, 160, 30, 0.25);
}


.control-group--search {
    transition: opacity var(--transition);
}

.control-group--search.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

/* Slide-in animation for address field */
.control-divider--animated {
    animation: fade-in 0.25s ease;
}

.control-group--animated {
    animation: slide-in-right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.control-divider {
    width: 1px;
    height: 20px;
    background: var(--color-border);
    flex-shrink: 0;
    margin: 0 2px;
}

/* Compact summary mode */
.floating-controls--compact {
    cursor: pointer;
    gap: 10px;
    padding: 8px 16px;
    height: 40px;
    transition: all var(--transition);
    animation: compact-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 1;
}

.floating-controls--compact:hover {
    background: var(--color-surface-solid);
    box-shadow: var(--shadow-lg);
}

.compact-school {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-green-dark);
    white-space: nowrap;
}

.compact-arrow {
    width: 16px;
    height: 16px;
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.compact-address {
    font-size: 14px;
    font-weight: 500;
    color: #1565c0;
    white-space: nowrap;
}

.compact-edit {
    width: 14px;
    height: 14px;
    color: var(--color-text-secondary);
    flex-shrink: 0;
    margin-left: 4px;
    opacity: 0;
    transition: opacity var(--transition);
}

.floating-controls--compact:hover .compact-edit {
    opacity: 1;
}

.control-select {
    height: 32px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    padding: 0 24px 0 10px;
    width: 120px;
    font-size: 14px;
    font-family: var(--font);
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
    transition: background-color var(--transition), width 0.25s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
}

.control-select:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.control-select:focus {
    outline: none;
    border-color: transparent;
    background-color: transparent;
}

.control-select.has-value {
    background-color: rgba(0, 160, 30, 0.07);
    color: var(--color-text);
    font-weight: 500;
}

.control-select option {
    background-color: var(--color-surface-solid);
    color: var(--color-text);
    font-weight: 400;
}

.control-input.has-value {
    background-color: rgba(0, 160, 30, 0.07);
    font-weight: 500;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-icon {
    position: absolute;
    left: 10px;
    width: 15px;
    height: 15px;
    color: #94a3b8;
    pointer-events: none;
    flex-shrink: 0;
}

.control-input {
    width: 150px;
    height: 32px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    padding: 0 32px 0 32px;
    font-size: 14px;
    font-family: var(--font);
    color: var(--color-text);
    background: transparent;
    transition: background-color var(--transition);
}

.control-input::placeholder {
    color: #94a3b8;
}

.control-input:hover:not(:disabled) {
    background-color: rgba(0, 0, 0, 0.04);
}

.control-input:focus {
    outline: none;
    border-color: transparent;
    background-color: transparent;
}

.control-input:disabled {
    cursor: not-allowed;
}

.input-clear {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    padding: 0;
    transition: all var(--transition);
}

.input-clear svg {
    width: 14px;
    height: 14px;
}

.input-clear.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.input-clear:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--color-text);
}

/* === Search results dropdown === */
.search-results {
    position: fixed;
    top: 64px;
    left: 50%;
    transform: translateX(-50%);
    width: 320px;
    background: var(--color-surface-solid);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    max-height: calc(100vh - 64px - 48px);
    overflow-y: auto;
    z-index: 2000;
    border: 1px solid var(--color-border);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease;
}

.search-results.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.search-result-group-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    padding: 8px 14px 4px;
    border-bottom: 1px solid #f1f5f9;
}

.search-result-group-header:not(:first-child) {
    border-top: 1px solid var(--color-border);
    margin-top: 2px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border: none;
    background: none;
    font-size: 14px;
    font-family: var(--font);
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    color: var(--color-text);
    transition: background 100ms ease;
}

.result-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--color-text-secondary);
}

.search-result-item:hover {
    background: #f8fafc;
}

.search-result-item:hover .result-icon {
    color: var(--color-green);
}

.search-result-item.active {
    background: var(--color-green);
    color: #fff;
}

.search-result-item.active .result-icon {
    color: #fff;
}

.search-result-item:last-child {
    border-bottom: none;
}

/* ============================================================
   Floating: Legend (bottom-left)
   ============================================================ */
.floating-legend {
    position: absolute;
    bottom: 48px;
    left: 16px;
    z-index: 1500;
    background: var(--color-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    box-shadow: var(--shadow-md);
    animation: fade-up 0.25s ease;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--color-text);
}

.legend-swatch {
    display: inline-block;
    flex-shrink: 0;
}

.legend-swatch--zone {
    width: 20px;
    height: 14px;
    background: rgba(255, 0, 0, 0.2);
    border: 2px solid #CC0000;
    border-radius: 3px;
}

.legend-marker {
    height: 24px;
    width: auto;
}

/* ============================================================
   Copyright + Scale bar (bottom-left)
   ============================================================ */
.map-copyright {
    position: absolute;
    bottom: 6px;
    left: 16px;
    z-index: 1500;
    font-size: 10px;
    color: rgba(0, 0, 0, 0.4);
    font-family: var(--font);
    pointer-events: none;
    user-select: none;
}
.ol-scale-line {
    bottom: 24px !important;
    left: 16px !important;
    right: auto !important;
    top: auto !important;
    background: none !important;
    padding: 0 !important;
}

.ol-scale-line-inner {
    border: 1.5px solid rgba(0, 0, 0, 0.35) !important;
    border-top: none !important;
    color: rgba(0, 0, 0, 0.5) !important;
    background: none !important;
    font-size: 10px !important;
    font-family: var(--font) !important;
    text-align: center;
    padding: 1px 4px 0 !important;
    min-width: 80px;
    -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 60%, transparent 100%);
    mask-image: linear-gradient(to right, rgba(0,0,0,1) 60%, transparent 100%);
}

/* ============================================================
   Floating: Info card (welcome)
   ============================================================ */
.floating-info-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1400;
    background: rgba(0, 0, 0, 0.12);
    animation: backdrop-in 0.3s ease;
}

.floating-info {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1500;
    background: var(--color-surface-solid);
    border-radius: var(--radius-lg);
    padding: 32px 36px;
    max-width: 420px;
    width: calc(100% - 32px);
    box-shadow: var(--shadow-lg);
    animation: modal-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.info-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-green-dark);
    background: var(--color-green-light);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    margin-bottom: 16px;
}

.floating-info h2 {
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--color-text);
}

.floating-info p {
    font-size: 14px;
    line-height: 1.65;
    color: var(--color-text-secondary);
    margin: 0 0 24px;
}

.info-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.info-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-green);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.step-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 4px;
}

.step-text strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

.step-text span {
    font-size: 13px;
    color: var(--color-text-secondary);
}

/* School select inside the welcome card (step 1) */
.welcome-select {
    margin-top: 6px;
    width: 100%;
    height: 38px;
    padding: 0 36px 0 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    color: var(--color-text);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.welcome-select:hover {
    border-color: var(--color-green);
}

.welcome-select:focus {
    outline: none;
    border-color: var(--color-green);
    box-shadow: 0 0 0 3px rgba(0, 160, 30, 0.18);
}

.info-step--active .step-text {
    flex: 1;
    padding-top: 0;
}

.info-step--active .step-text strong {
    margin-bottom: 2px;
}

.info-footer {
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.info-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

.info-link:hover {
    color: var(--color-green);
}

.info-link-icon {
    width: 15px;
    height: 15px;
}

/* Folkhögskola — orange manual-handling modal */
.floating-info--folkhogskola {
    border-top: 4px solid var(--color-orange);
    text-align: center;
}

.info-badge--warning {
    color: var(--color-orange-dark);
    background: var(--color-orange-light);
}

.floating-info--folkhogskola h2 {
    color: var(--color-text);
}

.floating-info--folkhogskola a {
    color: var(--color-orange-dark);
    font-weight: 600;
}

.folkhogskola-address {
    font-size: 14px;
    line-height: 1.65;
    color: var(--color-text-secondary);
    margin: 0 0 24px;
}

.info-footer--actions {
    border-top: none;
    padding-top: 8px;
    display: flex;
    justify-content: center;
}

.folkhogskola-ok {
    background: var(--color-green);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 32px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.folkhogskola-ok:hover {
    background: var(--color-green-dark);
}

/* ============================================================
   Floating: Result toasts
   ============================================================ */
.floating-toast {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1500;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-width: 480px;
    width: calc(100% - 32px);
    animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.toast-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.toast-badge svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
}

.toast-badge--negative {
    background: rgba(255, 255, 255, 0.15);
}

.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-body strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}

.toast-detail {
    display: block;
    font-size: 13px;
    line-height: 1.5;
    opacity: 0.88;
}

.toast-detail a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.toast-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 7px 14px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--transition);
}

.toast-action svg {
    width: 14px;
    height: 14px;
}

.toast-action:hover {
    background: rgba(255, 255, 255, 0.3);
}

.floating-toast.eligible {
    background: rgba(0, 140, 20, 0.92);
    color: #fff;
}

.floating-toast.not-eligible {
    background: rgba(200, 40, 55, 0.92);
    color: #fff;
}

.floating-toast.checking {
    background: var(--color-surface);
    backdrop-filter: blur(16px);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    gap: 10px;
    align-items: center;
    font-size: 14px;
}

.floating-toast.error {
    background: rgba(245, 158, 11, 0.94);
    color: var(--color-text);
    gap: 10px;
    align-items: center;
    font-size: 14px;
}

.toast-error-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
    transition: all var(--transition);
}

.toast-close svg {
    width: 16px;
    height: 16px;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid var(--color-border);
    border-top-color: var(--color-green);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ============================================================
   Zoom controls (bottom-right)
   ============================================================ */
.ol-zoom-right {
    bottom: 16px;
    right: 16px;
    left: auto !important;
    top: auto !important;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none !important;
    padding: 0 !important;
}

/* North arrow / compass (shows on rotation) */
.ol-rotate {
    right: 16px !important;
    bottom: 110px !important;
    left: auto !important;
    top: auto !important;
    background: none !important;
    padding: 0 !important;
}

.ol-rotate button {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--color-surface) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none !important;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    font-size: 20px;
    color: var(--color-text) !important;
    transition: all var(--transition);
}

.ol-rotate button:hover {
    background: var(--color-surface-solid) !important;
    transform: scale(1.04);
}

.ol-zoom-right button {
    width: 40px;
    height: 40px;
    font-size: 20px;
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all var(--transition);
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ol-zoom-right button:hover {
    background: var(--color-surface-solid);
    box-shadow: var(--shadow-md);
    transform: scale(1.04);
}

.ol-zoom-right button:active {
    transform: scale(0.96);
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(16px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes modal-in {
    from { opacity: 0; transform: translate(-50%, -46%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes backdrop-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes dropdown-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes slide-in-right {
    from { opacity: 0; max-width: 0; padding: 0; overflow: hidden; }
    to   { opacity: 1; max-width: 300px; padding: 4px 8px; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes compact-in {
    from { opacity: 0; transform: translateX(-50%) scale(0.95); }
    to   { opacity: 1; transform: translateX(-50%) scale(1); }
}

/* ============================================================
   Responsive — mobile
   ============================================================ */
@media (max-width: 640px) {
    .floating-brand {
        top: 12px;
        left: 12px;
        padding: 6px 12px 6px 8px;
    }

    /* On mobile the controls wrapper is just a transparent stack —
       each .control-group becomes its own pill so school and address
       read as two separate inputs. */
    .floating-controls {
        top: 56px;
        bottom: auto;
        left: 12px;
        right: 12px;
        transform: none;
        min-width: auto;
        flex-direction: column;
        align-items: stretch;
        height: auto;
        padding: 0;
        gap: 8px;
        white-space: normal;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
        border-radius: 0;
    }

    .floating-controls:focus-within {
        box-shadow: none;
    }

    .floating-controls .control-group {
        width: 100%;
        height: 40px;
        padding: 4px 8px;
        background: var(--color-surface);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-radius: var(--radius-pill);
        box-shadow: var(--shadow-md);
    }

    .floating-controls .control-divider {
        display: none;
    }

    .search-input-wrapper {
        width: 100%;
    }

    .control-select,
    .control-input {
        width: 100%;
    }

    /* Compact summary keeps the single-pill look */
    .floating-controls--compact {
        flex-direction: row;
        align-items: center;
        height: auto;
        padding: 10px 16px;
        background: var(--color-surface);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        box-shadow: var(--shadow-md);
        border-radius: var(--radius-pill);
    }

    /* Pill stack reaches: brand row (~52) + 56px offset shift gone —
       brand at top:12, controls at top:56. Two 40px pills with 8px gap
       end at 56 + 40 + 8 + 40 = 144. Dropdown sits 8px below. */
    .search-results {
        top: 152px;
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
        transform: none;
        max-height: calc(100vh - 152px - 24px);
    }

    .floating-legend {
        bottom: 12px;
        left: 12px;
        right: auto;
    }

    .floating-info {
        max-width: calc(100% - 24px);
        padding: 24px;
    }

    .floating-info h2 {
        font-size: 19px;
    }

    .floating-toast {
        left: 12px;
        right: 12px;
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
        width: auto;
        max-width: none;
    }

    @keyframes toast-in {
        from { opacity: 0; transform: translateY(calc(-50% + 12px)); }
        to   { opacity: 1; transform: translateY(-50%); }
    }
}

/* ============================================================
   Blazor error UI & admin spinner
   ============================================================ */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 9999;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

#cover-spin {
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 9999;
    display: none;
}
