/* =========================================================
   Puxlin Studio — Editor Stylesheet
   Tool aesthetic (Figma / VS Code): dense, calm, focused.
   All class names, IDs, and JS hooks preserved.
   ========================================================= */

/* ---------- Design Tokens ---------- */
:root {
    /* Brand / status */
    --puxlin-blue: #2563eb;
    --puxlin-blue-600: #1d4ed8;
    --puxlin-dark: #1e293b;
    --success: #10b981;
    --success-600: #059669;
    --danger: #ef4444;
    --danger-600: #dc2626;
    --warning: #f59e0b;
    --warning-600: #d97706;
    --purple: #8b5cf6;
    --purple-600: #7c3aed;
    --cyan: #06b6d4;
    --cyan-600: #0891b2;
    --sky: #0ea5e9;
    --pink: #ec4899;
    --slate-700: #334155;

    /* Surfaces */
    --bg-app: #eef2f7;
    --bg-gray: #eef2f7;            /* legacy alias */
    --bg-card: #ffffff;
    --bg-subtle: #f8fafc;
    --bg-canvas: #f4f6fa;          /* col-3 — light gray preview surface */
    --bg-canvas-panel: #1e293b;    /* dark accent (toolbar/export bar)   */
    --bg-canvas-panel-2: #111827;
    --canvas-frame: #d1d8e0;       /* fine gridded edge around canvas    */

    /* Borders */
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --border-soft: #eef2f7;
    --divider: #eef2f7;

    /* Text */
    --text: #0f172a;
    --text-2: #334155;
    --text-mute: #64748b;
    --text-faint: #94a3b8;
    --text-on-dark: #e2e8f0;
    --text-on-dark-mute: #94a3b8;
    --text-on-dark-faint: #64748b;

    /* Focus ring */
    --ring: 0 0 0 3px rgba(37, 99, 235, 0.18);

    /* Shadow */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 1px rgba(15, 23, 42, 0.03);
    --shadow-md: 0 6px 16px -8px rgba(15, 23, 42, 0.18), 0 2px 4px rgba(15, 23, 42, 0.06);
    --shadow-canvas: 0 24px 60px -20px rgba(0, 0, 0, 0.55), 0 8px 20px -8px rgba(0, 0, 0, 0.35);

    /* Radii */
    --r-xs: 4px;
    --r-sm: 6px;
    --r-md: 8px;
    --r-lg: 10px;
    --r-xl: 14px;

    /* Spacing rhythm (used in spacing decisions, not enforced) */
    --pad-card: 14px 14px 16px;
}

/* ---------- Reset / base ---------- */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    margin: 0;
    display: flex;
    height: 100vh;
    background: var(--bg-app);
    color: var(--text);
    font-size: 12px;
    line-height: 1.4;
    overflow: hidden;
    width: 100%;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection { background: rgba(37, 99, 235, 0.18); }

/* Quiet scrollbars (Chromium) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: padding-box; border: 2px solid transparent; }
#col-3 ::-webkit-scrollbar-thumb { background: #334155; background-clip: padding-box; border: 2px solid transparent; }

/* ---------- Layout ---------- */
.column {
    flex: 1;
    min-width: 0;
    padding: 18px 16px 0;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    height: 100%;
}

#col-1, #col-2 { background: var(--bg-app); }

#col-2 {
    flex: 1.6;
    min-width: 320px;
}

#col-3 {
    background: var(--bg-canvas);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1.15;
    min-width: 380px;
    max-width: 640px;
    overflow-y: hidden;
    padding-top: 18px;
    border-right: none;
    border-left: 1px solid var(--border);
}

/* col-3 header restated for the light theme */
#col-3 > h3 {
    color: #475569 !important;
    font-weight: 600;
}
#col-3 .canvas-info {
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: var(--shadow-xs);
}
#col-3 .editor-toolbar {
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}
#col-3 .editor-toolbar button {
    background: var(--bg-subtle);
    color: var(--text);
    border: 1px solid var(--border);
}
#col-3 .editor-toolbar button:hover { background: #e2e8f0; }
#col-3 .editor-toolbar .checkbox-label { color: var(--text-mute); font-size: 11px; }

/* canvas itself — soft frame so it stands out on the gray bg */
#canvas-preview {
    background: #ffffff;
    box-shadow:
        0 0 0 1px var(--canvas-frame),
        0 12px 32px -16px rgba(15, 23, 42, 0.18),
        0 2px 8px -4px rgba(15, 23, 42, 0.08);
    border-radius: 4px;
}

/* ---------- Cards ---------- */
.card {
    background: var(--bg-card);
    padding: var(--pad-card);
    border-radius: var(--r-lg);
    margin-bottom: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    position: relative;
    overflow: hidden;
}

.card::before {
    /* left accent stripe — defaults to brand blue, variants below */
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: transparent;
    transition: background 0.15s;
}

.card.collapsed { padding-bottom: 12px; }
.card.collapsed .card-content { display: none; }
.card.collapsed h3 { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }
.card.collapsed h3 .collapse-icon { transform: rotate(-90deg); }

/* Card variants — driven by inline border colors in markup.
   We keep markup-compatible by also matching with attribute selectors. */
.card[style*="#06b6d4"]::before { background: var(--cyan); }    /* Template Type */
.card[style*="#f59e0b"]::before { background: var(--warning); } /* SVG Import */
.card[style*="#8b5cf6"]::before { background: var(--purple); }  /* Quick Preset */
.card[style*="#0ea5e9"]::before { background: var(--sky); }     /* Targeting */

/* Override the loud inline `border: 2px solid` on accented cards
   (kept in markup for backward-compat) — the accent moves to the stripe. */
.card[style*="border: 2px solid"] {
    border: 1px solid var(--border) !important;
}

/* ---------- Headings ---------- */
h3 {
    margin: 0 0 10px 0;
    border-bottom: 1px solid var(--divider);
    padding-bottom: 8px;
    color: var(--text);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

h3 > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

h3:hover { color: var(--puxlin-blue); }
.collapse-icon {
    transition: transform 0.18s ease;
    font-size: 9px;
    color: var(--text-faint);
    margin-left: 6px;
}

/* ---------- Form rows / fields ---------- */
.row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.row:last-child { margin-bottom: 0; }

.field {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
}
.field.full { flex: 100%; }

label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-mute);
    margin-bottom: 4px;
}

/* Inline hints inside labels */
label span,
label .hint-inline {
    font-weight: 500;
    color: var(--text-faint);
    text-transform: none;
    letter-spacing: 0;
}

/* Boost contrast of all inline 9px gray hint spans */
label > span[style*="font-size:9px"],
label > span[style*="font-size: 9px"] {
    color: var(--text-mute) !important;
    font-weight: 500 !important;
}

input, select, textarea {
    padding: 7px 9px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    font-size: 11.5px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    width: 100%;
    transition: border-color 0.12s, box-shadow 0.12s, background 0.12s;
}
textarea { line-height: 1.45; resize: vertical; min-height: 38px; }

input:hover, select:hover, textarea:hover {
    border-color: #94a3b8;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--puxlin-blue);
    box-shadow: var(--ring);
    background: #fff;
}

input::placeholder, textarea::placeholder {
    color: #94a3b8;
}

/* Number inputs — calmer spinners */
input[type="number"] { -moz-appearance: textfield; }

input[type="date"], input[type="datetime-local"] {
    color: var(--text-2);
}

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path fill='%2364748b' d='M6 8.4 1.6 4l1-1L6 6.4 9.4 3l1 1z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px 10px;
    padding-right: 24px;
}

/* ---------- Element cards (col-2) ---------- */
.element-card {
    border-left: 4px solid var(--puxlin-blue);
    position: relative;
    padding-left: 14px;
}
.element-card::before { display: none; } /* its own left bar replaces stripe */
.element-card h3 { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }
.element-card:not(.collapsed) h3 {
    margin-bottom: 10px;
    border-bottom: 1px solid var(--divider);
    padding-bottom: 8px;
}
.element-card.collapsed { padding-bottom: 10px; }
.element-card .delete-btn { padding: 2px 6px; font-size: 12px; }

/* ---------- Group blocks (tinted sub-sections) ---------- */
.style-group,
.metadata-group,
.scheduling-group,
.priority-group,
.grouping-group,
.localization-group,
.social-group {
    padding: 10px 11px;
    border-radius: var(--r-md);
    margin-top: 6px;
    border: 1px solid;
}

.style-group        { background: #f0f7ff; border-color: #dbeafe; }
.metadata-group     { background: #fffbeb; border-color: #fde68a; }
.scheduling-group   { background: #eff6ff; border-color: #c7dafe; }
.priority-group     { background: #fef2f2; border-color: #fecaca; }
.grouping-group     { background: #f5f3ff; border-color: #ddd6fe; }
.localization-group { background: #ecfdf5; border-color: #a7f3d0; }
.social-group       { background: #fdf2f8; border-color: #fbcfe8; }

/* ---------- Buttons ---------- */
.add-btn,
button.add-btn {
    background: var(--success);
    color: #fff;
    border: 1px solid transparent;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 11.5px;
    font-family: inherit;
    line-height: 1.2;
    letter-spacing: 0.01em;
    transition: filter 0.12s, transform 0.06s, box-shadow 0.12s, background 0.12s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}
.add-btn:hover { filter: brightness(1.06); }
.add-btn:active { transform: translateY(0.5px); filter: brightness(0.96); }
.add-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.delete-btn {
    background: var(--danger);
    color: #fff;
    border: 1px solid transparent;
    padding: 4px 8px;
    border-radius: var(--r-xs);
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
    font-family: inherit;
    transition: filter 0.12s;
}
.delete-btn:hover { filter: brightness(1.08); }

/* Top button group in col-2 (Add Text / Image / Shape / Vector) */
.btn-group {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    position: sticky;
    top: 0;
    background: var(--bg-app);
    z-index: 100;
    padding: 8px 0 8px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
}
.btn-group .add-btn { flex: 1; min-width: 0; }

/* ---------- Template Type toggle (compact icon buttons) ---------- */
.type-toggle {
    display: flex;
    gap: 6px;
    background: var(--bg-subtle);
    padding: 4px;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
}
.type-selector-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 6px !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    color: var(--text-mute) !important;
    border-radius: var(--r-sm) !important;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px !important;
    font-weight: 500 !important;
    transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}
.type-selector-btn .type-icon {
    font-size: 18px;
    line-height: 1;
}
.type-selector-btn .type-label {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.type-selector-btn:hover {
    background: rgba(37, 99, 235, 0.06) !important;
    color: var(--text) !important;
}
.type-selector-btn.active {
    background: #ffffff !important;
    color: var(--brand-700) !important;
    border-color: var(--border-strong) !important;
    box-shadow: var(--shadow-xs);
}
.type-selector-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}
}

/* ---------- JSON output (hidden) ---------- */
pre {
    flex-grow: 1;
    font-family: 'Fira Code', ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 11px;
    margin: 0;
    overflow: auto;
    line-height: 1.45;
}

/* ---------- Action bars (sticky bottom) ---------- */
.action-bar {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 6px;
    margin: 16px -16px 0;
    flex-wrap: wrap;
    box-shadow: 0 -6px 16px -10px rgba(15, 23, 42, 0.18);
    z-index: 50;
}
.action-bar .add-btn {
    padding: 9px 10px;
    font-size: 11px;
    flex: 1;
    min-width: 88px;
}

/* col-2 export bar — dark, cohesive */
#col-2 .action-bar {
    background: var(--bg-canvas-panel);
    border-top: 1px solid #334155;
    box-shadow: 0 -6px 16px -10px rgba(0, 0, 0, 0.4);
}
#col-2 .action-bar .add-btn {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ---------- Canvas (col-3) ---------- */
#col-3 > h3 {
    color: var(--text-on-dark) !important;
    border-bottom: 1px solid #334155;
    padding-bottom: 8px;
    width: 100%;
    cursor: default;
}
#col-3 > h3:hover { color: var(--text-on-dark) !important; }

#canvas-preview {
    background: white;
    border: 1px solid #334155;
    border-radius: var(--r-md);
    box-shadow: var(--shadow-canvas);
}

.canvas-info {
    font-size: 11px;
    text-align: center;
    display: flex;
    gap: 18px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 4px 12px;
    border-radius: var(--r-sm);
    width: 100%;
    max-width: 600px;
    min-height: 26px;
    align-items: center;
}
.canvas-info > div { display: inline-flex; gap: 5px; align-items: baseline; }
.canvas-info strong { color: var(--text-mute); font-weight: 500; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; }
.canvas-info span { color: var(--text); font-weight: 600; font-size: 12px; }

/* ---------- Editor toolbar (compact, below canvas) ---------- */
.editor-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 4px 8px;
    border-radius: var(--r-sm);
    width: 100%;
    max-width: 600px;
    min-height: 30px;
    font-size: 11px;
}
.editor-toolbar .toolbar-sep { color: var(--border-strong); }
.editor-toolbar #history-info { font-size: 10px; color: var(--text-mute); }
.editor-toolbar #selected-element-info { margin-left: auto; font-size: 10px; color: var(--brand-700); }
.editor-toolbar button {
    padding: 3px 8px;
    border-radius: var(--r-xs);
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}
.editor-toolbar button {
    transition: background 0.12s, transform 0.06s;
    font-family: inherit;
}
.editor-toolbar {
    background: #ffffff !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-xs);
}
.editor-toolbar button {
    background: var(--bg-subtle) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
}
.editor-toolbar button:hover { background: #e2e8f0 !important; }
.editor-toolbar button:active { transform: translateY(0.5px); }
.editor-toolbar .checkbox-label { color: var(--text-mute) !important; }
.editor-toolbar > span { color: var(--text-mute) !important; }


#canvas-container { position: relative; cursor: crosshair; overflow: auto; flex: 1; min-height: 0; }
#canvas-container.dragging { cursor: grabbing; }
#canvas-preview { display: block; }

/* ---------- Selection / handles ---------- */
.element-selection {
    position: absolute;
    border: 2px solid #3b82f6;
    background: rgba(59, 130, 246, 0.10);
    pointer-events: none;
    box-sizing: border-box;
}
.element-selection::before {
    content: '';
    position: absolute;
    top: -4px; left: -4px; right: -4px; bottom: -4px;
    border: 1px dashed #3b82f6;
}

.resize-handle {
    position: absolute;
    width: 9px; height: 9px;
    background: #fff;
    border: 2px solid #3b82f6;
    border-radius: 2px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.resize-handle.nw { top: -4px; left: -4px; cursor: nw-resize; }
.resize-handle.ne { top: -4px; right: -4px; cursor: ne-resize; }
.resize-handle.sw { bottom: -4px; left: -4px; cursor: sw-resize; }
.resize-handle.se { bottom: -4px; right: -4px; cursor: se-resize; }
.resize-handle.n  { top: -4px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
.resize-handle.s  { bottom: -4px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
.resize-handle.w  { top: 50%; left: -4px; transform: translateY(-50%); cursor: w-resize; }
.resize-handle.e  { top: 50%; right: -4px; transform: translateY(-50%); cursor: e-resize; }

.element-hover-info {
    position: absolute;
    background: rgba(15, 23, 42, 0.92);
    color: #fff;
    padding: 4px 8px;
    border-radius: var(--r-xs);
    font-size: 10px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.4;
    margin-left: 4px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--text-faint);
    color: #fff;
}
.badge-new { background: var(--success); }
.badge-v16 { background: var(--purple); }

/* ---------- Hints / section titles ---------- */
.hint {
    font-size: 10px;
    color: var(--text-mute);
    margin-top: 3px;
    font-style: normal;
    display: block;
    line-height: 1.4;
}

.section-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-2);
    margin: 10px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    gap: 6px;
}
.section-title::before {
    content: '';
    width: 3px;
    height: 11px;
    background: var(--puxlin-blue);
    border-radius: 2px;
    opacity: 0.6;
}

/* ---------- Checkboxes ---------- */
.checkbox-row {
    display: flex;
    gap: 10px 14px;
    flex-wrap: wrap;
    align-items: center;
}
.checkbox-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 11px;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    color: var(--text-2);
}

.field label:has(input[type="checkbox"]),
.field > label:first-child:last-child {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 11px;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    flex-direction: row;
    color: var(--text-2);
}

.field label input[type="checkbox"],
.row input[type="checkbox"] {
    width: auto;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--puxlin-blue);
}

.checkbox-label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-weight: 500 !important;
    font-size: 11px !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    cursor: pointer;
    flex-direction: row !important;
    color: var(--text-2);
}
.checkbox-label input[type="checkbox"] { accent-color: var(--puxlin-blue); }

/* ---------- Sectors checkbox list ---------- */
#t_sectors_container {
    border-color: var(--border-strong);
    background: #fff;
    border-radius: var(--r-sm);
    padding: 6px 8px !important;
}
#t_sectors_container label {
    padding: 2px 0;
    color: var(--text-2);
}

/* ---------- Translations / dynamic containers ---------- */
#translations_container:empty { display: none; }

/* ---------- Hidden ---------- */
.hidden { display: none !important; }

/* ---------- Version badge (floating) ---------- */
.version-badge {
    position: fixed;
    top: 10px;
    right: 10px;
    background: var(--purple);
    color: #fff;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

/* ---------- File header strip (top of col-1) ----------
   Targets the inline-styled status strip at the top of col-1. */
#col-1 > div:first-child[style*="background: #1e293b"] {
    background: linear-gradient(180deg, #1e293b 0%, #172033 100%) !important;
    border: 1px solid #334155 !important;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.04);
    font-weight: 500;
}

/* ---------- SVG Import: 3-up source grid ---------- */
.import-source-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.import-source-btn {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0;
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    color: var(--text-mute);
    border-radius: var(--r-md);
    cursor: pointer;
    font-family: inherit;
    transition: background 0.12s, color 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.import-source-btn .import-source-icon {
    font-size: 22px;
    line-height: 1;
    filter: grayscale(1);
    opacity: 0.7;
}
.import-source-btn .import-source-label {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.import-source-btn:hover {
    background: #ffffff;
    color: var(--text);
    border-color: var(--border-strong);
}
.import-source-btn.drag-over,
.import-source-btn.active {
    background: var(--text);
    color: #ffffff;
    border-color: var(--text);
    box-shadow: var(--shadow-sm);
}
.import-source-btn.active .import-source-icon { filter: none; opacity: 1; }
.import-source-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}
.import-source-status {
    margin-top: 8px;
    padding: 6px 10px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    font-size: 10.5px;
    color: var(--text-mute);
    text-align: center;
    min-height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.import-source-status.has-file {
    color: var(--text);
    background: #ffffff;
    font-weight: 500;
}

/* ---------- (legacy) SVG drop zone hidden — replaced by import-source-grid ---------- */
#svg-drop-zone { display: none; }

/* ---------- Details / guides legend ---------- */
details {
    border-top: 1px solid #334155;
    padding-top: 6px;
}
details summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
    content: '▾';
    font-size: 8px;
    margin-left: 6px;
    color: var(--text-on-dark-faint);
}
details[open] summary::after { content: '▴'; }

/* ---------- Animation controls (col-3) ---------- */
#anim-controls {
    width: 100%;
    max-width: 500px;
    background: #ffffff !important;
    color: var(--text) !important;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border);
}
#anim-controls span,
#anim-controls #anim-time { color: var(--text-mute) !important; }
#anim-controls #anim-play-btn { background: var(--brand) !important; }

/* ---------- Misc cleanup for inline-styled nested fields ---------- */
/* Bluish info boxes around event previews */
.row .field[style*="background: #dbeafe"],
.row .field[style*="background: #fef3c7"],
.row .field[style*="background: #ede9fe"],
.row .field[style*="background: #fee2e2"],
.row .field[style*="background: #d1fae5"],
.row .field[style*="background: #ecfdf5"] {
    border-radius: var(--r-md) !important;
    padding: 9px 11px !important;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

/* Tighten <code> inside hint blocks */
code {
    font-family: 'Fira Code', ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 10.5px;
    background: rgba(15, 23, 42, 0.06);
    padding: 1px 5px;
    border-radius: 3px;
    color: var(--text-2);
}

/* ---------- Print / narrow ---------- */
@media (max-width: 1100px) {
    body { font-size: 11.5px; }
    .column { padding: 14px 12px 0; }
}

/* ---------- Column resizer (drag handle between cols) ---------- */
.col-resizer {
    flex: 0 0 5px;
    background: transparent;
    cursor: col-resize;
    position: relative;
    z-index: 10;
    transition: background 0.12s;
    user-select: none;
}
.col-resizer::before {
    content: '';
    position: absolute;
    left: 50%; top: 0; bottom: 0;
    width: 1px;
    background: var(--border);
    transform: translateX(-50%);
    transition: background 0.12s, width 0.12s;
}
.col-resizer:hover::before,
.col-resizer.dragging::before {
    background: var(--brand);
    width: 2px;
}
body.col-resizing { cursor: col-resize !important; user-select: none; }
body.col-resizing * { cursor: col-resize !important; user-select: none !important; }

/* ---------- Make col-3 stretch (no max-width cap) so resizer works ---------- */
#col-3 {
    max-width: none;
}
