/* ============================================================================
   Ideogram Restyler — styles
   Tokens reconstructed verbatim from the Ideogram Explore design-system bundle
   (colors, type scale, radii, shadows). Components mirror the captured Figma kit.
   ============================================================================ */
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Inter:wght@300;400&display=swap");

:root {
  --font-display: "Manrope", system-ui, sans-serif;
  --font-body:    "Manrope", system-ui, sans-serif;
  --font-caption: "Inter", system-ui, sans-serif;
  --font-mono:    ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;

  --bg-base:       #0F0F0F;
  --bg-elevated:   #171718;
  --bg-raised:     #1A1A1D;
  --bg-card:       #1E1E1E;
  --bg-card-mid:   #3F3F46;
  --bg-input:      #27272A;
  --bg-overlay:    rgba(15,15,15,0.9);
  --bg-translucent:rgba(255,255,255,0.024);

  --fg:         #FFFFFF;
  --fg-2:       rgba(255,255,255,0.85);
  --fg-muted:   #A1A1AA;
  --fg-dim:     #9B9BA1;
  --fg-dimmer:  #797980;
  --fg-faint:   rgba(255,255,255,0.3);
  --fg-accent:  #AB97EE;
  --fg-on-light:#0E0E10;

  --accent-purple:      #8864E4;
  --accent-purple-deep: #7E4DDA;
  --accent-purple-text: #AB97EE;
  --accent-lavender:    #EEEBFC;
  --accent-blue:        #48BDFF;
  --accent-blue-pale:   #D6EFFF;
  --accent-lime:        #D4FE9A;

  --border:        rgba(255,255,255,0.10);
  --border-strong: rgba(255,255,255,0.16);
  --border-field:  #52525B;

  --radius-xs: 4px;  --radius-sm: 6px;  --radius-md: 8px;
  --radius-lg: 12px; --radius-xl: 28px; --radius-pill: 9999px;

  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;

  --shadow-button:
    0 1px 2px rgba(0,0,0,0.04), 0 2px 4px rgba(0,0,0,0.03),
    0 4px 8px rgba(0,0,0,0.02), 0 8px 16px rgba(0,0,0,0.01);
  --shadow-glass:
    0 4px 12px rgba(9,9,11,0.40), 0 16px 40px rgba(9,9,11,0.40),
    0 24px 64px rgba(9,9,11,0.40), inset 0 1px 0 rgba(255,255,255,0.06);
  --shadow-tile: 0 12px 24px -24px rgba(15,15,15,0.075);
  --shadow-text: 0 0 2px rgba(9,9,11,0.4);

  /* ---- Semantic (theme-aware) ---- */
  --hover-surface: rgba(255,255,255,0.04);
  --btn-bg: #FFFFFF;            /* primary button fill */
  --btn-fg: #0E0E10;            /* primary button text */
  --ab-bg: linear-gradient(rgba(255,255,255,0.075), rgba(255,255,255,0.075)),
           linear-gradient(rgba(15,15,15,0.9), rgba(15,15,15,0.9));
  --ab-strip: rgba(15,15,15,0.9);
  --sidebar-border: rgba(255,255,255,0.04);
}

/* ---- Light theme ---- */
:root[data-theme="light"] {
  --bg-base:       #FFFFFF;
  --bg-elevated:   #F5F5F6;
  --bg-raised:     #ECECEE;
  --bg-card:       #F7F7F8;
  --bg-card-mid:   #D4D4D8;
  --bg-input:      #F0F0F1;
  --bg-overlay:    rgba(255,255,255,0.9);
  --bg-translucent:rgba(0,0,0,0.03);

  --fg:         #0E0E10;
  --fg-2:       rgba(14,14,16,0.85);
  --fg-muted:   #6B6B72;
  --fg-dim:     #6B6B72;
  --fg-dimmer:  #9B9BA1;
  --fg-faint:   rgba(14,14,16,0.35);
  --fg-accent:  #7E4DDA;
  --fg-on-light:#0E0E10;

  --accent-purple-text: #7E4DDA;

  --border:        rgba(0,0,0,0.10);
  --border-strong: rgba(0,0,0,0.16);
  --border-field:  #D4D4D8;

  --shadow-button:
    0 1px 2px rgba(15,15,15,0.06), 0 2px 6px rgba(15,15,15,0.05),
    0 8px 16px rgba(15,15,15,0.04);
  --shadow-glass:
    0 4px 12px rgba(15,15,15,0.10), 0 16px 40px rgba(15,15,15,0.12),
    0 24px 64px rgba(15,15,15,0.10), inset 0 1px 0 rgba(255,255,255,0.6);

  --hover-surface: rgba(0,0,0,0.04);
  --btn-bg: #0E0E10;           /* dark button on light bg */
  --btn-fg: #FFFFFF;
  --ab-bg: linear-gradient(rgba(255,255,255,0.82), rgba(255,255,255,0.82)),
           linear-gradient(#FFFFFF, #FFFFFF);
  --ab-strip: rgba(245,245,246,0.92);
  --sidebar-border: rgba(0,0,0,0.06);
}

body { transition: background-color .25s ease, color .25s ease; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg-base); color: var(--fg);
  font-family: var(--font-body); -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font-family: inherit; }
::selection { background: rgba(136,100,228,0.4); }

/* ---- Type ---- */
.t-display { font-family: var(--font-display); font-weight: 800; font-size: 36px; line-height: 45px; letter-spacing: -0.02em; }
.t-h1 { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 32px; letter-spacing: -0.01em; }
.t-h2 { font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 24px; }
.t-button { font-family: var(--font-display); font-weight: 700; font-size: 14px; line-height: 18px; }
.t-nav { font-family: var(--font-display); font-weight: 700; font-size: 13px; line-height: 16px; }
.t-section { font-family: var(--font-display); font-weight: 700; font-size: 13px; line-height: 16px; color: var(--fg-faint); }
.t-body { font-family: var(--font-body); font-weight: 400; font-size: 14px; line-height: 20px; color: var(--fg-2); }
.t-caption { font-family: var(--font-caption); font-weight: 300; font-size: 12px; line-height: 16px; color: var(--fg-muted); }
.t-badge { font-family: var(--font-display); font-weight: 700; font-size: 12px; line-height: 1; }

/* ---- Shell ---- */
.app { position: fixed; inset: 0; display: flex; overflow: hidden; }

.sidebar {
  width: 220px; flex-shrink: 0; background: var(--bg-base);
  height: 100%; padding: 20px 12px; display: flex; flex-direction: column;
  overflow-y: auto; border-right: 1px solid var(--sidebar-border);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 16px 6px; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: -0.2px; }

.account-chip {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 40px;
  padding: 0 10px; border-radius: var(--radius-md); border: 1px solid var(--border);
  background: transparent; color: var(--fg); cursor: pointer; transition: background-color .16s;
}
.account-chip:hover { background: var(--bg-translucent); }
.account-chip .avatar {
  width: 18px; height: 18px; border-radius: 9999px; background: var(--accent-purple-deep);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 11px; flex-shrink: 0;
}
.account-chip .name { flex: 1; text-align: left; }

.side-section { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.side-section > .t-section { height: 34px; display: flex; align-items: center; padding: 0 10px; }
.side-link {
  position: relative; width: 100%; height: 36px; border-radius: var(--radius-md);
  border: none; text-align: left; display: flex; align-items: center; gap: 10px;
  padding: 0 10px; background: transparent; color: var(--fg-2); cursor: pointer;
  transition: background-color .16s, color .16s; font-family: var(--font-display);
  font-weight: 700; font-size: 13px;
}
.side-link:hover { background: var(--bg-translucent); }
.side-link.active { background: var(--bg-raised); color: var(--fg); }
.side-link .ico { color: var(--fg-muted); display: inline-flex; }
.side-link.active .ico { color: var(--fg); }
.side-link .label { flex: 1; }
.badge-new {
  font-family: var(--font-display); font-weight: 700; font-size: 10px; line-height: 1;
  padding: 3px 6px; border-radius: 9999px; color: var(--bg-base);
  background: var(--accent-blue); letter-spacing: .4px; text-transform: uppercase;
}

/* ---- Main ---- */
.main { flex: 1; min-width: 0; overflow-y: auto; padding: 0 60px 80px 60px; }
.hero { display: flex; flex-direction: column; align-items: center; padding-top: 56px; padding-bottom: 8px; text-align: center; }
.hero .t-display { margin-bottom: 8px; }
.hero .sub { color: var(--fg-muted); font-size: 15px; max-width: 560px; }

.section-head { display: flex; align-items: center; gap: 10px; margin: 28px 0 14px; }
.section-head .step {
  width: 22px; height: 22px; border-radius: 9999px; background: rgba(136,100,228,0.15);
  border: 1px solid var(--accent-purple); color: var(--accent-purple-text);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.section-head .hint { color: var(--fg-dimmer); font-size: 13px; margin-left: auto; }
.section-head.col-head { margin-top: 8px; }

/* ---- Two-column workspace: upload (left) · styles (right) ---- */
.workspace {
  display: grid; grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 32px; align-items: start; margin-top: 4px;
}
.workspace .col { min-width: 0; }
.col-upload .uploader { min-height: 340px; height: calc(100% - 52px); }
@media (max-width: 920px) { .workspace { grid-template-columns: 1fr; } .col-upload .uploader { height: auto; } }

/* ---- Theme toggle (sidebar footer) ---- */
.theme-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; padding: 3px;
  border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--bg-elevated);
  margin-top: 12px;
}
.theme-toggle button {
  flex: 1; height: 100%; border: none; border-radius: var(--radius-pill); background: transparent;
  color: var(--fg-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; font-family: var(--font-display); font-weight: 700; font-size: 12px; transition: background-color .16s, color .16s;
}
.theme-toggle button.active { background: var(--bg-raised); color: var(--fg); box-shadow: var(--shadow-button); }

/* ---- Uploader ---- */
.uploader {
  position: relative; border: 1.5px dashed var(--border-field); border-radius: var(--radius-lg);
  background: var(--bg-elevated); min-height: 240px; display: flex; align-items: center;
  justify-content: center; cursor: pointer; transition: border-color .16s, background .16s;
  overflow: hidden;
}
.uploader:hover { border-color: var(--accent-purple); background: var(--bg-raised); }
.uploader.dragover { border-color: var(--accent-purple); background: rgba(136,100,228,0.06); }
.uploader.has-image { border-style: solid; border-color: var(--border); cursor: default; }
.uploader .placeholder { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--fg-muted); padding: 40px; }
.uploader .placeholder .ring {
  width: 52px; height: 52px; border-radius: 9999px; background: var(--bg-card);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--fg);
}
.uploader .placeholder .big { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--fg); }
.uploader img.preview { max-width: 100%; max-height: 420px; display: block; object-fit: contain; }
.uploader .replace {
  position: absolute; top: 12px; right: 12px; height: 32px; padding: 0 12px; border-radius: var(--radius-pill);
  background: rgba(0,0,0,0.45); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.15); color: var(--fg); font-family: var(--font-display);
  font-weight: 700; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}

/* ---- Style grid ---- */
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }

.style-card {
  position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-raised); cursor: pointer; padding: 0;
  transition: transform .18s ease-out, border-color .16s, box-shadow .18s;
}
.style-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,0.5); }
.style-card.active { border: 2px solid var(--accent-purple); box-shadow: 0 0 0 3px rgba(136,100,228,0.18); }
.style-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.style-card .veil { position: absolute; inset: auto 0 0 0; height: 64px; background: linear-gradient(transparent, rgba(0,0,0,0.55)); pointer-events: none; }
.style-card .name {
  position: absolute; left: 10px; bottom: 9px; font-family: var(--font-display); font-weight: 700;
  font-size: 13px; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,0.5); pointer-events: none;
}
.style-card .check {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 9999px;
  background: var(--accent-purple); color: #fff; display: none; align-items: center; justify-content: center;
}
.style-card.active .check { display: inline-flex; }
.style-card .swatch-row { position: absolute; top: 8px; left: 8px; display: flex; gap: 3px; }
.style-card .swatch-row i { width: 10px; height: 10px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,0.25); }

/* ---- Action bar (glass prompt-bar aesthetic) ---- */
.actionbar-wrap { position: sticky; bottom: 16px; display: flex; justify-content: center; margin-top: 32px; pointer-events: none; }
.actionbar {
  pointer-events: auto; width: 760px; max-width: 100%; border-radius: var(--radius-xl);
  background: var(--ab-bg);
  backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px); box-shadow: var(--shadow-glass);
  overflow: hidden;
}
.actionbar .ab-input { display: flex; align-items: center; gap: 12px; padding: 16px 20px 14px; }
.actionbar .ab-input .spark { color: var(--accent-purple-text); display: inline-flex; flex-shrink: 0; }
.actionbar .ab-input input {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: var(--fg);
  font-family: var(--font-body); font-weight: 500; font-size: 16px; line-height: 24px;
}
.actionbar .ab-input input::placeholder { color: var(--fg-muted); font-weight: 400; }
.actionbar .ab-strip {
  height: 56px; padding: 0 12px; background: var(--ab-strip);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.actionbar .meta { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pill {
  height: 28px; padding: 0 10px; border-radius: 9999px; background: rgba(255,255,255,0.05);
  border: 1px solid var(--border); color: var(--fg); font-family: var(--font-display); font-weight: 600;
  font-size: 12px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.pill.accent { background: rgba(136,100,228,0.15); border-color: var(--accent-purple); color: var(--accent-purple-text); }
.pill .dot { width: 10px; height: 10px; border-radius: 3px; }
.generate-btn {
  height: 40px; padding: 0 8px 0 16px; border-radius: 9999px; border: none; cursor: pointer;
  background: var(--btn-bg); color: var(--btn-fg); font-family: var(--font-display); font-weight: 700;
  font-size: 14px; display: inline-flex; align-items: center; gap: 10px; transition: opacity .16s, transform .12s;
}
.generate-btn .arrow { width: 26px; height: 26px; border-radius: 9999px; background: var(--btn-fg); color: var(--btn-bg); display: inline-flex; align-items: center; justify-content: center; }
.generate-btn:disabled { background: var(--bg-raised); color: var(--fg-dimmer); cursor: default; }
.generate-btn:disabled .arrow { background: var(--bg-card-mid); color: var(--fg-dimmer); }
.generate-btn:not(:disabled):active { transform: scale(0.98); }

/* ---- Results ---- */
.results { margin-top: 8px; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .result-grid { grid-template-columns: 1fr; } }
.result-tile { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-raised); border: 1px solid var(--border); }
.result-tile .cap {
  position: absolute; top: 10px; left: 10px; height: 24px; padding: 0 10px; border-radius: 9999px;
  background: rgba(0,0,0,0.45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-family: var(--font-display); font-weight: 700; font-size: 11px; display: inline-flex; align-items: center;
}
.result-tile img { width: 100%; display: block; }
.result-tile .actions { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 8px; }
.mini-btn {
  height: 30px; padding: 0 12px; border-radius: 9999px; border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.mini-btn:hover { background: rgba(0,0,0,0.7); }

/* skeleton shimmer */
.skeleton { position: relative; aspect-ratio: 4 / 3; background: var(--bg-raised); overflow: hidden; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.06) 50%, transparent 70%);
  transform: translateX(-100%); animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.gen-label { display: flex; align-items: center; gap: 10px; color: var(--fg-muted); font-size: 13px; margin: 0 0 12px; }
.spinner { width: 16px; height: 16px; border-radius: 9999px; border: 2px solid rgba(255,255,255,0.2); border-top-color: var(--accent-purple-text); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty-note { color: var(--fg-dimmer); font-size: 13px; text-align: center; padding: 28px; border: 1px dashed var(--border); border-radius: var(--radius-lg); }

/* toast */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #2a1215; color: #ff8a80; border: 1px solid #5c2b2e; padding: 10px 16px;
  border-radius: var(--radius-md); font-size: 13px; opacity: 0; transition: all .25s; z-index: 9999; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* scrollbars */
.main::-webkit-scrollbar, .sidebar::-webkit-scrollbar { width: 10px; }
.main::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 9999px; border: 3px solid var(--bg-base); }

/* ============================================================================
   Multi-view + Generator + My Assets
   ============================================================================ */
.view { display: none; }
.view.active { display: block; }

/* segmented control (Image / Video) */
.segmented { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--radius-pill);
  background: var(--bg-elevated); border: 1px solid var(--border); margin: 4px 0 8px; }
.segmented button { height: 34px; padding: 0 18px; border: none; border-radius: var(--radius-pill);
  background: transparent; color: var(--fg-muted); font-family: var(--font-display); font-weight: 700;
  font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: background-color .16s, color .16s; }
.segmented button.active { background: var(--btn-bg); color: var(--btn-fg); box-shadow: var(--shadow-button); }

.gen-workspace { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); }

/* image reference multi-upload */
.ref-multi { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.ref-tile { position: relative; aspect-ratio: 1; border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-raised); }
.ref-tile img { width: 100%; height: 100%; object-fit: cover; }
.ref-tile .rm { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 9999px;
  border: none; background: rgba(0,0,0,0.55); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ref-add { aspect-ratio: 1; border: 1.5px dashed var(--border-field); border-radius: var(--radius-md);
  background: var(--bg-elevated); color: var(--fg-muted); cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; font-family: var(--font-display); font-weight: 700; font-size: 12px; transition: border-color .16s, background .16s; }
.ref-add:hover { border-color: var(--accent-purple); background: var(--bg-raised); }

/* video frame slots */
.video-slots { display: flex; flex-direction: column; gap: 12px; }
.frame-slot { display: flex; flex-direction: column; gap: 6px; }
.fs-label { font-family: var(--font-display); font-weight: 700; font-size: 12px; color: var(--fg-muted); }
.fs-drop { position: relative; height: 120px; border: 1.5px dashed var(--border-field); border-radius: var(--radius-md);
  background: var(--bg-elevated); display: flex; align-items: center; justify-content: center; gap: 8px; overflow: hidden; }
.fs-drop .fs-actions { display: flex; gap: 8px; }
.fs-drop .mini2 { height: 28px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--border);
  background: var(--bg-card); color: var(--fg); font-family: var(--font-display); font-weight: 700; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.fs-drop .mini2:hover { border-color: var(--accent-purple); }
.fs-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fs-drop .rm { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 9999px; border: none;
  background: rgba(0,0,0,0.55); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; z-index: 2; }

/* settings */
.setting { margin-bottom: 18px; }
.setting-label { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--fg-2); margin-bottom: 8px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { height: 32px; padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--fg-2); font-family: var(--font-display); font-weight: 700; font-size: 12px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all .14s; }
.opt:hover { border-color: var(--border-strong); }
.opt.active { background: rgba(136,100,228,0.15); border-color: var(--accent-purple); color: var(--accent-purple-text); }
.model-note { margin-top: 4px; min-height: 16px; }

/* My Assets */
.assets-head { display: flex; align-items: center; gap: 20px; padding-top: 48px; padding-bottom: 8px; flex-wrap: wrap; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--radius-pill); background: var(--bg-elevated); border: 1px solid var(--border); }
.tabs button { height: 30px; padding: 0 14px; border: none; border-radius: var(--radius-pill); background: transparent;
  color: var(--fg-muted); font-family: var(--font-display); font-weight: 700; font-size: 12px; cursor: pointer; transition: all .14s; }
.tabs button.active { background: var(--btn-bg); color: var(--btn-fg); }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; padding: 16px 0 40px; }
.asset { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border);
  background: var(--bg-raised); cursor: pointer; aspect-ratio: 1; transition: transform .18s, box-shadow .18s; }
.asset:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,0.4); }
.asset img { width: 100%; height: 100%; object-fit: cover; display: block; }
.asset .ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--fg-dimmer); }
.asset .kind-badge { position: absolute; top: 8px; left: 8px; height: 22px; padding: 0 8px; border-radius: var(--radius-pill);
  background: rgba(0,0,0,0.5); backdrop-filter: blur(8px); color: #fff; font-family: var(--font-display); font-weight: 700;
  font-size: 10px; letter-spacing: .3px; text-transform: uppercase; display: inline-flex; align-items: center; gap: 5px; }
.asset .play { position: absolute; inset: 0; margin: auto; width: 46px; height: 46px; border-radius: 9999px;
  background: rgba(0,0,0,0.45); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; color: #fff; }
.asset .foot { position: absolute; inset: auto 0 0 0; padding: 18px 10px 8px; background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff; font-size: 11px; font-family: var(--font-caption); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset.gen::after { content: ""; position: absolute; inset: 0; background: var(--bg-raised); }
.asset .spin-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 2; }

/* modal / lightbox / picker */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); display: none;
  align-items: center; justify-content: center; z-index: 9998; padding: 40px; }
.modal.open { display: flex; }
.modal-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg);
  max-width: 90vw; max-height: 90vh; overflow: auto; box-shadow: var(--shadow-glass); }
.modal-card img, .modal-card video { max-width: 86vw; max-height: 72vh; display: block; border-radius: var(--radius-md); }
.modal-card .lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; }
.picker-card { width: 760px; max-width: 90vw; padding: 16px 18px; }
.picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.picker-card .asset-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); padding: 8px 0 0; }
.icon-x { width: 32px; height: 32px; border-radius: 9999px; border: 1px solid var(--border); background: var(--bg-card);
  color: var(--fg); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
