/* Global SKU mini editor — modal + standalone page */
.gsme-backdrop {
    position: fixed;
    inset: 0;
    z-index: 12000;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.gsme-backdrop[hidden] { display: none !important; }

.gsme-panel {
    width: min(920px, 100%);
    max-height: min(92vh, 900px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #1e293b;
}
html.dark-mode .gsme-panel {
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
}

.gsme-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}
html.dark-mode .gsme-header {
    background: #0f172a;
    border-color: #334155;
}
.gsme-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}
.gsme-header-actions { display: flex; gap: 8px; align-items: center; }

.gsme-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 10px 14px 0;
    border-bottom: 1px solid #e2e8f0;
    background: #fafafa;
}
html.dark-mode .gsme-tabs {
    background: #0f172a;
    border-color: #334155;
}
.gsme-tab {
    padding: 8px 14px;
    border: none;
    background: transparent;
    border-radius: 8px 8px 0 0;
    font-size: 13px;
    cursor: pointer;
    color: #64748b;
}
.gsme-tab.active {
    background: #fff;
    color: #4f46e5;
    font-weight: 600;
    box-shadow: 0 -1px 0 #e2e8f0 inset;
}
html.dark-mode .gsme-tab.active {
    background: #1e293b;
    color: #a5b4fc;
}

.gsme-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
}
.gsme-pane { display: none; }
.gsme-pane.active { display: block; }

.gsme-field { margin-bottom: 14px; }
.gsme-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
}
.gsme-field input[type="text"],
.gsme-field input[type="number"],
.gsme-field input[type="url"],
.gsme-field textarea,
.gsme-field select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    color: inherit;
}
html.dark-mode .gsme-field input,
html.dark-mode .gsme-field textarea,
html.dark-mode .gsme-field select {
    background: #0f172a;
    border-color: #475569;
}

.gsme-field input.gsme-readonly {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
}
html.dark-mode .gsme-field input.gsme-readonly {
    background: #1e293b;
    color: #94a3b8;
}
.gsme-hint {
    margin: 4px 0 0;
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.4;
}

.gsme-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .gsme-row-2 { grid-template-columns: 1fr; } }

.gsme-img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 8px;
}
.gsme-img-card {
    position: relative;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
}
.gsme-img-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}
.gsme-img-card .gsme-img-actions {
    display: flex;
    gap: 2px;
    padding: 4px;
    background: rgba(255,255,255,0.95);
    font-size: 10px;
}
.gsme-img-card button {
    flex: 1;
    border: none;
    background: #e2e8f0;
    border-radius: 4px;
    padding: 2px;
    cursor: pointer;
    font-size: 10px;
}

.gsme-opt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.gsme-opt-table th,
.gsme-opt-table td {
    border: 1px solid #e2e8f0;
    padding: 6px 8px;
    text-align: left;
}
.gsme-opt-table th { background: #f1f5f9; font-weight: 600; }
html.dark-mode .gsme-opt-table th { background: #0f172a; }
.gsme-opt-table input[type="number"],
.gsme-opt-table input[type="text"] {
    width: 100%;
    padding: 4px 6px;
    font-size: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    box-sizing: border-box;
}
.gsme-opt-table input.gsme-opt-tier0,
.gsme-opt-table input.gsme-opt-tier1,
.gsme-opt-table input.gsme-opt-name {
    min-width: 72px;
}

.gsme-panel {
    user-select: text;
}
.gsme-body {
    overscroll-behavior: contain;
}

/* 2-tier variation (product-collect vmTierList 스타일) */
.gsme-variation-banner {
    font-size: 12px;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
}
html.dark-mode .gsme-variation-banner {
    background: #1e3a5f;
    border-color: #3b82f6;
    color: #bfdbfe;
}
.gsme-tier-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}
@media (max-width: 640px) {
    .gsme-tier-grid { grid-template-columns: 1fr; }
}
.gsme-tier-block {
    border: 1px solid;
    border-radius: 8px;
    padding: 10px;
}
.gsme-tier-block-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.gsme-tier-block-head label {
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}
.gsme-tier-name {
    flex: 1;
    min-width: 80px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
}
.gsme-tier-opt-count {
    font-size: 10px;
    color: #64748b;
    white-space: nowrap;
}
.gsme-tier-opt-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.gsme-tier-opt-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 6px;
    background: #fff;
    border-radius: 5px;
    border: 1px solid rgba(0,0,0,0.08);
}
html.dark-mode .gsme-tier-opt-item { background: #0f172a; border-color: #334155; }
.gsme-tier-opt-idx { font-size: 10px; color: #94a3b8; min-width: 18px; }
.gsme-vm-tier-opt {
    flex: 1;
    padding: 4px 6px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}
.gsme-tier-empty { font-size: 11px; color: #94a3b8; margin: 0; }
.gsme-combo-section { margin-top: 4px; }
.gsme-combo-title {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}
html.dark-mode .gsme-combo-title { color: #94a3b8; }
.gsme-combo-table .gsme-tier-group-head td {
    background: #f0f9ff;
    border-top: 2px solid #7dd3fc;
    padding: 6px 10px;
}
html.dark-mode .gsme-combo-table .gsme-tier-group-head td {
    background: #0c4a6e;
    border-color: #38bdf8;
}
.gsme-tier-group-label {
    font-size: 12px;
    font-weight: 700;
    color: #0369a1;
}
html.dark-mode .gsme-tier-group-label { color: #7dd3fc; }
.gsme-combo-tier2 {
    font-weight: 600;
    color: #334155;
    padding-left: 14px !important;
}
html.dark-mode .gsme-combo-tier2 { color: #e2e8f0; }

.gsme-cat-result {
    margin-top: 8px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #c4b5fd;
    background: #faf5ff;
    font-size: 12px;
}
.gsme-cat-result.warn { border-color: #fcd34d; background: #fffbeb; }
.gsme-cat-result.block { border-color: #fecaca; background: #fef2f2; }
.gsme-cat-search-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 220px; overflow-y: auto; }
.gsme-cat-search-item {
    text-align: left;
    padding: 8px 10px;
    border: 1px solid #ddd6fe;
    border-radius: 6px;
    background: #faf5ff;
    cursor: pointer;
    font-size: 12px;
}
.gsme-cat-search-item:hover { background: #f3e8ff; }

.gsme-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}
html.dark-mode .gsme-footer { background: #0f172a; border-color: #334155; }

.gsme-btn {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
}
.gsme-btn-primary { background: #4f46e5; color: #fff; }
.gsme-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.gsme-btn-secondary { background: #e2e8f0; color: #334155; }
.gsme-btn-ghost { background: transparent; color: #64748b; border: 1px solid #cbd5e1; }
.gsme-status { font-size: 12px; color: #64748b; }
.gsme-status.error { color: #dc2626; }
.gsme-loading { text-align: center; padding: 40px; color: #94a3b8; }

/* Standalone page */
body.gsme-standalone-page {
    margin: 0;
    background: #f1f5f9;
    min-height: 100vh;
}
html.dark-mode body.gsme-standalone-page { background: #0f172a; }
.gsme-standalone-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}
.gsme-standalone-wrap .gsme-panel {
    max-height: none;
    width: 100%;
}
