@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: #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);
            --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);
            --tab-width: 80px;
            --drawer-width: 380px;
            --frame-width: 1000;
            --frame-height: 1500;
            --frame-max-width: 800px;   /* 与地图定制器一致：设计稿显示上限 */
            --frame-gap: clamp(8rem, 16vh, 16rem);
            --frame-mobile-gap: 2rem;
            --preview-scale: 1;
        }

        body.dark-theme {
            --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);
            --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);
        }

        body {
            background: var(--bg-primary);
            font-family: "GoogleSansFlex", "Microsoft YaHei UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Segoe UI", Arial, sans-serif;
            font-weight: 500;
            color: var(--text-primary);
            line-height: 1.4;
            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.drawer-open {
            margin-right: calc(var(--drawer-width) + var(--tab-width));
        }

        .btn-sm-outline,
        .drawer-btn {
            font-family: inherit;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-sm-outline {
            background: transparent;
            color: var(--btn-outline-text);
            border: 1px solid var(--btn-outline-border);
            border-radius: 999px;
            padding: 0.7rem 1.2rem;
            font-size: 0.88rem;
        }
        .btn-sm-outline:hover { background: var(--btn-outline-hover); color: var(--text-primary); transform: translateY(-1px); }

        .drawer-btn:hover { opacity: 1; transform: translateY(-1px); box-shadow: var(--shadow-sm); }

        .artwork-display {
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: calc(100vh - var(--customizer-header-height, 74px));
            padding: clamp(1rem, 3vw, 3rem);
            position: relative;
        }

        .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;
        }

        .artwork-stage {
            width: min(
                calc(100vw - var(--tab-width) - var(--frame-gap)),
                calc((100vh - var(--customizer-header-height, 74px) - var(--frame-gap)) * var(--frame-width) / var(--frame-height)),
                var(--frame-max-width)
            );
            aspect-ratio: calc(var(--frame-width) / var(--frame-height));
            position: relative;
        }

        .artwork-scale {
            width: calc(var(--frame-width) * 1px);
            height: calc(var(--frame-height) * 1px);
            position: absolute;
            top: 0;
            left: 0;
            transform: scale(var(--preview-scale));
            transform-origin: top left;
        }

        .artwork-frame {
            --design-frame-shadow: none;
            width: calc(var(--frame-width) * 1px);
            height: calc(var(--frame-height) * 1px);
            padding: 0;
            border-radius: 0;
            background: transparent;
            border: 0;
            box-shadow: var(--design-frame-shadow);
            transition: none;
        }

        .artwork-frame.landscape {
            width: calc(var(--frame-width) * 1px);
            height: calc(var(--frame-height) * 1px);
        }

        .star-poster {
            --poster-bg: #000000;
            --poster-text: #ffffff;
            --poster-line: #ffffff;
            --sky-bg: #000000;
            --sky-star: #ffffff;
            --text-bg: #000000;
            width: 100%;
            height: 100%;
            position: relative;
            overflow: hidden;
            border-radius: 0;
            border: 0;
            background: var(--poster-bg);
            color: var(--poster-text);
            font-family: "GoogleSansFlex", "PingFang SC", sans-serif;
        }

        .star-poster::before,
        .star-poster::after {
            content: none;
        }

        .sky-area::before {
            content: none;
        }

        .star-poster::before,
        .star-poster::after {
            position: absolute;
            inset: 5.4%;
            border: 1px solid var(--poster-line);
            z-index: 5;
            pointer-events: none;
        }

        .star-poster::after {
            inset: calc(5.4% + 8px);
            border-width: 3px;
        }

        .component-white-frame,
        .component-black-frame-outer,
        .component-black-frame-inner {
            content: "";
            display: block;
        }

        .star-poster-frame {
            position: absolute;
            z-index: 7;
            pointer-events: none;
        }

        .sky-area {
            --sky-border-width: 3px;
            --sky-border-color: var(--poster-line);
            position: absolute;
            top: 7.3%;
            left: 50%;
            width: 78%;
            aspect-ratio: 1;
            transform: translateX(-50%);
            border: 0;
            border-radius: 50%;
            overflow: hidden;
            background: var(--sky-bg);
            box-shadow: 0 0 0 var(--sky-border-width) var(--sky-border-color);
            z-index: 2;
        }

        .sky-area::after {
            content: none;
        }

        #celestial-map {
            position: absolute;
            inset: 0;
            width: 100% !important;
            height: 100% !important;
            min-width: 0 !important;
            display: block !important;
            overflow: hidden !important;
            isolation: isolate;
        }

        #celestial-map canvas {
            display: block !important;
            position: absolute !important;
            inset: 0 !important;
            width: 100% !important;
            height: 100% !important;
            z-index: 1;
        }

        #celestial-map svg.star-map-svg {
            width: 100% !important;
            height: 100% !important;
            display: block !important;
            position: absolute !important;
            inset: 0 !important;
            z-index: 1;
        }

        .poster-textbox {
            position: absolute;
            left: 90px;
            right: 90px;
            bottom: 117px;
            min-height: 420px;
            z-index: 6;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 16px;
            text-align: center;
            color: var(--poster-text);
            background: var(--poster-bg);
            padding-top: 0;
        }

        .poster-title {
            width: 88%;
            font-size: clamp(1.45rem, 4.6vw, 3.6rem);
            line-height: 1.05;
            font-weight: 800;
            overflow-wrap: anywhere;
        }

        .poster-location {
            font-size: clamp(0.82rem, 2vw, 1.25rem);
            letter-spacing: 0.08em;
            text-transform: uppercase;
            overflow-wrap: anywhere;
        }

        .poster-time,
        .poster-coordinates {
            font-size: clamp(0.62rem, 1.4vw, 0.9rem);
            color: var(--poster-text);
            overflow-wrap: anywhere;
        }

        .poster-message {
            width: min(82%, 540px);
            font-size: clamp(0.72rem, 1.55vw, 1rem);
            color: var(--poster-text);
            white-space: pre-line;
            overflow-wrap: anywhere;
        }

        .country-rule {
            display: none;
            width: 54px;
            height: 1px;
            background: currentColor;
            flex-shrink: 0;
        }

        .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);
        }

        .component-modal {
            position: fixed;
            inset: 0;
            z-index: 500;
            display: none;
            align-items: stretch;
            justify-content: flex-start;
            background: rgba(0,0,0,0.26);
        }

        .component-modal.open { display: flex; }

        .component-dialog {
            width: min(440px, 92vw);
            height: 100vh;
            max-height: 100vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            background: var(--drawer-bg);
            color: var(--text-primary);
            border-right: 1px solid var(--drawer-border);
            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-footer {
            flex-direction: column;
            align-items: stretch;
            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-controls {
            overflow: auto;
            padding: 1.2rem;
            display: grid;
            grid-template-columns: 1fr;
            gap: 1rem;
        }

        .component-card {
            border: 1px solid var(--drawer-border);
            background: var(--bg-card);
            padding: 1rem;
        }

        .component-card h3 {
            font-size: 0.84rem;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            margin-bottom: 0.85rem;
        }

        .component-control-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.75rem;
        }

        .component-field {
            display: flex;
            flex-direction: column;
            gap: 0.35rem;
            min-width: 0;
        }

        .component-field.full { grid-column: 1 / -1; }

        .component-field label {
            color: var(--text-secondary);
            font-size: 0.72rem;
            font-weight: 800;
        }

        .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.55rem 0.65rem;
            font: inherit;
            font-size: 0.78rem;
            outline: none;
        }

        .component-field input[type="color"] {
            min-height: 38px;
            padding: 0.2rem;
        }

        .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;
            width: 100%;
        }

        .component-actions .drawer-btn { flex: 1 1 calc(50% - 0.65rem); }

        .vertical-tab-bar {
            position: fixed;
            right: 0;
            top: var(--customizer-header-height, 74px);
            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);
        }

        .tab-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 5px;
            width: 100%;
            padding: 10px 0;
            cursor: pointer;
            color: var(--text-secondary);
            font-weight: 700;
            border-left: 3px solid transparent;
            transition: all 0.2s ease;
        }

        .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-color: var(--text-primary);
        }

        .drawer-panel {
            position: fixed;
            top: var(--customizer-header-height, 74px);
            right: var(--tab-width);
            width: var(--drawer-width);
            height: calc(100vh - var(--customizer-header-height, 74px));
            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);
            line-height: 1;
        }

        .drawer-content,
        .drawer-section {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .drawer-section { gap: 0.55rem; }

        .drawer-field-heading {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
            min-height: 32px;
        }

        .field-visibility-switch {
            display: inline-flex;
            align-items: center;
            gap: 0.55rem;
            flex: 0 0 auto;
            cursor: pointer;
        }

        .drawer-section label,
        .check-row {
            font-size: 0.78rem;
            font-weight: 700;
            color: var(--text-secondary);
            letter-spacing: 0.2px;
        }

        .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;
            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;
        }

        .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: 92px; }

        .drawer-btn {
            background: var(--btn-primary-bg);
            color: var(--btn-primary-text);
            border: none;
            border-radius: 999px;
            padding: 0.82rem 1.1rem;
            font-size: 0.9rem;
            width: 100%;
            box-shadow: var(--shadow-sm);
        }

        .inline-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.7rem;
        }

        .style-chip {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .chip,
        .swatch,
        .font-card {
            background: var(--badge-bg);
            color: var(--text-primary);
            border: 1px solid var(--border-card);
            border-radius: 8px;
            cursor: pointer;
            transition: 0.15s;
        }

        .chip {
            padding: 0.38rem 0.75rem;
            font-size: 0.72rem;
            font-weight: 700;
        }

        .chip.active-chip,
        .font-card.active,
        .swatch.active {
            background: var(--text-primary);
            color: var(--bg-primary);
            border-color: var(--text-primary);
        }

        .swatches {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 0.55rem;
        }

        .swatch {
            height: auto;
            aspect-ratio: 1;
            position: relative;
            overflow: hidden;
        }

        .swatch::after {
            content: "";
            position: absolute;
            inset: auto 0 0;
            height: 50%;
            background: var(--swatch-accent, transparent);
        }

        .font-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.65rem;
        }

        .font-card {
            padding: 0.8rem 0.6rem;
            text-align: center;
            font-size: 1rem;
        }

        .check-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.65rem;
        }

        .check-row {
            display: flex;
            align-items: center;
            gap: 0.45rem;
            border: 1px solid var(--border-card);
            border-radius: 8px;
            padding: 0.55rem 0.65rem;
            background: var(--input-bg);
        }

        .check-row input { accent-color: var(--text-primary); }

        .status-note {
            font-size: 0.72rem;
            color: var(--text-muted);
            line-height: 1.55;
        }

        /* 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 {
            font-size: 0.7rem;
            font-weight: 700;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            color: var(--text-muted);
        }

        .drawer-input,
        .drawer-select,
        .drawer-textarea,
        .component-field input,
        .component-field select,
        .component-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;
        }

        .drawer-input:focus,
        .drawer-select:focus,
        .drawer-textarea:focus,
        .component-field input:focus,
        .component-field select:focus,
        .component-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;
        }

        .inline-row {
            grid-template-columns: minmax(0, 1fr) auto;
            align-items: end;
            gap: 0.75rem;
        }

        .search-combo {
            display: grid;
            grid-template-columns: 1fr auto;
            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 {
            min-width: 0;
            min-height: 100%;
            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;
        }

        .style-chip {
            gap: 0.65rem;
        }

        .chip,
        .swatch,
        .font-card,
        .check-row {
            border-radius: 20px;
            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);
            transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
        }

        .chip {
            min-height: 38px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 0.45rem 0.9rem;
            font-size: 0.74rem;
            font-weight: 700;
        }

        .chip:hover,
        .swatch:hover,
        .font-card:hover,
        .check-row:hover {
            transform: translateY(-1px);
            border-color: color-mix(in srgb, var(--text-primary), transparent 78%);
        }

        .chip.active-chip,
        .font-card.active,
        .swatch.active {
            box-shadow: 0 12px 28px rgba(0,0,0,0.16);
        }

        .font-card {
            min-height: 70px;
            display: grid;
            place-items: center;
        }

        .swatch {
            height: auto;
            aspect-ratio: 1;
            border-radius: 50%;
        }

        .star-style-card {
            min-height: 0;
            width: 86%;
            aspect-ratio: 1;
            display: grid;
            place-items: center;
            justify-self: center;
            padding: 0;
            text-align: center;
            border-radius: 50%;
            overflow: hidden;
            transition: none;
        }

        .star-style-card::after {
            display: none;
        }

        .star-style-card.swatch::after {
            display: none;
        }

        .style-palette {
            width: 100%;
            height: 100%;
            display: grid;
            grid-template-columns: 1fr;
            grid-template-rows: 1fr 1fr;
            overflow: hidden;
            flex: 0 0 auto;
            border: 0;
            border-radius: 50%;
        }

        .star-style-card:hover {
            transform: none;
        }

        .star-style-card.active {
            box-shadow: none;
            border-width: 2px;
            border-color: var(--text-primary);
        }

        .style-palette i {
            display: block;
        }

        .preview-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.65rem;
        }

        .orientation-card {
            min-height: 112px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 0.45rem;
            padding: 0.75rem;
            text-align: center;
        }

        .orientation-card .preview-svg {
            width: 100%;
            max-width: 110px;
            height: 66px;
        }

        .orientation-card span {
            font-size: 0.72rem;
            font-weight: 800;
        }

        .check-row {
            min-height: 52px;
            gap: 0.65rem;
            padding: 0.75rem 0.85rem;
            color: var(--text-primary);
        }

        .check-row input {
            width: 16px;
            height: 16px;
        }

        .switch-list {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 0.65rem;
        }

        .switch-row {
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 0.55rem;
            min-height: 36px;
            padding: 0.25rem 0;
            text-align: left;
            border-radius: 0;
            border: 0;
            background: transparent;
            box-shadow: none;
        }

        .switch-row-label {
            display: inline-flex;
            align-items: center;
            min-width: 0;
            color: var(--text-primary);
            font-size: 0.72rem;
            font-weight: 700;
            letter-spacing: 0;
            text-transform: none;
        }

        /* Switch geometry, radius, palette and thumb placement all live in the
           single shared block inside customizer_ui_stage2.html, which every
           customizer page includes. Nothing switch-related is defined here on
           purpose: a second definition is what previously let the thumb drift
           out of the track. */

        .component-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);
        }

        @media (max-width: 900px) {
            .main-content-container.drawer-open { margin-right: 0; }
            .artwork-display {
                min-height: auto;
                padding: 1rem 1rem 1.5rem;
            }
            .artwork-stage {
                width: min(calc(100vw - var(--frame-mobile-gap)), 460px);
                max-width: 100%;
                margin: 0 auto;
            }
            .artwork-frame,
            .artwork-frame.landscape {
                padding: 0;
            }
            .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-header {
                padding-bottom: 0.6rem;
                border-bottom: none;
            }
            .component-editor-fab {
                left: 16px;
                bottom: 88px;
                padding: 0.75rem 0.95rem;
            }
            .component-dialog {
                width: 100vw;
                height: 100vh;
                max-height: 100vh;
            }
            .inline-row,
            .check-grid,
            .font-grid,
            .component-control-grid { grid-template-columns: 1fr; }
        }

        .search-combo.search-combo-with-map {
            grid-template-columns: minmax(0, 1fr) auto auto;
        }

        .search-combo.search-combo-with-map #searchBtn {
            min-width: 64px;
        }

        .search-combo-map-btn {
            min-width: 72px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.35rem;
            background: transparent;
            color: var(--text-primary);
            border: 1px solid color-mix(in srgb, var(--input-border), transparent 5%);
        }

        .search-combo-map-btn .ui-icon {
            width: 16px;
            height: 16px;
        }

        body.star-map-picker-open {
            overflow: hidden;
        }

        .star-map-picker-modal {
            position: fixed;
            inset: 0;
            z-index: 12000;
            display: grid;
            place-items: center;
            padding: 20px;
            background: rgba(0, 0, 0, 0.52);
        }

        .star-map-picker-modal[hidden] {
            display: none;
        }

        .star-map-picker-dialog {
            width: min(920px, 96vw);
            max-height: calc(100vh - 40px);
            display: grid;
            grid-template-rows: auto minmax(360px, 68vh) auto;
            overflow: hidden;
            border: 1px solid var(--drawer-border);
            border-radius: 6px;
            background: var(--drawer-bg);
            color: var(--text-primary);
            box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
        }

        .star-map-picker-header,
        .star-map-picker-footer {
            min-height: 58px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            padding: 12px 16px;
            background: var(--drawer-bg);
        }

        .star-map-picker-header {
            border-bottom: 1px solid var(--drawer-border);
        }

        .star-map-picker-header h2 {
            margin: 0;
            font-size: 16px;
            line-height: 1.3;
            letter-spacing: 0;
        }

        .star-map-picker-close {
            width: 36px;
            height: 36px;
            flex: 0 0 36px;
            display: inline-grid;
            place-items: center;
            border: 1px solid var(--input-border);
            border-radius: 4px;
            background: var(--input-bg);
            color: var(--text-primary);
            cursor: pointer;
        }

        .location-search-heading {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
        }

        .location-search-actions {
            display: inline-flex;
            align-items: center;
            justify-content: flex-end;
            gap: 0.45rem;
        }

        /* The AI-search control is a real shared .toggle-switch, so no bespoke
           pill styling lives here any more. */

        .search-map-btn {
            min-height: 30px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.28rem;
            padding: 0.3rem 0.55rem;
            border: 1px solid color-mix(in srgb, var(--input-border), transparent 6%);
            border-radius: 10px;
            background: color-mix(in srgb, var(--input-bg), var(--bg-card) 18%);
            color: var(--text-primary);
            font: inherit;
            font-size: 0.72rem;
            font-weight: 700;
            cursor: pointer;
        }

        .search-map-btn:hover {
            border-color: color-mix(in srgb, var(--text-primary), transparent 72%);
            transform: translateY(-1px);
        }

        .search-map-btn .ui-icon {
            width: 14px;
            height: 14px;
        }

        .star-coordinates-row {
            grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
            gap: 0.7rem;
        }

        .star-coordinates-row .drawer-input,
        .star-location-input,
        .star-time-section > .drawer-input {
            min-height: 40px;
            height: 40px;
            padding: 0 0.8rem;
            border-radius: 6px;
            border-width: 1px;
            box-shadow: none;
            font-size: 0.84rem;
        }

        .star-coordinates-row .drawer-input:focus,
        .star-location-input:focus,
        .star-time-section > .drawer-input:focus {
            box-shadow: 0 0 0 4px color-mix(in srgb, var(--text-primary), transparent 92%);
        }

        .star-time-heading {
            width: 100%;
            min-height: 30px;
            align-items: center;
        }

        .time-switch-control {
            display: inline-flex;
            align-items: center;
            justify-content: flex-end;
            gap: 0.55rem;
            min-height: 30px;
            color: var(--text-primary) !important;
            font-size: 0.72rem !important;
            font-weight: 700 !important;
            letter-spacing: 0 !important;
            text-transform: none !important;
            cursor: pointer;
        }

        /* No size override here on purpose: the time-row switches use the same
           shared geometry and palette as every other customizer switch. */

        .time-switch-row {
            display: flex;
            justify-content: flex-end;
            width: 100%;
            margin-top: -0.1rem;
        }

        @media (max-width: 900px) {
            .star-coordinates-row {
                grid-template-columns: 1fr;
            }
        }

        /* Keep the star-map search field aligned with the map customizer search field. */
        .location-search-heading + .search-combo {
            width: 100%;
            min-height: 40px;
            height: 40px;
            align-items: stretch;
            gap: 0;
            padding: 0;
            overflow: hidden;
            border-radius: 6px;
            box-shadow: none;
        }

        .location-search-heading + .search-combo:focus-within {
            box-shadow: 0 0 0 4px color-mix(in srgb, var(--text-primary), transparent 92%);
        }

        .location-search-heading + .search-combo .search-combo-input {
            min-height: 38px;
            font-size: 0.84rem;
        }

        .location-search-heading + .search-combo .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;
        }

        .star-map-picker-close .ui-icon {
            width: 18px;
            height: 18px;
        }

        .star-map-picker-canvas {
            width: 100%;
            min-height: 360px;
            background: #e8e9e6;
            cursor: crosshair;
        }

        .star-map-picker-footer {
            justify-content: center;
            border-top: 1px solid var(--drawer-border);
        }

        .star-map-picker-status {
            min-width: 0;
            color: var(--text-secondary);
            font-size: 13px;
            line-height: 1.45;
            text-align: center;
        }

        .star-map-picker-modal .maplibregl-ctrl-attrib {
            font-size: 10px;
        }

        @media (max-width: 640px) {
            .search-combo.search-combo-with-map {
                grid-template-columns: minmax(0, 1fr) 62px 68px;
            }

            .search-combo.search-combo-with-map #searchBtn,
            .search-combo-map-btn {
                min-width: 0;
                padding-inline: 8px;
            }

            .star-map-picker-modal {
                padding: 0;
            }

            .star-map-picker-dialog {
                width: 100vw;
                height: 100dvh;
                max-height: 100dvh;
                grid-template-rows: auto minmax(0, 1fr) auto;
                border: 0;
                border-radius: 0;
            }

            .star-map-picker-canvas {
                min-height: 0;
            }
        }
