/* ==============================================
   Helix SD Engine — Styles v3 (Glass Edition)
   ============================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Design Tokens ── */
:root {
    --color-bg: #09090b;
    --color-surface: #111113;
    --color-surface-2: #18181b;
    --color-surface-3: #1e1e21;
    --color-border: rgba(255, 255, 255, 0.06);
    --color-border-2: rgba(255, 255, 255, 0.1);
    --color-text: #e8e8f0;
    --color-text-dim: #8888a0;
    --color-accent: #7c6aef;
    --color-accent-bg: rgba(124,106,239,0.08);
    --color-accent-hover: #8d7df5;
    --color-accent-rgb: 124, 106, 239;
    /* Per-workflow tint — JS sets these from a hash of the workflow name. */
    --wf-tint: #7c6aef;
    --wf-tint-rgb: 124, 106, 239;
    --color-success: #34d399;
    --color-error: #f87171;
    --color-warning: #fbbf24;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-tint: background 0.6s cubic-bezier(0.4, 0, 0.2, 1), color 0.6s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.6s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    --glass-bg: rgba(18, 18, 26, 0.6);
    --glass-border: rgba(255, 255, 255, 0.06);
    --focus-ring: 0 0 0 2px var(--color-bg), 0 0 0 4px rgba(var(--color-accent-rgb), 0.55);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; font-family: var(--font); background: var(--color-bg); color: var(--color-text); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11'; }
::selection { background: var(--wf-tint); color: #fff; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(var(--wf-tint-rgb), 0.4); background-clip: padding-box; border: 2px solid transparent; }
* { scrollbar-color: rgba(255,255,255,0.08) transparent; scrollbar-width: thin; }

/* Accessible focus rings — only show on keyboard nav */
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }
button:focus-visible, .btn:focus-visible, .action-chip:focus-visible, .tray-tab:focus-visible { box-shadow: var(--focus-ring); }
input:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: 0 0 0 2px rgba(var(--color-accent-rgb), 0.35); border-color: var(--color-accent) !important; }

/* Per-workflow tint application — applied to a few high-impact spots */
.tray-tab.active { color: var(--wf-tint) !important; border-bottom-color: var(--wf-tint) !important; transition: var(--transition-tint); }
.btn-generate { box-shadow: 0 4px 18px rgba(var(--wf-tint-rgb), 0.18); transition: var(--transition-tint), transform var(--transition); }
.btn-generate:hover { box-shadow: 0 6px 24px rgba(var(--wf-tint-rgb), 0.36), 0 0 50px rgba(var(--wf-tint-rgb), 0.16); }
.workflow-tint-bar { height: 2px; background: linear-gradient(90deg, transparent, var(--wf-tint) 30%, var(--wf-tint) 70%, transparent); transition: var(--transition-tint); opacity: 0.7; }

/* ── Login ── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background-image: radial-gradient(ellipse at 50% 40%, rgba(124, 106, 239, 0.04) 0%, transparent 60%); }
.login-page.hidden { display: none; }
.login-card { background: var(--glass-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 380px; text-align: center; box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3), 0 0 60px rgba(124, 106, 239, 0.04); }
.login-logo { font-size: 3rem; margin-bottom: 12px; display: flex; justify-content: center; }
.login-card h1 { font-size: 1.4rem; font-weight: 600; margin-bottom: 4px; }
.login-subtitle { color: var(--color-text-dim); font-size: 0.85rem; margin-bottom: 24px; }
.login-card input { display: block; width: 100%; padding: 12px 16px; margin-bottom: 12px; background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius-sm); color: var(--color-text); font-size: 0.95rem; outline: none; transition: border-color var(--transition); }
.login-card input:focus { border-color: var(--color-accent); }
.login-error { color: var(--color-error); font-size: 0.82rem; margin-top: 12px; min-height: 1.2em; }
.login-error:not(.show) { display: none; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: var(--radius-sm); border: none; cursor: pointer; font-size: 0.85rem; font-weight: 500; transition: all var(--transition); font-family: var(--font); }
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-hover); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--color-text-dim); border: 1px solid var(--color-border); }
.btn-ghost:hover { color: var(--color-text); border-color: var(--color-border-2); background: var(--color-surface-2); }
.btn-sm { padding: 6px 10px; font-size: 0.8rem; }

/* Generate button group */
.gen-button-group { display: flex; gap: 8px; margin-top: 8px; }
.btn-generate { flex: 1; padding: 16px; font-size: 1rem; font-weight: 600; background: linear-gradient(135deg, var(--color-accent), #9b6aef); color: #fff; border: none; border-radius: var(--radius); cursor: pointer; transition: all var(--transition); position: relative; z-index: 1; }
.btn-generate:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(124,106,239,0.3), 0 0 40px rgba(124,106,239,0.12); }
.btn-generate::before { content: ''; position: absolute; inset: -2px; background: linear-gradient(135deg, var(--color-accent), #a78bfa, #818cf8); border-radius: inherit; z-index: -1; opacity: 0; filter: blur(12px); transition: opacity 300ms ease; }
.btn-generate:hover::before { opacity: 0.6; }
.btn-generate:disabled { opacity: 0.5; transform: none; cursor: not-allowed; }
.btn-generate.generating { animation: pulse-glow 1.5s ease-in-out infinite; }
@keyframes pulse-glow { 0%, 100% { box-shadow: 0 0 10px rgba(124,106,239,0.3); } 50% { box-shadow: 0 0 25px rgba(124,106,239,0.5); } }

/* Interrupt button */
.btn-interrupt { padding: 16px 20px; font-size: 1rem; font-weight: 600; background: linear-gradient(135deg, #dc2626, #ef4444); color: #fff; border: none; border-radius: var(--radius); cursor: pointer; transition: all var(--transition); white-space: nowrap; }
.btn-interrupt:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(239,68,68,0.3); }
.btn-interrupt:disabled { opacity: 0.5; transform: none; cursor: not-allowed; }
.btn-interrupt.hidden { display: none; }

/* ── App Layout ── */
.app-container { display: none; flex-direction: column; height: 100vh; height: 100dvh; }
.app-container.active { display: flex; }

.app-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; background: rgba(18,18,26,0.75); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border-bottom: 1px solid var(--glass-border); position: sticky; top: 0; z-index: 100; }
.header-left { display: flex; align-items: center; gap: 16px; }
.header-right { display: flex; align-items: center; gap: 8px; }
.logo { font-size: 1.1rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.logo .logo-icon { color: var(--color-accent); flex-shrink: 0; }
.logo span { background: linear-gradient(135deg, var(--color-accent), #a78bfa, #e879f9); background-size: 200% 200%; -webkit-background-clip: text; -webkit-text-fill-color: transparent; animation: logoGlow 6s ease-in-out infinite; }
@keyframes logoGlow { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* Freya topbar pill */
.fw-topbar-pill {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 14px 5px 7px;
  border-radius: 999px;
  border: 1px solid rgba(124,106,239,0.35) !important;
  background: rgba(124,106,239,0.08);
  color: #c4b9ff;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, color 0.18s;
  cursor: pointer;
}
.fw-topbar-pill:hover {
  background: rgba(124,106,239,0.18);
  border-color: rgba(124,106,239,0.6) !important;
  box-shadow: 0 0 12px rgba(124,106,239,0.25);
  color: #e0d9ff;
}
.fw-topbar-pill[aria-expanded="true"] {
  background: rgba(124,106,239,0.22);
  border-color: rgba(124,106,239,0.7) !important;
  box-shadow: 0 0 16px rgba(124,106,239,0.35);
  color: #e0d9ff;
}
.fw-pill-orb {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; position: relative;
  background: radial-gradient(circle at 38% 35%, #b8adff, #7c6aef 55%, #4a2fa0);
  box-shadow: 0 0 8px rgba(124,106,239,0.6);
  animation: orbBreath 4s ease-in-out infinite;
}
.fw-pill-orb::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,0.35) 0%, transparent 55%);
}
@keyframes orbBreath {
  0%, 100% { box-shadow: 0 0 8px rgba(124,106,239,0.55); }
  50%       { box-shadow: 0 0 14px rgba(124,106,239,0.85), 0 0 28px rgba(124,106,239,0.25); }
}

/* Status Badge */
.status-badge { display: flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px; background: var(--color-surface-2); border: 1px solid var(--color-border); font-size: 0.75rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-text-dim); }
.status-badge.online .status-dot { background: var(--color-success); box-shadow: 0 0 8px rgba(52,211,153,0.5); animation: statusPulse 3s ease-in-out infinite; }
@keyframes statusPulse { 0%, 100% { box-shadow: 0 0 8px rgba(52,211,153,0.5); } 50% { box-shadow: 0 0 14px rgba(52,211,153,0.7); } }
.status-badge.offline .status-dot { background: var(--color-error); }

/* ── Generation Layout ── */
.gen-layout { display: grid; grid-template-columns: 420px 1fr; gap: 0; flex: 1; overflow: hidden; }

.gen-controls { display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid var(--glass-border); background: rgba(18, 18, 26, 0.7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 0; }

.gen-output { display: flex; flex-direction: column; overflow: hidden; min-height: 0; }

.interrupt-dock { position: absolute; top: 12px; right: 12px; z-index: 65; padding: 10px 14px; border-radius: 999px; border: 1px solid rgba(239,68,68,0.4); background: rgba(127,29,29,0.85); color: #fff; font-size: 0.82rem; font-weight: 600; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.interrupt-dock:hover { background: rgba(153,27,27,0.9); }
.interrupt-dock.hidden { display: none; }

/* Sheet handle — hidden on desktop */
.sheet-handle { display: none; }

/* ── Tray Carousel (shared desktop + mobile) ──────────────────────── */
.sheet-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    padding: 0;
}

/* Tab strip */
.tray-tabs {
    display: flex;
    flex: 0 0 auto;
    align-items: stretch;
    gap: 4px;
    padding: 8px 8px 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid var(--color-border);
}
.tray-tabs::-webkit-scrollbar { display: none; }
.tray-tab {
    flex: 1 1 0;
    min-width: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--color-text-dim);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    white-space: nowrap;
    position: relative;
    -webkit-tap-highlight-color: rgba(124,106,239,0.2);
}
.tray-tab:hover { color: var(--color-text); }
.tray-tab svg { opacity: 0.7; transition: opacity 0.15s ease; }
.tray-tab.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
    background: linear-gradient(180deg, rgba(124,106,239,0.06) 0%, transparent 100%);
}
.tray-tab.active svg { opacity: 1; }
.tray-tab-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 16px; height: 16px; padding: 0 5px;
    background: var(--color-accent); color: #fff;
    border-radius: 8px; font-size: 10px; font-weight: 700;
}
.tray-tab-badge[hidden] { display: none; }

/* Carousel viewport + track. The TRACK is the scroll container — cards
   inside are plain blocks (only one visible at a time via display:none).
   Single scroller is what iOS Safari handles reliably; nested
   overflow:auto + flex sizing breaks on many iOS versions. */
.tray-track {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.tray-card {
    display: block;
    width: 100%;
}
.tray-card:not(.tray-card-active) { display: none; }
.tray-card-body {
    padding: 16px 18px 24px;
}
/* Prompt card: keep column flex so the textarea grows. */
.tray-card[data-card="prompt"].tray-card-active {
    display: flex;
    flex-direction: column;
}
.tray-card[data-card="prompt"] .tray-card-body {
    display: flex;
    flex-direction: column;
}

/* Roomy prompt textarea now that it has its own card */
.prompt-textarea-roomy {
    min-height: 140px;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* ── Prompt card: positive fills, negative is a small toggle ── */
.prompt-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    min-height: 0;
}
.prompt-main-group {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.prompt-label { margin-bottom: 0; }
.prompt-action-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2px 0 4px;
}
.action-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 20px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.action-chip:hover { border-color: var(--color-accent); color: var(--color-accent); }
.action-chip:active { transform: scale(0.97); }
.action-chip.busy {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background: rgba(124,106,239,0.1);
    pointer-events: none;
}
.action-chip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
}

/* Weight chips (+/-) — square-ish, icon-only */
.action-chip.weight-chip {
    padding: 5px 9px;
    min-width: 30px;
    justify-content: center;
}
.action-chip.weight-chip .action-chip-icon {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

/* Prompt history dropdown */
.prompt-history-wrap {
    position: relative;
    display: inline-flex;
}
.prompt-history-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 20;
    width: min(320px, 80vw);
    max-height: 320px;
    overflow: hidden;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.45);
    display: flex;
    flex-direction: column;
}
.prompt-history-panel.hidden { display: none; }
.prompt-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.72rem;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.prompt-history-clear {
    background: none;
    border: none;
    color: var(--color-text-dim);
    font-size: 0.72rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}
.prompt-history-clear:hover { color: var(--color-accent); background: rgba(124,106,239,0.1); }
.prompt-history-list {
    overflow-y: auto;
    flex: 1;
    padding: 4px;
}
.prompt-history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--color-text);
    font-size: 0.82rem;
    cursor: pointer;
    transition: background var(--transition);
}
.prompt-history-item:hover { background: var(--color-surface-2); }
.prompt-history-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.prompt-history-del {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: var(--color-text-dim);
    font-size: 1.1rem;
    line-height: 1;
    opacity: 0;
    transition: opacity var(--transition), background var(--transition), color var(--transition);
}
.prompt-history-item:hover .prompt-history-del { opacity: 1; }
.prompt-history-del:hover { background: rgba(255,80,80,0.15); color: #ff6b6b; }
.prompt-history-empty {
    padding: 20px;
    text-align: center;
    color: var(--color-text-dim);
    font-size: 0.82rem;
}

/* ── Snapshots / Presets ── */
.snapshots-section {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--color-border);
}
.snapshots-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.snapshots-title {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-dim);
}
.snapshots-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 14px;
    background: var(--color-accent);
    color: #fff;
    border: none;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s ease;
}
.snapshots-save-btn:hover { filter: brightness(1.1); }
.snapshots-save-btn:active { transform: scale(0.97); }
.snapshots-empty {
    padding: 12px;
    background: var(--color-surface-2);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--color-text-dim);
    line-height: 1.4;
}
.snapshots-list { display: flex; flex-direction: column; gap: 6px; }
.snapshot-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.snapshot-item:hover { border-color: var(--color-accent); }
.snapshot-item:active { transform: scale(0.98); }
.snapshot-info { flex: 1; min-width: 0; }
.snapshot-name {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.snapshot-meta {
    font-size: 0.7rem;
    color: var(--color-text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}
.snapshot-delete {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: var(--color-text-dim);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.snapshot-delete:hover { color: var(--color-error); background: rgba(255,80,80,0.08); }
.prompt-textarea-fill {
    flex: 1 1 auto;
    min-height: 120px;
    width: 100%;
    resize: none;
    line-height: 1.5;
    font-size: 0.98rem;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-family: inherit;
}
.prompt-textarea-fill:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(124,106,239,0.18);
}

/* Compact negative toggle pill + collapsible textarea */
.negative-block {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.negative-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    padding: 6px 10px;
    background: transparent;
    border: 1px dashed var(--color-border);
    border-radius: 999px;
    color: var(--color-text-dim);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.negative-toggle-btn:hover {
    color: var(--color-text);
    border-color: var(--color-text-dim);
}
.negative-toggle-btn[aria-expanded="true"] {
    color: var(--color-accent);
    border-color: var(--color-accent);
    border-style: solid;
    background: rgba(124,106,239,0.08);
}
.negative-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 16px;
    padding: 0 5px;
    background: var(--color-text-dim);
    color: var(--color-bg);
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
}
.negative-toggle-btn[aria-expanded="true"] .negative-status {
    background: var(--color-accent);
    color: #fff;
}

/* Negative prompt collapsible */
.negative-textarea {
    width: 100%;
    resize: vertical;
    min-height: 60px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.4;
}
.negative-textarea.hidden { display: none; }
.negative-chevron {
    display: inline-flex;
    transition: transform 0.2s ease;
    color: currentColor;
}
.negative-chevron.open { transform: rotate(180deg); }

/* Sticky footer with Generate button */
.tray-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--color-border);
    background: rgba(12, 12, 18, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.tray-footer .batch-select {
    flex: 0 0 auto;
    width: 64px;
    padding: 8px 10px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 0.88rem;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238888a0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    padding-right: 22px;
}
.tray-footer .btn-generate {
    flex: 1 1 auto;
    padding: 12px 18px;
    font-size: 0.95rem;
    font-weight: 600;
}
.tray-footer .btn-interrupt { flex: 1 1 auto; }


/* ── Controls ── */
.control-group { margin-bottom: 14px; }
.control-group label { display: block; font-size: 0.78rem; font-weight: 500; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.control-group label span { color: var(--color-accent); font-weight: 600; }
.control-row { display: flex; gap: 12px; margin-bottom: 14px; }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

textarea, select, input[type="number"] { width: 100%; padding: 10px 12px; background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius-sm); color: var(--color-text); font-size: 0.88rem; font-family: var(--font); resize: vertical; outline: none; transition: border-color var(--transition); }
textarea:focus, select:focus, input:focus { border-color: var(--color-accent); }
select { cursor: pointer; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238888a0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }

input[type="range"] { -webkit-appearance: none; width: 100%; height: 4px; background: var(--color-border); border-radius: 2px; outline: none; border: none; padding: 0; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--color-accent); cursor: pointer; }

/* Presets */
.preset-row { display: flex; gap: 6px; margin-bottom: 14px; }
.preset-btn { flex: 1; padding: 6px 4px; background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius-sm); color: var(--color-text-dim); font-size: 0.75rem; cursor: pointer; transition: all var(--transition); }
.preset-btn:hover, .preset-btn.active { border-color: var(--color-accent); color: var(--color-accent); background: var(--color-accent-bg); }

/* Advanced */
.advanced-panel { margin-bottom: 8px; }
.advanced-panel summary { cursor: pointer; font-size: 0.82rem; color: var(--color-text-dim); padding: 8px 0; user-select: none; }
.advanced-panel summary:hover { color: var(--color-text); }
.advanced-panel[open] summary { margin-bottom: 12px; }
.seed-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.seed-row > * { min-width: 0; }
.seed-row input { width: 100%; min-width: 0; }
.seed-row #randomSeedBtn { width: 44px; min-width: 44px; padding: 0; }

/* ── Output Area ── */
.output-display { display: flex; align-items: center; justify-content: center; padding: 12px 20px; overflow: hidden; min-height: 0; height: 100%; position: relative; flex: 1; }
.output-display img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius); cursor: pointer; transition: transform var(--transition); }
.output-display img:hover { transform: scale(1.01); }

/* Output action overlay */
.output-actions { position: absolute; bottom: 28px; right: 28px; display: flex; gap: 6px; opacity: 0; transition: opacity var(--transition); }
.output-display:hover .output-actions { opacity: 1; }

/* Keep overlay controls legible over very bright or dark images */
.output-actions .btn {
    background: rgba(8, 10, 16, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #ffffff;
    backdrop-filter: blur(8px) saturate(1.05);
    -webkit-backdrop-filter: blur(8px) saturate(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.output-actions .btn:hover {
    background: rgba(18, 22, 34, 0.9);
    border-color: rgba(255, 255, 255, 0.45);
    color: #ffffff;
}

.output-actions .btn svg {
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
}

.empty-state { text-align: center; color: var(--color-text-dim); }
.empty-icon { margin-bottom: 12px; opacity: 0.3; display: flex; justify-content: center; }
.empty-state h3 { font-size: 1.2rem; color: var(--color-text); margin-bottom: 6px; }
.empty-state p { font-size: 0.88rem; }

/* Queue status pill */
.queue-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 12px; background: var(--color-accent-bg); border: 1px solid rgba(124,106,239,0.2); font-size: 0.72rem; color: var(--color-accent); margin-top: 4px; }
.queue-status.hidden { display: none; }

/* Progress */
.progress-area { padding: 12px 20px; border-bottom: 1px solid var(--color-border); }
.progress-area.hidden { display: none; }
.progress-bar { height: 4px; background: var(--color-surface-2); border-radius: 2px; overflow: hidden; margin-bottom: 6px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--color-accent), #e879f9); border-radius: 2px; transition: width 0.3s ease; width: 0%; box-shadow: 0 0 12px rgba(124, 106, 239, 0.3); }
.progress-text { font-size: 0.78rem; color: var(--color-text-dim); }

/* Preview during generation */
.preview-container { display: flex; align-items: center; justify-content: center; padding: 8px; max-height: 50vh; overflow: hidden; }
.preview-container.hidden { display: none; }
.preview-container img { max-width: 100%; max-height: 45vh; object-fit: contain; border-radius: var(--radius-sm); opacity: 0.85; image-rendering: auto; animation: previewFadeIn 0.3s ease; }
@keyframes previewFadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 0.85; transform: scale(1); } }

/* Recent Strip */
.recent-strip { display: none !important; }
.recent-strip:empty { display: none !important; }
.recent-thumb { width: 60px; height: 60px; border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: border-color var(--transition); flex-shrink: 0; }
.recent-thumb:hover { border-color: var(--color-accent); }
.recent-thumb img { width: 100%; height: 100%; object-fit: cover; }

body.modal-open { overflow: hidden; position: fixed; inset: 0; }

/* ── Modals ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal-overlay.hidden { display: none; }
.modal { background: rgba(18, 18, 26, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; }
.modal-fullscreen { max-width: 95vw; max-height: 95vh; }
.modal-lg { max-width: 900px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--color-border); flex-shrink: 0; }
.modal-header h2 { font-size: 1.1rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.modal-close { background: none; border: none; color: var(--color-text-dim); font-size: 1.2rem; cursor: pointer; padding: 8px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; }
.modal-close:hover { background: var(--color-surface-2); color: var(--color-text); }
.modal-close:active { background: var(--color-surface-3); color: var(--color-text); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; min-height: 0; }

/* ── Gallery Grid ── */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.gallery-close-float { display: none; }
.gallery-card { position: relative; width: 100%; height: 0; padding-bottom: 100%; border-radius: var(--radius); overflow: hidden; cursor: pointer; border: 2px solid transparent; transition: all var(--transition); }
.gallery-card:hover { border-color: rgba(124, 106, 239, 0.3); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(124, 106, 239, 0.06); }
.gallery-card img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; -webkit-touch-callout: none; user-select: none; pointer-events: none; touch-action: pan-y; }
.gallery-card .gallery-actions { position: absolute; bottom: 0; left: 0; right: 0; padding: 8px; background: linear-gradient(transparent, rgba(0,0,0,0.8)); display: flex; justify-content: flex-end; gap: 4px; opacity: 0; transition: opacity var(--transition); z-index: 1; }
.gallery-card:hover .gallery-actions { opacity: 1; }
.gallery-actions button { background: rgba(255,255,255,0.2); border: none; color: #fff; padding: 4px 8px; border-radius: 4px; cursor: pointer; font-size: 0.8rem; }
.gallery-actions button:hover { background: rgba(255,255,255,0.4); }

/* ── History ── */
.history-item { display: flex; gap: 12px; padding: 12px; border-radius: var(--radius); border: 1px solid var(--color-border); margin-bottom: 10px; transition: background var(--transition); }
.history-item:hover { background: var(--color-surface-2); }
.history-thumb { width: 80px; height: 80px; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; background: var(--color-surface-2); display: flex; align-items: center; justify-content: center; }
.history-thumb img { width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; -webkit-touch-callout: none; user-select: none; pointer-events: none; touch-action: pan-y; }
.history-details { flex: 1; min-width: 0; }
.history-prompt { font-size: 0.88rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 4px; }
.history-meta { font-size: 0.75rem; color: var(--color-text-dim); display: flex; gap: 12px; flex-wrap: wrap; }
.history-actions { margin-top: 6px; }
.history-status { padding: 2px 8px; border-radius: 10px; font-size: 0.7rem; font-weight: 600; }
.history-status.completed { background: rgba(52,211,153,0.15); color: var(--color-success); }
.history-status.failed { background: rgba(248,113,113,0.15); color: var(--color-error); }
.history-status.pending, .history-status.running { background: rgba(124,106,239,0.15); color: var(--color-accent); }

/* ── Dream Queue ── */
.dream-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--radius-sm); border: 1px solid var(--color-border); margin-bottom: 8px; }
.dream-item .dream-prompt { flex: 1; font-size: 0.85rem; }
.dream-item .dream-status { font-size: 0.72rem; padding: 2px 8px; border-radius: 10px; }

/* ── Action Sheet (iOS-style) ── */
.action-sheet-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1500; display: flex; align-items: flex-end; justify-content: center; }
.action-sheet-overlay.hidden { display: none; }
.action-sheet { width: 100%; max-width: 500px; background: var(--color-surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 8px 0; margin-bottom: env(safe-area-inset-bottom, 0px); }
.action-sheet-header { padding: 12px 16px; border-bottom: 1px solid var(--color-border); }
.action-btn { display: block; width: 100%; text-align: left; padding: 14px 16px; background: none; border: none; color: var(--color-text); font-size: 0.92rem; cursor: pointer; transition: background var(--transition); font-family: var(--font); }
.action-btn:hover { background: var(--color-surface-2); }
.action-btn:active { background: var(--color-surface-3); }
.action-btn-danger { color: var(--color-error); }
.action-btn-cancel { text-align: center; font-weight: 600; color: var(--color-accent); border-top: 1px solid var(--color-border); margin-top: 4px; }

/* ── FAB (Floating Action Button) ── */
.fab-generate { display: none !important; }

/* ── Lightbox ── */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 2000; display: flex; align-items: center; justify-content: center; }
.lightbox.hidden { display: none; }
.lightbox img { max-width: 95vw; max-height: 95vh; object-fit: contain; }
.lightbox-close { position: absolute; top: 16px; right: 16px; background: rgba(255,255,255,0.1); border: none; color: #fff; font-size: 1.5rem; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; z-index: 10; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.1); border: none; color: #fff; font-size: 2rem; width: 50px; height: 80px; cursor: pointer; z-index: 10; border-radius: var(--radius-sm); }
.lightbox-nav:hover { background: rgba(255,255,255,0.2); }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }
.lightbox-info { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,0.6); font-size: 0.82rem; display: flex; flex-direction: column; align-items: center; gap: 6px; white-space: nowrap; }
.lightbox-info-row { display: flex; align-items: center; gap: 6px; }

/* ── Toast ── */
.toast-container { position: fixed; bottom: 20px; right: 88px; z-index: 5000; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 18px; border-radius: var(--radius-sm); color: #fff; font-size: 0.85rem; animation: toastIn 0.3s ease; box-shadow: var(--shadow-lg); max-width: 350px; }
.toast.success { background: #065f46; border: 1px solid var(--color-success); }
.toast.error { background: #7f1d1d; border: 1px solid var(--color-error); }
.toast.info { background: #1e3a5f; border: 1px solid #3b82f6; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ── AI Prompt Buttons ── */
.label-row { display: flex; align-items: center; justify-content: space-between; }
.prompt-ai-buttons { display: flex; gap: 4px; }
.ai-btn { width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--color-surface-2); border: 1px solid var(--color-border); color: var(--color-text-dim); font-size: 0.85rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all var(--transition); padding: 0; }
.ai-btn:hover { border-color: var(--color-accent); color: var(--color-accent); background: var(--color-accent-bg); }
.ai-btn.loading { opacity: 0.5; pointer-events: none; }

/* ── AI Chat Panel ── */
.prompt-chat-panel { background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius-sm); margin-bottom: 14px; overflow: hidden; display: flex; flex-direction: column; }
.prompt-chat-panel.hidden { display: none; }
.chat-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-bottom: 1px solid var(--color-border); flex-shrink: 0; }
.chat-panel-title { font-size: 0.76rem; font-weight: 600; color: var(--color-accent); letter-spacing: 0.04em; text-transform: uppercase; }
.chat-panel-close { background: none; border: none; color: var(--color-text-dim); cursor: pointer; padding: 4px; border-radius: 4px; display: flex; align-items: center; justify-content: center; transition: color var(--transition), background var(--transition); }
.chat-panel-close:hover { color: var(--color-text); background: rgba(255,255,255,0.06); }
.chat-messages { max-height: 180px; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.chat-messages:empty::after { content: 'Ask me to help refine your prompt...'; color: var(--color-text-dim); font-size: 0.8rem; font-style: italic; }
.chat-msg { padding: 8px 10px; border-radius: var(--radius-sm); font-size: 0.82rem; line-height: 1.4; max-width: 85%; word-wrap: break-word; }
.chat-msg.user { background: var(--color-accent-bg); border: 1px solid rgba(124,106,239,0.2); align-self: flex-end; }
.chat-msg.assistant { background: var(--color-surface-3); align-self: flex-start; }
.chat-input-row { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--color-border); }
.chat-input-row input { flex: 1; padding: 8px 10px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-sm); color: var(--color-text); font-size: 0.82rem; outline: none; }
.chat-input-row input:focus { border-color: var(--color-accent); }
.chat-use-btn { background: var(--color-accent-bg); border: 1px solid rgba(124,106,239,0.3); color: var(--color-accent); padding: 4px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 0.75rem; margin-top: 6px; transition: all var(--transition); }
.chat-use-btn:hover { background: var(--color-accent); color: #fff; }

/* ── Multi-LoRA Display ── */
.lora-list:empty { display: none; }
.lora-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.lora-item { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; padding: 6px 10px; background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius-sm); font-size: 0.78rem; transition: opacity var(--transition); }
.lora-item-disabled { opacity: 0.45; }
.lora-item-disabled .lora-name { text-decoration: line-through; color: var(--color-text-dim); }
.lora-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-text); min-width: 60px; }
.lora-active { width: 6px; height: 6px; border-radius: 50%; background: var(--color-success); flex-shrink: 0; }
.lora-toggle { background: none; border: none; color: var(--color-success); width: 22px; height: 22px; border-radius: 4px; cursor: pointer; transition: all var(--transition); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.lora-toggle[aria-pressed="false"] { color: var(--color-text-dim); }
.lora-toggle:hover { background: rgba(255,255,255,0.06); }
.lora-range-wrap { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.lora-range { width: 80px; accent-color: var(--color-accent); }
.lora-strength-val { color: var(--color-accent); font-weight: 600; font-size: 0.72rem; min-width: 28px; text-align: right; font-variant-numeric: tabular-nums; }
.lora-remove { background: none; border: none; color: var(--color-text-dim); width: 22px; height: 22px; border-radius: 4px; font-size: 1.1rem; line-height: 1; cursor: pointer; transition: all var(--transition); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.lora-remove:hover { background: rgba(255,80,80,0.15); color: #ff6b6b; }

/* Picker selected pill enable/disable */
.picker-selected-pill-disabled { opacity: 0.45; }
.picker-selected-pill-disabled .picker-selected-name { text-decoration: line-through; }
.picker-selected-toggle { background: none; border: none; color: var(--color-success); width: 18px; height: 18px; border-radius: 50%; cursor: pointer; padding: 0; font-size: 0.7rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.picker-selected-pill-disabled .picker-selected-toggle { color: var(--color-text-dim); }
.picker-selected-toggle:hover { background: rgba(255,255,255,0.08); }

/* ── Extras Controls ── */
.extras-controls:empty { display: none; }
.extras-controls { border-top: 1px solid var(--color-border); padding-top: 12px; margin-top: 8px; }
.extras-label { font-size: 0.72rem; font-weight: 600; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.extras-node { border: 1px solid var(--color-border); border-radius: 8px; padding: 4px 10px; margin-bottom: 8px; background: var(--color-surface-2); }
.extras-node > summary { list-style: none; cursor: pointer; padding: 6px 0; display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; gap: 8px; user-select: none; -webkit-tap-highlight-color: transparent; }
.extras-node > summary::-webkit-details-marker { display: none; }
.extras-node > summary::before { content: '▸'; font-size: 0.7rem; color: var(--color-text-dim); transition: transform var(--transition); }
.extras-node[open] > summary::before { transform: rotate(90deg); }
.extras-node-title { flex: 1; font-weight: 600; color: var(--color-text); }
.extras-node-id { font-family: ui-monospace, monospace; font-size: 0.7rem; color: var(--color-text-dim); }
.extras-category { border: 1px solid var(--color-border); border-radius: 10px; padding: 4px 12px; margin-bottom: 10px; background: var(--color-surface); }
.extras-category > summary { list-style: none; cursor: pointer; padding: 8px 0; display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; gap: 8px; user-select: none; -webkit-tap-highlight-color: transparent; }
.extras-category > summary::-webkit-details-marker { display: none; }
.extras-category > summary::before { content: '▸'; font-size: 0.75rem; color: var(--color-text-dim); transition: transform var(--transition); margin-right: 4px; }
.extras-category[open] > summary::before { transform: rotate(90deg); }
.extras-cat-title { flex: 1; font-weight: 700; color: var(--color-text); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.75rem; }
.extras-cat-count { font-size: 0.7rem; color: var(--color-text-dim); }
.extras-category > .extras-node { background: var(--color-surface-2); margin-top: 6px; }
.extras-check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.85rem; }
.extras-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--color-accent); }
.extra-textarea { width: 100%; min-height: 48px; resize: vertical; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text); font-family: inherit; font-size: 0.82rem; }
.extra-textarea:focus { outline: none; border-color: var(--color-accent); }

/* ── Group Toggles ── */
.group-toggles:empty { display: none; }
.group-toggles { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.group-chip { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 20px; background: var(--color-surface-2); border: 1px solid var(--color-border); font-size: 0.78rem; cursor: pointer; transition: all var(--transition); user-select: none; -webkit-tap-highlight-color: transparent; }
.group-chip:hover { border-color: var(--color-accent); }
.group-chip.disabled { opacity: 0.35; text-decoration: line-through; border-style: dashed; }
.group-chip-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── Batch Select ── */
.batch-select { width: 52px; padding: 0 4px; text-align: center; background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius-sm); color: var(--color-text); font-size: 0.82rem; cursor: pointer; flex-shrink: 0; -webkit-appearance: none; appearance: none; }

/* ══════════════════════════════════════
   Desktop: Generating State
   ══════════════════════════════════════ */

@media (min-width: 601px) {
    /* Hide empty output display so progress-area can fill the panel */
    .app-container.is-generating .output-display { display: none; }

    /* Progress area grows to fill gen-output */
    .app-container.is-generating .progress-area {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        padding: 8px 12px;
        border-bottom: none;
    }

    /* Preview container fills remaining space below progress bars */
    .app-container.is-generating .preview-container {
        flex: 1;
        min-height: 0;
        max-height: none;
        padding: 4px;
        order: 4;
    }

    .app-container.is-generating .preview-container img {
        max-height: 100%;
        height: 100%;
        max-width: 100%;
        object-fit: contain;
    }

    .app-container.is-generating .progress-bar { order: 1; }
    .app-container.is-generating .progress-text { order: 2; margin-bottom: 2px; }
    .app-container.is-generating .queue-status { order: 3; }

    /* Keep output-actions above the Freya widget button (52px at bottom: 24px) */
    .output-actions { bottom: 88px; }
}

/* ══════════════════════════════════════
   Responsive
   ══════════════════════════════════════ */

@media (max-width: 900px) {
    .gen-layout { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
    .gen-controls { border-right: none; border-bottom: 1px solid var(--color-border); overflow-y: auto; }
    .gen-output { min-height: 0; }
}

@media (max-width: 600px) {
    /* --- Locked bottom-sheet layout (no nested scrolling) ---
       Viewport is locked. Output fills the top, the bottom sheet is
       fixed-height with: tab strip + active card + Generate footer.
       Each card's contents are sized to fit the available card area
       so nothing inside the sheet needs to scroll. The prompt textarea
       is the only intentionally scrollable element (native textarea
       scrolling — works on iOS even inside fixed parents). */
    html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
    /* --vvh is set by JS (visualViewport resize listener) to the actual visible height
       above the keyboard. Fallback to 100dvh when JS hasn't run yet. */
    .app-container { height: var(--vvh, 100dvh); display: flex; flex-direction: column; overflow: hidden; }
    .app-header { flex: 0 0 auto; }

    .gen-layout {
        display: flex;
        flex-direction: column;
        position: static;
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
        overflow: hidden;
    }

    .gen-output {
        order: 1;
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
        overflow: hidden;
        padding-bottom: 0;
        position: relative;
    }

    .gen-controls {
        order: 2;
        position: relative;
        flex: 0 0 auto;
        /* Fixed sheet height: tabs(44) + card(~300) + footer(60) + safe-area */
        height: calc(54dvh + env(safe-area-inset-bottom, 0px));
        max-height: calc(54dvh + env(safe-area-inset-bottom, 0px));
        border-radius: 16px 16px 0 0;
        border-top: 1px solid var(--color-border);
        box-shadow: 0 -8px 24px rgba(0,0,0,0.25);
        background: var(--color-surface);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding: 0;
    }

    .gen-controls.collapsed { transform: none; }

    /* When keyboard is open, flip the flex weights so the prompt area dominates.
       gen-controls expands to fill most of the visible space above the keyboard;
       the output area shrinks to a strip. The prompt textarea gains usable height. */
    body.keyboard-open .gen-controls {
        flex: 1 1 auto;
        height: auto;
        max-height: none;
    }
    body.keyboard-open .gen-output {
        flex: 0 0 80px;
        min-height: 60px;
    }

    .app-container.is-generating .output-display {
        display: none;
    }

    .app-container.is-generating .gen-output {
        padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px));
    }

    .app-container.is-generating .progress-area {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }

    .app-container.is-generating .preview-container {
        flex: 1;
        min-height: 0;
        max-height: none;
        padding: 0;
        order: 4;
    }

    .app-container.is-generating .progress-bar { order: 1; margin-top: 8px; }
    .app-container.is-generating .progress-text { order: 2; margin-top: 6px; }
    .app-container.is-generating .queue-status { order: 3; margin-top: 6px; }

    .app-container.is-generating .preview-container img {
        max-height: calc(100% - 6px);
    }

    .output-display { overflow: hidden; flex: 1; min-height: 0; padding: 8px; }

    /* --- Drag Handle --- */
    .sheet-handle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        flex: 0 0 56px;
        height: 56px;
        padding: 0 40px;
        box-sizing: border-box;
        cursor: pointer;
        background: var(--color-surface);
        border-radius: 16px 16px 0 0;
        border-bottom: 1px solid var(--color-border);
        -webkit-tap-highlight-color: rgba(124,106,239,0.15);
    }

    .sheet-content {
        flex: 1 1 0;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding: 0;
    }

    .handle-bar {
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: var(--color-border-2);
    }

    .sheet-chevron {
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1.1rem;
        color: var(--color-text-dim);
        transition: transform 0.3s;
        line-height: 1;
    }

    .gen-controls.collapsed .sheet-chevron {
        transform: translateY(-50%) rotate(180deg);
    }

    /* Show drag handle to collapse/expand sheet */
    .sheet-handle { display: flex !important; flex: 0 0 28px; height: 28px; padding: 0; }
    .sheet-handle .handle-bar { width: 36px; height: 4px; }

    /* Collapsed state: hide everything except the drag handle */
    .gen-controls.collapsed {
        height: calc(28px + env(safe-area-inset-bottom, 0px)) !important;
        max-height: calc(28px + env(safe-area-inset-bottom, 0px)) !important;
        transform: none;
    }
    .gen-controls.collapsed .sheet-content { display: none !important; }

    .sheet-content {
        display: flex;
        flex-direction: column;
        padding: 0;
        overflow: hidden;
        flex: 1 1 auto;
        min-height: 0;
    }

    /* Tabs: fixed strip at top of sheet */
    .tray-tabs {
        position: relative;
        flex: 0 0 44px;
        height: 44px;
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
        z-index: 2;
    }

    /* Track: holds active card, fills remaining sheet space */
    .tray-track {
        position: relative;
        display: block;
        flex: 1 1 auto;
        min-height: 0;
        height: auto;
        overflow: hidden;
    }
    .tray-card {
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }
    .tray-card.tray-card-active {
        display: flex;
        flex-direction: column;
        height: 100%;
    }
    .tray-card-body {
        flex: 1 1 auto;
        min-height: 0;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    /* Tighten control spacing inside cards so everything fits */
    .tray-card-body .control-group { margin-bottom: 0; }
    .tray-card-body .control-row { gap: 8px; margin-bottom: 0; }
    .tray-card-body label { font-size: 0.7rem; margin-bottom: 3px; }
    .tray-card-body select,
    .tray-card-body input[type="number"],
    .tray-card-body input[type="text"],
    .tray-card-body .select-trigger { min-height: 38px; padding: 6px 10px; }
    .tray-card-body input[type="range"] { margin: 4px 0 0; }
    .tray-card-body .preset-row { gap: 4px; margin-bottom: 0; flex-wrap: wrap; }
    .tray-card-body .preset-btn { padding: 5px 8px; font-size: 0.72rem; min-height: 32px; }

    /* Generate footer: fixed at bottom of sheet (not viewport) */
    .tray-footer {
        position: relative;
        flex: 0 0 auto;
        z-index: 3;
        background: var(--color-surface);
        border-top: 1px solid var(--color-border);
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    }

    /* ── Prompt card: textarea fills, scrolls internally ── */
    .tray-card[data-card="prompt"] .tray-card-body {
        display: flex;
        flex-direction: column;
        gap: 6px;
        overflow: hidden; /* prompt card uses textarea native scroll, no body scroll */
    }
    .prompt-card-body { display: flex !important; flex-direction: column; height: 100%; min-height: 0; }
    .prompt-main-group {
        display: flex !important;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
        margin-bottom: 0 !important;
    }
    .prompt-action-chips { flex: 0 0 auto; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
    .prompt-label { flex: 0 0 auto; }
    #promptInput,
    #promptInput.prompt-textarea-fill,
    #promptInput.prompt-textarea-roomy {
        flex: 1 1 auto;
        height: auto !important;
        min-height: 0 !important;
        max-height: none;
        resize: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .negative-block { flex: 0 0 auto; }
    .negative-textarea { max-height: 80px; }

    /* ── Image card: pack controls densely ── */
    .tray-card[data-card="image"] .tray-card-body { gap: 6px; }
    .tray-card[data-card="image"] .control-group { margin-bottom: 0; }
    .tray-card[data-card="image"] .preset-btn { min-height: 30px; padding: 4px 8px; font-size: 0.72rem; }

    /* ── Sampling card: 2-col grid of compact rows ── */
    .tray-card[data-card="sampling"] .tray-card-body { gap: 8px; }
    .tray-card[data-card="sampling"] .control-row { gap: 8px; }

    /* ── LoRA card: list scrolls internally if long ── */
    .tray-card[data-card="lora"] .tray-card-body { gap: 8px; }
    .tray-card[data-card="lora"] #loraGroup { flex: 0 0 auto; }
    .tray-card[data-card="lora"] .lora-list {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* ── Extras card: contents scroll internally ── */
    .tray-card[data-card="extras"] .tray-card-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        gap: 10px;
    }

    /* Chat overlay on mobile */
    .prompt-chat-panel:not(.hidden) {
        position: absolute;
        inset: 0;
        margin: 0;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid var(--color-border);
        z-index: 5;
        display: flex;
        flex-direction: column;
        background: var(--color-surface-2);
    }
    .prompt-chat-panel:not(.hidden) .chat-messages {
        flex: 1;
        max-height: none;
        min-height: 0;
    }

    /* Footer stays in flex flow at bottom of sheet-content */
    .tray-footer { flex: 0 0 auto; }

    /* --- FAB --- */
    .fab-generate {
        position: fixed;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        right: 16px;
        z-index: 60;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--color-accent), #9b6aef);
        color: #fff;
        border: none;
        font-size: 1.4rem;
        box-shadow: 0 4px 16px rgba(124,106,239,0.4);
        cursor: pointer;
        display: none !important;
    }
    .fab-generate:not(.hidden) { display: none !important; }
    .fab-generate:active { transform: scale(0.92); }

    /* Interrupt button on mobile: FAB-style */
    .btn-interrupt:not(.hidden) {
        position: fixed;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        right: 16px;
        z-index: 60;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        padding: 0;
        font-size: 0;
    }
    .btn-interrupt:not(.hidden) .btn-text { font-size: 1.2rem; }

    .interrupt-dock:not(.hidden) {
        top: calc(10px + env(safe-area-inset-top, 0px));
        right: 10px;
        padding: 10px 12px;
        min-height: 40px;
    }

    /* --- Header compact --- */
    .app-header { padding: 8px 12px; gap: 8px; }
    .header-left { gap: 8px; min-width: 0; flex-shrink: 1; }
    .header-right { gap: 4px; flex-shrink: 0; }
    .header-right .btn { padding: 6px 8px; font-size: 1rem; min-height: 36px; border: none; }
    .header-right .fw-topbar-pill { padding: 4px 10px 4px 5px; font-size: 0.75rem; }
    .header-right .fw-topbar-pill span { display: inline; }
    .fw-pill-orb { width: 18px; height: 18px; }
    .header-right .btn-label { display: none; }
    .logo { font-size: 0.95rem; }
    .logo span { display: none; }

    /* Status badge: compact */
    .status-badge .status-text { display: none; }
    .status-badge { padding: 4px 8px; min-width: 0; }

    /* Controls: tighter */
    .control-group { margin-bottom: 10px; }
    .control-group label { font-size: 0.72rem; margin-bottom: 4px; }
    textarea { font-size: 0.85rem; }
    .control-row { gap: 8px; }

    /* Presets: compact but touchable */
    .preset-row { gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
    .preset-btn { padding: 6px 8px; font-size: 0.75rem; min-height: 36px; }

    /* Generate button: slimmer */
    .btn-generate { padding: 12px; font-size: 0.9rem; }

    /* Output area */
    .empty-icon { margin-bottom: 8px; }
    .empty-icon svg { width: 48px; height: 48px; }
    .empty-state h3 { font-size: 1rem; }
    .empty-state p { font-size: 0.8rem; }
    /* Output actions always visible on mobile */
    .output-actions { opacity: 1; }

    /* Recent strip intentionally hidden on mobile */
    .recent-strip { display: none !important; }

    /* Modals */
    .modal { border-radius: var(--radius); margin: 8px; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: var(--color-surface) !important; }
    .modal-overlay { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: rgba(0,0,0,0.85); }
    .modal-overlay:has(.modal-fullscreen) { padding: 0; }
    .modal-fullscreen { max-width: 100vw; max-height: 100vh; max-height: 100dvh; width: 100vw; height: 100vh; height: 100dvh; margin: 0; border-radius: 0; }
    .modal-fullscreen .modal-header { padding-top: calc(12px + env(safe-area-inset-top, 0px)); background: var(--color-surface); }
    .modal-header { padding: 12px 16px; }
    .gallery-close-float { display: flex; align-items: center; justify-content: center; position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; z-index: 1010; width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,0.7); border: 1px solid rgba(255,255,255,0.2); color: #fff; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
    .modal-body { padding: 14px; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .history-thumb { width: 60px; height: 60px; }
    .history-item { padding: 10px; gap: 10px; }

    /* Lightbox */
    .lightbox-nav { width: 40px; height: 60px; font-size: 1.5rem; }
    .lightbox-close { top: 10px; right: 10px; width: 36px; height: 36px; font-size: 1.2rem; }

    /* Toast: full width on mobile */
    .toast-container { left: 12px; right: 74px; bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
    .toast { max-width: none; }
}

/* ── iOS ── */
@supports (padding: env(safe-area-inset-top)) {
    .app-header { padding-top: calc(12px + env(safe-area-inset-top)); }
    .modal:not(.modal-fullscreen) { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
}

@media (display-mode: standalone) {
    body { overscroll-behavior: none; -webkit-overflow-scrolling: touch; }
}

@media (pointer: coarse) {
    .btn { min-height: 44px; padding: 10px 16px; }
    .header-right .btn { min-height: 36px; padding: 6px 8px; }
    .ai-btn { width: 36px; height: 36px; font-size: 1rem; }
    select, input[type="text"], input[type="number"], textarea { font-size: 16px; min-height: 44px; }
    .gallery-card:hover { transform: none; }
    .gallery-card:active { transform: scale(0.98); transition-duration: 50ms; }
    .gallery-card .gallery-actions { opacity: 1; }
    .recent-thumb:active { border-color: var(--color-accent); }
}

body { overscroll-behavior-y: contain; }
.gen-controls { -webkit-overflow-scrolling: touch; }

/* ── Picker (Model / LoRA browser) ──────────────────────────────────────── */
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.picker-btn-link {
    background: transparent; border: 1px solid var(--color-border);
    color: var(--color-accent); font-size: 11px; font-weight: 500;
    padding: 3px 10px; border-radius: 12px; cursor: pointer;
    transition: all 0.15s ease;
}
.picker-btn-link:hover, .picker-btn-link:active {
    background: var(--color-accent); color: #fff; border-color: var(--color-accent);
}

.picker-toolbar {
    display: flex; flex-direction: column; gap: 8px;
    padding: 10px 16px; border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
    position: sticky; top: 0; z-index: 5;
}
.picker-search {
    width: 100%; padding: 10px 12px;
    background: var(--color-bg); border: 1px solid var(--color-border);
    border-radius: 10px; color: var(--color-text);
    font-size: 14px; -webkit-appearance: none; appearance: none;
}
.picker-search:focus { outline: none; border-color: var(--color-accent); }

.picker-filters {
    display: flex; gap: 6px; overflow-x: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    padding-bottom: 2px;
}
.picker-filters::-webkit-scrollbar { display: none; }
.picker-chip {
    flex: 0 0 auto; padding: 6px 12px; font-size: 12px; font-weight: 500;
    background: var(--color-bg); color: var(--color-text-dim);
    border: 1px solid var(--color-border); border-radius: 14px;
    cursor: pointer; white-space: nowrap; user-select: none;
    transition: all 0.15s ease;
}
.picker-chip:hover { color: var(--color-text); border-color: var(--color-accent); }
.picker-chip.active {
    background: var(--color-accent); color: #fff; border-color: var(--color-accent);
}
.picker-chip-count { opacity: 0.7; margin-left: 4px; font-size: 10px; }

.picker-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}
.picker-card {
    position: relative; display: flex; fl
    rection: column;
    background: var(--color-bg); border: 1px solid var(--color-border);
    border-radius: 10px; overflow: hidden; cursor: pointer;
    transition: all 0.15s ease; min-height: 200px;
}
.picker-card:active { transform: scale(0.97); }
.picker-card.selected { border-color: var(--color-accent); box-shadow: 0 0 0 2px var(--color-accent); }

.picker-thumb {
    aspect-ratio: 1 / 1; width: 100%; background: linear-gradient(135deg, #1a1a24 0%, #0f0f17 100%);
    display: flex; align-items: center; justify-content: center; position: relative;
}
.picker-thumb img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    user-select: none;
    pointer-events: none;
    touch-action: pan-y;
}
.picker-card, .workflow-picker-card { touch-action: pan-y; -webkit-touch-callout: none; }
.modal-body { touch-action: pan-y; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.picker-thumb-model { overflow: hidden; }
.picker-thumb-model > img { position: absolute; inset: 0; z-index: 2; }
.picker-thumb-placeholder {
    color: var(--color-text-dim); opacity: 0.4; font-family: var(--font-mono, monospace);
    font-size: 22px; font-weight: 700;
}

.model-art {
    position: absolute;
    inset: 0;
    overflow: hidden;
    display: block;
    pointer-events: none;
    background:
        radial-gradient(circle at 18% 18%, hsla(var(--model-h2), 92%, 72%, 0.26), transparent 34%),
        linear-gradient(135deg, hsla(var(--model-h), 52%, 24%, 1), hsla(var(--model-h2), 58%, 12%, 1));
}
.model-art::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.08), transparent 34%),
        linear-gradient(180deg, transparent 58%, rgba(0,0,0,0.42));
    z-index: 1;
}
.model-art-orb {
    position: absolute;
    right: -14%;
    top: -18%;
    width: 62%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, hsla(var(--model-h2), 95%, 76%, 0.72) 0%, hsla(var(--model-h2), 95%, 58%, 0.18) 44%, transparent 72%);
    filter: blur(7px);
    opacity: 0.95;
    z-index: 0;
}
.model-art-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.75), transparent 80%);
    opacity: 0.2;
    z-index: 0;
}
.model-art-kind,
.model-art-family {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 7px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(8, 10, 16, 0.36);
    color: rgba(255,255,255,0.88);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.model-art-kind { top: 8px; left: 8px; }
.model-art-family { top: 8px; right: 8px; }
.model-art-initials {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 2;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: rgba(255,255,255,0.94);
    text-shadow: 0 4px 18px rgba(0,0,0,0.35);
}

.model-art-trigger {
    border-radius: inherit;
}
.model-art-trigger .model-art-grid { background-size: 14px 14px; opacity: 0.16; }
.model-art-trigger .model-art-kind,
.model-art-trigger .model-art-family {
    padding: 2px 4px;
    font-size: 5px;
    letter-spacing: 0.08em;
}
.model-art-trigger .model-art-kind { top: 4px; left: 4px; }
.model-art-trigger .model-art-family { top: 4px; right: 4px; }
.model-art-trigger .model-art-initials {
    left: 6px;
    bottom: 5px;
    font-size: 15px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.model-art-trigger .model-art-orb {
    right: -22%;
    top: -24%;
    width: 70%;
    filter: blur(5px);
}

.picker-meta { padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.picker-name { font-size: 12px; font-weight: 500; color: var(--color-text);
    word-break: break-word; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.picker-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 10px; color: var(--color-text-dim); }
.picker-pill {
    display: inline-block; padding: 2px 7px; font-size: 10px; font-weight: 600;
    border-radius: 8px; text-transform: uppercase; letter-spacing: 0.4px;
}
.picker-pill.fam-sdxl { background: rgba(124,106,239,0.18); color: #a99dff; }
.picker-pill.fam-flux { background: rgba(34,197,94,0.18); color: #6ee7a7; }
.picker-pill.fam-pony { background: rgba(236,72,153,0.18); color: #f9a8d4; }
.picker-pill.fam-illustrious { background: rgba(245,158,11,0.18); color: #fcd34d; }
.picker-pill.fam-zimage { background: rgba(56,189,248,0.18); color: #7dd3fc; }
.picker-pill.fam-wan { background: rgba(168,85,247,0.18); color: #d8b4fe; }
.picker-pill.fam-ltx { background: rgba(20,184,166,0.18); color: #5eead4; }
.picker-pill.fam-sd15 { background: rgba(239,68,68,0.18); color: #fca5a5; }
.picker-pill.fam-other { background: rgba(120,120,140,0.18); color: var(--color-text-dim); }
.picker-size { opacity: 0.7; }
.picker-triggers { font-size: 10px; color: var(--color-text-dim); font-style: italic;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}

.picker-grid-empty { grid-column: 1 / -1; padding: 40px 20px; text-align: center; color: var(--color-text-dim); }

/* Workflow picker grid */
.workflow-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 16px;
}
.workflow-picker-card {
    position: relative;
    display: flex; flex-direction: column;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
    text-align: left;
    color: var(--color-text);
    font-family: inherit;
}
.workflow-picker-card:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--wf-tint-rgb), 0.5);
    box-shadow: 0 6px 18px rgba(0,0,0,0.4), 0 0 24px rgba(var(--wf-tint-rgb), 0.12);
}
.workflow-picker-card.active {
    border-color: var(--wf-tint);
    box-shadow: 0 0 0 1px var(--wf-tint), 0 6px 18px rgba(var(--wf-tint-rgb), 0.18);
}
.workflow-picker-thumb {
    width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
    background: var(--color-bg);
    display: block;
}
.workflow-picker-thumb-empty {
    display: flex; align-items: center; justify-content: center;
    color: var(--color-text-dim);
    background: linear-gradient(135deg, var(--color-surface-2), var(--color-surface-3));
}
.workflow-picker-meta { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-height: 44px; }
.workflow-picker-name { font-size: 0.82rem; font-weight: 600; color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workflow-picker-sub { font-size: 0.7rem; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.workflow-picker-badge {
    position: absolute; top: 6px; right: 6px;
    padding: 2px 8px; font-size: 0.65rem; font-weight: 700;
    border-radius: 999px;
    background: var(--wf-tint); color: #fff;
    text-transform: uppercase; letter-spacing: 0.05em;
    box-shadow: 0 2px 8px rgba(var(--wf-tint-rgb), 0.4);
}
.workflow-picker-empty { padding: 40px 20px; text-align: center; color: var(--color-text-dim); grid-column: 1 / -1; }
@media (max-width: 600px) {
    .workflow-picker-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; padding: 12px; }
}

/* LoRA picker per-card strength controls + add/remove */
.picker-strength {
    display: flex; align-items: center; gap: 4px; margin-top: 4px;
    padding-top: 6px; border-top: 1px dashed var(--color-border);
}
.picker-strength-btn {
    width: 22px; height: 22px; padding: 0;
    background: var(--color-surface-2); color: var(--color-text);
    border: 1px solid var(--color-border); border-radius: 5px;
    font-size: 12px; font-weight: 700; line-height: 1; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.picker-strength-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.picker-strength-input {
    flex: 1; min-width: 0; width: 100%;
    background: var(--color-bg); color: var(--color-text);
    border: 1px solid var(--color-border); border-radius: 5px;
    padding: 3px 4px; font-size: 11px; text-align: center;
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield; appearance: textfield;
}
.picker-strength-input::-webkit-outer-spin-button,
.picker-strength-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.picker-add-btn {
    padding: 3px 8px; font-size: 11px; font-weight: 600;
    background: var(--color-accent); color: #fff;
    border: 1px solid var(--color-accent); border-radius: 5px;
    cursor: pointer; transition: all var(--transition);
    white-space: nowrap;
}
.picker-add-btn:hover { filter: brightness(1.15); }
.picker-add-btn.remove { background: transparent; color: #ff6b6b; border-color: rgba(255,107,107,0.4); }
.picker-add-btn.remove:hover { background: rgba(255,80,80,0.15); }

/* "Added" checkmark badge on thumb */
.picker-added-badge {
    position: absolute; top: 6px; right: 6px;
    width: 22px; height: 22px;
    background: var(--color-accent); color: #fff;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; line-height: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    pointer-events: none;
}

/* Picker header right-side actions */
.picker-header-actions { display: inline-flex; align-items: center; gap: 8px; }

/* Selected-LoRA chips bar (between toolbar and grid) */
.picker-selected-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
    padding: 8px 14px; border-bottom: 1px solid var(--color-border);
    background: var(--color-surface-2);
}
.picker-selected-bar.hidden { display: none; }
.picker-selected-label {
    font-size: 0.72rem; font-weight: 600; color: var(--color-text-dim);
    text-transform: uppercase; letter-spacing: 0.04em;
    margin-right: 4px;
}
.picker-selected-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 4px 4px 10px;
    background: rgba(124,106,239,0.18);
    color: var(--color-text);
    border: 1px solid rgba(124,106,239,0.4);
    border-radius: 16px;
    font-size: 0.78rem;
    max-width: 220px;
}
.picker-selected-name {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 140px;
}
.picker-selected-strength {
    font-variant-numeric: tabular-nums;
    color: var(--color-accent); font-weight: 600;
    font-size: 0.72rem;
}
.picker-selected-remove {
    background: rgba(255,107,107,0.15); border: none;
    color: #ff6b6b; cursor: pointer;
    width: 18px; height: 18px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem; line-height: 1;
    transition: all var(--transition);
}
.picker-selected-remove:hover { background: rgba(255,80,80,0.3); }

/* Seed mode select inline with seed input */
.seed-mode {
    width: 118px; min-width: 118px;
    background: var(--color-bg); color: var(--color-text);
    border: 1px solid var(--color-border); border-radius: 8px;
    padding: 6px 8px; font-size: 12px;
}

@media (max-width: 600px) {
    .seed-row { grid-template-columns: minmax(0, 1fr) auto; }
    .seed-row input { grid-column: 1 / -1; }
    .seed-mode { width: auto; min-width: 0; }
    .picker-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
    .picker-card { min-height: 180px; }
    .picker-name { font-size: 11px; }
    .picker-toolbar { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
}

/* LoRA info button overlay on picker cards */
.picker-info-btn {
    position: absolute; top: 6px; left: 6px;
    width: 22px; height: 22px; padding: 0;
    background: rgba(0, 0, 0, 0.55); color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all var(--transition);
    backdrop-filter: blur(4px);
    z-index: 2;
}
.picker-info-btn:hover { background: var(--color-accent); border-color: var(--color-accent); transform: scale(1.1); }
.picker-thumb { position: relative; }

/* Card-4 LoRA row info icon */
.lora-info {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; padding: 0;
    background: transparent; color: var(--color-text-dim);
    border: 1px solid var(--color-border); border-radius: 50%;
    cursor: pointer; transition: all var(--transition);
    flex-shrink: 0;
}
.lora-info:hover { color: var(--color-accent); border-color: var(--color-accent); background: rgba(var(--color-accent-rgb), 0.08); }

/* LoRA Info Modal */
.lora-info-loading, .lora-info-empty {
    padding: 32px 20px; text-align: center; color: var(--color-text-dim);
}
.lora-info-body { padding: 8px 4px 20px; display: flex; flex-direction: column; gap: 18px; }
.lora-info-grid {
    display: grid; grid-template-columns: 160px 1fr; gap: 18px; align-items: start;
}
.lora-info-cover {
    width: 160px; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
    background: linear-gradient(135deg, var(--color-surface-2), var(--color-surface-3));
    border: 1px solid var(--color-border);
}
.lora-info-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lora-info-text h3 {
    margin: 0 0 8px; font-size: 1.1rem; line-height: 1.25;
    color: var(--color-text); word-break: break-word;
}
.lora-info-meta-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.lora-info-meta-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; font-size: 0.7rem; font-weight: 600;
    background: var(--color-surface-2); color: var(--color-text-dim);
    border: 1px solid var(--color-border); border-radius: 999px;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.lora-info-meta-pill.nsfw {
    background: rgba(220, 53, 69, 0.15); color: #ff8d97;
    border-color: rgba(220, 53, 69, 0.4);
}
.lora-info-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lora-info-section {
    display: flex; flex-direction: column; gap: 8px;
    padding-top: 14px; border-top: 1px solid var(--color-border);
}
.lora-info-section-label {
    font-size: 0.72rem; font-weight: 700; color: var(--color-text-dim);
    text-transform: uppercase; letter-spacing: 0.06em;
}
.lora-info-hint { font-weight: 500; text-transform: none; letter-spacing: 0; opacity: 0.75; }
.lora-info-triggers { display: flex; flex-wrap: wrap; gap: 6px; }
.trigger-chip {
    padding: 5px 10px; font-size: 0.78rem; font-weight: 500;
    background: var(--color-surface-2); color: var(--color-text);
    border: 1px solid var(--color-border); border-radius: 6px;
    cursor: pointer; transition: all var(--transition);
}
.trigger-chip:hover { border-color: var(--color-accent); color: var(--color-accent); background: rgba(var(--color-accent-rgb), 0.08); }
.trigger-chip.inserted { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.lora-info-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.lora-info-tag {
    padding: 2px 8px; font-size: 0.7rem; color: var(--color-text-dim);
    background: var(--color-surface-2); border-radius: 4px;
}
.lora-info-desc {
    font-size: 0.85rem; line-height: 1.5; color: var(--color-text);
    white-space: pre-wrap; max-height: 240px; overflow-y: auto;
    padding-right: 4px;
}
.lora-info-gallery {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
}
.lora-info-gallery img {
    width: 100%; aspect-ratio: 1; object-fit: cover;
    border-radius: 6px; cursor: zoom-in; border: 1px solid var(--color-border);
    transition: transform var(--transition);
}
.lora-info-gallery img:hover { transform: scale(1.03); border-color: var(--color-accent); }

@media (max-width: 600px) {
    .lora-info-grid { grid-template-columns: 1fr; }
    .lora-info-cover { width: 100%; max-width: 240px; margin: 0 auto; }
    .lora-info-gallery { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

/* Lightbox overlay (in-page image preview) */
.helix-lightbox {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0, 0, 0, 0.92);
    display: none; align-items: center; justify-content: center;
    padding: 24px; cursor: zoom-out;
    backdrop-filter: blur(8px);
}
.helix-lightbox.open { display: flex; animation: helix-lightbox-in 0.18s ease-out; }
@keyframes helix-lightbox-in { from { opacity: 0; } to { opacity: 1; } }
.helix-lightbox-img {
    max-width: 100%; max-height: calc(100vh - 80px);
    object-fit: contain; border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    cursor: default;
}
.helix-lightbox-close {
    position: absolute; top: 16px; right: 16px;
    width: 40px; height: 40px; padding: 0;
    background: rgba(0, 0, 0, 0.6); color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%; font-size: 24px; line-height: 1;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.helix-lightbox-close:hover { background: var(--color-accent); border-color: var(--color-accent); transform: scale(1.05); }
.helix-lightbox-caption {
    position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
    max-width: 80%; padding: 8px 14px;
    background: rgba(0, 0, 0, 0.6); color: var(--color-text-dim);
    font-size: 0.78rem; border-radius: 6px;
    text-align: center; pointer-events: none;
}
.helix-lightbox-caption:empty { display: none; }

/* Lightbox v2: side panel for sample image prompts */
.helix-lightbox { padding: 0; align-items: stretch; justify-content: stretch; }
.helix-lightbox-stage {
    flex: 1 1 auto; display: flex; align-items: center; justify-content: center;
    padding: 24px; min-width: 0; min-height: 0; overflow: hidden;
}
.helix-lightbox-stage .helix-lightbox-img {
    max-width: 100%; max-height: 100%;
}
.helix-lightbox-panel {
    flex: 0 0 380px;
    background: rgba(17, 17, 19, 0.95);
    border-left: 1px solid rgba(255,255,255,0.06);
    padding: 56px 20px 24px;
    overflow-y: auto;
    cursor: default;
    display: flex; flex-direction: column; gap: 12px;
}
.helix-lightbox-panel:empty { display: none; }
.helix-lightbox-meta {
    font-size: 0.78rem; color: var(--color-text-dim);
    letter-spacing: 0.02em;
}
.helix-lightbox-prompt {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 0.86rem; line-height: 1.5;
    color: rgba(255,255,255,0.92);
    white-space: pre-wrap; word-break: break-word;
    max-height: 40vh; overflow-y: auto;
}
.helix-lightbox-prompt.empty { color: var(--color-text-dim); font-style: italic; }
.helix-lightbox-prompt.negative { background: rgba(239,68,68,0.05); border-color: rgba(239,68,68,0.18); }
.helix-lightbox-prompt-label {
    display: inline-block; font-size: 0.65rem; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: rgba(239,68,68,0.85); margin-right: 6px;
}
.helix-lightbox-actions {
    display: flex; flex-wrap: wrap; gap: 8px;
    padding-top: 6px; border-top: 1px solid rgba(255,255,255,0.05);
}
.lora-info-hint { color: var(--color-text-dim); font-weight: 400; font-size: 0.75rem; margin-left: 6px; }

@media (max-width: 768px) {
    .helix-lightbox { flex-direction: column; }
    .helix-lightbox-panel {
        flex: 0 0 auto; max-height: 50vh;
        border-left: none; border-top: 1px solid rgba(255,255,255,0.06);
        padding: 16px 16px 24px;
    }
    .helix-lightbox-stage { padding: 12px; }
}

/* ── Pin/Favorite buttons (workflow + LoRA + model pickers) ──────────── */
.picker-fav-btn,
.workflow-picker-fav {
    position: absolute;
    top: 6px; left: 6px;
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    color: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transform: scale(0.85);
    transition: all 200ms cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 4;
    padding: 0;
}
.picker-card:hover .picker-fav-btn,
.workflow-picker-card:hover .workflow-picker-fav,
.picker-fav-btn.active,
.workflow-picker-fav.active,
.picker-card.is-favorite .picker-fav-btn,
.workflow-picker-card.is-favorite .workflow-picker-fav {
    opacity: 1;
    transform: scale(1);
}
.picker-fav-btn:hover,
.workflow-picker-fav:hover {
    background: rgba(0, 0, 0, 0.75);
    color: #f5d249;
    border-color: rgba(245, 210, 73, 0.4);
    transform: scale(1.1);
}
.picker-fav-btn.active,
.workflow-picker-fav.active {
    color: #f5d249;
    border-color: rgba(245, 210, 73, 0.4);
    background: rgba(245, 210, 73, 0.15);
}

/* Pinned cards: subtle gold accent border */
.picker-card.is-favorite,
.workflow-picker-card.is-favorite {
    border-color: rgba(245, 210, 73, 0.32);
    box-shadow: 0 0 0 1px rgba(245, 210, 73, 0.08), 0 4px 14px rgba(0,0,0,0.3);
}
.picker-card.is-favorite::before,
.workflow-picker-card.is-favorite::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, #f5d249, transparent);
    z-index: 3;
    pointer-events: none;
}

/* Workflow picker upgrades — richer card visuals */
.workflow-picker-card {
    background: linear-gradient(180deg, var(--color-surface-2), var(--color-surface));
    transition: transform 220ms cubic-bezier(0.23, 1, 0.32, 1),
                border-color 220ms ease,
                box-shadow 220ms ease;
}
.workflow-picker-card::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.55));
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
}
.workflow-picker-card:hover::after { opacity: 1; }
.workflow-picker-card:hover {
    transform: translateY(-3px);
}
.workflow-picker-card .workflow-picker-meta {
    position: relative;
    z-index: 2;
    background: rgba(17, 17, 19, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-top: 1px solid rgba(255,255,255,0.04);
}
.workflow-picker-card.active .workflow-picker-meta {
    background: rgba(124, 106, 239, 0.12);
}
.workflow-picker-thumb { transition: transform 400ms cubic-bezier(0.23, 1, 0.32, 1); }
.workflow-picker-card:hover .workflow-picker-thumb { transform: scale(1.04); }

/* ── Select Trigger (replaces legacy <select> for workflow + model) ─── */
.select-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 180ms ease, background 180ms ease, transform 120ms ease;
    min-height: 56px;
}
.select-trigger:hover {
    border-color: rgba(var(--wf-tint-rgb, 124, 106, 239), 0.55);
    background: var(--color-surface-3, var(--color-surface-2));
}
.select-trigger:active { transform: scale(0.99); }

.select-trigger-thumb {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    position: relative;
    border-radius: 8px;
    background: linear-gradient(135deg, #1a1a24, #0f0f17);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
    border: 1px solid rgba(255,255,255,0.06);
}
.select-trigger-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.select-trigger-thumb-initials {
    font-family: var(--font-mono, monospace);
    font-size: 13px;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.02em;
}

.select-trigger-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.select-trigger-text {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.select-trigger-sub {
    font-size: 0.68rem;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.select-trigger-sub:empty { display: none; }

.select-trigger-chevron {
    flex: 0 0 auto;
    color: var(--color-text-dim);
    opacity: 0.7;
    transition: transform 180ms ease, color 180ms ease;
}
.select-trigger:hover .select-trigger-chevron {
    color: var(--color-text);
    opacity: 1;
    transform: translateY(1px);
}

/* Workflow picker thumb initials (built-in placeholder) */
.workflow-picker-thumb-initials {
    font-family: var(--font-mono, monospace);
    font-size: 26px;
    font-weight: 700;
    color: rgba(255,255,255,0.92);
    letter-spacing: 0.02em;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* Workflow thumb wrapper — initials show as backdrop, image overlays. If image
   404s the onerror handler removes it and the initials remain visible. */
.workflow-picker-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    display: block;
    overflow: hidden;
}
.workflow-picker-thumb-wrap > img.workflow-picker-thumb {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    user-select: none;
    pointer-events: none;
    touch-action: pan-y;
}
.workflow-picker-thumb-initials-bg {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    z-index: 0;
    pointer-events: none;
}

/* ── Dream Queue ────────────────────────────────────────────────────── */
.dream-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
    padding: 12px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.dream-stat {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.dream-stat-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}
.dream-stat-label {
    font-size: 0.65rem;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.dream-section {
    margin-bottom: 24px;
}
.dream-section h3 {
    font-size: 0.78rem;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dream-section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
}
.dream-section-header h3 { margin: 0; }
.dream-count {
    background: var(--color-surface-2);
    color: var(--color-text);
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
}
.dream-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.btn-sm {
    padding: 4px 10px;
    font-size: 0.78rem;
    gap: 4px;
}
.btn-danger-text { color: #ff7575; }
.btn-danger-text:hover { background: rgba(255, 80, 80, 0.1); }
.dream-hint {
    margin-top: 8px;
    font-size: 0.72rem;
    color: var(--color-text-dim);
    font-style: italic;
}

.dream-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 6px;
}
.dream-item .dream-prompt {
    flex: 1;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--color-text);
    word-break: break-word;
}
.dream-item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.dream-tag {
    font-size: 0.65rem;
    padding: 2px 6px;
    background: rgba(124, 106, 239, 0.18);
    color: var(--color-accent);
    border-radius: 4px;
    text-transform: lowercase;
}
.dream-del-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--color-text-dim);
    padding: 4px;
    border-radius: 6px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 150ms ease;
}
.dream-del-btn:hover {
    color: #ff7575;
    background: rgba(255, 80, 80, 0.1);
    border-color: rgba(255, 80, 80, 0.25);
}

.dream-recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}
.dream-recent-item {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
}
.dream-recent-item img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.dream-recent-item.broken { display: none; }
.dream-recent-cap {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 6px 8px 5px;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.85));
    color: #fff;
    font-size: 0.65rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Recipe panel + suggest controls */
.dream-recipe {
    background: linear-gradient(135deg, rgba(124, 106, 239, 0.06), rgba(124, 106, 239, 0.02));
    border: 1px solid rgba(124, 106, 239, 0.2);
    border-radius: 10px;
    padding: 12px 14px;
}
.dream-recipe-summary {
    font-size: 0.72rem;
    color: var(--color-accent);
    background: rgba(124, 106, 239, 0.15);
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
}
.dream-recipe-mode {
    display: flex; flex-direction: column; gap: 6px;
    margin-bottom: 10px;
}
.dream-radio {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 8px;
    align-items: center;
    padding: 8px 10px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease;
}
.dream-radio:has(input:checked) {
    border-color: var(--color-accent);
    background: rgba(124, 106, 239, 0.08);
}
.dream-radio input { margin: 0; accent-color: var(--color-accent); }
.dream-radio span:nth-of-type(1) {
    font-size: 0.85rem;
    color: var(--color-text);
    font-weight: 500;
}
.dream-radio-hint {
    grid-column: 2;
    font-size: 0.7rem !important;
    color: var(--color-text-dim) !important;
    font-weight: 400 !important;
}
.dream-recipe-detail {
    display: flex; flex-direction: column; gap: 6px;
    padding-top: 8px;
    border-top: 1px dashed var(--color-border);
}
.dream-recipe-row {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 8px;
    font-size: 0.78rem;
    align-items: center;
}
.dream-recipe-label {
    color: var(--color-text-dim);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.dream-recipe-hint {
    margin: 0;
    font-size: 0.78rem;
    color: var(--color-text-dim);
    line-height: 1.5;
}
.dream-recipe-muted {
    color: var(--color-text-dim);
    font-size: 0.72rem;
    font-style: italic;
}
.dream-chips {
    display: flex; gap: 4px; flex-wrap: wrap;
}
.dream-chip {
    background: rgba(124, 106, 239, 0.15);
    color: var(--color-accent);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 999px;
}
.dream-chip em {
    font-style: normal;
    opacity: 0.7;
    margin-left: 4px;
    font-size: 0.65rem;
}
.dream-suggest-controls {
    display: flex; align-items: center; gap: 10px;
}
.dream-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--color-text-dim);
    cursor: pointer;
    user-select: none;
}
.dream-toggle input {
    accent-color: var(--color-accent);
    margin: 0;
}
.dream-toggle:has(input:checked) {
    color: var(--color-accent);
}

/* Mini select used inline in suggest controls */
.dream-mini-select {
    background: var(--color-surface-2);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 3px 6px;
    font-size: 0.75rem;
    cursor: pointer;
}
.dream-mini-select:hover { border-color: var(--color-accent); }

/* Auto-review row under main dream actions */
.dream-autoreview {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    padding: 8px 10px;
    background: rgba(124, 106, 239, 0.04);
    border: 1px dashed rgba(124, 106, 239, 0.25);
    border-radius: 8px;
    flex-wrap: wrap;
}
.dream-num-field {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.7rem;
    color: var(--color-text-dim);
    text-transform: lowercase;
}
.dream-num-field input {
    width: 56px;
    background: var(--color-surface-2);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 3px 6px;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

/* Per-dream meta tags */
.dream-tag-retry {
    background: rgba(255, 175, 60, 0.15) !important;
    color: #ffaf3c !important;
}
.dream-tag-score.good { background: rgba(80, 200, 120, 0.18) !important; color: #50c878 !important; }
.dream-tag-score.meh  { background: rgba(255, 175, 60, 0.18) !important; color: #ffaf3c !important; }
.dream-tag-score.bad  { background: rgba(255, 90, 90, 0.18) !important; color: #ff5a5a !important; }
.dream-tag-parent { background: rgba(120, 140, 255, 0.16) !important; color: #8c9eff !important; }
button.dream-critique-btn {
    border: 0; cursor: pointer; font: inherit;
    padding: 2px 8px; border-radius: 999px;
    transition: filter 0.12s ease;
}
button.dream-critique-btn:hover { filter: brightness(1.25); }

.dream-recent-item { position: relative; }
.dream-recent-item { cursor: pointer; }
.dream-recent-score, .dream-recent-parent {
    position: absolute; top: 6px; left: 6px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff; font-size: 0.7rem; font-weight: 600;
    padding: 2px 6px; border-radius: 6px;
    backdrop-filter: blur(4px);
    pointer-events: none;
}
.dream-recent-score.good { color: #6dd393; }
.dream-recent-score.meh  { color: #ffaf3c; }
.dream-recent-score.bad  { color: #ff7878; }
.dream-recent-parent { left: auto; right: 6px; color: #8c9eff; }

/* Critique modal */
.critique-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.critique-summary {
    background: rgba(255,255,255,0.04);
    border-left: 3px solid var(--color-accent, #6366f1);
    padding: 10px 12px; border-radius: 4px;
    font-size: 0.9rem; line-height: 1.5; margin: 0;
}
.critique-issues { margin: 6px 0 0; padding-left: 22px; font-size: 0.85rem; line-height: 1.5; }
.critique-issues li { margin-bottom: 4px; }
.critique-rewrite {
    margin-top: 14px; padding: 10px 12px;
    background: rgba(120, 140, 255, 0.08);
    border-radius: 6px;
}

/* Rating stars */
.critique-rate-section { margin-top: 16px; }
.critique-stars {
    display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px;
}
.rate-star {
    background: none; border: none; cursor: pointer; padding: 2px;
    font-size: 1.3rem; color: rgba(255,255,255,0.2);
    transition: color 150ms ease, transform 100ms ease;
    line-height: 1;
}
.rate-star:hover, .rate-star.rate-star-hover { color: #f5c518; transform: scale(1.15); }
.rate-star.rate-star-active { color: #f5c518; }
.critique-rate-hint { font-size: 0.75rem; color: var(--color-text-dim); }

/* Suggestion preview modal */
.modal-md { max-width: 720px; width: 90%; }
.suggest-toolbar {
    display: flex; align-items: center; gap: 6px;
    margin: 10px 0;
    flex-wrap: wrap;
}
.suggest-count-pill {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--color-text-dim);
    background: var(--color-surface-2);
    padding: 2px 10px;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}
.suggest-list {
    display: flex; flex-direction: column; gap: 6px;
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 4px;
}
.suggest-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: start;
    padding: 8px 10px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 150ms ease;
}
.suggest-item:has(.suggest-check:checked) {
    border-color: var(--color-accent);
    background: rgba(124, 106, 239, 0.06);
}
.suggest-check {
    margin: 4px 0 0;
    accent-color: var(--color-accent);
    cursor: pointer;
}
.suggest-text {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--color-text);
    font-size: 0.85rem;
    font-family: inherit;
    line-height: 1.45;
    resize: vertical;
    padding: 0;
}
.suggest-text:focus { outline: none; }

/* ── Drop image overlay & metadata ── */
.drop-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
    animation: dropFadeIn 0.15s ease-out;
}
.drop-overlay.hidden { display: none; }
.drop-overlay-card {
    border: 2px dashed var(--color-accent, #6366f1);
    border-radius: 16px;
    padding: 48px 64px;
    text-align: center;
    background: rgba(20, 20, 30, 0.7);
    color: var(--color-text);
    max-width: 520px;
}
.drop-overlay-card svg { color: var(--color-accent, #6366f1); margin-bottom: 12px; }
.drop-overlay-card h2 { margin: 8px 0 6px; font-size: 1.25rem; }
.drop-overlay-card p  { margin: 0; opacity: 0.75; font-size: 0.9rem; line-height: 1.5; }
@keyframes dropFadeIn { from { opacity: 0; } to { opacity: 1; } }

.drop-meta-summary { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 18px; }
.drop-meta-row {
    display: grid; grid-template-columns: 90px 1fr; gap: 10px;
    align-items: start; font-size: 0.85rem; line-height: 1.45;
}
.drop-meta-label {
    color: var(--color-text-muted, #94a3b8);
    text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.04em;
    padding-top: 2px;
}
.drop-meta-val { color: var(--color-text); word-break: break-word; }
.drop-meta-val em { color: var(--color-text-muted, #94a3b8); font-style: normal; }
.drop-meta-raw {
    margin: 0 0 16px;
    border-top: 1px solid var(--color-border, #2a2a3a);
    padding-top: 10px;
}
.drop-meta-raw summary {
    cursor: pointer; font-size: 0.78rem;
    color: var(--color-text-muted, #94a3b8);
    user-select: none;
}
.drop-meta-raw pre {
    margin: 8px 0 0; padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3); border-radius: 8px;
    font-size: 0.72rem; max-height: 220px; overflow: auto;
    white-space: pre-wrap; word-break: break-all;
}

/* ── Video Mode Controls ─────────────────────────────────────────────────────── */
.video-controls {
    margin-top: 12px;
    padding: 12px;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 10px;
}
.video-controls-header {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em;
    text-transform: uppercase; color: var(--color-accent, #6366f1);
    margin-bottom: 10px;
}
.video-duration {
    font-size: 0.75rem; color: var(--color-text-muted, #94a3b8);
    text-align: right; margin-top: 4px;
}

/* ── Describe chip loading state ─────────────────────────────────────────────── */
.action-chip.loading {
    opacity: 0.6; pointer-events: none;
}
.action-chip.loading .action-chip-icon::after {
    content: '…';
}

/* ── Outpaint Modal ──────────────────────────────────────────────────────────── */
.outpaint-layout {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 16px;
    align-items: start;
}
@media (max-width: 640px) {
    .outpaint-layout { grid-template-columns: 1fr; }
}
.outpaint-canvas-wrap {
    position: relative;
    background: #111;
    border-radius: 8px;
    min-height: 200px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.outpaint-canvas-wrap canvas {
    max-width: 100%; max-height: 60vh;
    object-fit: contain;
    display: block;
}
.outpaint-canvas-empty {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center; color: var(--color-text-muted, #94a3b8);
    pointer-events: none;
}
.outpaint-canvas-empty p { margin: 8px 0 0; font-size: 0.85rem; line-height: 1.4; }
.outpaint-controls {
    display: flex; flex-direction: column; gap: 12px;
}
.outpaint-source-row {
    display: flex; gap: 8px;
}
.outpaint-dir-grid {
    display: grid;
    grid-template-areas: ". top ." "left center right" ". bottom .";
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px; width: 120px;
}
.outpaint-dir-btn {
    padding: 6px; border-radius: 6px; font-size: 1rem;
    background: var(--color-surface-2, #1e1e2e);
    border: 1px solid var(--color-border, #2a2a3a);
    color: var(--color-text-muted, #94a3b8);
    cursor: pointer; transition: background 0.15s, color 0.15s;
}
.outpaint-dir-btn[data-dir="top"]    { grid-area: top; }
.outpaint-dir-btn[data-dir="left"]   { grid-area: left; }
.outpaint-dir-btn[data-dir="right"]  { grid-area: right; }
.outpaint-dir-btn[data-dir="bottom"] { grid-area: bottom; }
.outpaint-dir-center                 { grid-area: center; pointer-events: none; opacity: 0.3; }
.outpaint-dir-btn.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--color-accent, #6366f1);
    color: var(--color-accent, #6366f1);
}
.outpaint-dir-btn:hover:not(:disabled) {
    background: var(--color-surface-3, #2a2a3e);
    color: var(--color-text);
}
.outpaint-actions {
    display: flex; flex-direction: column; gap: 8px;
}

/* ── Describe panel (image-to-prompt dropdown) ─────────────────── */
.describe-wrap {
    position: relative;
    display: inline-flex;
}
.describe-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 20;
    width: min(280px, 82vw);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.45);
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}
.describe-panel.hidden { display: none; }
.describe-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 0.8rem;
    cursor: pointer;
    text-align: left;
    width: 100%;
    border-bottom: 1px solid var(--color-border);
}
.describe-option:hover { background: rgba(124,106,239,0.1); }
.describe-url-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
}
.describe-url-row input {
    flex: 1;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    font-size: 0.75rem;
    padding: 5px 8px;
    min-width: 0;
}
.describe-url-row input:focus { outline: none; border-color: var(--color-accent); }
.describe-url-row button {
    flex-shrink: 0;
    background: var(--color-accent);
    border: none;
    border-radius: 6px;
    color: #fff;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.describe-url-row button:hover { opacity: 0.85; }

/* ── LoRA Picker: mode toggle ──────────────────────────────────────── */
.picker-grid.hidden { display: none; }
.picker-filters.hidden { display: none; }
.lora-picker-mode-toggle {
    display: flex;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}
.lora-mode-btn {
    background: none;
    border: none;
    color: var(--color-text-dim);
    font-size: 0.78rem;
    padding: 5px 12px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.lora-mode-btn.active {
    background: var(--color-accent);
    color: #fff;
}
.lora-mode-btn:not(.active):hover { color: var(--color-text); background: rgba(255,255,255,0.05); }

/* ── CivitAI search results ────────────────────────────────────────── */
.civitai-lora-grid { display: flex; flex-direction: column; gap: 0; padding: 12px; overflow-y: auto; flex: 1; min-height: 0; }
.civitai-lora-grid.hidden { display: none; }
.civitai-empty { color: var(--color-text-dim); text-align: center; padding: 40px 16px; font-size: 0.85rem; }
.civitai-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--color-text-dim); }
.civitai-spinner { width: 18px; height: 18px; border: 2px solid var(--color-border); border-top-color: var(--color-accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.civitai-results-meta { font-size: 0.72rem; color: var(--color-text-dim); margin-bottom: 10px; }
.civitai-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.civitai-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.civitai-card-img { position: relative; aspect-ratio: 2/3; overflow: hidden; background: var(--color-bg); }
.civitai-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.civitai-card-img-empty { width: 100%; height: 100%; background: var(--color-bg); }
.civitai-nsfw-badge {
    position: absolute; top: 6px; right: 6px;
    background: rgba(200,0,50,0.85); color: #fff;
    font-size: 0.65rem; font-weight: 700; padding: 2px 6px; border-radius: 4px;
}
.civitai-card-body { padding: 8px 10px; flex: 1; }
.civitai-card-name { font-size: 0.82rem; font-weight: 600; color: var(--color-text); line-height: 1.3; margin-bottom: 4px; }
.civitai-card-meta { display: flex; flex-wrap: wrap; gap: 4px; font-size: 0.7rem; color: var(--color-text-dim); margin-bottom: 3px; }
.civitai-card-meta span::after { content: '·'; margin-left: 4px; }
.civitai-card-meta span:last-child::after { content: none; }
.civitai-card-creator { font-size: 0.7rem; color: var(--color-text-dim); }
.civitai-card-actions { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--color-border); align-items: center; flex-wrap: wrap; }
.civitai-installed-badge { font-size: 0.72rem; color: #4ade80; font-weight: 600; }
.civitai-dl-btn { flex: 1; }
.civitai-dest-select {
    font-size: 0.72rem;
    background: var(--color-bg-secondary, #1a1a2e);
    color: var(--color-text-dim);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 3px 6px;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}
.civitai-dest-select:focus { outline: none; border-color: var(--color-accent); }
.civitai-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px 0; font-size: 0.8rem; color: var(--color-text-dim); }
.civitai-load-more { display: flex; justify-content: center; padding: 14px 0; }

/* ── Sample image note editor ──────────────────────────────────────── */
.sample-note-editor { padding: 10px 0 0; }
.sample-note-label { font-size: 0.72rem; color: var(--color-text-dim); margin-bottom: 6px; }
.sample-note-textarea {
    width: 100%; box-sizing: border-box;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    font-size: 0.8rem;
    padding: 8px 10px;
    resize: vertical;
    min-height: 70px;
    font-family: inherit;
}
.sample-note-textarea:focus { outline: none; border-color: var(--color-accent); }
.sample-note-actions { display: flex; gap: 8px; margin-top: 6px; }
.sample-note-badge { font-size: 0.65rem; background: rgba(124,106,239,0.2); color: var(--color-accent); padding: 1px 5px; border-radius: 4px; vertical-align: middle; }

