*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --bg: #0f1115;
    --surface: #171a20;
    --surface-raised: #20242c;
    --surface-soft: #242018;
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.15);
    --text: #f5f7fa;
    --muted: #9aa3af;
    --faint: #69727f;
    --accent: #2f80ed;
    --accent-strong: #1f6fd1;
    --warm: #f4b740;
    --good: #20b486;
    --danger: #ef5b5b;
    --radius: 8px;
    --shadow-lg: 0 26px 80px rgba(0, 0, 0, 0.45);
}

body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    overflow: hidden;
    font-size: 14px;
}

.app-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

/* ===== Upload Screen ===== */
.upload-screen {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background:
        linear-gradient(115deg, rgba(15, 17, 21, 0.96), rgba(20, 23, 29, 0.92)),
        url("/static/labeltest.png") center / cover;
    z-index: 2000;
    padding: 36px;
}

.upload-shell {
    width: min(1080px, 100%);
    min-height: min(660px, calc(100vh - 72px));
    display: grid;
    grid-template-columns: minmax(320px, 0.86fr) minmax(360px, 1fr);
    gap: 28px;
    align-items: stretch;
}

.upload-panel,
.upload-preview {
    border: 1px solid var(--line);
    background: rgba(20, 23, 29, 0.86);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
}

.upload-panel {
    padding: clamp(28px, 4vw, 52px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-radius: 8px;
}

.upload-kicker {
    color: var(--warm);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
    text-transform: uppercase;
}

.upload-panel h1 {
    margin: 0 0 12px;
    color: var(--text);
    font-size: clamp(2.4rem, 6vw, 5.4rem);
    font-weight: 700;
    line-height: 0.9;
}

.upload-panel p {
    max-width: 430px;
    margin: 0 0 26px;
    color: #c8d0da;
    font-size: 1rem;
    line-height: 1.6;
}

.drop-zone {
    position: relative;
    display: grid;
    gap: 8px;
    place-items: center;
    min-height: 190px;
    padding: 24px;
    border: 1px dashed rgba(244, 183, 64, 0.48);
    background: linear-gradient(180deg, rgba(244, 183, 64, 0.1), rgba(255, 255, 255, 0.03));
    color: var(--text);
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
    transform: translateY(-2px);
    border-color: var(--warm);
    background: linear-gradient(180deg, rgba(244, 183, 64, 0.16), rgba(47, 128, 237, 0.08));
}

.drop-zone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.drop-zone-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(244, 183, 64, 0.16);
    color: var(--warm);
    font-size: 1.4rem;
}

.drop-zone-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.drop-zone-subtitle {
    color: var(--muted);
    font-size: 0.84rem;
}

.upload-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.upload-status {
    min-height: 20px;
    margin-top: 16px;
    color: var(--muted);
    font-size: 0.86rem;
}

.upload-preview {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    border-radius: 8px;
    overflow: hidden;
}

.upload-preview-frame {
    overflow: hidden;
    border-radius: 6px;
    background: white;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
    transform: rotate(-1deg);
}

.upload-preview-frame img {
    display: block;
    width: 100%;
    height: auto;
}

.upload-preview-meta {
    margin-top: 18px;
    display: grid;
    gap: 4px;
}

.upload-preview-meta span {
    color: var(--warm);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.upload-preview-meta strong {
    color: var(--text);
    font-size: 1.05rem;
}

.file-input-wrapper.icon-btn {
    margin-left: auto;
}

/* ===== Editor Layout ===== */
.editor-interface {
    display: flex;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Sidebar */
.sidebar-panel {
    width: 410px;
    min-width: 360px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(24, 27, 33, 0.96);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand-lockup .logo {
    font-size: 1.25rem;
}

.brand-lockup h1 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.brand-lockup span:not(.logo) {
    display: block;
    margin-top: 2px;
    color: var(--faint);
    font-size: 0.72rem;
}

.header-actions,
.history-actions,
.preview-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-content::-webkit-scrollbar {
    width: 4px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

/* Status bar */
.status-bar {
    padding: 0;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-height: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface);
}

.status-bar.info {
    padding: 12px 16px;
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.status-bar.success {
    padding: 12px 16px;
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-bar.warning {
    padding: 12px 16px;
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-bar.error {
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Sections */
.section {
    background: rgba(255, 255, 255, 0.035);
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

h2 {
    font-size: 0.75rem;
    margin: 0 0 10px;
    color: #c0c7d1;
    font-weight: 600;
    letter-spacing: 0.3px;
}

label {
    display: block;
    margin-top: 8px;
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 3px;
    font-weight: 500;
}

input[type="text"],
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    background: rgba(7, 9, 12, 0.48);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: var(--radius);
    box-sizing: border-box;
    font-size: 0.85rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]::placeholder,
textarea::placeholder {
    color: #444;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
    border-color: rgba(47, 128, 237, 0.75);
    box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.14);
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 50px;
}

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

.form-grid.three-up {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.btn-chip {
    background: rgba(244, 183, 64, 0.1);
    color: #ffd77b;
    border: 1px solid rgba(244, 183, 64, 0.22);
    border-radius: 999px;
    padding: 5px 8px;
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
}

.btn-chip:hover {
    background: rgba(244, 183, 64, 0.16);
}

.input-warning {
    border-color: rgba(245, 158, 11, 0.9) !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16) !important;
}

.lit-transit-panel {
    border-color: rgba(244, 183, 64, 0.28);
    background: rgba(244, 183, 64, 0.055);
}

.lit-transit-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
    margin-top: 8px;
}

.lit-transit-summary {
    margin-top: 8px;
    color: #ffd77b;
    font-size: 0.72rem;
    line-height: 1.35;
    word-break: break-word;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: white;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    padding: 10px 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    font-family: inherit;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.24);
    transform: translateY(-1px);
}

.btn-accent {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    padding: 7px 14px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    margin-top: 8px;
    font-family: inherit;
}

.btn-accent:hover {
    background: rgba(59, 130, 246, 0.25);
}

.btn-ghost {
    background: transparent;
    color: #b3bdc9;
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    float: none;
    font-family: inherit;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ccc;
}

.btn-icon {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #888;
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

/* ===== Preview ===== */
.preview-container {
    flex: 1;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 30%),
        #101216;
    position: relative;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    overflow: hidden;
    padding: 68px 22px 22px;
}

.preview-toolbar {
    position: absolute;
    top: 14px;
    left: 22px;
    right: 22px;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(23, 26, 32, 0.9);
    backdrop-filter: blur(12px);
}

.preview-toolbar strong {
    display: block;
    color: var(--text);
    font-size: 0.88rem;
}

.preview-eyebrow {
    display: block;
    color: var(--warm);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mobile-mode-switch {
    display: none;
}

.preview-wrapper {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    overflow: hidden;
}

iframe {
    background-color: white;
    border: none;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    display: block;
}

.aztec-debug-panel {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 4400;
    display: none;
    width: min(520px, calc(100vw - 32px));
    max-height: 180px;
    overflow: auto;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(20, 23, 29, 0.96);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.36);
    color: #cbd5e1;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.72rem;
}

.aztec-debug-panel summary {
    cursor: pointer;
    color: #93c5fd;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.76rem;
    font-weight: 800;
    list-style-position: inside;
}

.aztec-debug-panel code {
    display: block;
    margin-top: 8px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

/* ===== Debug ===== */
#debuginfo {
    margin-top: 6px;
    font-size: 0.7rem;
    color: #555;
    word-break: break-all;
}

/* ===== Map Results ===== */
.map-results {
    max-height: 160px;
    overflow-y: auto;
    margin-top: 6px;
}

.map-result-item {
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.8rem;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.map-result-item:hover {
    background: rgba(59, 130, 246, 0.12);
}

.map-result-item strong {
    display: block;
    color: #ddd;
    font-size: 0.8rem;
    margin-bottom: 2px;
}

.map-result-item span {
    color: #777;
    font-size: 0.7rem;
}

/* Leaflet overrides for dark mode */
#mapContainer {
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.leaflet-control-attribution {
    font-size: 8px !important;
}

/* ===== Google Maps Style Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    z-index: 5000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gmap-modal {
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    width: 90vw;
    max-width: 1100px;
    height: 75vh;
    max-height: 700px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 32px 100px rgba(0, 0, 0, 0.7);
}

.gmap-topbar {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: #16162a;
}

.gmap-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gmap-search-row input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #1e1e38;
    color: #e0e0e0;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.gmap-search-row input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.gmap-search-btn,
.gmap-reload-btn {
    background: #3b82f6;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
}

.gmap-search-btn:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.gmap-reload-btn {
    background: #374151;
}

.gmap-reload-btn:hover {
    background: #4b5563;
    transform: scale(1.05);
}

.gmap-close-btn {
    background: transparent;
    border: none;
    color: #888;
    font-size: 1.6rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
}

.gmap-close-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

/* Split body */
.gmap-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.gmap-list-panel {
    width: 340px;
    min-width: 300px;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    background: #16162a;
}

.gmap-map-panel {
    flex: 1;
    position: relative;
}

.map-search-area-btn {
    position: absolute;
    top: 14px;
    left: 50%;
    z-index: 500;
    display: none;
    transform: translateX(-50%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(22, 22, 42, 0.94);
    color: #eef2ff;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 9px 13px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.36);
}

.map-search-area-btn.is-visible {
    display: block;
}

.map-search-area-btn:hover {
    background: rgba(37, 99, 235, 0.94);
}

.map-details-card {
    position: absolute;
    left: 16px;
    bottom: 16px;
    z-index: 520;
    width: min(360px, calc(100% - 32px));
    max-height: calc(100% - 84px);
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(22, 22, 42, 0.96);
    color: #e5e7eb;
    padding: 14px;
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.42);
}

.map-details-close {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    cursor: pointer;
    font-size: 1.1rem;
}

.map-details-title {
    padding-right: 32px;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.25;
}

.map-details-type {
    margin-top: 4px;
    color: #93c5fd;
    font-size: 0.72rem;
    text-transform: capitalize;
}

.map-details-address {
    margin-top: 10px;
    color: #cbd5e1;
    font-size: 0.82rem;
    line-height: 1.35;
}

.map-details-meta {
    display: grid;
    gap: 4px;
    margin-top: 10px;
    color: #9ca3af;
    font-size: 0.74rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.map-details-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.map-details-actions a,
.map-details-actions button {
    border: 1px solid rgba(96, 165, 250, 0.35);
    border-radius: 7px;
    background: rgba(59, 130, 246, 0.14);
    color: #bfdbfe;
    cursor: pointer;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 7px 9px;
    text-decoration: none;
}

.map-details-actions button {
    background: #2563eb;
    color: white;
}

.gmap-loading {
    padding: 20px;
    color: #60a5fa;
    font-size: 0.9rem;
    text-align: center;
}

.gmap-results {
    padding: 0;
}

.gmap-results-count {
    padding: 10px 16px;
    color: #888;
    font-size: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* Business list items */
.business-item {
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s;
    position: relative;
}

.business-item:hover,
.business-item.active {
    background: rgba(59, 130, 246, 0.08);
}

.business-item.active {
    border-left: 3px solid #3b82f6;
    padding-left: 13px;
}

.business-item .biz-index {
    position: absolute;
    top: 14px;
    right: 12px;
    background: #3b82f6;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.business-name {
    color: #e0e0e0;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 3px;
    padding-right: 30px;
}

.business-addr {
    color: #888;
    font-size: 0.78rem;
    line-height: 1.35;
}

.business-hours {
    color: #4ade80;
    font-size: 0.72rem;
    margin-top: 3px;
}

.business-contact {
    color: #60a5fa;
    font-size: 0.72rem;
    line-height: 1.35;
    margin-top: 3px;
    overflow-wrap: anywhere;
}

.business-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.business-chip {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: #a8b3cf;
    font-size: 0.66rem;
    line-height: 1;
    padding: 4px 7px;
}

.business-chip.is-complete {
    border-color: rgba(74, 222, 128, 0.28);
    color: #4ade80;
}

/* Leaflet overrides */
#modalMapContainer .leaflet-container {
    background: #1a1a2e;
}

.leaflet-control-attribution {
    font-size: 8px !important;
}

/* Custom numbered markers */
.numbered-marker {
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s;
}

.numbered-marker.highlight {
    background: #ef4444;
    transform: scale(1.3);
    z-index: 9999 !important;
}

/* ===== Opening Hours Filter Panel ===== */
.filter-panel {
    padding: 12px 16px;
    background: #1a1a2e;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.filter-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #999;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 0;
    color: #b0b0b0;
    font-size: 0.8rem;
    transition: color 0.2s;
}

.filter-checkbox:hover {
    color: #e0e0e0;
}

.filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #3b82f6;
    cursor: pointer;
}

.filter-custom {
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.filter-custom label {
    display: block;
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 6px;
}

.filter-control-row {
    display: grid;
    gap: 6px;
    margin-bottom: 10px;
}

.filter-control-row label {
    font-size: 0.75rem;
    color: #888;
}

.filter-control-row select {
    width: 100%;
    background: #1e1e38;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: inherit;
    outline: none;
}

.filter-control-row select:focus {
    border-color: #3b82f6;
}

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

.filter-time-row select,
.filter-time-row input[type="time"] {
    background: #1e1e38;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.filter-time-row select:focus,
.filter-time-row input[type="time"]:focus {
    border-color: #3b82f6;
}

.filter-time-row select {
    flex: 1;
    cursor: pointer;
}

.filter-time-row input[type="time"] {
    width: 100px;
}

.filter-time-row span {
    color: #666;
    font-size: 0.75rem;
}

/* Radius selector styles */
.filter-radius-row {
    display: flex;
    align-items: center;
}

.filter-radius-row select {
    background: #1e1e38;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    cursor: pointer;
}

.filter-radius-row select:focus {
    border-color: #3b82f6;
}

/* Location buttons hover effects */
.btn-filter-location {
    transition: all 0.2s ease;
}

.btn-filter-location:hover {
    opacity: 0.8;
}

.btn-filter-location:active {
    transform: scale(0.98);
}

.workspace-status {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 6px 0 10px;
    background: linear-gradient(180deg, var(--surface) 76%, rgba(23, 26, 32, 0));
}

.btn-history {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    background: rgba(47, 128, 237, 0.12);
    border: 1px solid rgba(47, 128, 237, 0.36);
    border-radius: var(--radius);
    color: #7eb4ff;
    cursor: pointer;
    font-size: 0.95rem;
    transition: opacity 0.2s, transform 0.2s, background 0.2s;
}

.btn-history:hover:not(:disabled) {
    background: rgba(47, 128, 237, 0.2);
    transform: translateY(-1px);
}

.btn-history:disabled {
    cursor: not-allowed;
}

.history-counter {
    min-width: 42px;
    color: var(--faint);
    font-size: 0.72rem;
    text-align: right;
}

.ban-suggestion-item:hover {
    background: rgba(47, 128, 237, 0.18) !important;
}

.ban-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 6200;
    max-height: 230px;
    margin-top: 4px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: #1e1e38;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.38);
}

.ban-suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.78rem;
}

.ban-suggestion-item:last-child {
    border-bottom: 0;
}

.ban-suggestion-main {
    color: #e5e7eb;
    line-height: 1.3;
}

.ban-suggestion-sub {
    margin-top: 3px;
    color: #8b95aa;
    font-size: 0.68rem;
    line-height: 1.25;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.drop-zone:focus-within {
    outline: 2px solid rgba(244, 183, 64, 0.8);
    outline-offset: 2px;
}

@media (max-width: 980px) {
    body,
    html {
        height: 100%;
        overflow: hidden;
    }

    .app-container {
        height: 100dvh;
        min-height: 100dvh;
    }

    .upload-screen {
        position: fixed;
        overflow-y: auto;
        align-items: start;
        padding: 18px;
    }

    .upload-shell {
        min-height: 0;
        grid-template-columns: 1fr;
    }

    .upload-preview {
        display: none;
    }

    .editor-interface {
        flex-direction: column;
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
        padding-bottom: 72px;
    }

    .sidebar-panel {
        width: 100%;
        min-width: 0;
        flex: 1;
        min-height: 0;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--line);
    }

    .sidebar-content {
        padding: 14px 14px 92px;
    }

    .mobile-mode-switch {
        position: fixed;
        left: 14px;
        right: 14px;
        bottom: 14px;
        z-index: 4500;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        padding: 6px;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: rgba(15, 17, 21, 0.92);
        box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(18px);
    }

    .mobile-mode-btn {
        min-height: 44px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: var(--muted);
        font: inherit;
        font-weight: 800;
        cursor: pointer;
    }

    .mobile-mode-btn.is-active {
        background: linear-gradient(135deg, var(--accent), var(--accent-strong));
        color: white;
    }

    .editor-interface[data-mobile-panel="edit"] .preview-container {
        display: none;
    }

    .editor-interface[data-mobile-panel="preview"] .sidebar-panel {
        display: none;
    }

    .editor-interface[data-mobile-panel="preview"] .preview-container {
        display: flex;
    }

    .editor-interface[data-mobile-panel="preview"] #aztec_string_display_main {
        display: none !important;
    }

    .preview-container {
        flex: 1;
        min-height: 0;
        height: 100%;
        padding: 86px 14px 92px;
        overflow: hidden;
    }

    .preview-toolbar {
        align-items: flex-start;
        flex-direction: column;
        left: 14px;
        right: 14px;
    }

    .aztec-debug-panel {
        right: 12px;
        bottom: 82px;
        width: calc(100vw - 24px);
        max-height: 132px;
    }

    .gmap-modal {
        width: min(94vw, 720px);
        height: min(86dvh, 760px);
        border-radius: 12px;
    }

    .gmap-body {
        flex-direction: column;
    }

    .gmap-list-panel {
        width: 100%;
        min-width: 0;
        flex: 1 1 auto;
        min-height: 0;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .gmap-map-panel {
        flex: 0 0 240px;
        min-height: 190px;
    }

    .map-details-card {
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto;
        max-height: 58%;
    }
}

@media (max-width: 620px) {
    .upload-panel {
        padding: 24px;
    }

    .upload-panel h1 {
        font-size: 2.6rem;
    }

    .sidebar-header,
    .upload-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .preview-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    .preview-actions .btn-secondary,
    .preview-actions .btn-primary {
        padding: 10px 8px;
        font-size: 0.76rem;
    }

    .header-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .workspace-status {
        grid-template-columns: 1fr;
    }

    .history-actions {
        justify-content: flex-start;
    }

    .form-grid.three-up {
        grid-template-columns: 1fr;
    }

    .gmap-modal {
        width: calc(100vw - 18px);
        height: calc(100dvh - 22px);
        max-height: none;
    }

    .gmap-topbar {
        padding: 10px;
    }

    .gmap-search-row {
        gap: 6px;
    }

    .gmap-search-row input {
        min-width: 0;
        padding: 10px 11px;
        font-size: 0.84rem;
    }

    .gmap-search-btn,
    .gmap-reload-btn,
    .gmap-close-btn {
        flex: 0 0 36px;
        width: 36px;
        height: 36px;
    }

    .gmap-list-panel {
        flex-basis: 62%;
    }

    .gmap-map-panel {
        flex-basis: 210px;
        min-height: 180px;
    }

    .map-search-area-btn {
        top: 10px;
        max-width: calc(100% - 24px);
        white-space: nowrap;
    }

    .map-details-card {
        padding: 12px;
        max-height: 68%;
    }

    .filter-options {
        grid-template-columns: 1fr;
    }

    .filter-control-row {
        margin-bottom: 8px;
    }

    .business-item {
        padding: 13px 14px;
    }

    .business-item.active {
        padding-left: 11px;
    }
}
