/* ============================================================
   Asset Forge — Industrial Forge Theme
   ============================================================ */

@keyframes ember-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes slide-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

:root {
    --carbon: #0a0a0a;
    --steel: #141414;
    --steel-light: #1e1e1e;
    --steel-lighter: #2a2a2a;
    --edge: #333;
    --ember: #ff6b35;
    --ember-dim: #cc5529;
    --ember-glow: rgba(255, 107, 53, 0.15);
    --ember-glow-strong: rgba(255, 107, 53, 0.3);
    --ash: #999;
    --smoke: #666;
    --bone: #e8e4e0;
    --font-display: 'Chakra Petch', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
    --sidebar-w: 220px;
    --radius: 6px;
}

[x-cloak] { display: none !important; }

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

body {
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--carbon);
    color: var(--bone);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* Grain overlay on body */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============ SIDEBAR ============ */

.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--steel);
    border-right: 1px solid var(--edge);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    color: var(--ember);
    flex-shrink: 0;
    animation: ember-pulse 3s ease-in-out infinite;
}

.brand-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.15em;
    line-height: 1.2;
    color: var(--bone);
}

.sidebar-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--edge), transparent);
    margin: 0.25rem 1rem;
}

.sidebar-nav {
    padding: 0.5rem 0;
}

.nav-label {
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--smoke);
    padding: 0.5rem 1rem 0.35rem;
}

.sidebar-tool {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.55rem 1rem;
    background: none;
    border: none;
    color: var(--ash);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    position: relative;
}

.sidebar-tool:hover {
    background: var(--steel-light);
    color: var(--bone);
}

.sidebar-tool.active {
    background: var(--steel-lighter);
    color: var(--ember);
}

.sidebar-tool.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: var(--ember);
    border-radius: 0 2px 2px 0;
}

.sidebar-tool-icon {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-tool-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-tool-arrow {
    color: var(--ember);
    font-size: 1.2rem;
    font-weight: 700;
}

.sidebar-status {
    margin-top: auto;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--smoke);
    border-top: 1px solid var(--edge);
}

.sidebar-status .status-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-credits {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--smoke);
    opacity: 0.7;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-ok { background: #4caf50; box-shadow: 0 0 6px rgba(76, 175, 80, 0.5); }
.status-err { background: #e53935; box-shadow: 0 0 6px rgba(229, 57, 53, 0.5); }

/* ============ WORKSPACE ============ */

.workspace {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    padding: 1.5rem 2rem;
    position: relative;
}

/* ---- Error ---- */
.error-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    background: rgba(229, 57, 53, 0.1);
    border: 1px solid rgba(229, 57, 53, 0.3);
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    color: #ff8a80;
    font-size: 0.85rem;
    animation: slide-up 0.2s ease;
}

.error-dismiss {
    margin-left: auto;
    background: none;
    border: none;
    color: #ff8a80;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0.25rem;
}

/* ---- Empty state ---- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    color: var(--smoke);
}

.empty-icon {
    color: var(--edge);
    margin-bottom: 1.5rem;
    opacity: 0.4;
}

.empty-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--ash);
    margin-bottom: 0.35rem;
}

.empty-subtitle {
    font-size: 0.85rem;
    color: var(--smoke);
}

/* ---- Tool workspace ---- */
.tool-workspace {
    animation: slide-up 0.25s ease;
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--edge);
}

.tool-header-icon {
    font-size: 1.6rem;
}

.tool-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--bone);
}

.tool-subtitle {
    font-size: 0.8rem;
    color: var(--smoke);
    margin-top: 0.1rem;
}

.workspace-columns {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* ---- Panels ---- */
.panel-label {
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--smoke);
    margin-bottom: 0.75rem;
}

.form-panel {
    background: var(--steel);
    border: 1px solid var(--edge);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.output-panel {
    background: var(--steel);
    border: 1px solid var(--edge);
    border-radius: var(--radius);
    padding: 1.25rem;
    min-height: 300px;
}

/* ---- Form fields ---- */
.field {
    margin-bottom: 0.85rem;
}

.field-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ash);
    margin-bottom: 0.3rem;
    letter-spacing: 0.03em;
}

.field-input {
    width: 100%;
    background: var(--carbon);
    border: 1px solid var(--edge);
    border-radius: 4px;
    padding: 0.5rem 0.65rem;
    color: var(--bone);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    transition: border-color 0.15s;
}

.field-input:focus {
    outline: none;
    border-color: var(--ember);
    box-shadow: 0 0 0 2px var(--ember-glow);
}

.field-textarea {
    resize: vertical;
    min-height: 350px;
    line-height: 1.5;
}

/* Radio group */
.field-radio-group {
    display: flex;
    gap: 0.5rem;
}

.field-radio {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--ash);
    padding: 0.4rem 0.65rem;
    background: var(--carbon);
    border: 1px solid var(--edge);
    border-radius: 4px;
    transition: all 0.15s;
}

.field-radio:hover {
    border-color: var(--ember-dim);
}

.field-radio input { display: none; }

.field-radio .radio-dot {
    width: 14px;
    height: 14px;
    border: 1px solid var(--edge);
    border-radius: 50%;
    background: var(--carbon);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

.field-radio input:checked ~ .radio-dot {
    border-color: var(--ember);
}

.field-radio input:checked ~ .radio-dot::after {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--ember);
    border-radius: 50%;
}

.field-radio input:checked ~ span:last-child {
    color: var(--ember);
}

.field-radio.active {
    border-color: var(--ember);
    background: var(--ember-glow);
}

.field-preview {
    width: 100%;
    background: var(--carbon);
    border: 1px solid var(--edge);
    border-radius: 4px;
    padding: 0.5rem 0.65rem;
    color: var(--smoke);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-style: italic;
    line-height: 1.5;
    min-height: 2rem;
}

select.field-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    padding-right: 2rem;
}

/* File drop zone */
.file-drop {
    position: relative;
    border: 1px dashed var(--edge);
    border-radius: 4px;
    background: var(--carbon);
    transition: border-color 0.15s;
}

.file-drop:hover { border-color: var(--ember-dim); }

.upload-preview {
    margin-top: 0.5rem;
    border: 1px solid var(--edge);
    border-radius: 4px;
    background: var(--carbon);
    padding: 0.5rem;
    text-align: center;
}

.upload-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 3px;
    object-fit: contain;
}

.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-label {
    display: block;
    padding: 0.75rem;
    text-align: center;
    color: var(--smoke);
    font-size: 0.8rem;
    cursor: pointer;
}

/* Checkbox */
.field-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--ash);
}

.field-check input { display: none; }

.check-box {
    width: 16px;
    height: 16px;
    border: 1px solid var(--edge);
    border-radius: 3px;
    background: var(--carbon);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.field-check input:checked + .check-box {
    background: var(--ember);
    border-color: var(--ember);
}

.field-check input:checked + .check-box::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid var(--carbon);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-1px);
}

/* ---- Forge button ---- */
.forge-btn {
    width: 100%;
    padding: 0.7rem;
    margin-top: 0.5rem;
    background: linear-gradient(135deg, var(--ember), var(--ember-dim));
    border: none;
    border-radius: 4px;
    color: var(--carbon);
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.forge-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.4s;
}

.forge-btn-sm {
    width: 100%;
    padding: 0.5rem;
    background: var(--steel-lighter);
    border: 1px solid var(--ember-dim);
    border-radius: 4px;
    color: var(--ember);
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.15s;
}

.forge-btn-sm:hover:not(:disabled) {
    background: var(--ember-glow);
}

.forge-btn-sm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.forge-btn:hover:not(:disabled)::before {
    transform: translateX(100%);
}

.forge-btn:hover:not(:disabled) {
    box-shadow: 0 0 20px var(--ember-glow-strong), 0 4px 12px rgba(0,0,0,0.3);
}

.forge-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.forge-btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: var(--carbon);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ---- Progress ---- */
.progress-box {
    margin-bottom: 1rem;
    animation: slide-up 0.2s ease;
}

.progress-track {
    height: 4px;
    background: var(--steel-lighter);
    border-radius: 2px;
    overflow: visible;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--ember);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-glow {
    position: absolute;
    top: -4px;
    width: 12px;
    height: 12px;
    background: var(--ember);
    border-radius: 50%;
    filter: blur(6px);
    opacity: 0.6;
    transform: translateX(-50%);
    transition: left 0.3s ease;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--smoke);
    margin-top: 0.5rem;
}

/* ---- Results ---- */
.seed-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--smoke);
    margin-bottom: 0.75rem;
}

.seed-badge code {
    background: var(--carbon);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    color: var(--ember);
    font-family: var(--font-mono);
    margin-left: 0.25rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.6rem;
}

.result-tile {
    position: relative;
    aspect-ratio: 1;
    background: var(--carbon);
    border: 1px solid var(--edge);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.result-tile:hover {
    border-color: var(--ember);
    box-shadow: 0 0 12px var(--ember-glow);
}

.result-tile img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: auto;
}

.result-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    color: var(--bone);
}

.result-tile:hover .result-overlay { opacity: 1; }

.result-audio {
    background: var(--steel);
    border: 1px solid var(--edge);
    border-radius: 4px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-audio audio {
    width: 100%;
    height: 36px;
    border-radius: 4px;
}

.audio-download {
    display: inline-block;
    text-align: center;
    font-size: 0.75rem;
    color: var(--ember);
    text-decoration: none;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--ember-dim);
    border-radius: 3px;
    transition: all 0.15s;
}

.audio-download:hover {
    background: var(--ember-glow);
}

.result-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.75);
    color: var(--bone);
    font-size: 0.65rem;
    padding: 0.25rem 0.4rem;
    text-align: center;
    font-family: var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Output empty ---- */
.output-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    gap: 0.75rem;
    color: var(--smoke);
    font-size: 0.8rem;
}

/* ---- Gallery ---- */
.gallery-workspace {
    animation: slide-up 0.25s ease;
}

.gallery-filter {
    margin-left: auto;
    background: var(--steel);
    border: 1px solid var(--edge);
    border-radius: 4px;
    padding: 0.4rem 0.65rem;
    color: var(--bone);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    cursor: pointer;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
}

.gallery-card {
    background: var(--steel);
    border: 1px solid var(--edge);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.gallery-card:hover {
    border-color: var(--ember-dim);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.gallery-thumb-wrap {
    height: 160px;
    background: var(--carbon);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-thumb {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: auto;
}

.gallery-no-thumb {
    color: var(--smoke);
    font-size: 0.8rem;
    font-family: var(--font-display);
    letter-spacing: 0.1em;
}

.gallery-info {
    padding: 0.6rem 0.75rem;
    border-top: 1px solid var(--edge);
}

.gallery-info-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.gallery-badge {
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ember);
}

.gallery-date {
    font-size: 0.7rem;
    color: var(--smoke);
}

.gallery-prompt {
    font-size: 0.75rem;
    color: var(--ash);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-empty-msg {
    text-align: center;
    color: var(--smoke);
    padding: 3rem;
    font-size: 0.85rem;
}

/* ---- Modal ---- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: pointer;
    padding: 2rem;
    backdrop-filter: blur(4px);
}

.modal-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius);
    image-rendering: auto;
    cursor: default;
    box-shadow: 0 0 40px rgba(0,0,0,0.6);
}

.modal-x {
    position: fixed;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--ash);
    font-size: 2rem;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.15s;
}

.modal-x:hover { color: var(--bone); }

.modal-in { transition: opacity 0.2s ease; }
.modal-out { transition: opacity 0.15s ease; }

/* ---- Audio Editor ---- */
.audio-editor {
    background: var(--steel);
    border: 1px solid var(--edge);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 1rem;
    animation: slide-up 0.25s ease;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.editor-close {
    background: none;
    border: none;
    color: var(--ash);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 0.25rem;
    transition: color 0.15s;
}

.editor-close:hover { color: var(--bone); }

.editor-track {
    border: 1px solid var(--edge);
    border-radius: 4px;
    background: var(--carbon);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.editor-track-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.65rem;
    background: var(--steel-light);
    border-bottom: 1px solid var(--edge);
}

.editor-track-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ash);
    letter-spacing: 0.03em;
}

.editor-track-remove {
    background: none;
    border: none;
    color: var(--smoke);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 0.3rem;
    transition: color 0.15s;
}

.editor-track-remove:hover { color: #ff8a80; }

.editor-track-waveform {
    height: 120px;
    padding: 0.25rem;
}

.editor-track-controls {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0.65rem;
    border-top: 1px solid var(--edge);
    background: var(--steel-light);
    flex-wrap: wrap;
}

.editor-ctrl {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    color: var(--smoke);
}

.editor-ctrl-input {
    width: 55px;
    background: var(--carbon);
    border: 1px solid var(--edge);
    border-radius: 3px;
    padding: 0.2rem 0.35rem;
    color: var(--bone);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-align: center;
}

.editor-ctrl-input:focus {
    outline: none;
    border-color: var(--ember);
}

.editor-ctrl-range {
    width: 80px;
    accent-color: var(--ember);
}

.editor-ctrl-val {
    min-width: 32px;
    text-align: right;
    color: var(--ash);
    font-size: 0.7rem;
}

.editor-ctrl-unit {
    color: var(--smoke);
    font-size: 0.65rem;
}

.editor-add-track {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
    background: none;
    border: 1px dashed var(--edge);
    border-radius: 4px;
    color: var(--smoke);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}

.editor-add-track:hover {
    border-color: var(--ember-dim);
    color: var(--ember);
}

.editor-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.editor-actions-left {
    display: flex;
    gap: 0.4rem;
}

.editor-actions-right {
    display: flex;
    gap: 0.4rem;
}

.editor-btn {
    padding: 0.45rem 0.85rem;
    background: var(--steel-lighter);
    border: 1px solid var(--edge);
    border-radius: 4px;
    color: var(--bone);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}

.editor-btn:hover:not(:disabled) {
    border-color: var(--ember-dim);
    color: var(--ember);
}

.editor-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.editor-btn-primary {
    background: linear-gradient(135deg, var(--ember), var(--ember-dim));
    border-color: var(--ember);
    color: var(--carbon);
    font-weight: 600;
}

.editor-btn-primary:hover:not(:disabled) {
    color: var(--carbon);
    box-shadow: 0 0 12px var(--ember-glow);
}

.editor-format-select {
    width: auto;
    min-width: 70px;
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
}

.audio-edit-btn {
    display: inline-block;
    text-align: center;
    font-size: 0.75rem;
    color: var(--ember);
    background: none;
    border: 1px solid var(--ember-dim);
    border-radius: 3px;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    font-family: var(--font-mono);
    transition: all 0.15s;
}

.audio-edit-btn:hover {
    background: var(--ember-glow);
}

/* ---- Audio Picker Modal ---- */
.audio-picker-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 2rem;
    backdrop-filter: blur(4px);
}

.audio-picker-content {
    background: var(--steel);
    border: 1px solid var(--edge);
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

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

.audio-picker-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--bone);
}

.audio-picker-list {
    overflow-y: auto;
    padding: 0.5rem;
}

.audio-picker-item {
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--edge);
    border-radius: 4px;
    margin-bottom: 0.4rem;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--carbon);
}

.audio-picker-item:hover {
    border-color: var(--ember-dim);
    background: var(--steel-light);
}

.audio-picker-item-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.audio-picker-item-title {
    font-size: 0.85rem;
    color: var(--bone);
    flex: 1;
}

.audio-picker-preview {
    width: 100%;
    height: 30px;
    border-radius: 3px;
}

.result-audio .result-label {
    position: static;
    background: none;
    text-align: left;
    padding: 0;
    font-size: 0.8rem;
    color: var(--bone);
}

/* ---- Responsive ---- */
@media (max-width: 960px) {
    .workspace-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }

    .brand-text,
    .sidebar-tool-name,
    .sidebar-tool-arrow,
    .nav-label,
    .status-text {
        display: none;
    }

    .sidebar-brand {
        justify-content: center;
        padding: 1rem 0.5rem;
    }

    .sidebar-tool {
        justify-content: center;
        padding: 0.6rem 0;
    }

    .sidebar-tool-icon {
        width: auto;
    }

    .workspace {
        margin-left: 60px;
        padding: 1rem;
    }

    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }
}
