@font-face {
    font-family: "StickerText";
    src: url("/assets/fonts/bungee-outline-latin-400-normal.woff2") format("woff2"),
         url("/assets/fonts/BungeeOutline-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-primary: #0A0A0F;
    --bg-secondary: rgba(22, 22, 30, 0.7);
    --bg-tertiary: rgba(30, 30, 42, 0.6);
    --accent: #E11D48;
    --accent-hover: #F43F5E;
    --accent-glow: rgba(225, 29, 72, 0.4);
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --border-color: rgba(255, 255, 255, 0.08);
    --success: #10B981;
    --warning: #F59E0B;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);
    --font-heading: "Trebuchet MS", "Segoe UI", "Verdana", sans-serif;
    --font-body: "Segoe UI", "Helvetica Neue", "Arial", sans-serif;
    --app-header-offset: 0px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: radial-gradient(circle at top right, #1E1225, var(--bg-primary) 50%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    background-attachment: fixed;
}

body.modal-scroll-lock {
    overflow: hidden;
}

/* Header */
.header {
    background: var(--bg-secondary);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #F8FAFC 0%, #94A3B8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.header h1::before {
    content: "◧";
    -webkit-text-fill-color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

.header-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #BE123C);
    color: white;
    box-shadow: 0 4px 15px rgba(225, 29, 72, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(225, 29, 72, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.btn-danger {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-danger:hover {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 15px rgba(225, 29, 72, 0.3);
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

/* Dashboard */
.dashboard {
    padding: 1rem;
    max-width: 1400px;
    margin: 0 auto;
    padding-bottom: 1rem;
}

.dashboard.has-export-dock {
    padding-bottom: 7.25rem;
}

.dashboard-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.dashboard-header h2 {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.dashboard-tools {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
    align-items: flex-end;
}

.dashboard-tools .btn {
    flex: 0 0 auto;
    justify-content: center;
}

.dashboard-top-dock {
    position: sticky;
    top: calc(var(--app-header-offset) + 0.35rem);
    z-index: 170;
    margin-bottom: 0.7rem;
}

.dashboard-top-dock-inner {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(22, 22, 30, 0.84), rgba(22, 22, 30, 0.7));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.45rem;
}

.dashboard-top-dock .dashboard-tools {
    margin: 0;
}

.table-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.table-toolbar-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.table-toolbar-total {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.table-toolbar-total strong {
    color: var(--text-primary);
}

.table-toolbar-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.table-toolbar-bulk {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
    align-items: flex-end;
}

.table-toolbar-bulk .batch-export-controls {
    align-items: flex-end;
}

.table-toolbar-bulk .batch-format-field {
    gap: 0.15rem;
    min-width: 92px;
}

.table-toolbar-bulk .batch-format-label {
    font-size: 0.64rem;
}

.table-toolbar-bulk .batch-format-select {
    width: 92px;
    height: 34px;
}

.table-toolbar-bulk .btn {
    height: 34px;
    padding-top: 0;
    padding-bottom: 0;
}

.table-bulk-details {
    position: relative;
    flex: 0 0 auto;
}

.table-bulk-summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.table-bulk-details.is-disabled .table-bulk-summary {
    opacity: 0.55;
    cursor: not-allowed;
}

.table-bulk-summary::-webkit-details-marker {
    display: none;
}

.table-bulk-menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    z-index: 200;
    min-width: 220px;
    padding: 0.4rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(22, 22, 30, 0.98), rgba(15, 15, 22, 0.98));
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.table-bulk-menu-item {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
}

.table-bulk-menu-sep {
    height: 1px;
    margin: 0.15rem 0;
    background: var(--border-color);
}

.table-toolbar-bulk-only-menu {
    width: auto;
    justify-content: flex-start;
}

.batch-export-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 220;
    border-top: 1px solid var(--border-color);
    background: linear-gradient(180deg, rgba(10, 10, 15, 0.88), rgba(10, 10, 15, 0.97));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding:
        max(0.55rem, calc(0.55rem + env(safe-area-inset-bottom)))
        max(0.75rem, env(safe-area-inset-left))
        calc(0.55rem + env(safe-area-inset-bottom))
        max(0.75rem, env(safe-area-inset-right));
}

.batch-export-dock-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.batch-export-dock .batch-export-controls {
    flex: 0 0 auto;
    min-width: auto;
    display: flex;
}

.batch-export-dock .batch-format-field {
    min-width: 110px;
    flex: 0 0 auto;
    align-self: flex-end;
    gap: 0;
}

.batch-export-dock .batch-format-select {
    flex: none;
    width: 110px;
    min-width: 110px;
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    line-height: 1.1;
    box-sizing: border-box;
}

.batch-export-dock #exportAllBtn,
.batch-export-dock #exportSelectedBtn {
    flex: 0 0 auto;
    min-width: 112px;
    height: 36px;
    padding-top: 0;
    padding-bottom: 0;
    align-self: flex-end;
}

.batch-export-status-dock {
    max-width: 1400px;
    margin: 0.25rem auto 0;
    min-height: 0;
}

.batch-export-status-dock:empty {
    display: none;
}

.batch-export-progress {
    max-width: 1400px;
    margin: 0.25rem auto 0;
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.batch-export-progress.visible {
    display: flex;
}

.batch-export-progress-label {
    flex: 0 0 auto;
    min-width: 3rem;
    text-align: right;
}

.batch-export-progress-track {
    flex: 1 1 auto;
    height: 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
    overflow: hidden;
}

.batch-export-progress-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(225, 29, 72, 0.85), rgba(244, 63, 94, 0.95));
    transition: width 0.18s ease;
}

.dashboard-top-dock .batch-export-controls {
    flex: 0 0 auto;
    min-width: auto;
}

.batch-format-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 110px;
}

.batch-format-label {
    font-size: 0.72rem;
    line-height: 1.1;
}

.batch-format-select {
    min-width: 0;
    width: 110px;
    height: 38px;
}

.tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.tag-card {
    background: rgba(22, 22, 30, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tag-card:hover {
    border-color: rgba(225, 29, 72, 0.5);
    box-shadow: var(--shadow-glow), 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    transform: translateY(-5px) scale(1.02);
    background: rgba(22, 22, 30, 0.6);
}

.tags-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.75rem;
    background: transparent;
}

.tags-table thead {
    display: none;
}

.tags-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tags-table tbody tr {
    display: block;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    overflow: hidden;
    transition: background 0.15s ease;
}

.tags-table tbody tr:hover {
    background: var(--bg-hover);
}

.tags-table td {
    display: block;
    padding: 0.75rem 0.85rem;
    border-top: 1px solid var(--border-color);
}

.table-preview-cell {
    border-top: none !important;
    padding: 0 !important;
}

.table-preview-cell {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 88px;
    background: #333;
    padding: 0 !important;
    margin: 0;
    line-height: 0;
}

.table-select-cell {
    width: 44px;
    text-align: center;
}

.tag-select-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.table-preview {
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 88px;
    margin: 0;
    padding: 5px;
    box-sizing: border-box;
}

.table-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 2px;
}

.table-preview-interactive {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.table-preview-interactive:active {
    opacity: 0.9;
}

.table-text-cell {
    width: auto;
    display: none !important;
}

.table-actions-cell {
    display: none !important;
}

.table-size-cell,
.table-shape-cell {
    display: none !important;
}

.table-actions-inline {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    flex-wrap: nowrap;
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    padding: 0.32rem;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn-icon svg,
.btn svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
}

.btn-icon:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.tag-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tag-name {
    font-weight: 500;
    font-size: 0.95rem;
}

.tag-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.tag-actions {
    display: flex;
    gap: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: rgba(22, 22, 30, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow), 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}


.modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--accent);
}

.modal-body {
    padding: 1rem;
}

.modal-footer {
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 0.5rem;
    position: sticky;
    bottom: 0;
    background: var(--bg-secondary);
    z-index: 3;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
}

.modal-actions .btn {
    flex: 1 1 calc(50% - 0.25rem);
    justify-content: center;
}

.modal-export-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.5rem;
    align-items: end;
}

.modal-export-row .btn {
    min-width: 118px;
    flex: 0 0 auto;
}

.modal-export-field {
    min-width: 0;
}

.modal-primary-actions .btn {
    flex: 1 1 calc(33.33% - 0.35rem);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    letter-spacing: 0.2px;
}

.form-select {
    width: 100%;
    height: 38px;
    padding: 0 0.65rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 0.86rem;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.2);
}

.form-select option {
    background: #1a1a22;
    color: var(--text-primary);
}

.batch-format-select {
    min-width: 126px;
    flex: 0 0 auto;
}

.batch-export-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 190px;
    flex: 1 1 190px;
}

.batch-format-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.export-status,
.batch-export-status {
    width: 100%;
    min-height: 1.1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.export-status.visible,
.batch-export-status.visible {
    opacity: 1;
}

.export-status.is-error,
.batch-export-status.is-error {
    color: #fb7185;
}

.export-status.is-success,
.batch-export-status.is-success {
    color: #34d399;
}

.btn.is-busy {
    opacity: 0.8;
    cursor: wait;
}

.export-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex: 1 1 calc(50% - 0.25rem);
}

.export-controls .btn {
    flex: 0 0 auto;
}

.export-format-select {
    flex: 1 1 auto;
    min-width: 92px;
    height: 38px;
    padding: 0 0.6rem;
    font-size: 0.9rem;
}

.btn-download-icon {
    min-width: 44px;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    justify-content: center;
}

.btn-add-another {
    padding: 0.5rem 0.75rem;
    min-width: 44px;
    flex: 0 0 auto !important;
}

.auto-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    width: 100%;
}

.auto-name strong {
    color: var(--text-primary);
}

/* Editor Sections */
.editor-section {
    margin-bottom: 0.65rem;
}

.editor-section h4 {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.editor-setup {
    margin-bottom: 0.42rem;
}

.setup-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(88px, 1fr));
    gap: 0.34rem;
    align-items: end;
}

.setup-cell {
    min-width: 0;
}

.editor-setup .selector-field {
    max-width: none;
    gap: 0.12rem;
}

.editor-setup .selector-field label {
    font-size: 0.68rem;
    letter-spacing: 0.25px;
    line-height: 1.05;
}

.editor-setup .selector-field .editor-dropdown {
    height: 29px;
    border-radius: 8px;
    padding: 0 0.45rem;
    font-size: 0.8rem;
}

.editor-setup .selector-caption {
    display: none;
}

.editor-section-tight {
    margin-bottom: 0.42rem;
}

.editor-section-tight h4 {
    margin-bottom: 0.22rem;
}

/* Size Selector */
.size-selector {
    display: block;
}

.selector-field {
    max-width: 340px;
    gap: 0.22rem;
}

.selector-field .editor-dropdown {
    height: 34px;
    padding: 0 0.55rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.selector-caption {
    font-size: 0.62rem;
    color: var(--text-secondary);
    line-height: 1.1;
}

.size-btn {
    padding: 0.35rem 0.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 0.75rem;
    flex: none;
    min-width: 0;
    text-align: center;
}

.size-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.size-btn.active {
    border-color: var(--accent);
    background: rgba(225, 29, 72, 0.15);
    box-shadow: inset 0 0 10px rgba(225, 29, 72, 0.1);
}

.size-btn .size-dims {
    font-size: 0.65rem;
    color: var(--text-secondary);
    display: none;
    margin-top: 0.12rem;
}

/* Layout Selectors */
.layout-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.layout-group {
    flex: 1;
    min-width: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.45rem 0.55rem;
}

.layout-group-title {
    font-size: 0.64rem;
    color: #cbd5e1;
    margin-bottom: 0.28rem;
    text-transform: uppercase;
    letter-spacing: 0.45px;
}

.layout-options {
    display: block;
}

.layout-options .selector-field {
    max-width: none;
}

.layout-btn {
    padding: 0.5rem 0.35rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: left;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
}

.layout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.layout-btn.active {
    border-color: var(--accent);
    background: linear-gradient(180deg, rgba(225, 29, 72, 0.22), rgba(225, 29, 72, 0.12));
    box-shadow: inset 0 0 10px rgba(225, 29, 72, 0.12), 0 0 0 1px rgba(225, 29, 72, 0.2);
}

.layout-icon-badge {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.layout-btn.active .layout-icon-badge {
    color: #fff;
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(255, 255, 255, 0.35);
}

.layout-glyph {
    width: 18px;
    height: 18px;
    display: block;
}

.layout-icon {
    font-size: 1rem;
    margin-bottom: 0.1rem;
    display: block;
}

.layout-label {
    font-size: 0.66rem;
    color: #f1f5f9;
    line-height: 1.2;
}

.layout-hint {
    font-size: 0.58rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

.color-picker-row {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.color-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.color-input {
    -webkit-appearance: none;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: none;
}

.color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-input::-webkit-color-swatch {
    border: 2px solid var(--border-color);
    border-radius: 50%;
}

.icon-mask {
    width: 100%;
    height: 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* Canvas Preview */
.canvas-container {
    background: rgba(10, 10, 15, 0.6);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.5);
}

.canvas-wrapper {
    width: 100%;
    max-width: 100%;
}

.canvas {
    width: 100%;
    aspect-ratio: 34.5 / 10.5;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px var(--accent-glow);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.canvas img {
    width: 100%;
    height: 100%;
    display: block;
}

/* Overlay container for interactive zones */
.canvas-overlays {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.canvas-zone {
    position: absolute;
    cursor: pointer;
    border: 2px dashed rgba(0, 0, 0, 0.15);
    border-radius: 3px;
    box-sizing: border-box;
    transition: border-color 0.15s ease, border-style 0.15s ease, box-shadow 0.15s ease;
}

.canvas-zone:hover {
    border-color: var(--accent);
    border-style: solid;
}

.canvas-zone.slot-selected {
    border-color: var(--accent);
    border-style: solid;
    box-shadow: 0 0 8px rgba(233, 69, 96, 0.5);
}

.canvas-zone-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: rgba(0, 0, 0, 0.2);
}

/* Zone Editor */

.zone-inline-editor {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
}

.zone-inline-empty {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.zone-inline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.zone-inline-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-primary);
}

.zone-inline-type {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.zone-inline-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.zone-inline-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.zone-item {
    margin-bottom: 1rem;
}

.zone-item:last-child {
    margin-bottom: 0;
}

.zone-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    display: block;
}

.zone-input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: rgba(22, 22, 30, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.zone-input:focus {
    outline: none;
    background: rgba(22, 22, 30, 0.8);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.text-align-toggle {
    display: flex;
    gap: 0.5rem;
}

.text-align-btn {
    flex: 1;
    height: 34px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.text-align-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.text-align-btn.active {
    border-color: var(--accent);
    background: rgba(225, 29, 72, 0.15);
    color: var(--text-primary);
    box-shadow: inset 0 0 10px rgba(225, 29, 72, 0.1);
}

.text-align-icon {
    width: 18px;
    height: 14px;
}

.text-align-icon line {
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

/* Text size slider */
.text-size-control {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.text-size-control label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.text-size-control input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.text-size-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

.text-size-control input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.text-size-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* Treeview */
.icon-search {
    margin-bottom: 0.5rem;
}

.treeview {
    max-height: 180px;
    overflow-y: auto;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.treeview-folder {
    border-bottom: 1px solid var(--border-color);
}

.treeview-folder:last-child {
    border-bottom: none;
}

.treeview-header {
    padding: 0.5rem 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    transition: background 0.2s ease;
    user-select: none;
}

.treeview-header:hover {
    background: var(--bg-tertiary);
}

.treeview-arrow {
    transition: transform 0.2s ease;
    font-size: 0.6rem;
}

.treeview-folder.open .treeview-arrow {
    transform: rotate(90deg);
}

.treeview-content {
    display: none;
    padding: 0.25rem;
}

.treeview-folder.open>.treeview-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 0.4rem;
}

/* Nested subcategory styles */
.treeview-subcategories {
    display: none;
    padding-left: 0.5rem;
    border-left: 1px solid var(--border-color);
    margin-left: 0.5rem;
}

.treeview-category.open>.treeview-subcategories {
    display: block;
}

.treeview-header-sub {
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
    color: var(--text-secondary);
}

.treeview-header-sub:hover {
    color: var(--text-primary);
}

.treeview-subcategory {
    border-bottom: none;
}

.treeview-subcategory>.treeview-content {
    padding: 0.25rem;
    margin-left: 0.25rem;
}

.treeview-item {
    padding: 0.5rem 0.35rem;
    cursor: pointer;
    font-size: 0.68rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    border-radius: 8px;
    border: 1px solid transparent;
    background: rgba(15, 23, 42, 0.28);
    text-align: center;
}

.treeview-item:hover {
    background: rgba(51, 65, 85, 0.45);
    color: var(--text-primary);
    border-color: rgba(148, 163, 184, 0.45);
}

.treeview-item.selected {
    background: rgba(225, 29, 72, 0.24);
    color: #fff;
    border: 1px solid var(--accent);
}

.treeview-icon-preview {
    width: 40px;
    height: 40px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.treeview-icon-preview img {
    max-width: 34px;
    max-height: 34px;
    object-fit: contain;
}

.treeview-icon-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.zone-empty {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-align: center;
    padding: 1rem;
}

.icon-picker-body {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    flex: 1 1 auto;
    min-height: 0;
}

.icon-picker-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.icon-picker-pills-selected {
    margin-top: -0.1rem;
}

.icon-picker-pills-current {
    margin-bottom: 0.05rem;
}

.icon-picker-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.42rem 0.72rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.28);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.72rem;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.icon-picker-pill:hover {
    color: var(--text-primary);
    border-color: rgba(148, 163, 184, 0.46);
    background: rgba(51, 65, 85, 0.42);
}

.icon-picker-pill.active {
    color: #fff;
    border-color: var(--accent);
    background: rgba(225, 29, 72, 0.24);
}

.icon-picker-pill-filter {
    border-style: dashed;
}

.icon-picker-pill-selected {
    color: #fff;
    border-color: var(--accent);
    background: rgba(225, 29, 72, 0.24);
}

.icon-picker-pill-remove {
    font-size: 0.9em;
    line-height: 1;
    opacity: 0.78;
}

.icon-picker-pill-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.28rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.66rem;
    color: inherit;
}

.icon-gallery {
    max-height: 300px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 0.45rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.icon-gallery-sections {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding-right: 0.15rem;
}

.icon-gallery-section {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.28);
    padding: 0.45rem;
}

.icon-gallery-section-title {
    margin: 0 0 0.4rem;
    padding: 0 0.15rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.icon-gallery-subsection {
    margin-top: 0.45rem;
}

.icon-gallery-subsection:first-of-type {
    margin-top: 0;
}

.icon-gallery-subsection-title {
    margin: 0 0 0.35rem;
    padding: 0 0.2rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(226, 232, 240, 0.86);
    text-transform: uppercase;
    letter-spacing: 0.35px;
}

.icon-gallery-section .icon-gallery {
    max-height: none;
    overflow: visible;
    border: none;
    background: transparent;
    padding: 0.2rem;
}

.icon-gallery-item {
    appearance: none;
    border: 1px solid transparent;
    background: rgba(15, 23, 42, 0.28);
    border-radius: 10px;
    padding: 0.5rem 0.3rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.42rem;
    text-align: center;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.icon-gallery-item:hover {
    color: var(--text-primary);
    border-color: rgba(148, 163, 184, 0.45);
    background: rgba(51, 65, 85, 0.45);
}

.icon-gallery-item.selected {
    color: #fff;
    border-color: var(--accent);
    background: rgba(225, 29, 72, 0.24);
}

.icon-gallery-preview {
    width: 44px;
    height: 44px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.icon-gallery-preview img {
    max-width: 36px;
    max-height: 36px;
    object-fit: contain;
}

.icon-gallery-name {
    font-size: 0.67rem;
    line-height: 1.15;
    color: inherit;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.3em;
}

/* Clear button for icon */
.icon-clear-btn {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 10, 15, 0.4);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    border: 2px solid rgba(10, 10, 15, 0.4);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Extra compact on phones */
@media (max-width: 768px) {
    .dashboard.has-export-dock {
        padding-bottom: 7.75rem;
    }

    .batch-export-dock {
        padding:
            max(0.46rem, calc(0.46rem + env(safe-area-inset-bottom)))
            max(0.62rem, env(safe-area-inset-left))
            calc(0.46rem + env(safe-area-inset-bottom))
            max(0.62rem, env(safe-area-inset-right));
    }

    .batch-export-dock-inner {
        gap: 0.34rem;
    }

    .batch-export-dock .batch-format-select {
        height: 34px;
        min-height: 34px;
        max-height: 34px;
        flex: none;
    }

    .batch-export-dock #exportAllBtn,
    .batch-export-dock #exportSelectedBtn {
        min-width: 96px;
        height: 34px;
    }

    .dashboard-top-dock {
        top: calc(var(--app-header-offset) + 0.24rem);
        margin-bottom: 0.5rem;
    }

    .dashboard-top-dock-inner {
        padding: 0.36rem;
        border-radius: 10px;
    }

    .table-toolbar-row {
        justify-content: flex-start;
    }

    .table-toolbar-actions,
    .table-toolbar-bulk {
        width: 100%;
    }

    .table-toolbar-bulk .batch-export-controls {
        width: 100%;
    }

    .table-toolbar-bulk .batch-format-field {
        width: 100%;
    }

    .table-toolbar-bulk .batch-format-select {
        width: 100%;
    }

    .batch-format-label {
        font-size: 0.66rem;
    }

    .batch-format-select {
        height: 34px;
        width: 100px;
    }

    .modal {
        width: 96%;
        max-height: 92vh;
        border-radius: 12px;
    }

    .modal-header {
        padding: 0.72rem 0.8rem;
    }

    .modal-header h3 {
        font-size: 0.95rem;
    }

    .modal-body {
        padding: 0.72rem 0.78rem;
    }

    .editor-setup {
        margin-bottom: 0.26rem;
    }

    .setup-grid {
        gap: 0.26rem;
    }

    .editor-setup .selector-field label {
        font-size: 0.62rem;
    }

    .selector-field {
        gap: 0.14rem;
    }

    .editor-setup .selector-field .editor-dropdown {
        height: 27px;
        border-radius: 7px;
        padding: 0 0.38rem;
        font-size: 0.74rem;
    }

    .selector-caption {
        font-size: 0.56rem;
        line-height: 1.05;
    }

    .layout-row {
        gap: 0.36rem;
    }

    .layout-group {
        border-radius: 10px;
        padding: 0.34rem 0.45rem;
    }

    .layout-group-title {
        font-size: 0.58rem;
        margin-bottom: 0.2rem;
        letter-spacing: 0.35px;
    }
}

/* Desktop-up overrides (mobile-first base above) */
@media (min-width: 769px) {
    .header {
        padding: 1rem 2rem;
        align-items: center;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .header-actions {
        width: auto;
        gap: 0.75rem;
    }

    .header-actions .btn {
        flex: 0 0 auto;
    }

    .dashboard {
        padding: 2rem;
        padding-bottom: 2rem;
    }

    .dashboard.has-export-dock {
        padding-bottom: 8rem;
    }

    .dashboard-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.75rem 1rem;
        margin-bottom: 0.85rem;
    }

    .dashboard-header h2 {
        font-size: 1.3rem;
    }

    .dashboard-tools {
        width: auto;
        align-items: center;
    }

    .dashboard-tools .btn {
        flex: 0 0 auto;
    }

    .dashboard-top-dock {
        margin-bottom: 1.05rem;
    }

    .dashboard-top-dock .dashboard-tools {
        justify-content: flex-start;
    }

    .batch-format-select {
        width: 144px;
        flex: 0 0 144px;
    }

    .batch-export-controls {
        flex: 0 0 auto;
    }

    .tags-table {
        border-collapse: collapse;
        border-spacing: 0;
        background: var(--bg-secondary);
        border-radius: 8px;
        overflow: hidden;
    }

    .tags-table thead {
        display: table-header-group;
        background: var(--bg-tertiary);
    }

    .tags-table tbody tr {
        display: table-row;
        background: transparent;
        border: none;
        border-top: 1px solid var(--border-color);
        border-radius: 0;
        overflow: visible;
    }

    .tags-table td {
        display: table-cell;
        padding: 1rem;
        border-top: none;
    }

    .table-select-cell {
        width: 56px;
        min-width: 56px;
    }

    .table-preview-cell {
        width: 340px;
        min-width: 340px;
        max-width: 500px;
        height: 100px;
    }

    .table-preview {
        height: 100px;
        padding: 6px;
    }

    .table-actions-cell {
        width: 176px;
        display: table-cell !important;
        text-align: right;
    }

    .table-text-cell {
        display: table-cell !important;
    }

    .table-size-cell,
    .table-shape-cell {
        display: table-cell !important;
    }

    .modal {
        border-radius: 16px;
        width: 95%;
        max-width: 1000px;
        max-height: 90vh;
    }

    .slot-editor-modal {
        width: min(96vw, 1120px);
        max-width: 1120px;
        height: 90vh;
        max-height: 90vh;
        border-radius: 12px;
    }

    .json-export-actions .btn {
        flex: 0 0 auto;
    }

    .json-import-actions .btn {
        flex: 0 0 auto;
    }

    .modal-header {
        padding: 1.25rem 1.5rem;
    }

    .modal-header h3 {
        font-size: 1.2rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-footer {
        padding: 1rem 1.5rem;
        position: static;
        background: transparent;
    }

    .auto-name {
        width: auto;
        font-size: 0.9rem;
    }

    .modal-actions {
        width: auto;
    }

    .modal-actions .btn {
        flex: 0 0 auto;
    }

    .modal-export-row,
    .modal-primary-actions {
        width: 100%;
    }

    .modal-export-row {
        grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto;
    }

    .export-controls {
        flex: 0 0 auto;
    }

    .export-format-select {
        width: 116px;
    }

    .btn-add-another {
        min-width: auto;
    }

    .editor-section {
        margin-bottom: 1.5rem;
    }

    .editor-section h4 {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }

    .editor-setup {
        margin-bottom: 0.8rem;
    }

    .setup-grid {
        grid-template-columns: repeat(4, minmax(110px, 1fr));
        gap: 0.5rem;
    }

    .editor-setup .selector-field label {
        font-size: 0.72rem;
    }

    .editor-setup .selector-field .editor-dropdown {
        height: 33px;
        font-size: 0.84rem;
        padding: 0 0.55rem;
    }

    .editor-section-tight {
        margin-bottom: 0.75rem;
    }

    .editor-section-tight h4 {
        margin-bottom: 0.42rem;
    }

    .size-selector {
        display: block;
    }

    .size-btn {
        flex: 0 0 auto;
        min-width: 120px;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .size-btn .size-dims {
        display: block;
        font-size: 0.7rem;
        margin-top: 0.2rem;
    }

    .layout-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

    .layout-group {
        min-width: 0;
        padding: 0.6rem 0.7rem;
    }

    .layout-options {
        display: block;
    }

    .layout-btn {
        min-width: 0;
        min-height: 86px;
        padding: 0.65rem 0.55rem;
    }

    .layout-icon-badge {
        width: 34px;
        height: 34px;
    }

    .layout-label {
        font-size: 0.72rem;
    }

    .layout-hint {
        font-size: 0.62rem;
    }

    .canvas-container {
        padding: 1.5rem;
    }

    .canvas-wrapper {
        max-width: 345px;
    }

    .zone-editor-body {
        padding: 1rem;
    }

    .zone-editor-body > .treeview,
    .zone-editor-body > .icon-gallery {
        max-height: 280px;
    }

    .zone-input {
        font-size: 0.85rem;
    }
}

/* Zone Editor Panel */
.zone-editor-panel {
    background: rgba(22, 22, 30, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    min-height: 0;
    transition: min-height 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.slot-editor-overlay {
    z-index: 1200;
    align-items: flex-start;
    padding: min(8vh, 3.5rem) 1rem 1rem;
}

.slot-editor-modal {
    width: min(96vw, 1120px);
    max-width: 1120px;
    height: 90vh;
    max-height: 90vh;
    border-radius: 12px;
}

.slot-editor-modal .zone-editor-panel {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.json-export-modal {
    width: min(94vw, 720px);
    max-width: 720px;
    max-height: 90vh;
    border-radius: 12px;
}

.json-export-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.json-export-actions .btn {
    flex: 1 1 calc(33.33% - 0.34rem);
    justify-content: center;
}

.json-export-text {
    min-height: 220px;
    max-height: 50vh;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px !important;
    line-height: 1.35;
}

.json-import-modal {
    width: min(94vw, 720px);
    max-width: 720px;
    max-height: 90vh;
    border-radius: 12px;
}

.json-import-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.json-import-actions .btn {
    flex: 1 1 calc(50% - 0.25rem);
    justify-content: center;
}

.json-import-text {
    min-height: 220px;
    max-height: 50vh;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px !important;
    line-height: 1.35;
}

.preview-3d-modal {
    width: min(96vw, 900px);
    max-width: 900px;
    max-height: 90vh;
}

.preview-3d-viewport {
    width: 100%;
    height: min(56vh, 420px);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: radial-gradient(circle at 30% 20%, rgba(71, 85, 105, 0.32), rgba(2, 6, 23, 0.9));
}

.zone-editor-panel:empty {
    display: none;
}

.zone-editor-hint {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.zone-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.zone-editor-header .zone-editor-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
}

.zone-editor-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    line-height: 1;
    border-radius: 4px;
}

.zone-editor-close:hover {
    color: var(--accent);
    background: var(--bg-tertiary);
}

.zone-editor-body {
    padding: 0.75rem;
    overflow: hidden;
}

.zone-editor-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.zone-editor-actions .btn {
    flex: 1 1 50%;
    justify-content: center;
}

.zone-editor-actions-single .btn {
    flex: 1 1 100%;
}

/* Preview hint subtitle */
.preview-hint {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

/* Taller icon picker content in zone editor */
.zone-editor-body .treeview,
.zone-editor-body > .icon-gallery {
    max-height: 440px;
}
