/* ==========================================================================
   LUMORA AI — App shell, forms, and dashboard components
   Builds on css/style.css tokens (:root vars, reset, .btn, .text-gradient)
   ========================================================================== */

/* ==========================================================================
   Auth pages
   ========================================================================== */

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow-x: hidden;
}

.auth-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(35% 45% at 15% 20%, rgba(47, 168, 245, 0.22), transparent 70%),
    radial-gradient(35% 45% at 85% 80%, rgba(236, 72, 153, 0.2), transparent 70%),
    radial-gradient(40% 50% at 50% 50%, rgba(139, 92, 246, 0.14), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 44px);
}

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}
.auth-brand .brand-icon { height: 32px; }
.auth-brand .brand-wordmark { font-size: 19px; }

.auth-card h1 {
  font-size: clamp(22px, 4vw, 26px);
  text-align: center;
  margin-bottom: 8px;
}
.auth-sub {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14.5px;
  margin-bottom: 28px;
}

.auth-form { display: flex; flex-direction: column; gap: 18px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field[hidden], [data-field][hidden] { display: none; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--text-secondary); }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  font-size: 14.5px;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-tertiary); }
/* Belt-and-suspenders alongside :root's color-scheme: dark — some browsers
   only partially theme a <select>'s native popup from that alone, so pin
   the options' own colors explicitly too. Without this, an option could
   render as light text on a browser-default light popup: unreadable.
   Unscoped (not just .field select) so it also covers one-off selects that
   never went through the standard .field wrapper, like admin.html's
   support-ticket status picker. */
select option {
  background: var(--bg-elevated-2);
  color: var(--text-primary);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--violet);
  background: rgba(255, 255, 255, 0.05);
}

.field-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-hint { font-size: 12.5px; color: var(--text-tertiary); }

.field-link {
  font-size: 13.5px;
  color: var(--text-secondary);
  transition: color 0.18s ease;
}
.field-link:hover { color: var(--text-primary); }

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-secondary);
}
.checkbox-row input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--violet);
  flex-shrink: 0;
}
.checkbox-row a { color: var(--text-primary); text-decoration: underline; text-underline-offset: 2px; }

.btn-block { width: 100%; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  color: var(--text-tertiary);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.oauth-row { display: flex; flex-direction: column; gap: 12px; }
.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.btn-oauth:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.3); }
.btn-oauth svg { width: 18px; height: 18px; flex-shrink: 0; }

.auth-footer {
  text-align: center;
  margin-top: 26px;
  font-size: 14px;
  color: var(--text-secondary);
}
.auth-footer a { color: var(--text-primary); font-weight: 600; }

.auth-error {
  display: none;
  background: rgba(236, 72, 153, 0.1);
  border: 1px solid rgba(236, 72, 153, 0.3);
  color: #fda4c9;
  font-size: 13.5px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}
.auth-error.is-visible { display: block; }

.back-to-site {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}
.back-to-site:hover { color: var(--text-primary); }
.back-to-site svg { width: 16px; height: 16px; }

/* ==========================================================================
   App shell (dashboard layout)
   ========================================================================== */

.app-shell {
  display: grid;
  grid-template-columns: 264px 1fr;
  height: 100vh;
}

.sidebar-scrim { display: none; }

.sidebar {
  border-right: 1px solid var(--border);
  padding: 12px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand { display: flex; align-items: center; padding: 2px 6px 2px; }
.sidebar-brand .brand-lockup { gap: 7px; }
.sidebar-brand .brand-icon { height: 18px; }
.sidebar-brand .brand-wordmark { font-size: 13px; }

.sidebar-cta {
  margin: 0 6px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.nav-group { display: flex; flex-direction: column; gap: 0; }
.nav-group-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 6px 10px 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.25;
  transition: background 0.16s ease, color 0.16s ease;
}
/* Same class of bug as .field-options-group above: a class selector's own
   display value has equal specificity to the UA [hidden] rule and loads
   after it, so it silently wins — toggling .hidden via JS on a .nav-link
   (e.g. the Admin Panel link) would do nothing without this override. */
.nav-link[hidden] { display: none; }
.nav-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-link:hover { background: rgba(255, 255, 255, 0.04); color: var(--text-primary); }
.nav-link.active {
  background: var(--gradient-brand-soft);
  color: var(--text-primary);
  position: relative;
}
.nav-link.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  border-radius: 3px;
  background: var(--gradient-brand);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding-top: 6px;
}

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(5, 5, 10, 0.85);
  backdrop-filter: blur(14px);
}

.topbar-left { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 1; }

.sidebar-toggle {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-toggle svg { width: 18px; height: 18px; }

.topbar-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 380px;
  width: 100%;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-tertiary);
}
.topbar-search svg { width: 16px; height: 16px; flex-shrink: 0; }
.topbar-search input {
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 14px;
  width: 100%;
}
.topbar-search input::placeholder { color: var(--text-tertiary); }
.topbar-search input:focus { outline: none; }

.topbar-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.credit-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 7px 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  transition: border-color 0.16s ease, background 0.16s ease;
}
.credit-pill:hover { border-color: var(--border-strong); background: rgba(255, 255, 255, 0.06); }
.credit-pill svg { width: 16px; height: 16px; color: var(--orange); flex-shrink: 0; }
.credit-pill.is-low { border-color: rgba(236, 72, 153, 0.4); background: rgba(236, 72, 153, 0.08); }
.credit-pill.is-low svg { color: var(--magenta); }
.credit-pill-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: #05050a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

@media (max-width: 480px) {
  .credit-pill span[data-credit-balance] { display: none; }
  .credit-pill { padding: 7px; gap: 0; }
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  position: relative;
  transition: color 0.16s ease, border-color 0.16s ease;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { color: var(--text-primary); border-color: var(--border-strong); }
.icon-btn .dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--magenta);
  border: 1.5px solid var(--bg);
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: #05050a;
  flex-shrink: 0;
}

.user-menu { position: relative; }
.user-menu-trigger { display: flex; align-items: center; gap: 8px; }
.user-menu-trigger svg { width: 14px; height: 14px; color: var(--text-tertiary); }

.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  z-index: 60;
}
.dropdown.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a, .dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-secondary);
  text-align: left;
}
.dropdown a:hover, .dropdown button:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); }
.dropdown svg { width: 16px; height: 16px; }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 4px; }
.dropdown-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.dropdown-user-info strong { font-size: 13.5px; color: var(--text-primary); }
.dropdown-user-info span { font-size: 12px; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.notif-dropdown { min-width: 320px; padding: 6px; }
.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.notif-head button {
  width: auto;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
}
.notif-head button:hover { color: var(--text-primary); background: none; }

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
}
.notif-item:hover { background: rgba(255, 255, 255, 0.05); }
.notif-icon {
  width: 32px;
  height: 32px;
  padding: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
}
.notif-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: normal;
  line-height: 1.4;
}
.notif-text strong { color: var(--text-primary); font-size: 13.5px; }

.notif-empty { padding: 28px 10px; text-align: center; font-size: 13px; color: var(--text-tertiary); }

@media (max-width: 480px) {
  .notif-dropdown { min-width: calc(100vw - 32px); right: -8px; }
}

.app-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(20px, 3vw, 32px);
  scroll-behavior: smooth;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.page-head h1 { font-size: clamp(22px, 3vw, 28px); margin-bottom: 6px; }
.page-head p { color: var(--text-secondary); font-size: 14.5px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}
.breadcrumb a:hover { color: var(--text-primary); }

/* ==========================================================================
   Reusable widgets: cards, tables, badges, empty states
   ========================================================================== */

.widget-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.widget-grid-5 { grid-template-columns: repeat(5, 1fr); }
.widget-grid-3 { grid-template-columns: repeat(3, 1fr); }

.widget-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  /* Depth at rest fixes the "everything sits flush on the background" flatness
     — no hover-lift here (unlike .studio-card/.item-card below): a stat
     display isn't a clickable item, so lifting it on hover would be a false
     affordance. */
  box-shadow: var(--shadow-sm);
}
.widget-label { font-size: 13px; color: var(--text-tertiary); margin-bottom: 10px; }
.widget-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.widget-delta { font-size: 12.5px; margin-top: 6px; color: var(--success); }
.widget-delta.down { color: var(--danger); }

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  /* Same reasoning as .widget-card above — real elevation, no hover-lift
     (a whole section container isn't a clickable unit). */
  box-shadow: var(--shadow-sm);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.panel-head h2 { font-size: var(--text-lg); }
.panel-head .btn-sm { flex-shrink: 0; }

/* Instructional text under a panel-head, before its form — was four
   identical inline style="..." repeats in app/admin.html alone. */
.panel-lead { color: var(--text-secondary); font-size: var(--text-sm); margin: -6px 0 20px; }
/* A masked key/id/hash shown in a table cell (API keys, asset ids). */
.mono-cell { font-family: monospace; font-size: var(--text-xs); }

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 20px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.quick-action:hover { transform: translateY(-3px); border-color: var(--border-strong); background: rgba(255, 255, 255, 0.035); }
.quick-action .studio-icon { margin-bottom: 0; }
.quick-action span { font-size: 13.5px; font-weight: 600; }

.split-panel {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.item-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.item-card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.item-thumb {
  aspect-ratio: 16 / 10;
  background: var(--gradient-brand-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
}
.item-thumb svg { width: 32px; height: 32px; }
.item-thumb-has-text { align-items: flex-start; padding: 14px; background: var(--bg-elevated); }
.item-thumb-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  -webkit-box-orient: vertical;
  text-align: left;
}
.item-body { padding: 14px 16px; }
.item-body h3 { font-size: 14.5px; margin-bottom: 4px; font-family: var(--font-body); font-weight: 600; }
.item-meta { font-size: 12.5px; color: var(--text-tertiary); display: flex; justify-content: space-between; gap: 8px; }

/* Boost & Earn — earn-tab task cards. A dedicated small square icon (not
   .item-thumb, which is a 16:10 hero block meant for a big preview image —
   reusing it here with inline width/height fought its own aspect-ratio). */
.boost-task-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.boost-task-card:hover { transform: none; } /* the lift-on-hover reads oddly on a card this dense */
.boost-task-head { display: flex; align-items: flex-start; gap: 12px; }
.boost-task-icon {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: var(--radius-sm);
  background: var(--gradient-brand-soft); display: flex; align-items: center; justify-content: center; color: var(--text-tertiary);
}
.boost-task-icon svg { width: 18px; height: 18px; }
.boost-task-head h3 { font-size: 14.5px; font-family: var(--font-body); font-weight: 600; }
.boost-task-link { display: flex; gap: 8px; }
.boost-task-link-input {
  flex: 1; min-width: 0; font-family: monospace; font-size: 12px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-base); color: var(--text-secondary);
}
.boost-task-instructions {
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; margin: 0;
  padding: 8px 10px; border-radius: var(--radius-sm); background: var(--bg-base); border: 1px solid var(--border);
}
.boost-task-instructions strong { color: var(--text-primary); }

/* Search + status filter + "show older" toggle row above a filterable
   table (currently: Boost & Earn's "My submissions"). */
.list-filter-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.list-filter-row input[type="search"] {
  flex: 1; min-width: 200px; padding: 9px 12px; font-size: 13.5px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elevated); color: var(--text-primary);
}
.list-filter-row select {
  padding: 9px 12px; font-size: 13.5px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elevated); color: var(--text-primary);
}

/* Templates page: real per-template accent color + description, not a
   generic shared-color icon box */
.template-thumb { position: relative; overflow: hidden; }
.template-thumb svg { transition: transform 0.2s ease; }
.template-card:hover .template-thumb svg { transform: scale(1.1); }
.template-preview-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}
.template-card:hover .template-preview-media { transform: scale(1.05); }
.template-audio-play {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(5, 5, 10, 0.55);
  backdrop-filter: blur(4px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.template-audio-play:hover { background: rgba(5, 5, 10, 0.75); }
.template-audio-play svg { width: 20px; height: 20px; }
.template-spec-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(5, 5, 10, 0.55);
  color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
}
.template-studio-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.template-description {
  font-size: 12.5px;
  color: var(--text-tertiary);
  line-height: 1.5;
  margin-top: 2px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { color: var(--success); background: var(--success-bg); }
.badge-blue { color: var(--blue); background: rgba(47, 168, 245, 0.12); }
.badge-violet { color: var(--violet); background: rgba(139, 92, 246, 0.12); }
.badge-orange { color: var(--orange); background: rgba(251, 146, 60, 0.12); }
.badge-red { color: var(--danger); background: var(--danger-bg); }

.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.data-table td { padding: 14px; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.14s ease; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.data-table td:first-child, .data-table th:first-child { color: var(--text-primary); }
.table-wrap { overflow-x: auto; }

.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-tertiary);
}
.empty-state svg { width: 40px; height: 40px; margin: 0 auto 16px; opacity: 0.6; }
.empty-state h3 { color: var(--text-primary); font-size: 16px; margin-bottom: 8px; }
.empty-state p { font-size: 14px; margin-bottom: 20px; }

.tab-row {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}
.tab-btn {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--text-primary); border-bottom-color: var(--violet); }

/* ==========================================================================
   Tool workspace (generator UI) layout
   ========================================================================== */

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

.tool-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tool-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-secondary);
}
.tool-list-item.active { background: var(--gradient-brand-soft); color: var(--text-primary); }
.tool-list-item:hover { color: var(--text-primary); }

/* Effects section: a visual grid of preset cards instead of the plain Tools
   list rows — still plain .tool-list-item elements underneath (js/studio.js
   handles selection identically), just laid out and styled differently. */
.tool-list.effects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.tool-list.effects-grid .tool-list-item {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  position: relative;
  min-height: 92px;
}
.tool-list.effects-grid .tool-list-item svg { margin-bottom: 2px; }
.tool-list.effects-grid .tool-name { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.tool-list.effects-grid .tool-hint {
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-tertiary);
  font-weight: 400;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tool-list.effects-grid .tool-list-item svg {
  width: 16px !important;
  height: 16px !important;
  padding: 8px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(139,92,246,.22), rgba(236,72,153,.22));
  box-sizing: content-box;
}
.tool-list.effects-grid .tool-list-item.active svg {
  background: linear-gradient(135deg, rgba(139,92,246,.4), rgba(236,72,153,.4));
}
.tool-list.effects-grid .tool-cost-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: var(--text-secondary);
}
/* Real generated example, in place of the generic icon, on the effects that
   have one (see EFFECT_PREVIEW in studio.js) — same 32px box the icon
   already occupied (16px + 8px padding each side) so the card layout
   doesn't shift depending on which effects have a preview yet. */
.tool-list.effects-grid .tool-icon-media {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  object-fit: cover;
  margin-bottom: 2px;
  display: block;
}

.result-canvas {
  position: relative;
  min-height: 420px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  color: var(--text-tertiary);
  text-align: center;
  padding: 32px;
}
.result-canvas svg { width: 44px; height: 44px; opacity: 0.6; }
.result-canvas.has-output { border-style: solid; align-items: stretch; }

/* A finished result arrives rather than snapping into place — was a hard
   innerHTML swap with no transition at all before this. */
.result-output {
  display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; color: var(--text-primary);
  animation: resultReveal 0.36s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes resultReveal {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .result-output { animation: none; }
}

/* The brief success checkmark+glow shown once, right after a result
   reveals — see js/studio.js's showSuccessFlourish(). Absolutely
   positioned over .result-canvas (now position:relative, above), removes
   itself after ~1.1s. */
.success-flourish {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 3;
  animation: successFlourishFade 1.1s ease forwards;
}
.success-flourish-ring {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gradient-brand);
  box-shadow: var(--shadow-glow);
  animation: successRingPulse 0.9s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
.success-flourish-check {
  position: relative;
  width: 28px;
  height: 28px;
  animation: successCheckIn 0.35s ease 0.12s both;
}
.success-flourish-check path { animation: successCheckDraw 0.35s ease 0.22s forwards; }
@keyframes successRingPulse {
  0%   { transform: scale(0.3); opacity: 0; }
  55%  { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes successCheckIn {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes successCheckDraw { to { stroke-dashoffset: 0; } }
@keyframes successFlourishFade {
  0%, 55% { opacity: 1; }
  100%    { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .success-flourish { display: none; }
}
.result-output img { max-width: 100%; max-height: 460px; border-radius: var(--radius-md); object-fit: contain; }
.result-output audio { width: 100%; }
.result-text {
  width: 100%;
  max-width: 640px;
  max-height: 420px;
  overflow-y: auto;
  text-align: left;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-primary);
  padding: 4px 6px;
}
.result-text p { margin: 0 0 1.1em; }
.result-text p:last-child { margin-bottom: 0; }
.result-text h2, .result-text h3, .result-text h4, .result-text h5 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
  margin: 0.2em 0 0.6em;
  color: var(--text-primary);
}
.result-text h2 { font-size: 1.5em; }
.result-text h3 { font-size: 1.25em; }
.result-text h4, .result-text h5 { font-size: 1.05em; }
.result-text strong { font-weight: 700; color: var(--text-primary); }
.result-text em { font-style: italic; color: var(--text-secondary); }
.result-text hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.4em auto;
  width: 40%;
}
.result-asset { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.result-note {
  font-size: 12.5px;
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  text-align: left;
}
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.result-audio-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 28px 20px;
  border-radius: var(--radius-lg);
  background: var(--gradient-brand-soft);
  border: 1px solid var(--border-strong);
}
.result-audio-card svg {
  width: 40px;
  height: 40px;
  color: var(--violet);
  padding: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}
.result-audio-card audio { width: 100%; max-width: 380px; }

.lumora-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 2, 6, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}
.lumora-preview-overlay.is-open { display: flex; }
.lumora-preview-modal {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.lumora-preview-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lumora-preview-close:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.1); }
.lumora-preview-close svg { width: 15px; height: 15px; }
.lumora-preview-head { margin-bottom: 18px; padding-right: 36px; }
.lumora-preview-title { font-size: 17px; font-weight: 600; color: var(--text-primary); margin: 0 0 4px; }
.lumora-preview-meta { font-size: 12.5px; color: var(--text-tertiary); margin: 0; }
.lumora-preview-body { display: flex; flex-direction: column; gap: 18px; }
.lumora-preview-loading, .lumora-preview-error {
  padding: 48px 16px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13.5px;
}
.lumora-preview-footer { margin-top: 18px; display: flex; justify-content: center; }

.lumora-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 2, 6, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}
.lumora-confirm-overlay.is-open {
  display: flex;
  /* Was an instant display:none -> flex snap — a confirm gate for real
     money deserves to feel deliberate, not like a flash. */
  animation: confirmBackdropFade 0.16s ease both;
}
.lumora-confirm-overlay.is-open .lumora-confirm-modal {
  animation: confirmModalIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes confirmBackdropFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes confirmModalIn {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .lumora-confirm-overlay.is-open,
  .lumora-confirm-overlay.is-open .lumora-confirm-modal { animation: none; }
}
.lumora-confirm-modal {
  width: 100%;
  max-width: 420px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
}
.lumora-confirm-title { font-size: 17px; font-weight: 600; color: var(--text-primary); margin: 0 0 10px; }
.lumora-confirm-message { font-size: 14px; color: var(--text-secondary); line-height: 1.5; margin: 0 0 24px; }
.lumora-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }

.btn-danger {
  background: linear-gradient(120deg, #f43f5e, #ec4899);
  color: #05050a;
  font-weight: 700;
  box-shadow: 0 8px 24px -8px rgba(244, 63, 94, 0.55);
}
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -8px rgba(244, 63, 94, 0.7); }
.btn-danger:active { transform: translateY(0); }

.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-row input[type="range"] { flex: 1; accent-color: var(--violet); }
.slider-row output { font-size: 13px; color: var(--text-secondary); min-width: 34px; text-align: right; }

.chip-select { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-size: 13px;
  color: var(--text-secondary);
}
.chip.active { background: var(--gradient-brand); color: #05050a; border-color: transparent; font-weight: 600; }

.generate-cost {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-tertiary);
}
.generate-cost strong {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 14px;
}
.generate-cost strong svg { width: 14px; height: 14px; color: var(--orange); }
.generate-cost.is-insufficient { border-color: rgba(236, 72, 153, 0.4); }
.generate-cost.is-insufficient strong { color: var(--magenta); }

.brand-kit-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.25);
  cursor: pointer;
}
.brand-kit-toggle input[type="checkbox"] { margin-top: 2px; accent-color: var(--violet); cursor: pointer; }
.brand-kit-toggle span { display: flex; flex-direction: column; gap: 2px; }
.brand-kit-toggle strong { font-size: 13px; color: var(--text-primary); font-weight: 600; }
.brand-kit-toggle small { font-size: 11.5px; color: var(--text-tertiary); line-height: 1.4; }

/* Multi-file tools: Multi-Image Story, Combine Videos. Stacked (not a
   side-by-side grid) so it stays clean at the sidebar panel's actual width
   — a 3-column row squeezed the file-picker button into overlapping the
   text input. */
.multi-upload-rows { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 12px; }
.multi-upload-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.multi-upload-row-top { display: flex; align-items: center; gap: 8px; }
.multi-upload-row-filename {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.multi-upload-row-text {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
}
.multi-upload-row-remove {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  flex-shrink: 0;
}
.multi-upload-row-remove:hover { color: var(--magenta); border-color: rgba(236, 72, 153, 0.4); }
/* The visual circle stays small/tidy — the real tap target underneath it
   is a full ~40px, matching the touch-target guideline without visually
   bloating the row. */
.multi-upload-row-remove::before { content: ''; position: absolute; inset: -7px; }

/* Was an inline style="display:flex..." on [data-field="options"] in
   Image/Video Studio — an inline style always wins over the [hidden]
   attribute's UA display:none rule, so toggling .hidden = true on that
   element (see js/studio.js's applyFields) silently did nothing: switching
   to a tool without "options" in its data-fields left Style/Duration/Aspect
   ratio visibly stuck on screen. Moved to a class so [hidden] can win. */
.field-options-group { display: flex; flex-direction: column; gap: 20px; }

.callout {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(47, 168, 245, 0.07);
  border: 1px solid rgba(47, 168, 245, 0.25);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.callout strong { color: var(--text-primary); }

/* ==========================================================================
   Cross-studio chaining
   ========================================================================== */

.chain-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--gradient-brand-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  margin-bottom: 20px;
  font-size: 13.5px;
  color: var(--text-secondary);
}
.chain-banner-text { display: flex; align-items: center; gap: 10px; }
.chain-banner-text svg { width: 18px; height: 18px; color: var(--violet); flex-shrink: 0; }
.chain-banner button { color: var(--text-tertiary); flex-shrink: 0; }

/* Full-width "couldn't reach the server" state — shown in place of the
   sidebar/topbar when even the session check itself couldn't complete (see
   js/layout.js's showConnectionError) and reused as a lighter inline
   variant by js/offline.js's site-wide offline banner. */
.connection-error-banner {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  margin: 16px; color: var(--text-secondary); font-size: 14px;
}
.connection-error-banner svg { width: 22px; height: 22px; color: var(--orange); flex-shrink: 0; }
.connection-error-banner p { flex: 1; margin: 0; }

.offline-banner {
  display: none; align-items: center; justify-content: center; gap: 10px;
  position: sticky; top: 0; z-index: 500; padding: 10px 16px;
  background: var(--orange); color: #05050A; font-size: 13.5px; font-weight: 600; text-align: center;
}
.offline-banner.is-visible { display: flex; }
.offline-banner svg { width: 16px; height: 16px; flex-shrink: 0; }
.chain-banner button:hover { color: var(--text-primary); }

/* An unclaimed-reward nudge, not a suggested next step — distinct amber
   tint instead of the brand-gradient chain-banner look. */
.verify-banner { background: rgba(251, 146, 60, 0.08); border-color: rgba(251, 146, 60, 0.3); }
.verify-banner .chain-banner-text svg { color: var(--orange); }

.chain-actions {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
  width: 100%;
}
.chain-actions p { font-size: 12.5px; color: var(--text-tertiary); margin-bottom: 12px; }
.chain-actions .chip-select { justify-content: center; }
.chain-actions .chip { display: inline-flex; align-items: center; gap: 6px; }
.chain-actions .chip svg { width: 14px; height: 14px; }

/* ==========================================================================
   Brand kit / settings widgets
   ========================================================================== */

.color-swatch-row { display: flex; flex-wrap: wrap; gap: 16px; }
.color-swatch { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.color-swatch .swatch {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
}
.color-swatch span { font-size: 12px; color: var(--text-tertiary); font-family: var(--font-display); }

.upload-drop {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  color: var(--text-tertiary);
}
.upload-drop svg { width: 30px; height: 30px; margin: 0 auto 12px; }
.upload-drop strong { color: var(--text-primary); }

/* Boost order fulfillment progress (remaining/quantity) */
.progress-track { width: 100%; min-width: 100px; height: 6px; border-radius: 999px; background: var(--bg-elevated-2); overflow: hidden; }
.progress-fill { height: 100%; background: var(--gradient-brand); border-radius: 999px; }
.progress-label { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }

/* Generic file-upload zone used in studio workspaces (image/video/audio input) */
.upload-zone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.upload-zone:hover,
.upload-zone.is-dragover { border-color: var(--violet); background: rgba(139, 92, 246, 0.06); }
.upload-zone svg { width: 24px; height: 24px; margin: 0 auto 10px; }
.upload-zone strong { color: var(--text-primary); }
.upload-zone-hint { font-size: 12px; margin-top: 4px; }

.upload-zone-preview { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.upload-zone-preview img { max-height: 130px; max-width: 100%; border-radius: var(--radius-sm); object-fit: cover; }
.upload-zone-file { display: flex; align-items: center; gap: 8px; color: var(--text-primary); font-size: 13.5px; }
.upload-zone-file svg { width: 18px; height: 18px; margin: 0; color: var(--violet); flex-shrink: 0; }
.upload-zone-preview[hidden],
.upload-zone-file[hidden],
.upload-zone-empty[hidden],
.upload-zone img[hidden] { display: none; }
.upload-zone-remove {
  position: relative;
  display: inline-block;
  padding: 10px 4px;
  margin: -10px -4px;
  font-size: 12.5px;
  color: var(--text-tertiary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.upload-zone-remove:hover { color: var(--magenta); }

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row h4 { font-size: 14.5px; margin-bottom: 4px; }
.settings-row p { font-size: 13px; color: var(--text-tertiary); }

.toggle {
  display: inline-block;
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle .track {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  transition: background 0.2s ease;
}
.toggle .track::before {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}
.toggle input:checked ~ .track { background: var(--gradient-brand); }
.toggle input:checked ~ .track::before { transform: translateX(18px); }

/* ==========================================================================
   Pricing / plan cards
   ========================================================================== */

.plan-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.plan-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.plan-card.current { border-color: var(--violet); background: var(--gradient-brand-soft); }
.plan-card.popular { border-color: var(--border-strong); position: relative; }

.plan-name { font-size: 15px; font-weight: 600; }
.plan-price { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.plan-price span { font-size: 13px; color: var(--text-tertiary); font-family: var(--font-body); font-weight: 400; }

.plan-features { display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; color: var(--text-secondary); }
.plan-features li { display: flex; align-items: center; gap: 8px; }
.plan-features svg { width: 15px; height: 15px; color: var(--violet); flex-shrink: 0; }

@media (max-width: 1080px) {
  .plan-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .plan-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Credit balance hero + top-up packs
   ========================================================================== */

.balance-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 26px 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--gradient-brand-soft);
  position: relative;
  overflow: hidden;
}
.balance-hero-value {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.balance-hero-value strong {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 700;
}
.balance-hero-value span { color: var(--text-secondary); font-size: 14px; }
.balance-hero-label { font-size: 13px; color: var(--text-tertiary); margin-bottom: 6px; }

.pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}
.pack-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
}
.pack-card.popular { border-color: var(--border-strong); position: relative; }
.pack-card .pack-badge {
  align-self: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--violet);
}
.pack-amount {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
}
.pack-amount svg { width: 20px; height: 20px; color: var(--orange); }
.pack-price { color: var(--text-secondary); font-size: 13.5px; }
.pack-rate { font-size: 12px; color: var(--text-tertiary); }

.credit-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 12px 30px -8px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 300;
}
.credit-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }


/* ==========================================================================
   Mobile app-shell behavior
   ========================================================================== */

@media (max-width: 1080px) {
  .quick-action-grid { grid-template-columns: repeat(3, 1fr); }
  .widget-grid { grid-template-columns: repeat(2, 1fr); }
  .workspace-grid { grid-template-columns: 1fr; }
  .split-panel { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 264px;
    z-index: 200;
    background: var(--bg);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .sidebar.is-open { transform: translateX(0); }

  .sidebar-scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 190;
  }
  .sidebar-scrim.is-open { display: block; }

  .sidebar-toggle { display: flex; }
  .topbar-search { display: none; }
}

@media (max-width: 640px) {
  .widget-grid { grid-template-columns: 1fr 1fr; }
  .quick-action-grid { grid-template-columns: repeat(2, 1fr); }
  .item-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  /* Was hard-locked to 2 columns at every width — fine in a wide sidebar
     panel, cramped once .workspace-grid itself has already stacked to
     one column (1080px, above) and this grid is the only thing left
     sharing the phone's width. */
  .tool-list.effects-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .app-content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .panel { padding: 18px; }
}

@media (max-width: 420px) {
  .widget-grid { grid-template-columns: 1fr; }
  .quick-action-grid { grid-template-columns: repeat(2, 1fr); }
  /* A hint sentence per card reads better single-column at the narrowest
     widths than squeezed two-up. */
  .tool-list.effects-grid { grid-template-columns: 1fr; }
}
