/*
  FARZI Generation Canvas (js/canvas/generation-canvas.js) - the New Project
  view. Full-viewport like the Library (body.farzi-canvas-open hides the app
  sidebar/topbar), its own slim bar, a large stage for generation cards and a
  floating composer docked bottom-centre.

  Motion is CSS-only (transform/opacity/background-position), and every
  animation stops under prefers-reduced-motion. No canvas/WebGL.
*/
#farziCanvasView {
  --fcv-bg: #09090F;
  --fcv-panel: rgba(21, 21, 27, .92);
  --fcv-panel-solid: #15151B;
  --fcv-raise: rgba(245, 245, 250, .045);
  --fcv-raise-2: rgba(245, 245, 250, .08);
  --fcv-line: rgba(245, 245, 250, .09);
  --fcv-line-2: rgba(245, 245, 250, .16);
  --fcv-text: #EEEEF4;
  --fcv-muted: #A1A1A6;
  --fcv-faint: #737379;
  --fcv-gold: #D9C06C;
  --fcv-gold-2: #EBD99F;
  --fcv-gold-soft: rgba(217, 192, 108, .14);
  --fcv-teal: #946FD3;
  --fcv-danger: #f08a7e;
  --fcv-ok: #7fd49a;
  --fcv-radius: 16px;
  --fcv-dock-h: 220px;
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 520px at 18% -8%, rgba(217, 192, 108, .07), transparent 60%),
    radial-gradient(900px 560px at 92% 4%, rgba(148, 111, 211, .05), transparent 62%),
    var(--fcv-bg);
  color: var(--fcv-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  overflow: hidden;
}
#farziCanvasView.hidden { display: none; }
body.farzi-canvas-open .farzi-sidebar,
body.farzi-canvas-open #farziSidebar,
body.farzi-canvas-open header.topbar,
body.farzi-canvas-open .topbar { display: none !important; }
body.farzi-canvas-open { overflow: hidden; }
/* The canvas cards already show every job's status. */
body.farzi-canvas-open .fjb-root { display: none !important; }

#farziCanvasView button { font: inherit; color: inherit; }
#farziCanvasView :focus-visible { outline: 2px solid var(--fcv-gold); outline-offset: 2px; }

/* ---------- top bar ---------- */
.fcv-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 56px;
  padding: 0 18px;
  border-bottom: 1px solid var(--fcv-line);
  background: rgba(9, 9, 15, .72);
  backdrop-filter: blur(10px);
}
.fcv-brand { display: flex; align-items: center; gap: 10px; font-family: Outfit, Inter, sans-serif; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; }
.fcv-logo {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(140deg, var(--fcv-gold-2), var(--fcv-gold) 55%, #9C863C);
  color: #1A1608; font-weight: 800; font-size: 15px;
}
.fcv-tabs { display: flex; gap: 4px; }
.fcv-tab {
  border: 0; background: none; padding: 8px 14px; border-radius: 10px; cursor: pointer;
  color: var(--fcv-muted); font-weight: 500;
}
.fcv-tab:hover { color: var(--fcv-text); background: var(--fcv-raise); }
.fcv-tab.active { color: var(--fcv-text); background: var(--fcv-raise-2); box-shadow: inset 0 -2px 0 var(--fcv-gold); }
.fcv-project { display: flex; align-items: center; gap: 8px; min-width: 0; margin-left: auto; }
.fcv-project-name {
  width: 200px; max-width: 32vw; min-width: 0; background: transparent; border: 1px solid transparent; border-radius: 8px;
  color: var(--fcv-text); padding: 6px 8px; font: inherit; text-overflow: ellipsis;
}
.fcv-project-name:hover, .fcv-project-name:focus { border-color: var(--fcv-line-2); background: var(--fcv-raise); outline: none; }
.fcv-ghost {
  border: 1px solid var(--fcv-line-2); background: var(--fcv-raise); padding: 7px 12px; border-radius: 10px; cursor: pointer; white-space: nowrap;
}
.fcv-ghost:hover { background: var(--fcv-raise-2); }
.fcv-balance { color: var(--fcv-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fcv-balance b { color: var(--fcv-text); font-weight: 600; }
.fcv-icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--fcv-line);
  background: var(--fcv-raise); cursor: pointer;
}
.fcv-icon-btn:hover { background: var(--fcv-raise-2); }

/* ---------- body: rail + stage ---------- */
.fcv-body { flex: 1; display: flex; min-height: 0; }
.fcv-rail {
  flex: none; width: 92px; padding: 14px 10px calc(var(--fcv-dock-h) + 16px); overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px; border-right: 1px solid var(--fcv-line);
  scrollbar-width: thin;
}
.fcv-rail:empty { display: none; }
.fcv-rail-item {
  position: relative; width: 70px; height: 70px; border-radius: 12px; overflow: hidden; padding: 0; cursor: pointer;
  border: 1px solid var(--fcv-line-2); background: var(--fcv-raise);
}
.fcv-rail-item img, .fcv-rail-item video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.fcv-rail-item.current { border-color: var(--fcv-gold); box-shadow: 0 0 0 2px var(--fcv-gold-soft); }
.fcv-rail-item .fcv-rail-kind { position: absolute; left: 5px; bottom: 5px; font-size: 9px; letter-spacing: .06em; padding: 1px 5px; border-radius: 5px; background: rgba(9, 9, 15, .6); }

.fcv-stage {
  flex: 1; min-width: 0; overflow-y: auto; overflow-x: hidden;
  padding: 26px clamp(16px, 4vw, 48px) calc(var(--fcv-dock-h) + 28px);
  scroll-behavior: smooth;
}
.fcv-empty {
  min-height: calc(100% - 20px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px;
  color: var(--fcv-muted);
}
.fcv-empty.hidden { display: none; }
.fcv-empty-mark {
  width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font-family: Outfit, Inter, sans-serif; font-weight: 800; font-size: 28px; color: #1A1608;
  background: linear-gradient(140deg, var(--fcv-gold-2), var(--fcv-gold) 55%, #9C863C);
  box-shadow: 0 18px 60px rgba(217, 192, 108, .22);
}
.fcv-empty h1 { margin: 6px 0 0; font-family: Outfit, Inter, sans-serif; font-weight: 600; font-size: clamp(26px, 3.6vw, 40px); letter-spacing: -.03em; color: var(--fcv-text); }
.fcv-empty p { margin: 0; max-width: 520px; line-height: 1.55; }

/* ---------- batches and cards ---------- */
.fcv-batch { max-width: 1180px; margin: 0 auto 34px; }
.fcv-batch-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 0 2px 12px; color: var(--fcv-muted); font-size: 12.5px; }
.fcv-batch-head .fcv-batch-prompt { flex: 1 1 320px; min-width: 0; color: var(--fcv-text); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fcv-batch-head .fcv-batch-meta { white-space: nowrap; }
.fcv-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fcv-grid[data-count="1"] { grid-template-columns: minmax(0, 1fr); max-width: 920px; margin: 0 auto; }
.fcv-grid[data-count="3"] > .fcv-card:first-child { grid-column: 1 / -1; }

.fcv-card {
  position: relative; border-radius: var(--fcv-radius); overflow: hidden; background: var(--fcv-panel-solid);
  border: 1px solid var(--fcv-line); box-shadow: 0 14px 40px rgba(9, 9, 15, .35);
  animation: fcv-in .45s cubic-bezier(.2, .8, .2, 1) both;
}
.fcv-card.flash { box-shadow: 0 0 0 2px var(--fcv-gold), 0 14px 40px rgba(9, 9, 15, .35); }
.fcv-card-media { position: relative; aspect-ratio: var(--fcv-ar, 16 / 9); max-height: 62vh; max-height: 62dvh; width: 100%; background: #0C0C11; display: grid; place-items: center; overflow: hidden; }
.fcv-card-media img, .fcv-card-media video { width: 100%; height: 100%; object-fit: contain; display: block; background: #09090F; animation: fcv-reveal .6s ease both; }
.fcv-card-foot { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--fcv-line); min-height: 48px; }
.fcv-card-num { font-family: Outfit, Inter, sans-serif; font-weight: 600; letter-spacing: .08em; font-size: 11.5px; color: var(--fcv-gold); white-space: nowrap; }
.fcv-card-status { flex: 1; min-width: 0; color: var(--fcv-muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcv-card-status b { color: var(--fcv-text); font-weight: 600; }
.fcv-card.failed .fcv-card-status b { color: var(--fcv-danger); }
.fcv-card.done .fcv-card-status b { color: var(--fcv-ok); }
.fcv-card-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.fcv-act {
  border: 1px solid var(--fcv-line-2); background: var(--fcv-raise); color: var(--fcv-text); border-radius: 9px; padding: 6px 10px; font-size: 12.5px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.fcv-act:hover { background: var(--fcv-raise-2); }

/* Processing visual: indeterminate only - never a fabricated percentage. */
.fcv-proc { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 18px; text-align: center; overflow: hidden; }
.fcv-proc::before {
  content: ""; position: absolute; inset: -40%;
  background: conic-gradient(from 0deg, transparent 0 25%, rgba(217, 192, 108, .10) 32%, transparent 45%, rgba(148, 111, 211, .08) 70%, transparent 80%);
  animation: fcv-spin 14s linear infinite;
}
.fcv-proc::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(245, 245, 250, .055) 48%, transparent 66%);
  background-size: 220% 100%;
  animation: fcv-shimmer 2.8s ease-in-out infinite;
}
.fcv-wave { position: relative; z-index: 1; display: flex; align-items: center; gap: 4px; height: 38px; }
.fcv-wave i { display: block; width: 4px; height: 100%; border-radius: 4px; background: linear-gradient(180deg, var(--fcv-gold-2), var(--fcv-teal)); transform-origin: center; animation: fcv-bar 1.25s ease-in-out infinite; opacity: .9; }
.fcv-wave i:nth-child(2) { animation-delay: -.15s; } .fcv-wave i:nth-child(3) { animation-delay: -.3s; } .fcv-wave i:nth-child(4) { animation-delay: -.45s; }
.fcv-wave i:nth-child(5) { animation-delay: -.6s; } .fcv-wave i:nth-child(6) { animation-delay: -.75s; } .fcv-wave i:nth-child(7) { animation-delay: -.9s; }
.fcv-proc-title { position: relative; z-index: 1; font-family: Outfit, Inter, sans-serif; font-size: 16px; font-weight: 600; }
.fcv-proc-sub { position: relative; z-index: 1; max-width: 520px; color: var(--fcv-muted); font-size: 12.5px; line-height: 1.5; }
.fcv-proc.failed::before, .fcv-proc.failed::after { display: none; }
.fcv-proc.failed .fcv-proc-title { color: var(--fcv-danger); }

@keyframes fcv-in { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes fcv-reveal { from { opacity: 0; filter: blur(6px); } to { opacity: 1; filter: none; } }
@keyframes fcv-spin { to { transform: rotate(360deg); } }
@keyframes fcv-shimmer { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
@keyframes fcv-bar { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

/* ---------- composer dock ---------- */
.fcv-dock { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 16px max(16px, env(safe-area-inset-bottom)); pointer-events: none; z-index: 5; }
.fcv-dock::before { content: ""; position: absolute; inset: -40px 0 0; background: linear-gradient(180deg, transparent, rgba(9, 9, 15, .92) 45%); pointer-events: none; }
.fcv-composer {
  position: relative; pointer-events: auto; max-width: 1080px; margin: 0 auto; padding: 12px; border-radius: 20px;
  background: var(--fcv-panel); border: 1px solid var(--fcv-line-2);
  box-shadow: 0 24px 70px rgba(9, 9, 15, .5), inset 0 1px 0 rgba(245, 245, 250, .04);
  backdrop-filter: blur(14px);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.fcv-composer:focus-within { border-color: rgba(217, 192, 108, .45); box-shadow: 0 24px 70px rgba(9, 9, 15, .5), 0 0 0 4px rgba(217, 192, 108, .07); }
.fcv-row-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.fcv-model-btn {
  display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; padding: 7px 10px 7px 8px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--fcv-line-2); background: var(--fcv-raise);
}
.fcv-model-btn:hover, .fcv-model-btn[aria-expanded="true"] { border-color: rgba(217, 192, 108, .55); background: var(--fcv-gold-soft); }
.fcv-model-glyph { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(217, 192, 108, .16); color: var(--fcv-gold-2); font-size: 14px; flex: none; }
.fcv-model-text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; line-height: 1.15; }
.fcv-model-text small { font-size: 9.5px; letter-spacing: .12em; color: var(--fcv-faint); }
.fcv-model-text b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.fcv-kind { font-size: 9.5px; letter-spacing: .08em; padding: 2px 6px; border-radius: 6px; border: 1px solid; white-space: nowrap; }
.fcv-kind.video { color: #C9AEF7; border-color: rgba(201, 174, 247, .4); background: rgba(201, 174, 247, .1); }
.fcv-kind.image { color: #8fe3c4; border-color: rgba(143, 227, 196, .4); background: rgba(143, 227, 196, .1); }
.fcv-kind.owner-test { color: #E7D390; border-color: rgba(231, 211, 144, .45); background: rgba(231, 211, 144, .1); margin-left: 4px; }
.fcv-caret { width: 8px; height: 8px; border-right: 1.5px solid var(--fcv-muted); border-bottom: 1.5px solid var(--fcv-muted); transform: rotate(45deg) translate(-2px, -2px); margin: 0 4px; flex: none; }
.fcv-inputs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.fcv-slot {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 10px 0 4px; border-radius: 12px; border: 1px dashed var(--fcv-line-2);
  background: transparent; cursor: pointer; color: var(--fcv-muted); white-space: nowrap; max-width: 220px;
}
.fcv-slot:hover { border-color: var(--fcv-gold); color: var(--fcv-text); }
.fcv-slot.required { border-color: rgba(217, 192, 108, .6); color: var(--fcv-gold-2); }
.fcv-slot.filled { border-style: solid; color: var(--fcv-text); }
.fcv-slot-thumb { width: 36px; height: 36px; border-radius: 8px; background: var(--fcv-raise-2); display: grid; place-items: center; overflow: hidden; flex: none; font-size: 15px; }
.fcv-slot-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fcv-slot-label { overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.fcv-slot-x { border: 0; background: none; color: var(--fcv-muted); cursor: pointer; padding: 2px 4px; font-size: 15px; line-height: 1; }
.fcv-slot-x:hover { color: var(--fcv-danger); }
.fcv-refmgr-trigger {
  border-style: solid;
  border-color: rgba(217, 192, 108, .42);
  background: rgba(217, 192, 108, .075);
  color: var(--fcv-gold-2);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.fcv-refmgr-trigger:hover {
  border-color: var(--fcv-gold);
  background: rgba(217, 192, 108, .13);
  box-shadow: 0 0 0 3px rgba(217, 192, 108, .055);
}
.fcv-refmgr-trigger .fcv-slot-thumb {
  background: rgba(217, 192, 108, .14);
  color: var(--fcv-gold-2);
}


.fcv-prompt-wrap { position: relative; border-radius: 14px; background: rgba(9, 9, 15, .22); border: 1px solid var(--fcv-line); padding: 10px 12px 6px; }
.fcv-prompt {
  display: block; width: 100%; min-height: 48px; max-height: 30vh; resize: none; border: 0; outline: none; background: transparent;
  color: var(--fcv-text); font: inherit; font-size: 14.5px; line-height: 1.5;
}
.fcv-prompt::placeholder { color: var(--fcv-faint); }
.fcv-prompt-foot { display: flex; justify-content: space-between; gap: 10px; color: var(--fcv-faint); font-size: 11.5px; padding-top: 4px; }
.fcv-count.over { color: var(--fcv-danger); }

.fcv-row-bottom { display: flex; align-items: flex-end; gap: 12px; margin-top: 10px; }
.fcv-settings { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.fcv-group { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fcv-group-label { font-size: 11px; color: var(--fcv-muted); letter-spacing: .02em; white-space: nowrap; }
.fcv-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: rgba(9, 9, 15, .25); border: 1px solid var(--fcv-line); flex-wrap: wrap; }
.fcv-seg button {
  border: 0; background: none; padding: 5px 9px; border-radius: 7px; cursor: pointer; color: var(--fcv-muted); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums;
  transition: background .15s ease, color .15s ease;
}
.fcv-seg button:hover { color: var(--fcv-text); }
.fcv-seg button[aria-pressed="true"] { background: var(--fcv-gold-soft); color: var(--fcv-gold-2); box-shadow: inset 0 0 0 1px rgba(217, 192, 108, .45); }
.fcv-select, .fcv-number {
  background: rgba(9, 9, 15, .25); border: 1px solid var(--fcv-line); color: var(--fcv-text); border-radius: 10px; padding: 6px 8px; font: inherit; font-size: 12.5px; min-width: 76px;
}
.fcv-static { padding: 6px 2px; font-size: 12.5px; color: var(--fcv-text); white-space: nowrap; }
.fcv-switch { position: relative; width: 46px; height: 26px; border-radius: 26px; border: 1px solid var(--fcv-line-2); background: rgba(9, 9, 15, .3); cursor: pointer; padding: 0; }
.fcv-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--fcv-muted); transition: transform .18s ease, background .18s ease; }
.fcv-switch[aria-checked="true"] { background: var(--fcv-gold-soft); border-color: rgba(217, 192, 108, .55); }
.fcv-switch[aria-checked="true"]::after { transform: translateX(20px); background: var(--fcv-gold-2); }
.fcv-adv-btn { align-self: flex-end; }
.fcv-settings-toggle { display: none; }

.fcv-go { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.fcv-price { text-align: right; font-size: 12px; color: var(--fcv-muted); line-height: 1.35; max-width: 300px; font-variant-numeric: tabular-nums; }
.fcv-price b { color: var(--fcv-text); font-size: 15px; font-weight: 600; }
.fcv-price.warn { color: var(--fcv-danger); }
.fcv-generate {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer; border-radius: 13px; padding: 12px 20px; font-weight: 700; white-space: nowrap;
  color: #1A1608; background: linear-gradient(135deg, var(--fcv-gold-2), var(--fcv-gold) 55%, #B89D45);
  box-shadow: 0 10px 30px rgba(217, 192, 108, .25);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.fcv-generate:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 36px rgba(217, 192, 108, .32); }
.fcv-generate:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* ---------- popovers ---------- */
.fcv-pop {
  position: absolute; z-index: 30; width: min(440px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 140px)); max-height: min(560px, calc(100dvh - 140px)); display: flex; flex-direction: column;
  border-radius: 18px; background: var(--fcv-panel-solid); border: 1px solid var(--fcv-line-2); box-shadow: 0 30px 90px rgba(9, 9, 15, .6);
  animation: fcv-pop .16s ease-out both;
}
.fcv-pop.hidden { display: none; }
@keyframes fcv-pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.fcv-pop-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; font-weight: 600; }
.fcv-pop-close { border: 0; background: none; color: var(--fcv-muted); font-size: 20px; cursor: pointer; line-height: 1; padding: 2px 6px; border-radius: 8px; }
.fcv-pop-close:hover { color: var(--fcv-text); background: var(--fcv-raise); }
.fcv-search { margin: 0 14px 10px; display: block; width: calc(100% - 28px); box-sizing: border-box; padding: 9px 12px; border-radius: 11px; border: 1px solid var(--fcv-line-2); background: rgba(9, 9, 15, .3); color: var(--fcv-text); font: inherit; }
.fcv-search:focus { outline: none; border-color: rgba(217, 192, 108, .55); }
.fcv-pop-tabs { display: flex; gap: 6px; padding: 0 14px 10px; border-bottom: 1px solid var(--fcv-line); }
.fcv-pop-tabs button { border: 1px solid transparent; background: none; padding: 5px 12px; border-radius: 9px; cursor: pointer; color: var(--fcv-muted); font-size: 12px; letter-spacing: .06em; }
.fcv-pop-tabs button[aria-pressed="true"] { color: var(--fcv-gold-2); border-color: rgba(217, 192, 108, .45); background: var(--fcv-gold-soft); }
.fcv-model-list { overflow-y: auto; padding: 6px; scrollbar-width: thin; }
.fcv-model-group { font-size: 10.5px; letter-spacing: .12em; color: var(--fcv-faint); padding: 10px 10px 4px; }
.fcv-model-row {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 9px 10px; border-radius: 12px; border: 1px solid transparent; background: none; cursor: pointer;
  transition: background .12s ease;
}
.fcv-model-row:hover { background: var(--fcv-raise); }
.fcv-model-row[aria-selected="true"] { background: var(--fcv-gold-soft); border-color: rgba(217, 192, 108, .35); }
.fcv-model-row[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.fcv-model-row .fcv-model-glyph { width: 34px; height: 34px; }
/* the model's logo (css/model-logos.css) fills the glyph box: same size as before, no shift */
.fcv-model-glyph .fz-mlogo { width: 100%; height: 100%; border-radius: inherit; font-size: 11px; }
.fcv-model-glyph .fz-mlogo:not(.is-tile) img { width: 62%; height: 62%; }
.fcv-model-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fcv-model-name { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.fcv-model-name span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcv-model-desc { color: var(--fcv-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcv-check { width: 20px; height: 20px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 11px; color: #1A1608; background: var(--fcv-gold); visibility: hidden; }
.fcv-model-row[aria-selected="true"] .fcv-check { visibility: visible; }
.fcv-pop-empty { padding: 18px; color: var(--fcv-muted); text-align: center; }
.fcv-adv-body { padding: 4px 16px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.fcv-adv-body .fcv-note { color: var(--fcv-muted); font-size: 12px; line-height: 1.5; }

/* ---------- lightbox ---------- */
.fcv-lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(9, 9, 15, .92); display: flex; align-items: center; justify-content: center; padding: 56px 16px 16px; }
.fcv-lightbox.hidden { display: none; }
.fcv-lightbox img, .fcv-lightbox video { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: 0 30px 90px rgba(9, 9, 15, .6); }
.fcv-lightbox .fcv-pop-close { position: absolute; top: 12px; right: 14px; font-size: 28px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .fcv-rail { display: none; }
  .fcv-balance { display: none; }
}
@media (max-width: 720px) {
  .fcv-bar { gap: 8px; padding: 0 10px; height: 52px; }
  .fcv-brand b { display: none; }
  .fcv-tab { padding: 7px 9px; }
  .fcv-project-name { width: 110px; }
  .fcv-project .fcv-ghost { padding: 6px 9px; }
  .fcv-stage { padding: 16px 12px calc(var(--fcv-dock-h) + 20px); }
  .fcv-grid { grid-template-columns: minmax(0, 1fr); }
  .fcv-grid[data-count="3"] > .fcv-card:first-child { grid-column: auto; }
  .fcv-dock { padding: 0 8px max(8px, env(safe-area-inset-bottom)); }
  .fcv-composer { padding: 10px; border-radius: 18px; }
  .fcv-model-text b { max-width: 150px; }
  .fcv-row-bottom { align-items: center; gap: 8px; min-width: 0; }
  /* Settings become a small bottom sheet - the same controls, moved. */
  .fcv-settings-toggle { display: block; flex: 0 1 auto; min-width: 0; max-width: 34%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fcv-settings {
    position: fixed; left: 8px; right: 8px; bottom: calc(var(--fcv-dock-h) + 4px); z-index: 25; max-height: 52vh; max-height: 52dvh; overflow-y: auto;
    padding: 14px; border-radius: 18px; background: var(--fcv-panel-solid); border: 1px solid var(--fcv-line-2); box-shadow: 0 -10px 60px rgba(9, 9, 15, .55);
    display: none;
  }
  .fcv-settings.open { display: flex; }
  .fcv-go { flex: 1 1 auto; min-width: 0; flex-direction: row; align-items: center; justify-content: flex-end; gap: 8px; }
  .fcv-price { flex: 1 1 auto; min-width: 0; max-width: none; font-size: 11px; }
  .fcv-price b { font-size: 13.5px; }
  .fcv-generate { flex: none; padding: 11px 14px; }
  .fcv-pop { position: fixed; left: 8px !important; right: 8px; top: auto !important; bottom: 8px !important; width: auto; max-height: 72vh; max-height: 72dvh; }
}
@media (prefers-reduced-motion: reduce) {
  #farziCanvasView *, #farziCanvasView *::before, #farziCanvasView *::after { animation: none !important; transition: none !important; }
  .fcv-stage { scroll-behavior: auto; }
}
