/* FARZI Studio - Avatar Studio (js/tools/avatar-studio.js). Same dark ink and champagne gold as Add Balance.
   Scoped to #avatarStudioModal. */

#avatarStudioModal .plans-card.av-shell {
  width: min(1080px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 0;
  background: #07080c;
  border: 1px solid rgba(217, 181, 107, .16) !important;
  border-radius: 26px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .04);
  scrollbar-width: thin;
  scrollbar-color: rgba(217, 181, 107, .25) transparent;
}
#avatarStudioModal .plans-card.av-shell > .close { position: sticky; top: 14px; float: right; margin: 14px 14px 0 0; z-index: 5; }

#farziAvatarStudio {
  --av-line: rgba(255, 255, 255, .08);
  --av-line-strong: rgba(255, 255, 255, .16);
  --av-panel: rgba(255, 255, 255, .028);
  --av-text: #f5f3ee;
  --av-muted: #9b9aa3;
  --av-gold: #d9b56b;
  --av-gold-2: #f0d08b;
  --av-bad: #f08a8a;
  color: var(--av-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  padding: 40px clamp(16px, 4vw, 44px) 44px;
  background: radial-gradient(800px 360px at 50% -140px, rgba(217, 181, 107, .10), transparent 70%), #07080c;
}
#farziAvatarStudio * { box-sizing: border-box; }
#farziAvatarStudio h2 { font-family: Outfit, Inter, sans-serif; font-weight: 600; font-size: clamp(24px, 3.4vw, 34px); letter-spacing: -.03em; line-height: 1.12; margin: 12px 0 8px; }
#farziAvatarStudio h3 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 12px; }
#farziAvatarStudio p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--av-muted); }

.av-eyebrow { font: 600 11px/1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .28em; color: var(--av-gold); text-transform: uppercase; }
.av-head { margin-bottom: 22px; max-width: 680px; }

.av-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.av-tool { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 16px; border: 1px solid var(--av-line); background: var(--av-panel); color: var(--av-text); cursor: pointer; min-height: 44px; font: inherit; }
.av-tool b { font-size: 15px; }
.av-tool-tag { font: 600 10.5px/1.4 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--av-gold); }
.av-tool-blurb { font-size: 12.5px; line-height: 1.5; color: var(--av-muted); }
.av-tool.is-selected { border-color: rgba(217, 181, 107, .55); background: rgba(217, 181, 107, .07); box-shadow: inset 0 0 0 1px rgba(217, 181, 107, .25); }

.av-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; }
.av-card { border: 1px solid var(--av-line); background: var(--av-panel); border-radius: 18px; padding: 20px; margin-bottom: 16px; min-width: 0; }
.av-hint { font-size: 12px !important; line-height: 1.55; color: var(--av-muted); }
.av-error { color: var(--av-bad) !important; font-size: 13px !important; margin-top: 8px !important; }
.av-error:empty { display: none; }

.av-slot { border: 1px dashed var(--av-line-strong); border-radius: 14px; padding: 14px; margin-top: 12px; }
.av-slot.has-file { border-style: solid; }
.av-slot-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.av-drop { width: 100%; min-height: 96px; border-radius: 12px; border: 1px solid var(--av-line); background: rgba(255, 255, 255, .02); color: var(--av-muted); font: inherit; font-size: 13px; cursor: pointer; }
.av-drop.is-over, .av-drop:hover { border-color: rgba(217, 181, 107, .5); color: var(--av-text); }
.av-file { display: none; }
.av-preview { display: block; max-width: 100%; max-height: 260px; border-radius: 10px; margin: 0 auto 8px; background: #000; }
.av-preview-audio { width: 100%; margin-bottom: 8px; }
.av-slot-meta { overflow-wrap: anywhere; }
.av-slot-actions { display: flex; gap: 8px; margin-top: 8px; }

.av-label { display: block; font-size: 12px; color: var(--av-muted); margin: 12px 0 6px; }
.av-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.av-chip { min-width: 72px; min-height: 40px; border-radius: 999px; border: 1px solid var(--av-line-strong); background: transparent; color: var(--av-text); font: inherit; font-size: 13px; cursor: pointer; }
.av-chip.is-selected { border-color: var(--av-gold); background: rgba(217, 181, 107, .12); color: var(--av-gold-2); }
.av-input { width: 100%; border-radius: 12px; border: 1px solid var(--av-line-strong); background: rgba(0, 0, 0, .35); color: var(--av-text); font: inherit; font-size: 13.5px; padding: 10px 12px; resize: vertical; }
.av-consent { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 4px; font-size: 12.5px; line-height: 1.5; color: var(--av-text); cursor: pointer; }
.av-consent input { margin-top: 3px; width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--av-gold); }

.av-quote { margin: 14px 0 10px; min-height: 24px; }
.av-price { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(217, 181, 107, .3); background: rgba(217, 181, 107, .06); margin-bottom: 6px; }
.av-price span { color: var(--av-muted); font-size: 13px; }
.av-price b { font-size: 20px; color: var(--av-gold-2); }

.av-btn { min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--av-line-strong); background: transparent; color: var(--av-text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.av-btn-primary { width: 100%; background: linear-gradient(180deg, var(--av-gold-2), var(--av-gold)); color: #15110a; border: 0; }
.av-btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.av-btn-small { min-height: 36px; padding: 0 14px; font-size: 12.5px; }
.av-btn-ghost { color: var(--av-muted); }
.av-tool:focus-visible, .av-chip:focus-visible, .av-btn:focus-visible, .av-drop:focus-visible { outline: 2px solid var(--av-gold); outline-offset: 2px; }

.av-status b { color: var(--av-text); }
.av-result { display: block; width: 100%; max-height: 520px; border-radius: 12px; background: #000; margin: 12px 0 8px; }
.av-recent { display: flex; flex-direction: column; gap: 8px; }
.av-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--av-line); }
.av-row-main { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; font-size: 13px; }
.av-row-main span { color: var(--av-muted); font-size: 12px; }
.av-row-price { color: var(--av-gold-2); font-size: 13px; }

@media (max-width: 760px) {
  #avatarStudioModal .plans-card.av-shell { border-radius: 0; max-height: 100vh; height: 100vh; }
  .av-tools { grid-template-columns: 1fr; }
  .av-grid { grid-template-columns: 1fr; }
  .av-card { padding: 16px; }
}

/* expected output and billed length (from the server), and the actions on a finished video */
.av-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.av-fact { border: 1px solid var(--av-line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.av-fact span { color: var(--av-muted); font-size: 11.5px; }
.av-fact b { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.av-result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.av-result-actions .av-btn { display: inline-flex; align-items: center; text-decoration: none; }
@media (max-width: 760px) { .av-facts { grid-template-columns: 1fr; } }

/* Avatar Showcase - vertical 9:16 cards (assets/avatar-showcase/manifest.json) */
.av-showcase { margin: 0 0 22px; }
.av-showcase-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 12px; }
.av-showcase-head h3 { margin: 0 !important; }
.av-showcase-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin; scrollbar-color: rgba(217, 181, 107, .25) transparent; }
.av-sc-card { scroll-snap-align: start; display: flex; flex-direction: column; border: 1px solid var(--av-line); border-radius: 16px; overflow: hidden; background: var(--av-panel); min-width: 0; }
.av-sc-media { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: #000; cursor: pointer; }
.av-sc-pending { cursor: default; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 12px;
  background: radial-gradient(120% 80% at 50% 0%, rgba(217, 181, 107, .16), transparent 60%), linear-gradient(180deg, #11131a, #07080c); }
.av-sc-glyph { font-size: 34px; color: var(--av-gold); opacity: .8; }
.av-sc-pending-text { font: 600 10.5px/1.4 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--av-muted); }
.av-sc-body { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; }
.av-sc-title { font-size: 13.5px; line-height: 1.3; }
.av-sc-sub { font-size: 12px; color: var(--av-muted); line-height: 1.4; }
.av-sc-tool { font: 600 10px/1.4 "JetBrains Mono", ui-monospace, monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--av-gold); margin-top: 2px; }
.av-sc-try { margin-top: 8px; width: 100%; }
@media (max-width: 760px) {
  .av-showcase-row { grid-auto-columns: 62%; }
}
@media (prefers-reduced-motion: reduce) {
  .av-showcase-row { scroll-behavior: auto; }
}
