@font-face {
            font-family: 'GoogleSansFlex';
            src: url("../fonts/GoogleSansFlex-Variable.woff2") format('woff2');
            font-weight: 100 900;
            font-stretch: 75% 100%;
            font-style: normal;
            font-display: swap;
        }
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        :root {
            --bg-primary: #0b0b0b;
            --bg-card: #111111;
            --border-card: rgba(246, 246, 246, 0.12);
            --text-primary: #f6f6f6;
            --text-secondary: rgba(246, 246, 246, 0.72);
            --text-muted: rgba(246, 246, 246, 0.52);
            --input-bg: color-mix(in srgb, #111111, #0b0b0b 22%);
            --input-border: rgba(246, 246, 246, 0.12);
            --input-focus-border: rgba(246, 246, 246, 0.32);
            --btn-primary-bg: #f6f6f6;
            --btn-primary-text: #0b0b0b;
            --btn-outline-border: rgba(246, 246, 246, 0.12);
            --btn-outline-text: #f6f6f6;
            --btn-outline-hover: #151515;
            --shadow-sm: 0 22px 60px rgba(0,0,0,0.22);
            --shadow-md: 0 30px 80px rgba(0,0,0,0.34);
            --badge-bg: #171717;
            --badge-text: rgba(246, 246, 246, 0.72);
            --hr-color: rgba(246, 246, 246, 0.08);
            --tab-bg: #111111;
            --tab-hover: #191919;
            --tab-active: #1f1f1f;
            --drawer-bg: rgba(17,17,17,0.94);
            --drawer-border: rgba(246, 246, 246, 0.12);
            --tab-width: 80px;
            --drawer-width: 380px;
            --frame-width: 800;
            --frame-height: 1200;
            --frame-max-width: 800px;
            --frame-gap: clamp(8rem, 16vh, 16rem);
            --frame-mobile-gap: 2rem;
        }

        body:not(.dark-theme) {
            --bg-primary: #e7e7e7;
            --bg-card: #f2f2f2;
            --border-card: rgba(17, 17, 17, 0.12);
            --text-primary: #111111;
            --text-secondary: rgba(17,17,17,0.72);
            --text-muted: rgba(17,17,17,0.56);
            --input-bg: color-mix(in srgb, #ffffff, #e7e7e7 18%);
            --input-border: rgba(17,17,17,0.12);
            --input-focus-border: rgba(17,17,17,0.28);
            --btn-primary-bg: #000000;
            --btn-primary-text: #ffffff;
            --btn-outline-border: rgba(17,17,17,0.12);
            --btn-outline-text: #111111;
            --btn-outline-hover: #f0f0f0;
            --shadow-sm: 0 22px 60px rgba(17,17,17,0.06);
            --shadow-md: 0 30px 80px rgba(17,17,17,0.1);
            --badge-bg: #f0f0f0;
            --badge-text: rgba(17,17,17,0.72);
            --hr-color: rgba(17,17,17,0.08);
            --tab-bg: #f2f2f2;
            --tab-hover: #e6e6e6;
            --tab-active: #ededed;
            --drawer-bg: rgba(242,242,242,0.95);
            --drawer-border: rgba(17,17,17,0.12);
        }

        body {
            background: var(--bg-primary);
            font-weight: 400;
            color: var(--text-primary);
            transition: background-color 0.25s ease, color 0.2s ease;
            overflow-x: hidden;
        }

        body::before {
            content: "";
            position: fixed;
            inset: 0;
            z-index: -2;
            background: var(--bg-primary);
        }

        body::after {
            content: "";
            position: fixed;
            inset: 0;
            z-index: -1;
            opacity: 0.035;
            color: var(--text-primary);
            background-image:
                linear-gradient(currentColor 1px, transparent 1px),
                linear-gradient(90deg, currentColor 1px, transparent 1px);
            background-size: 56px 56px;
            pointer-events: none;
        }

        .app-wrapper {
            display: flex;
            flex-direction: column;
            min-height: 100vh;
            position: relative;
        }

        .main-content-container {
            flex: 1;
            transition: margin-right 0.3s ease;
            background: var(--bg-primary);
            min-width: 0;
        }

        .main-content-container,
        .vertical-tab-bar,
        .drawer-panel,
        .component-modal,
        .component-editor-fab {
            font-family: "GoogleSansFlex", "Microsoft YaHei UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Segoe UI", Arial, sans-serif;
            font-size: 16px;
            line-height: 1.6;
            letter-spacing: 0;
        }

        .main-content-container.drawer-open {
            margin-right: calc(var(--drawer-width) + var(--tab-width));
        }

        .map-static-template .artwork-display {
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: calc(100vh - var(--customizer-header-height, 72px));
            padding: clamp(1rem, 3vw, 3rem);
            position: relative;
        }

        .map-static-template .artwork-display::before {
            content: "";
            position: absolute;
            inset: 0;
            background-image:
                linear-gradient(color-mix(in srgb, var(--text-primary), transparent 96%) 1px, transparent 1px),
                linear-gradient(90deg, color-mix(in srgb, var(--text-primary), transparent 96%) 1px, transparent 1px);
            background-size: 48px 48px;
            pointer-events: none;
        }

        .map-static-template .artwork-stage {
            width: min(
                calc(100vw - var(--tab-width) - var(--frame-gap)),
                calc((100vh - var(--customizer-header-height, 72px) - var(--frame-gap)) * var(--frame-width) / var(--frame-height)),
                var(--frame-max-width)
            );
            aspect-ratio: calc(var(--frame-width) / var(--frame-height));
            position: relative;
            transition: none;
            will-change: auto;
        }

        .map-static-template .artwork-scale {
            width: calc(var(--frame-width) * 1px);
            height: calc(var(--frame-height) * 1px);
            position: absolute;
            top: 0;
            left: 0;
            transform-origin: top left;
            transition: none;
            will-change: auto;
        }

        .map-static-template .artwork-frame {
            --design-frame-shadow: none;
            width: calc(var(--frame-width) * 1px);
            height: calc(var(--frame-height) * 1px);
            padding: 0;
            background: transparent;
            border: 0;
            box-shadow: var(--design-frame-shadow);
            border-radius: 0;
            transition: none;
            will-change: auto;
        }

        .map-static-template .artwork-canvas {
            width: 100%;
            height: 100%;
            background: var(--bg-card);
            position: relative;
            overflow: hidden;
            border: 0;
            border-radius: 0;
        }

        .map-static-template .artwork-canvas::before {
            content: "";
            position: absolute;
            inset: 0;
            background-image:
                repeating-linear-gradient(0deg, color-mix(in srgb, var(--text-primary), transparent 94%) 0px, color-mix(in srgb, var(--text-primary), transparent 94%) 1px, transparent 1px, transparent 24px),
                repeating-linear-gradient(90deg, color-mix(in srgb, var(--text-primary), transparent 94%) 0px, color-mix(in srgb, var(--text-primary), transparent 94%) 1px, transparent 1px, transparent 24px),
                repeating-linear-gradient(0deg, color-mix(in srgb, var(--text-primary), transparent 97%) 0px, color-mix(in srgb, var(--text-primary), transparent 97%) 1px, transparent 1px, transparent 96px),
                repeating-linear-gradient(90deg, color-mix(in srgb, var(--text-primary), transparent 97%) 0px, color-mix(in srgb, var(--text-primary), transparent 97%) 1px, transparent 1px, transparent 96px);
            pointer-events: none;
        }

        .map-static-template .map-surface,
        .map-static-template .poster-overlay,
        .map-static-template .poster-white-frame-layer,
        .map-static-template .poster-black-frame-layer,
        .map-static-template .poster-text-layer {
            position: absolute;
            inset: 0;
            pointer-events: none;
        }

        .map-static-template .map-surface { z-index: 0; pointer-events: auto; }
        .map-preprocessed-template .map-processing-surface {
            position: absolute;
            left: 0;
            top: 0;
            z-index: 1;
            opacity: 0;
            pointer-events: none;
            transform-origin: top left;
            transition: opacity 80ms ease;
        }
        .map-preprocessed-template .map-processing-surface .maplibregl-canvas-container,
        .map-preprocessed-template .map-processing-surface .maplibregl-canvas,
        .map-preprocessed-template .map-processing-surface .maplibregl-control-container {
            pointer-events: none !important;
        }
        .map-preprocessed-template.map-preview-moving .map-processing-surface {
            opacity: 1;
        }
        .map-preprocessed-template.map-preview-moving .map-surface .maplibregl-canvas {
            opacity: 0;
        }
        .map-preprocessed-template.map-preview-moving .map-surface {
            background: transparent !important;
        }
        .map-preprocessed-template.map-preview-moving .map-processing-surface .maplibregl-marker.poster-marker {
            width: calc(var(--marker-size, 72px) * var(--processing-marker-scale, 0.342857));
            height: calc(var(--marker-size, 72px) * var(--processing-marker-scale, 0.342857));
        }
        .map-preprocessed-template .map-surface {
            position: absolute;
            z-index: 2;
        }
        .map-preprocessed-template .map-surface .maplibregl-canvas {
            opacity: 1;
            transition: opacity 80ms ease;
        }
        .map-static-template .map-loading-overlay {
            position: absolute;
            inset: 0;
            z-index: 10;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            color: var(--text-primary);
            background: color-mix(in srgb, var(--bg-card), transparent 12%);
            font-size: 12px;
            font-weight: 600;
            opacity: 1;
            visibility: visible;
            transition: opacity 180ms ease, visibility 180ms ease;
            pointer-events: none;
        }
        .map-static-template .map-loading-overlay.is-hidden {
            opacity: 0;
            visibility: hidden;
        }
        .map-static-template .map-loading-overlay.is-error {
            color: var(--text-primary);
        }
        .map-static-template .map-loading-spinner {
            width: 18px;
            height: 18px;
            flex: 0 0 auto;
            border: 2px solid currentColor;
            border-right-color: transparent;
            border-radius: 50%;
            animation: map-loading-spin 0.75s linear infinite;
        }
        .map-static-template .map-loading-overlay.is-error .map-loading-spinner {
            display: none;
        }
        @keyframes map-loading-spin {
            to { transform: rotate(360deg); }
        }
        .map-static-template .poster-overlay { z-index: 20; color: #111; }
        .map-static-template .poster-white-frame-layer { z-index: 10 !important; }
        .map-static-template .poster-text-layer { z-index: 20 !important; }
        .map-static-template .poster-black-frame-layer { z-index: 30 !important; }

        .map-static-template .poster-border {
            position: absolute;
            pointer-events: none;
            box-sizing: border-box;
        }

        .map-static-template .component-white-frame { inset: 18px; border: 14px solid #fff; outline: 1px solid #777; }
        .map-static-template .component-black-frame-outer { inset: 32px; border: 3px solid #111; z-index: 50 !important; }
        .map-static-template .component-black-frame-inner { inset: 42px; border: 1px solid #111; z-index: 50 !important; }

        .map-static-template .poster-text-layer {
            top: auto;
            height: 30%;
            display: flex;
            align-items: flex-end;
            justify-content: center;
            padding: 0 56px 60px;
            background: linear-gradient(to top, rgb(255, 255, 255) 40%, rgba(255, 255, 255, 0.92) 55%, rgba(255, 255, 255, 0) 100%);
            transform-origin: bottom center;
        }

        .map-static-template .artwork-frame.layout-1 {
            padding: 0 !important;
            background: #fff !important;
            border: none !important;
        }

        .map-static-template .artwork-frame.layout-1 .component-map { inset: 0 !important; }
        .map-static-template .artwork-frame.layout-1 .component-frame-layer { display: block; }
        .map-static-template .artwork-frame.layout-1 .component-white-frame { display: block; }
        .map-static-template .artwork-frame.layout-1 .component-black-frame-outer { display: block; }
        .map-static-template .artwork-frame.layout-1 .component-black-frame-inner { display: block; }
        .map-static-template .artwork-frame.layout-1 .component-text-background {
            left: 18px;
            right: 18px;
            bottom: 18px;
            width: auto;
            height: 33%;
            padding: 0 72px 56px;
            background: linear-gradient(to top, rgb(255, 255, 255) 40%, rgba(255, 255, 255, 0.92) 55%, rgba(255, 255, 255, 0) 100%);
        }
        .map-static-template .artwork-frame.layout-1 .component-city-name { display: block; font-size: 60px; font-weight: 800; letter-spacing: 0.02em; }
        .map-static-template .artwork-frame.layout-1 .component-country-name { display: flex; font-size: 14px; letter-spacing: 0.32em; margin: 20px 0 12px; }
        .map-static-template .artwork-frame.layout-1 .component-country-line { display: block; }
        .map-static-template .artwork-frame.layout-1 .component-country-text { display: inline-block; }
        .map-static-template .artwork-frame.layout-1 .component-coordinates { display: block; font-size: 12px; }

        .map-static-template .poster-text-wrapper {
            display: flex;
            width: 100%;
            margin-bottom: 0;
            flex-direction: column;
            align-items: stretch;
            text-align: center;
            transform-origin: bottom center;
        }
        .map-static-template .poster-title { font-family: 'GoogleSansFlex', sans-serif; font-size: 50px; margin-bottom: 10px; line-height: 0.9; font-weight: 700; letter-spacing: 0; text-transform: uppercase; }
        .map-static-template .poster-country {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 24px;
            margin: 28px 0 16px;
            font-size: 14px;
            font-family: 'GoogleSansFlex', sans-serif;
            font-weight: 400;
            text-transform: uppercase;
        }
        .map-static-template .component-country-line { width: 54px; height: 1px; background: currentColor; }
        .map-static-template .poster-coordinates { font-family: 'GoogleSansFlex', sans-serif; font-size: 14px; font-weight: 400; opacity: 1; margin-top: 10px; }

        .map-static-template .poster-marker-layer {
            position: absolute;
            inset: 0;
            z-index: 10;
            pointer-events: none;
            overflow: hidden;
        }

        .map-static-template .poster-marker {
            position: absolute;
            width: var(--marker-size, 72px);
            height: var(--marker-size, 72px);
            transform-origin: var(--marker-transform-origin, 50% 100%);
            border: 0;
            padding: 0;
            background: transparent;
            color: var(--marker-fill, #111);
            pointer-events: none;
        }

        .map-static-template .poster-marker-svg {
            display: block;
            width: 100%;
            height: 100%;
            overflow: visible;
            pointer-events: none;
        }

        .map-static-template .poster-marker-shape {
            fill: var(--marker-fill, #111);
            stroke: var(--marker-stroke, #fff);
            stroke-width: var(--marker-stroke-width, 0);
            paint-order: stroke fill;
            vector-effect: non-scaling-stroke;
        }

        .map-static-template .poster-marker-mask,
        .map-static-template .poster-marker-mask::before,
        .map-static-template .poster-marker-mask::after {
            position: absolute;
            inset: 0;
            pointer-events: none;
        }

        .map-static-template .poster-marker-mask::before,
        .map-static-template .poster-marker-mask::after {
            content: "";
            background: currentColor;
            -webkit-mask: var(--marker-image) center / contain no-repeat;
            mask: var(--marker-image) center / contain no-repeat;
        }

        .map-static-template .poster-marker-mask::before {
            color: var(--marker-stroke, #fff);
            transform: scale(var(--marker-stroke-scale, 1));
            transform-origin: 50% 50%;
        }

        .map-static-template .poster-marker-mask::after {
            color: var(--marker-fill, #111);
        }

        .map-static-template .poster-marker.selected {
            filter: drop-shadow(0 0 0.5px #fff) drop-shadow(0 8px 18px rgba(0,0,0,0.25));
        }

        .map-static-template .maplibregl-marker.poster-marker {
            position: absolute;
            z-index: 10;
            pointer-events: auto;
            cursor: grab;
            touch-action: none;
        }

        .map-static-template .maplibregl-marker.poster-marker:active {
            cursor: grabbing;
        }

        .map-static-template .artwork-canvas .maplibregl-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
        .map-static-template .artwork-canvas .maplibregl-canvas-container { position: absolute; inset: 0; pointer-events: auto; }
        .map-static-template .artwork-canvas .maplibregl-control-container { position: absolute; inset: 0; pointer-events: none; }
        .map-static-template .artwork-canvas .maplibregl-ctrl,
        .map-static-template .artwork-canvas .maplibregl-ctrl-group,
        .map-static-template .artwork-canvas .maplibregl-ctrl-group button { pointer-events: auto; }
        .map-static-template .artwork-canvas .maplibregl-ctrl-group { background: var(--bg-card); border: 1px solid var(--border-card); border-radius: 8px; }
        .map-static-template .artwork-canvas .maplibregl-ctrl-group button { background-color: transparent; border-color: var(--border-card); }
        .map-static-template .artwork-canvas .maplibregl-ctrl-group button:hover { background-color: var(--tab-hover); }
        .map-static-template .artwork-canvas .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
        .map-static-template .artwork-canvas .maplibregl-ctrl-attrib { display: none !important; }
        .map-static-template .artwork-canvas .maplibregl-ctrl-logo { display: none !important; }

        .map-static-template .section-title {
            font-size: 1.8rem;
            font-weight: 800;
            letter-spacing: 0;
            margin-bottom: 0.25rem;
        }

        .map-static-template .section-sub {
            font-size: 0.85rem;
            color: var(--text-secondary);
            border-left: 3px solid var(--text-primary);
            padding-left: 0.75rem;
            margin-bottom: 1.5rem;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .map-static-template .content-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }

        .map-static-template .card {
            background: var(--bg-card);
            border-radius: 12px;
            padding: 1.5rem;
            border: 1px solid var(--border-card);
            box-shadow: var(--shadow-sm);
            transition: background 0.2s, border 0.2s;
        }

        .map-static-template .card-title {
            font-weight: 800;
            font-size: 1rem;
            margin-bottom: 0.8rem;
            color: var(--text-primary);
        }

        .map-static-template .badge {
            background: var(--badge-bg);
            font-size: 0.66rem;
            font-weight: 700;
            padding: 0.2rem 0.6rem;
            border-radius: 40px;
            color: var(--badge-text);
            display: inline-block;
        }

        .map-static-template .card p {
            font-size: 0.82rem;
            color: var(--text-secondary);
            line-height: 1.65;
            margin-bottom: 1rem;
        }

        .map-static-template .card-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .map-static-template .price {
            font-size: 1.1rem;
            font-weight: 800;
        }

        .map-static-template .btn-sm {
            background: var(--btn-primary-bg);
            color: var(--btn-primary-text);
            border: none;
            border-radius: 999px;
            padding: 0.62rem 1rem;
            font-size: 0.8rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }
        .map-static-template .btn-sm:hover { opacity: 1; transform: translateY(-1px); box-shadow: var(--shadow-sm); }

        .map-static-template .btn-sm-outline {
            background: transparent;
            color: var(--btn-outline-text);
            border: 1px solid var(--btn-outline-border);
            border-radius: 999px;
            padding: 0.62rem 1rem;
            font-size: 0.8rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }
        .map-static-template .btn-sm-outline:hover { background: var(--btn-outline-hover); color: var(--text-primary); transform: translateY(-1px); }

        .map-static-template .input-field {
            background: var(--input-bg);
            border: 1.5px solid var(--input-border);
            border-radius: 18px;
            padding: 0.8rem 1rem;
            font-weight: 600;
            font-size: 0.84rem;
            color: var(--text-primary);
            outline: none;
            transition: border-color 0.2s;
            width: 100%;
            font-family: inherit;
            min-height: 52px;
        }
        .map-static-template .input-field:focus { border-color: var(--input-focus-border); box-shadow: 0 0 0 4px color-mix(in srgb, var(--text-primary), transparent 92%); }

        .map-static-template .input-field[type="select"],
        .map-static-template select.input-field {
            appearance: none;
            -webkit-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='%23888' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 0.8rem center;
            padding-right: 2.2rem;
            cursor: pointer;
        }

        .map-static-template .input-group { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
        .map-static-template .input-group label { font-size: 0.78rem; font-weight: 700; color: var(--text-secondary); }

        .map-static-template .btn-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }

        .map-static-template .footer-note {
            text-align: center;
            font-size: 0.76rem;
            color: var(--text-muted);
            padding: 1.5rem 0 0.5rem;
            border-top: 1px solid var(--hr-color);
            margin-top: 1rem;
        }

        /* Vertical Tab Bar */
        .vertical-tab-bar {
            position: fixed;
            right: 0;
            top: var(--customizer-header-height, 72px);
            bottom: 0;
            width: var(--tab-width);
            background: var(--tab-bg);
            border-left: 1px solid var(--border-card);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            padding-top: 1.2rem;
            gap: 0.7rem;
            z-index: 300;
            backdrop-filter: blur(12px);
            transition: background 0.2s;
        }

        .tab-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 5px;
            width: 100%;
            padding: 10px 0;
            cursor: pointer;
            transition: all 0.2s ease;
            color: var(--text-secondary);
            font-weight: 700;
            border-radius: 0px;
            background: transparent;
            border-left: 3px solid transparent;
        }

        .tab-item svg {
            width: 26px;
            height: 26px;
            stroke: currentColor;
            fill: none;
            stroke-width: 1.7;
        }

        .tab-item span {
            font-size: 0.7rem;
            font-weight: 700;
            letter-spacing: 0.3px;
        }

        .tab-item:hover {
            background: var(--tab-hover);
            color: var(--text-primary);
        }

        .tab-item.active {
            background: var(--tab-active);
            color: var(--text-primary);
            border-left: 3px solid var(--text-primary);
        }

        /* Drawer Panel */
        .drawer-panel {
            position: fixed;
            top: var(--customizer-header-height, 72px);
            right: var(--tab-width);
            width: var(--drawer-width);
            height: calc(100vh - var(--customizer-header-height, 72px));
            background: var(--drawer-bg);
            border-left: 1px solid var(--drawer-border);
            z-index: 200;
            transform: translateX(calc(100% + var(--tab-width)));
            transition: transform 0.3s ease;
            padding: 1.8rem 1.5rem;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
            backdrop-filter: blur(18px);
        }

        .drawer-panel.open {
            transform: translateX(0);
        }

        .drawer-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 2px solid var(--hr-color);
            padding-bottom: 0.75rem;
            font-weight: 800;
            font-size: 1.3rem;
            letter-spacing: 0;
        }

        .drawer-close {
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: var(--text-secondary);
            transition: 0.2s;
            line-height: 1;
        }
        .drawer-close:hover { color: var(--text-primary); transform: scale(1.1); }

        .drawer-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
        }

        .drawer-purchase-bar {
            padding-top: 1rem;
            border-top: 1px solid var(--drawer-border);
        }

        .drawer-purchase-bar .drawer-btn {
            width: 100%;
        }

        .drawer-section {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .location-field-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
        }

        /* Location values use one compact segmented control per field: label,
           editable value, then the visibility switch. The switch itself is the
           shared .toggle-switch from customizer_ui_stage2.html. */
        .location-field-group {
            display: flex;
            align-items: stretch;
            width: 100%;
            min-height: 40px;
            box-sizing: border-box;
            overflow: hidden;
            border: 1px solid color-mix(in srgb, var(--input-border), transparent 6%);
            border-radius: 6px;
            background: color-mix(in srgb, var(--input-bg), var(--bg-card) 18%);
            box-shadow: none;
        }

        .location-field-label {
            flex: 0 0 92px;
            box-sizing: border-box;
            display: inline-flex;
            align-items: center;
            padding: 0 0.8rem;
            border-right: 1px solid color-mix(in srgb, var(--input-border), transparent 16%);
            color: var(--text-secondary);
            font-size: 0.76rem;
            font-weight: 700;
            white-space: nowrap;
        }

        .location-field-group > .drawer-input {
            flex: 1 1 auto;
            min-width: 0;
            width: auto;
            min-height: 38px;
            padding: 0.4rem 0.8rem;
            border: 0;
            border-radius: 0;
            background: transparent;
            box-shadow: none;
        }

        .location-field-group > .drawer-input:focus {
            border: 0;
            box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--text-primary), transparent 78%);
        }

        /* Only the cell chrome lives here; the pill is the shared switch. */
        .location-field-group .location-visibility-toggle {
            border-left: 1px solid color-mix(in srgb, var(--input-border), transparent 16%);
            border-radius: 0 5px 5px 0;
        }

        .drawer-section label {
            font-size: 0.78rem;
            font-weight: 700;
            color: var(--text-secondary);
            letter-spacing: 0.2px;
        }

        .font-weight-control {
            display: flex;
            flex-direction: column;
            gap: 0.45rem;
            padding-top: 0.2rem;
        }

        .font-weight-control label {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
        }

        .font-weight-control label span {
            color: var(--text-primary);
            font-variant-numeric: tabular-nums;
        }

        .font-weight-control input[type="range"] {
            width: 100%;
            margin: 0;
            accent-color: var(--text-primary);
            cursor: pointer;
        }

        .drawer-input, .drawer-select, .drawer-textarea {
            background: var(--input-bg);
            border: 1.5px solid var(--input-border);
            border-radius: 18px;
            padding: 0.8rem 1rem;
            font-weight: 600;
            font-size: 0.84rem;
            color: var(--text-primary);
            outline: none;
            transition: border-color 0.2s;
            width: 100%;
            font-family: inherit;
            min-height: 52px;
        }

        .drawer-select {
            appearance: none;
            -webkit-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='%23888' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 0.8rem center;
            padding-right: 2.2rem;
            cursor: pointer;
        }

        .drawer-input:focus, .drawer-select:focus, .drawer-textarea:focus {
            border-color: var(--input-focus-border);
            box-shadow: 0 0 0 4px color-mix(in srgb, var(--text-primary), transparent 92%);
        }

        .drawer-textarea { resize: vertical; min-height: 80px; }

        .coordinate-input-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.65rem;
        }

        .coordinate-input-grid label {
            display: flex;
            min-width: 0;
            flex-direction: column;
            gap: 0.35rem;
        }

        .coordinate-input-grid span {
            color: var(--text-muted);
            font-size: 0.66rem;
            font-weight: 700;
            letter-spacing: 0.08em;
            text-transform: uppercase;
        }

        .coordinate-apply-btn {
            width: 100%;
        }

        .coordinate-display {
            color: var(--text-secondary);
            background: color-mix(in srgb, var(--input-bg), var(--bg-card) 25%);
        }

        .component-editor-fab {
            position: fixed;
            left: 24px;
            bottom: 24px;
            z-index: 320;
            border: 1px solid var(--btn-primary-bg);
            background: var(--btn-primary-bg);
            color: var(--btn-primary-text);
            border-radius: 999px;
            padding: 0.85rem 1.1rem;
            font-weight: 900;
            letter-spacing: 0.02em;
            cursor: pointer;
            box-shadow: 0 18px 40px rgba(0,0,0,0.28);
        }

        .style-editor-fab {
            bottom: 78px;
        }

        .component-modal {
            position: fixed;
            inset: 0;
            z-index: 2100;
            display: none;
            align-items: stretch;
            justify-content: flex-start;
            padding: var(--customizer-header-height, 72px) 0 0;
            background: rgba(0,0,0,0.26);
        }

        .component-modal.open { display: flex; }

        .marker-editor-modal {
            z-index: 560;
            inset: 0;
            display: none;
            padding: 0;
            background: transparent;
            pointer-events: none;
        }

        .map-preprocessed-template .processing-overlay-marker {
            display: none;
        }

        .marker-editor-modal.open {
            display: block;
        }

        .component-dialog.marker-editor-dialog {
            position: absolute;
            left: var(--marker-editor-left, 50%);
            top: var(--marker-editor-top, 50%);
            width: min(320px, calc(100vw - 32px));
            height: auto;
            max-height: min(460px, calc(100vh - 32px));
            border: 1px solid var(--drawer-border);
            border-radius: 8px;
            box-shadow: 0 24px 64px rgba(0,0,0,0.34);
            pointer-events: auto;
        }

        .marker-editor-content {
            overflow-y: auto;
            padding: 0.9rem;
        }

        .marker-editor-content .marker-control-card {
            margin: 0;
        }

        .component-dialog {
            width: min(420px, 92vw);
            height: 100%;
            max-height: 100%;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            background: var(--drawer-bg);
            color: var(--text-primary);
            border-right: 1px solid var(--drawer-border);
            border-left: none;
            border-top: none;
            border-bottom: none;
            box-shadow: 24px 0 60px rgba(0,0,0,0.34);
        }

        .component-dialog-header,
        .component-dialog-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
            padding: 1rem 1.2rem;
            border-bottom: 1px solid var(--drawer-border);
        }

        .component-dialog-actions {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-left: auto;
        }

        .component-dialog-footer {
            flex-direction: column;
            align-items: stretch;
            flex-shrink: 0;
            gap: 0.75rem;
            border-top: 1px solid var(--drawer-border);
            border-bottom: none;
        }

        .component-dialog-title {
            font-size: 1rem;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }

        .component-dialog-close {
            width: 34px;
            height: 34px;
            border: 1px solid var(--input-border);
            background: var(--input-bg);
            color: var(--text-primary);
            cursor: pointer;
            font-size: 1.35rem;
            line-height: 1;
        }

        .component-dialog-save {
            min-height: 34px;
            padding: 0.35rem 0.8rem;
            border-radius: 999px;
            border: none;
            background: var(--btn-primary-bg);
            color: var(--btn-primary-text);
            cursor: pointer;
            font-size: 0.78rem;
            font-weight: 700;
            box-shadow: var(--shadow-sm);
        }

        .component-dialog-save:hover {
            box-shadow: var(--shadow-md);
            transform: translateY(-1px);
        }

        .component-controls {
            flex: 1 1 auto;
            min-height: 0;
            overflow: auto;
            padding: 0.9rem;
            display: grid;
            grid-template-columns: 1fr;
            gap: 0.75rem;
        }

        .component-card {
            border: 1px solid var(--drawer-border);
            background: var(--bg-card);
            padding: 0.75rem;
        }

        .component-card h3 {
            font-size: 0.76rem;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            margin-bottom: 0.6rem;
        }

        .component-control-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 0.5rem;
        }

        .component-field {
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
            min-width: 0;
        }

        .component-field.full { grid-column: 1 / -1; }

        .component-field label {
            color: var(--text-secondary);
            font-size: 0.66rem;
            font-weight: 800;
            letter-spacing: 0.02em;
        }

        .component-field input,
        .component-field select,
        .component-json-output {
            width: 100%;
            min-width: 0;
            background: var(--input-bg);
            border: 1px solid var(--input-border);
            color: var(--text-primary);
            padding: 0.38rem 0.5rem;
            font: inherit;
            font-size: 0.72rem;
            outline: none;
            min-height: 32px;
        }

        .component-field input[type="color"] {
            min-height: 30px;
            height: 30px;
            padding: 0.12rem;
        }

        .component-field-range label {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.5rem;
        }

        .component-field-range label span {
            color: var(--text-primary);
            font-size: 0.72rem;
            font-weight: 800;
        }

        .component-field input[type="range"] {
            min-height: 24px;
            padding: 0;
            border: 0;
            background: transparent;
            accent-color: var(--text-primary);
        }

        .component-json-output {
            min-height: 150px;
            resize: vertical;
            font-family: "Courier New", monospace;
            font-weight: 500;
        }

        .component-actions {
            display: flex;
            gap: 0.65rem;
            flex-wrap: wrap;
            justify-content: stretch;
            width: 100%;
        }

        .component-actions #componentSaveBtn {
            flex: 1 1 100%;
        }

        .component-actions .drawer-btn { flex: 1 1 calc(50% - 0.65rem); }

        .drawer-btn {
            background: var(--btn-primary-bg);
            color: var(--btn-primary-text);
            border: none;
            border-radius: 999px;
            padding: 0.82rem 1.1rem;
            font-weight: 500;
            font-size: 0.9rem;
            cursor: pointer;
            box-shadow: var(--shadow-sm);
            transition: 0.2s;
            width: 100%;
        }
        .drawer-btn:hover { opacity: 1; transform: translateY(-1px); box-shadow: var(--shadow-md); }

        .style-chip { display: flex; gap: 0.5rem; flex-wrap: wrap; }
        .chip {
            background: var(--badge-bg);
            padding: 0.35rem 0.75rem;
            border-radius: 999px;
            font-size: 0.72rem;
            font-weight: 600;
            cursor: pointer;
            transition: 0.15s;
            color: var(--text-primary);
            border: 1px solid var(--border-card);
        }
        .chip:hover { background: var(--tab-hover); }
        .chip.active-chip { background: var(--text-primary); color: var(--bg-primary); }

        .control-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.6rem;
        }
        .control-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
        .panel-note { color: var(--text-muted); font-size: 0.72rem; line-height: 1.6; }
        .search-results {
            display: none;
            border: 1px solid var(--border-card);
            background: var(--drawer-bg);
            max-height: 220px;
            overflow-y: auto;
        }
        .search-results.open { display: block; }
        .search-result {
            padding: 0.75rem 0.8rem;
            border-bottom: 1px solid var(--border-card);
            cursor: pointer;
            color: var(--text-secondary);
            font-size: 0.78rem;
        }
        .search-result:hover { background: var(--tab-hover); color: var(--text-primary); }
        .location-json-debug {
            display: none !important;
            gap: 0.45rem;
            margin-top: 0.75rem;
        }
        .location-json-debug pre {
            max-height: 280px;
            margin: 0;
            padding: 0.75rem;
            overflow: auto;
            white-space: pre-wrap;
            word-break: break-word;
            border: 1px solid var(--border-card);
            border-radius: 12px;
            background: color-mix(in srgb, var(--drawer-bg), #000 5%);
            color: var(--text-secondary);
            font-family: Consolas, Monaco, monospace;
            font-size: 0.68rem;
            line-height: 1.45;
        }

        .switch-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
            color: var(--text-secondary);
            font-size: 0.78rem;
            font-weight: 700;
        }

        .switch {
            position: relative;
            display: inline-flex;
            width: 46px;
            height: 26px;
            flex: 0 0 auto;
        }

        .switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .switch span {
            position: absolute;
            inset: 0;
            cursor: pointer;
            background: var(--input-bg);
            border: 1px solid var(--input-border);
            transition: 0.2s;
        }

        .switch span::before {
            content: "";
            position: absolute;
            width: 18px;
            height: 18px;
            left: 3px;
            top: 3px;
            background: var(--text-muted);
            transition: 0.2s;
        }

        .switch input:checked + span {
            background: var(--text-primary);
            border-color: var(--text-primary);
        }

        .switch input:checked + span::before {
            transform: translateX(20px);
            background: var(--bg-primary);
        }

        .style-card,
        .layout-card,
        .orientation-card {
            display: grid;
            gap: 0.55rem;
            width: 100%;
            min-height: 78px;
            padding: 0.75rem;
            text-align: left;
            border-radius: 18px;
            background: var(--badge-bg);
            color: var(--text-primary);
            border: 1px solid transparent;
            cursor: pointer;
            font: inherit;
            font-weight: 800;
        }

        .style-card.active-chip,
        .layout-card.active-chip,
        .orientation-card.active-chip {
            background: var(--text-primary);
            color: var(--bg-primary);
            border-color: var(--text-primary);
        }

        .style-preview-image {
            position: relative;
            display: block;
            width: 100%;
            aspect-ratio: 2 / 3;
            overflow: hidden;
            border-radius: 8px;
            border: 1px solid color-mix(in srgb, currentColor, transparent 70%);
            background: color-mix(in srgb, var(--bg-card), var(--text-primary) 6%);
        }

        .style-preview-image img {
            display: block;
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .style-card span,
        .layout-card span,
        .orientation-card span {
            font-size: 0.74rem;
        }

        .marker-grid {
            display: grid;
            grid-template-columns: repeat(6, minmax(0, 1fr));
            gap: 0.5rem;
        }

        .marker-card {
            display: grid;
            place-items: center;
            width: 100%;
            aspect-ratio: 1 / 1;
            min-height: 0;
            padding: 0.45rem;
            border-radius: 8px;
            border: 1px solid color-mix(in srgb, var(--border-card), transparent 8%);
            background: color-mix(in srgb, var(--badge-bg), var(--bg-card) 20%);
            color: var(--text-primary);
            cursor: pointer;
            font: inherit;
            font-size: 0.72rem;
            font-weight: 800;
            overflow: hidden;
        }

        .marker-card:hover {
            border-color: color-mix(in srgb, var(--text-primary), transparent 78%);
            transform: translateY(-1px);
        }

        .marker-card-icon {
            display: grid;
            place-items: center;
            width: 28px;
            height: 28px;
            color: currentColor;
            background: transparent;
            flex: 0 0 auto;
            overflow: hidden;
        }

        .marker-card-icon .poster-marker-svg,
        .marker-card-icon svg {
            display: block;
            width: 100%;
            height: 100%;
        }

        .marker-card-icon-mask {
            display: block;
            width: 100%;
            height: 100%;
            background: currentColor;
            -webkit-mask: var(--marker-card-image) center / contain no-repeat;
            mask: var(--marker-card-image) center / contain no-repeat;
        }

        .placed-marker-list {
            display: grid;
            gap: 0.55rem;
        }

        .placed-marker-card {
            display: grid;
            grid-template-columns: 40px minmax(0, 1fr);
            align-items: center;
            gap: 0.75rem;
            min-height: 58px;
            padding: 0.55rem 0.65rem;
            border-radius: 12px;
            border: 1px solid color-mix(in srgb, var(--border-card), transparent 8%);
            background: color-mix(in srgb, var(--badge-bg), var(--bg-card) 20%);
            color: var(--text-primary);
            cursor: pointer;
            font: inherit;
            text-align: left;
        }

        .placed-marker-card:hover {
            border-color: color-mix(in srgb, var(--text-primary), transparent 78%);
            transform: translateY(-1px);
        }

        .placed-marker-card.active-chip {
            background: var(--text-primary);
            color: var(--bg-primary);
            border-color: var(--text-primary);
        }

        .placed-marker-card span:last-child {
            display: grid;
            gap: 0.12rem;
            min-width: 0;
        }

        .placed-marker-card strong,
        .placed-marker-card small {
            display: block;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .placed-marker-card strong {
            font-size: 0.78rem;
            font-weight: 800;
        }

        .placed-marker-card small {
            font-size: 0.68rem;
            opacity: 0.68;
        }
        .marker-control-card {
            display: grid;
            gap: 0.75rem;
            padding: 0.85rem;
            border-radius: 12px;
            border: 1px solid color-mix(in srgb, var(--drawer-border), transparent 6%);
            background: color-mix(in srgb, var(--bg-card), transparent 4%);
        }

        .marker-control-card .component-actions .drawer-btn {
            flex: 1 1 calc(50% - 0.65rem);
        }

        .preview-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.75rem;
        }

        .preview-grid.four {
            grid-template-columns: repeat(4, minmax(0, 1fr));
        }

        .size-group-list {
            display: grid;
            gap: 1rem;
        }

        .size-group {
            display: grid;
            gap: 0.55rem;
        }

        .size-group-title {
            font-size: 0.75rem;
            font-weight: 800;
            color: var(--text-secondary);
        }

        .size-series-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.55rem;
        }

        .size-series-button {
            width: 100%;
            min-height: 44px;
            border-radius: 8px;
            white-space: normal;
            line-height: 1.25;
            text-align: center;
        }

        .preview-svg {
            width: 100%;
            height: 82px;
            color: currentColor;
        }

        .orientation-card .preview-svg {
            height: 96px;
        }

        .style-json-editor {
            display: grid;
            gap: 0.9rem;
        }

        .style-editor-dialog {
            width: min(520px, 94vw);
        }

        .style-json-card {
            display: grid;
            gap: 0.65rem;
            padding: 0.9rem 0;
            border-top: 1px solid var(--hr-color);
        }

        .style-json-card:first-child { border-top: none; }

        .style-json-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.6rem;
        }

        .style-json-field {
            display: grid;
            gap: 0.35rem;
            min-width: 0;
        }

        .style-json-field.full { grid-column: 1 / -1; }

        .style-json-field input,
        .style-json-field select {
            width: 100%;
            min-width: 0;
            background: var(--input-bg);
            border: 1px solid var(--input-border);
            color: var(--text-primary);
            border-radius: 14px;
            padding: 0.58rem 0.7rem;
            font: inherit;
            font-size: 0.78rem;
            outline: none;
        }

        .style-json-field input[type="color"] {
            min-height: 38px;
            padding: 0.2rem;
        }

        .style-json-output {
            min-height: 180px;
            resize: vertical;
            font-family: "Courier New", monospace;
            font-weight: 500;
        }

        /* Unified control system */
        .vertical-tab-bar {
            padding: 1.2rem 0 0;
            gap: 0.7rem;
            background: var(--tab-bg);
            box-shadow: none;
        }

        .tab-item {
            width: 100%;
            min-height: auto;
            padding: 10px 0;
            border-radius: 0;
            border: 1px solid transparent;
            border-left: 3px solid transparent;
            background: transparent;
        }

        .tab-item:hover {
            background: var(--tab-hover);
            border-color: transparent;
            transform: none;
        }

        .tab-item.active {
            background: var(--tab-active);
            border-color: transparent;
            border-left-color: var(--text-primary);
            box-shadow: none;
        }

        .drawer-header {
            border-bottom: 1px solid color-mix(in srgb, var(--hr-color), transparent 8%);
            padding-bottom: 0.95rem;
            font-size: 1.15rem;
            font-weight: 700;
            letter-spacing: 0;
        }

        .drawer-close,
        .component-dialog-close {
            width: 38px;
            height: 38px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 999px;
            border: 1px solid var(--input-border);
            background: color-mix(in srgb, var(--input-bg), transparent 4%);
            box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
        }

        .drawer-close:hover,
        .component-dialog-close:hover {
            background: var(--bg-card);
            border-color: color-mix(in srgb, var(--text-primary), transparent 72%);
            transform: translateY(-1px);
        }

        .drawer-content,
        .drawer-section {
            gap: 0.9rem;
        }

        .drawer-section label,
        .component-field label {
            font-size: 0.7rem;
            font-weight: 700;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            color: var(--text-muted);
        }

        .location-field-head {
            gap: 0.6rem;
        }

        .drawer-input,
        .drawer-select,
        .drawer-textarea,
        .component-field input,
        .component-field select,
        .component-json-output,
        .style-json-field input,
        .style-json-field select,
        .style-json-output {
            border-radius: 18px;
            border: 1px solid color-mix(in srgb, var(--input-border), transparent 6%);
            background: color-mix(in srgb, var(--input-bg), var(--bg-card) 18%);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
        }

        .drawer-input,
        .drawer-select,
        .drawer-textarea {
            min-height: 46px;
            padding: 0.72rem 0.92rem;
        }

        .component-field input,
        .component-field select {
            min-height: 32px;
            padding: 0.36rem 0.5rem;
            border-radius: 10px;
            font-size: 0.72rem;
        }

        .component-field input[type="checkbox"] {
            min-height: 0;
            width: 16px;
            height: 16px;
            padding: 0;
        }

        .component-field input[type="color"] {
            min-height: 30px;
            height: 30px;
        }

        .drawer-input:focus,
        .drawer-select:focus,
        .drawer-textarea:focus,
        .component-field input:focus,
        .component-field select:focus,
        .component-json-output:focus,
        .style-json-field input:focus,
        .style-json-field select:focus,
        .style-json-output:focus {
            border-color: color-mix(in srgb, var(--text-primary), transparent 35%);
            box-shadow:
                0 0 0 4px color-mix(in srgb, var(--text-primary), transparent 92%),
                inset 0 1px 0 rgba(255,255,255,0.35);
        }

        .drawer-btn {
            min-height: 46px;
            font-weight: 700;
            letter-spacing: 0.01em;
        }

        .style-chip {
            gap: 0.65rem;
        }

        .chip {
            min-height: 38px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0.45rem 0.9rem;
            border-radius: 999px;
            font-size: 0.74rem;
            font-weight: 700;
            border: 1px solid color-mix(in srgb, var(--border-card), transparent 10%);
            background: color-mix(in srgb, var(--badge-bg), var(--bg-card) 22%);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
        }

        .chip:hover {
            background: color-mix(in srgb, var(--tab-hover), var(--bg-card) 25%);
            border-color: color-mix(in srgb, var(--text-primary), transparent 78%);
            transform: translateY(-1px);
        }

        .chip.active-chip {
            background: var(--text-primary);
            color: var(--bg-primary);
            border-color: var(--text-primary);
            box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
        }

        .panel-note {
            color: var(--text-muted);
            font-size: 0.74rem;
            line-height: 1.65;
        }

        /* The AI-search control is the shared switch row (.customizer-switch-row
           + .toggle-switch) from customizer_ui_stage2.html, so the bespoke
           .ai-search-toggle pill that used to live here is gone. */

        .search-combo {
            display: flex;
            align-items: center;
            gap: 0.35rem;
            min-height: 46px;
            padding: 4px;
            border: 1px solid color-mix(in srgb, var(--input-border), transparent 6%);
            border-radius: 16px;
            background: color-mix(in srgb, var(--input-bg), var(--bg-card) 18%);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
        }

        .search-combo:focus-within {
            border-color: color-mix(in srgb, var(--text-primary), transparent 35%);
            box-shadow:
                0 0 0 4px color-mix(in srgb, var(--text-primary), transparent 92%),
                inset 0 1px 0 rgba(255,255,255,0.35);
        }

        .search-combo-input {
            flex: 1;
            min-width: 0;
            border: none;
            outline: none;
            background: transparent;
            color: var(--text-primary);
            padding: 0 0.8rem;
            font: inherit;
            font-size: 0.85rem;
            font-weight: 600;
        }

        .search-combo-btn {
            min-width: 92px;
            min-height: 38px;
            border: none;
            border-radius: 14px;
            background: var(--btn-primary-bg);
            color: var(--btn-primary-text);
            font: inherit;
            font-size: 0.82rem;
            font-weight: 700;
            cursor: pointer;
        }

        .search-toolbar {
            /* The city label and current-location action were removed from the location drawer. */
            display: none;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            margin-bottom: 0.45rem;
        }

        .search-toolbar label {
            margin: 0;
        }

        .search-icon-btn {
            width: 34px;
            height: 34px;
            flex: 0 0 auto;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 999px;
            border: 1px solid color-mix(in srgb, var(--input-border), transparent 6%);
            background: color-mix(in srgb, var(--input-bg), var(--bg-card) 18%);
            color: var(--text-primary);
            cursor: pointer;
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
            transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
        }

        .search-icon-btn:hover {
            transform: translateY(-1px);
            border-color: color-mix(in srgb, var(--text-primary), transparent 72%);
            box-shadow: 0 8px 18px rgba(0,0,0,0.08);
        }

        .search-icon-btn svg {
            width: 16px;
            height: 16px;
            stroke: currentColor;
            fill: none;
            stroke-width: 1.9;
        }

        .search-results {
            margin-top: 0.2rem;
            border-radius: 20px;
            border: 1px solid color-mix(in srgb, var(--border-card), transparent 8%);
            background: color-mix(in srgb, var(--drawer-bg), transparent 2%);
            box-shadow: 0 18px 36px rgba(0, 0, 0, 0.12);
            overflow: hidden;
        }

        .search-result {
            padding: 0.88rem 1rem;
            border-bottom: 1px solid color-mix(in srgb, var(--border-card), transparent 18%);
            font-size: 0.8rem;
            line-height: 1.45;
        }

        .search-result.is-status {
            cursor: default;
        }

        .search-result.is-error {
            color: #b42318;
            cursor: default;
        }

        .ai-search-candidate-label {
            display: block;
            padding: 0.8rem 1rem 0.35rem;
            color: var(--text-muted);
            font-size: 0.74rem;
            font-weight: 700;
        }

        .ai-search-candidate-select {
            width: calc(100% - 2rem);
            min-height: 42px;
            margin: 0 1rem 1rem;
            padding: 0 0.75rem;
            border: 1px solid color-mix(in srgb, var(--input-border), transparent 6%);
            border-radius: 10px;
            background: var(--input-bg);
            color: var(--text-primary);
            font: inherit;
            font-size: 0.8rem;
        }

        .switch-row {
            padding: 0.2rem 0;
            font-size: 0.8rem;
        }

        .switch {
            width: 54px;
            height: 32px;
        }

        .switch span {
            border-radius: 999px;
            background: color-mix(in srgb, var(--input-bg), var(--bg-card) 18%);
            border: 1px solid color-mix(in srgb, var(--input-border), transparent 8%);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
        }

        .switch span::before {
            width: 24px;
            height: 24px;
            left: 3px;
            top: 3px;
            border-radius: 50%;
            background: var(--bg-primary);
            box-shadow: 0 6px 12px rgba(0,0,0,0.16);
        }

        .switch input:checked + span::before {
            transform: translateX(22px);
            background: var(--bg-primary);
        }

        .component-card,
        .style-json-card {
            border-radius: 12px;
            border: 1px solid color-mix(in srgb, var(--drawer-border), transparent 6%);
            background: color-mix(in srgb, var(--bg-card), transparent 4%);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.32);
        }

        .component-card {
            padding: 1rem 1rem 1.05rem;
        }

        .style-card,
        .layout-card,
        .orientation-card {
            display: grid;
            align-content: start;
            justify-items: stretch;
            gap: 0.55rem;
            min-height: 96px;
            padding: 0.85rem;
            border-radius: 12px;
            border: 1px solid color-mix(in srgb, var(--border-card), transparent 8%);
            background: color-mix(in srgb, var(--badge-bg), var(--bg-card) 20%);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
            transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
        }

        .style-card:hover,
        .layout-card:hover,
        .orientation-card:hover {
            transform: translateY(-2px);
            border-color: color-mix(in srgb, var(--text-primary), transparent 78%);
            box-shadow: 0 14px 26px rgba(0,0,0,0.09);
        }

        .style-card.active-chip,
        .layout-card.active-chip,
        .orientation-card.active-chip {
            box-shadow: 0 18px 30px rgba(0,0,0,0.16);
        }

        @media (max-width: 1100px) {
            .map-grid-overlay { grid-template-columns: repeat(4, 1fr); }
        }

        @media (max-width: 900px) {
            .map-static-template .nav { display: none; }
            .map-static-template .hamburger-btn { display: grid; }
            .map-static-template .actions > .btn-outline,
            .map-static-template .actions > .btn-primary { display: none; }
            .map-static-template .mobile-menu .btn-outline,
            .map-static-template .mobile-menu .btn-primary {
                justify-self: start;
                margin-top: 0.75rem;
            }
            .map-static-template .main-content-container.drawer-open { margin-right: 0; }
            .map-static-template .artwork-display {
                min-height: auto;
                padding: 1rem 1rem 1.5rem;
            }
            .map-static-template .artwork-display::before {
                display: none;
            }
            .map-static-template .artwork-stage {
                width: min(calc(100vw - var(--frame-mobile-gap)), 460px);
                max-width: 100%;
                margin: 0 auto;
            }
            .map-static-template .artwork-scale,
            .map-static-template .artwork-frame {
                transition: none;
                will-change: auto;
            }
            .map-static-template .artwork-frame {
                --design-frame-shadow: none;
            }
            .vertical-tab-bar {
                position: static;
                width: 100%;
                flex-direction: row;
                align-items: stretch;
                justify-content: flex-start;
                padding: 0 1rem 1rem;
                gap: 0.5rem;
                overflow-x: auto;
                border-left: none;
                border-top: 1px solid var(--border-card);
                background: var(--bg-primary);
                backdrop-filter: none;
            }
            .tab-item {
                min-width: 72px;
                width: auto;
                flex: 0 0 auto;
                padding: 0.7rem 0.8rem;
                border-left: none;
                border-bottom: 3px solid transparent;
                border-radius: 0;
                background: transparent;
            }
            .tab-item.active {
                border-left: none;
                border-bottom: 3px solid var(--text-primary);
                background: var(--tab-active);
            }
            .tab-item svg { width: 20px; height: 20px; }
            .tab-item span { font-size: 0.58rem; }
            :root { --tab-width: 0px; --drawer-width: 100vw; }
            .drawer-panel {
                position: static;
                width: auto;
                height: auto;
                transform: none;
                border-left: none;
                border-top: none;
                padding: 1.25rem 1rem 1.5rem;
                display: flex;
                margin: 0;
                border-radius: 0;
            }
            .drawer-panel.open {
                display: flex;
            }
            .drawer-header {
                padding-bottom: 0.6rem;
                border-bottom: none;
            }
            .component-editor-fab {
                left: 16px;
                bottom: 88px;
                padding: 0.75rem 0.95rem;
            }
            .component-modal {
                align-items: stretch;
                padding: 0;
            }
            .marker-editor-modal {
                display: none;
                align-items: flex-end;
                justify-content: center;
                background: rgba(0,0,0,0.26);
                pointer-events: auto;
            }
            .marker-editor-modal.open {
                display: flex;
            }
            .component-dialog.marker-editor-dialog {
                position: relative;
                left: auto;
                top: auto;
                width: min(360px, 100%);
                height: auto;
                max-height: min(460px, 60vh);
                border-right: 0;
                border-bottom: 0;
                border-left: 0;
                border-radius: 8px 8px 0 0;
            }
            .component-dialog {
                width: 100vw;
                height: 100vh;
                max-height: 100vh;
            }
            .component-controls {
                grid-template-columns: 1fr;
                padding: 1rem;
            }
            .component-control-grid {
                grid-template-columns: 1fr;
            }
            .preview-grid.four {
                grid-template-columns: repeat(4, minmax(0, 1fr));
            }
            .marker-grid {
                grid-template-columns: repeat(6, minmax(0, 1fr));
            }
        }


        /* map-style-icon-only-overrides */
        .map-static-template .style-card {
            min-height: 0;
            padding: 0;
            gap: 0;
            overflow: hidden;
        }

        .map-static-template .style-card .style-preview-image {
            height: 100%;
            border: 0;
            border-radius: 0;
        }

        .map-static-template .layout-card {
            place-items: center;
            text-align: center;
        }

        .map-static-template .placed-marker-card {
            grid-template-columns: 1fr;
            place-items: center;
            min-height: 58px;
            padding: 0.55rem;
            text-align: center;
        }

        /* Art Studio Next customizer rail: quiet, editorial controls with
           deliberate spacing and a restrained active state. */
        .frontend-theme-art-studio-next.map-static-template {
            --drawer-width: 450px;
        }

        .frontend-theme-art-studio-next.map-static-template .admin-custom-map-size {
            top: 96px;
            right: auto;
            left: 24px;
            bottom: auto;
        }

        .frontend-theme-art-studio-next.map-static-template .admin-custom-map-size-panel {
            position: static;
            right: auto;
            bottom: auto;
            left: auto;
        }

        .frontend-theme-art-studio-next.map-static-template .vertical-tab-bar {
            width: var(--tab-width);
            padding: 28px 9px 20px;
            gap: 10px;
            align-items: center;
            background: #f8f8f6;
            border-left: 1px solid #deded8;
            box-shadow: -8px 0 24px rgba(18, 18, 16, 0.025);
            backdrop-filter: none;
        }

        .frontend-theme-art-studio-next.map-static-template .vertical-tab-bar::before {
            content: "";
            width: 28px;
            height: 1px;
            margin: 0 0 8px;
            background: #c9c9c2;
        }

        .frontend-theme-art-studio-next.map-static-template .tab-item {
            width: 62px;
            min-height: 68px;
            padding: 12px 5px 11px;
            gap: 8px;
            border: 1px solid transparent;
            border-radius: 2px;
            color: #777771;
            background: transparent;
            font-weight: 500;
            transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
        }

        .frontend-theme-art-studio-next.map-static-template .tab-item svg {
            width: 19px;
            height: 19px;
            stroke-width: 1.35;
        }

        .frontend-theme-art-studio-next.map-static-template .tab-item span {
            font-size: 10px;
            line-height: 1.15;
            letter-spacing: 0.12em;
            font-weight: 550;
            white-space: nowrap;
        }

        .frontend-theme-art-studio-next.map-static-template .tab-item:hover {
            color: #11110f;
            background: #f0f0ec;
            border-color: #e3e3dd;
            transform: none;
        }

        .frontend-theme-art-studio-next.map-static-template .tab-item.active {
            color: #fff;
            background: #10100f;
            border-color: #10100f;
            box-shadow: 0 5px 14px rgba(16, 16, 15, 0.12);
        }

        .frontend-theme-art-studio-next.map-static-template .drawer-panel {
            background: #fbfbf9;
            border-left: 1px solid #deded8;
            box-shadow: -18px 0 36px rgba(18, 18, 16, 0.045);
            backdrop-filter: none;
            padding: 32px 28px 40px;
            gap: 28px;
            overflow: hidden;
            transition: transform 260ms cubic-bezier(.22, .61, .36, 1);
        }

        .frontend-theme-art-studio-next.map-static-template .drawer-header {
            padding: 0 0 17px;
            border-bottom: 1px solid #deded8;
            font-size: 17px;
            line-height: 1.25;
            letter-spacing: 0.015em;
            font-weight: 600;
        }

        .frontend-theme-art-studio-next.map-static-template .drawer-content {
            gap: 26px;
            min-height: 0;
            overflow-y: auto;
            padding-right: 4px;
            padding-bottom: 8px;
        }

        .frontend-theme-art-studio-next.map-static-template .drawer-purchase-bar {
            display: grid;
            grid-template-columns: minmax(92px, 0.7fr) minmax(0, 1.3fr);
            align-items: stretch;
            gap: 0;
            flex: 0 0 auto;
            padding: 8px 0 0;
            border-top: 1px solid #deded8;
            background: #fbfbf9;
        }

        .frontend-theme-art-studio-next.map-static-template .drawer-purchase-price,
        .frontend-theme-art-studio-next.map-static-template .drawer-purchase-add,
        .frontend-theme-art-studio-next.map-static-template .drawer-purchase-save {
            min-height: 34px;
        }

        .frontend-theme-art-studio-next.map-static-template .drawer-purchase-price {
            display: flex;
            align-items: center;
            min-width: 0;
            padding: 0 10px;
        }

        .frontend-theme-art-studio-next.map-static-template .drawer-purchase-price strong {
            color: #10100f;
            font-size: 20px;
            font-weight: 600;
            line-height: 1;
            white-space: nowrap;
        }

        .frontend-theme-art-studio-next.map-static-template .drawer-purchase-actions {
            display: flex;
            min-width: 0;
            width: 100%;
            gap: 8px;
            overflow: visible;
            border-radius: 0;
        }

        .frontend-theme-art-studio-next.map-static-template .drawer-purchase-actions .drawer-btn {
            width: 50%;
            min-width: 0;
            margin: 0;
            padding: 0 10px;
            border-radius: 6px !important;
            transition: none;
            white-space: nowrap;
        }

        .frontend-theme-art-studio-next.map-static-template .drawer-purchase-actions .drawer-btn:hover {
            transform: none;
            box-shadow: none;
        }

        .frontend-theme-art-studio-next.map-static-template .drawer-purchase-actions .drawer-purchase-save {
            margin-left: 0;
            border: 1px solid #176b4d;
            background: #176b4d;
            color: #ffffff;
        }

        .frontend-theme-art-studio-next.map-static-template .drawer-purchase-actions .drawer-purchase-save:hover {
            border-color: #11533b;
            background: #11533b;
            color: #ffffff;
        }

        .frontend-theme-art-studio-next.map-static-template .drawer-purchase-message {
            grid-column: 1 / -1;
            min-height: 0;
            margin: 0;
            color: #85857e;
            font-size: 11px;
            line-height: 1.3;
        }

        .frontend-theme-art-studio-next.map-static-template .drawer-section {
            gap: 11px;
            padding-bottom: 24px;
            border-bottom: 1px solid #e7e7e1;
        }

        .frontend-theme-art-studio-next.map-static-template .drawer-content > .drawer-section:first-child,
        .frontend-theme-art-studio-next.map-static-template .drawer-content > .drawer-section.location-field {
            border-bottom: 0;
        }

        /* Keep the location form compact and place AI search as a quiet
           utility toggle in the upper-right corner. */
        .map-static-template #drawerContent:has(.location-field) {
            gap: 14px;
        }

        .map-static-template #drawerContent:has(.location-field) > .drawer-section {
            gap: 10px;
            padding-bottom: 0;
        }

        .map-static-template #drawerContent:has(.location-field) .drawer-section:last-child {
            padding-top: 4px;
        }

        .map-static-template #drawerContent:has(.location-field) .search-combo {
            width: 100%;
            min-height: 40px;
            height: 40px;
            align-items: stretch;
            gap: 0;
            padding: 0;
            overflow: hidden;
            border-radius: 6px;
            box-shadow: none;
        }

        .map-static-template #drawerContent:has(.location-field) .search-combo:focus-within {
            box-shadow: 0 0 0 4px color-mix(in srgb, var(--text-primary), transparent 92%);
        }

        .map-static-template #drawerContent:has(.location-field) .search-combo-input {
            min-height: 38px;
            font-size: 0.84rem;
            font-weight: 600;
        }

        .map-static-template #drawerContent:has(.location-field) .search-combo-btn {
            align-self: stretch;
            min-width: 58px;
            min-height: 38px;
            margin: 0;
            border-left: 1px solid color-mix(in srgb, var(--input-border), transparent 16%);
            border-radius: 0 5px 5px 0;
            box-shadow: none;
            font-size: 0.72rem;
            font-weight: 700;
        }

        .frontend-theme-art-studio-next.map-static-template .drawer-section:last-child {
            padding-bottom: 0;
            border-bottom: 0;
        }

        .frontend-theme-art-studio-next.map-static-template .drawer-section label,
        .frontend-theme-art-studio-next.map-static-template .component-field label {
            color: #85857e;
            font-size: 10px;
            line-height: 1.2;
            letter-spacing: 0.16em;
            font-weight: 600;
        }

        @media (max-width: 920px) {
            .frontend-theme-art-studio-next.map-static-template {
                --drawer-width: 100vw;
            }

            .frontend-theme-art-studio-next.map-static-template .admin-custom-map-size {
                top: 84px;
                left: 16px;
                right: auto;
                bottom: auto;
            }

            .frontend-theme-art-studio-next.map-static-template .admin-custom-map-size-panel {
                position: static;
                right: auto;
                bottom: auto;
                left: auto;
            }

            .frontend-theme-art-studio-next.map-static-template .vertical-tab-bar {
                padding: 10px 16px 14px;
                gap: 8px;
                box-shadow: none;
            }
            .frontend-theme-art-studio-next.map-static-template .vertical-tab-bar::before {
                display: none;
            }
            .frontend-theme-art-studio-next.map-static-template .tab-item {
                width: auto;
                min-width: 74px;
                min-height: 56px;
                padding: 9px 12px 8px;
            }
            .frontend-theme-art-studio-next.map-static-template .drawer-panel {
                padding: 24px 20px 32px;
                box-shadow: none;
            }
        }

        /* Compact segmented controls for the location quick picks. */
        .city-button-group,
        .style-chip:has(> .city-button) {
            display: flex;
            flex-wrap: wrap;
            align-items: stretch;
            gap: 0;
            width: fit-content;
            max-width: 100%;
            overflow: hidden;
            border: 0;
            border-radius: 0;
            background: transparent;
        }

        .city-button-group .city-button,
        .style-chip:has(> .city-button) .city-button {
            min-height: 30px;
            margin: 0;
            padding: 0.2rem 0.58rem;
            border: 0;
            border-right: 0;
            border-radius: 0;
            background: transparent;
            box-shadow: none;
            color: var(--text-primary);
            font: inherit;
            font-size: 0.7rem;
            font-weight: 700;
            line-height: 1.25;
            white-space: nowrap;
            cursor: pointer;
        }

        .city-button-group .city-button:last-child,
        .style-chip:has(> .city-button) .city-button:last-child {
            border-right: 0;
        }

        .city-button-group .city-button:hover,
        .style-chip:has(> .city-button) .city-button:hover {
            background: var(--tab-hover);
            transform: none;
        }

        .city-button-group .city-button.active-chip,
        .style-chip:has(> .city-button) .city-button.active-chip {
            background: var(--text-primary);
            color: var(--bg-primary);
        }

        /* Compact five-column controls for the style drawer. */
        .frontend-theme-art-studio-next.map-static-template #drawerContent .layout-preset-grid,
        .frontend-theme-art-studio-next.map-static-template #drawerContent .map-appearance-grid {
            grid-template-columns: repeat(5, minmax(0, 1fr));
            gap: 6px;
        }

        .frontend-theme-art-studio-next.map-static-template #drawerContent .layout-preset-grid .layout-card,
        .frontend-theme-art-studio-next.map-static-template #drawerContent .map-appearance-grid .style-card {
            border-radius: 6px !important;
        }

        .frontend-theme-art-studio-next.map-static-template #drawerContent .layout-preset-grid .layout-card,
        .frontend-theme-art-studio-next.map-static-template #drawerContent .layout-preset-grid .layout-card:hover,
        .frontend-theme-art-studio-next.map-static-template #drawerContent .layout-preset-grid .layout-card.active-chip {
            transform: none;
            box-shadow: none;
        }

        .frontend-theme-art-studio-next.map-static-template #drawerContent .map-appearance-grid .style-preview-image {
            border-radius: 5px;
        }

        /* 版式预设：固定五列与卡片比例，缩小内边距，避免空白过多、各机型高度不固定。 */
        #drawerContent .layout-preset-grid {
            grid-template-columns: repeat(5, minmax(0, 1fr));
            gap: 6px;
        }

        #drawerContent .layout-preset-grid .layout-card {
            min-height: 0;
            aspect-ratio: 128 / 96;
            padding: 0.3rem;
            gap: 0;
            align-content: center;
            justify-items: center;
        }

        #drawerContent .layout-preset-grid .preview-svg {
            width: 100%;
            height: 100%;
            aspect-ratio: 128 / 96;
        }

        /* 版式预设与其下方区块之间的间距小一点 */
        #drawerContent > .drawer-section:has(.layout-preset-grid) {
            padding-bottom: 12px;
        }

        #drawerContent > .drawer-section:has(.layout-preset-grid) + .drawer-section {
            padding-top: 2px;
        }
