/* Director — guided AI shoot studio. Full-bleed dark layout: center builder,
   right assistant, fixed bottom dock. Matches the app's cyan-on-dark theme. */

.dir-body {
  background:
    radial-gradient(1100px 640px at 82% -8%, rgba(0, 212, 255, 0.10), transparent 60%),
    radial-gradient(900px 560px at 6% 4%, rgba(157, 77, 255, 0.10), transparent 62%),
    #0a0a0f;
  color: var(--landing-text, #f6f7fb);
  min-height: 100vh;
}

.dir-body .site-shell { display: flex; flex-direction: column; min-height: 100vh; }

/* ---------------------------------------------------------------- stage */
.dir-stage {
  flex: 1;
  display: flex;
  gap: 22px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 22px 48px;
  box-sizing: border-box;
}

/* one clear action for the storyboard section */
.dir-action { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.dir-action-note { font-size: 0.9rem; color: var(--landing-text-soft, #b3b9c8); margin-right: auto; }

/* mode toggle */
.dir-mode { flex: 0 0 auto; display: inline-flex; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 999px; overflow: hidden; }
.dir-mode-btn { border: none; cursor: pointer; padding: 6px 14px; font-size: 0.8rem; font-weight: 700; background: transparent; color: var(--landing-text-soft, #b3b9c8); }
.dir-mode-btn.is-active { background: rgba(0, 212, 255, 0.16); color: #fff; }

/* plan review modal (manual mode) */
.dir-plan { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(6, 8, 12, 0.7); backdrop-filter: blur(4px); }
.dir-plan[hidden] { display: none; }
.dir-plan-card {
  width: min(720px, 94vw); max-height: 88vh; display: flex; flex-direction: column;
  border: 1px solid rgba(0, 212, 255, 0.22); border-radius: 18px;
  background: linear-gradient(180deg, rgba(18, 22, 32, 0.99), rgba(12, 14, 20, 0.99));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.dir-plan-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.dir-plan-title { font-weight: 700; font-size: 1.08rem; }
.dir-plan-x { border: none; background: transparent; color: var(--text-muted, #8a90a3); font-size: 1.4rem; cursor: pointer; line-height: 1; }
.dir-plan-refs { padding: 14px 18px 0; }
.dir-plan-refs-label, .dir-plan-shot-m { font-size: 0.72rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--text-muted, #8a90a3); }
.dir-plan-refs-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.dir-plan-ref { margin: 0; text-align: center; }
.dir-plan-ref img { width: 54px; height: 54px; object-fit: cover; border-radius: 9px; border: 1px solid rgba(255, 255, 255, 0.12); display: block; }
.dir-plan-ref .dir-plan-face { border-radius: 50%; border-color: rgba(0, 212, 255, 0.6); }
.dir-plan-ref figcaption { margin-top: 4px; font-size: 0.62rem; color: var(--text-muted, #8a90a3); }
.dir-plan-body { padding: 14px 18px; overflow-y: auto; }
.dir-plan-loading { padding: 30px; text-align: center; color: var(--landing-text-soft, #b3b9c8); }
.dir-plan-meta { font-size: 0.86rem; color: var(--landing-text-soft, #b3b9c8); margin-bottom: 14px; }
.dir-plan-meta strong { color: #dff6ff; }
.dir-plan-shot { border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 12px; padding: 11px 13px; margin-bottom: 9px; background: rgba(0, 0, 0, 0.22); }
.dir-plan-shot-h { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 0.9rem; margin-bottom: 5px; }
.dir-plan-shot-p { font-size: 0.83rem; line-height: 1.45; color: var(--landing-text-soft, #b3b9c8); }
.dir-plan-editnote { font-size: 0.76rem; color: var(--text-muted, #8a90a3); margin-bottom: 12px; }
.dir-plan-edit {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 54px;
  border-radius: 9px; border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.3); color: #eef4fb;
  padding: 8px 10px; font-size: 0.82rem; line-height: 1.4; font-family: inherit;
}
.dir-plan-edit:focus { outline: none; border-color: rgba(0, 212, 255, 0.6); }
.dir-plan-shot-m { margin-top: 5px; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text-muted, #8a90a3); }
.dir-plan-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid rgba(255, 255, 255, 0.08); }

/* saved sessions strip */
.dir-sessions-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.dir-sessions-label { font-size: 0.74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted, #8a90a3); flex: 0 0 auto; }
.dir-sessions { flex: 1; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.dir-sessions-empty { font-size: 0.8rem; color: var(--text-muted, #8a90a3); }
.dir-session {
  position: relative; flex: 0 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 26px 6px 6px; border-radius: 11px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(18, 21, 30, 0.7);
  color: var(--landing-text-soft, #b3b9c8); max-width: 220px;
}
.dir-session:hover { border-color: rgba(0, 212, 255, 0.4); color: #fff; }
.dir-session.is-active { border-color: rgba(0, 212, 255, 0.7); color: #fff; background: rgba(0, 212, 255, 0.08); }
.dir-session img, .dir-session-ph {
  width: 30px; height: 30px; border-radius: 7px; object-fit: cover; flex: 0 0 auto;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.06); font-size: 0.9rem;
}
.dir-session-title { font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dir-session-x {
  position: absolute; top: 3px; right: 5px; font-size: 14px; line-height: 1;
  color: var(--text-muted, #8a90a3); padding: 2px;
}
.dir-session-x:hover { color: var(--danger, #ff6d91); }

/* ---------------------------------------------------------------- center */
.dir-center { flex: 1; min-width: 0; }

.dir-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.dir-cat {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(18, 21, 30, 0.7);
  color: var(--landing-text-soft, #b3b9c8);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: border-color .18s, background .18s, color .18s, transform .18s;
}
.dir-cat:not([disabled]):hover { transform: translateY(-1px); border-color: rgba(0, 212, 255, 0.4); }
.dir-cat.is-active {
  color: #fff;
  border-color: rgba(0, 212, 255, 0.7);
  background: linear-gradient(180deg, rgba(0, 212, 255, 0.16), rgba(0, 212, 255, 0.06));
  box-shadow: 0 8px 26px rgba(0, 212, 255, 0.14);
}
.dir-cat[disabled] { opacity: 0.45; cursor: not-allowed; }
.dir-cat-ic { font-size: 1.05rem; }
.dir-cat-soon {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted, #8a90a3);
}

/* steps */
.dir-flow { display: flex; flex-direction: column; gap: 16px; }
.dir-step {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(16, 18, 26, 0.72);
  border-radius: 18px;
  padding: 18px;
}
.dir-step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.dir-step-num {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-weight: 700; font-size: 0.9rem;
  color: #001018;
  background: linear-gradient(135deg, #00d4ff, #8ff1ff);
}
.dir-step-title { font-weight: 700; font-size: 1.02rem; }
.dir-step-sub { font-size: 0.84rem; color: var(--landing-text-soft, #b3b9c8); }
.dir-step-count {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--landing-text-soft, #b3b9c8);
  white-space: nowrap;
}
.dir-step-count strong { color: #fff; }

/* garment example guide strip */
.dir-guide { margin-bottom: 14px; }
.dir-guide-cap {
  font-size: 0.82rem;
  color: var(--landing-text-soft, #b3b9c8);
  margin-bottom: 10px;
}
.dir-guide-cap strong { color: #dff6ff; }
.dir-guide-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.dir-guide-item { margin: 0; width: 78px; }
.dir-guide-item img {
  width: 78px;
  height: 78px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  display: block;
}
.dir-guide-item figcaption {
  margin-top: 4px;
  font-size: 0.62rem;
  line-height: 1.2;
  text-align: center;
  color: var(--text-muted, #8a90a3);
}
@media (max-width: 560px) {
  .dir-guide-row { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
  .dir-guide-item { scroll-snap-align: start; flex: 0 0 auto; }
}

/* upload grids */
.dir-upload-grid, .dir-face-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}
.dir-face-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }

.dir-upload-tile, .dir-face-upload {
  aspect-ratio: 1;
  border-radius: 13px;
  border: 1.5px dashed rgba(0, 212, 255, 0.4);
  background: rgba(0, 212, 255, 0.04);
  color: var(--landing-text-soft, #b3b9c8);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s;
}
.dir-upload-tile:hover, .dir-face-upload:hover { border-color: #00d4ff; background: rgba(0, 212, 255, 0.09); transform: translateY(-1px); }
.dir-upload-plus { font-size: 1.5rem; line-height: 1; color: #00d4ff; }
.dir-upload-hint { font-size: 0.72rem; }

.dir-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.dir-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dir-thumb-x, .dir-chip-x {
  position: absolute; top: 5px; right: 5px;
  width: 22px; height: 22px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(0, 0, 0, 0.62); color: #fff;
  font-size: 15px; line-height: 1; display: grid; place-items: center;
}
.dir-thumb-x:hover { background: var(--danger, #ff6d91); }

/* faces */
.dir-face-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 21, 30, 0.7);
  padding: 0; cursor: pointer;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.dir-face-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dir-face-tile:hover { transform: translateY(-2px); border-color: rgba(0, 212, 255, 0.5); }
.dir-face-tile.is-selected {
  border-color: #00d4ff;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.25), 0 10px 24px rgba(0, 212, 255, 0.2);
}
.dir-face-upload { border-radius: 50%; }
.dir-face-upload.has-img { background-size: cover; background-position: center; }
.dir-face-upload.has-img .dir-upload-plus, .dir-face-upload.has-img .dir-upload-hint { display: none; }
/* faces that failed to load (assets not generated yet) show a neutral avatar */
.dir-face-tile.is-missing { background: repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 8px, rgba(255,255,255,.02) 8px 16px); }
.dir-face-tile.is-missing img { opacity: 0; }

/* scene & style chips */
.dir-scene-label {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em;
  color: var(--landing-text-soft, #b3b9c8);
  margin: 4px 0 8px;
}
.dir-scene-label .dir-scene-opt { font-weight: 500; color: var(--text-muted, #8a90a3); }
.dir-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.dir-chip-opt {
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 21, 30, 0.7);
  color: var(--landing-text-soft, #b3b9c8);
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  transition: border-color .16s, background .16s, color .16s, transform .16s;
}
.dir-chip-opt:hover { transform: translateY(-1px); border-color: rgba(0, 212, 255, 0.4); color: #fff; }
.dir-chip-opt.is-active {
  color: #001018;
  border-color: transparent;
  background: linear-gradient(135deg, #00d4ff, #8ff1ff);
}
.dir-chip-opt.is-disabled, .dir-chip-opt:disabled {
  opacity: 0.32; cursor: not-allowed; transform: none;
}

/* compact output settings row */
.dir-out-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.dir-out-label { font-size: 0.74rem; font-weight: 700; color: var(--landing-text-soft, #b3b9c8); }
.dir-out-hint { font-size: 0.72rem; color: var(--text-muted, #8a90a3); }
.dir-chips-sm { margin: 0; gap: 5px; }
.dir-chips-sm .dir-chip-opt { padding: 5px 10px; font-size: 0.76rem; }
.dir-plan-time { display: inline-block; padding: 1px 7px; border-radius: 999px; background: rgba(120,110,255,0.16); color: #b9b2ff; font-size: 0.72rem; font-weight: 600; margin: 0 2px; }

/* Intro modal */
.dir-intro { position: fixed; inset: 0; z-index: 5000; display: flex; align-items: center; justify-content: center; background: rgba(6,6,12,0.86); backdrop-filter: blur(8px); padding: 20px; }
.dir-intro[hidden] { display: none; }
.dir-intro-card { position: relative; width: min(560px, 96vw); max-height: 92vh; overflow: hidden; display: flex; flex-direction: column; border-radius: 20px; background: #101018; border: 1px solid rgba(255,255,255,0.09); box-shadow: 0 30px 90px rgba(0,0,0,0.6); }
.dir-intro-x { position: absolute; top: 10px; right: 12px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(0,0,0,0.5); color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.dir-intro-x:hover { background: rgba(0,0,0,0.72); }
.dir-intro-media { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.dir-intro-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.dir-intro-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.dir-intro-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dir-intro-title { font-family: "DM Sans", sans-serif; font-weight: 700; font-size: 1.2rem; line-height: 1.25; letter-spacing: -0.01em; margin: 0; color: #fff; flex: 1 1 auto; min-width: 0; }
.dir-intro-sub { margin: 0; font-size: 0.9rem; line-height: 1.45; color: var(--landing-text-soft, #b3b9c8); }
.dir-intro-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 6px; flex-wrap: wrap; }
.dir-intro-check { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--landing-text-soft, #b3b9c8); cursor: pointer; }
.dir-intro-check input { width: 16px; height: 16px; accent-color: #00d4ff; cursor: pointer; }
.dir-intro-actions .dir-generate { flex: 0 0 auto; }
@media (max-width: 520px) {
  .dir-intro-title { font-size: 1.1rem; }
  .dir-intro-actions { flex-direction: column-reverse; align-items: stretch; }
  .dir-intro-actions .dir-generate { width: 100%; justify-content: center; }
  .dir-intro-check { justify-content: center; }
}

/* Processing overlay */
.dir-loader { position: fixed; inset: 0; z-index: 3800; display: flex; align-items: center; justify-content: center; background: rgba(8,8,16,0.72); backdrop-filter: blur(5px); }
.dir-loader[hidden] { display: none; }
.dir-loader-box { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 32px 40px; border-radius: 18px; background: rgba(20,20,32,0.9); border: 1px solid rgba(255,255,255,0.08); box-shadow: 0 24px 80px rgba(0,0,0,0.5); max-width: 440px; text-align: center; }
.dir-loader-spinner { width: 52px; height: 52px; border-radius: 50%; border: 4px solid rgba(255,255,255,0.12); border-top-color: #8f86ff; animation: dir-spin 0.9s linear infinite; }
@keyframes dir-spin { to { transform: rotate(360deg); } }
.dir-loader-msg { font-family: "Sora", sans-serif; font-weight: 700; font-size: 1.05rem; color: #fff; }
.dir-loader-sub { font-size: 0.84rem; color: #a7a3c0; line-height: 1.4; min-height: 0; }

/* Live elapsed timer inside the processing overlay */
.dir-loader-timer { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 2px; }
.dir-loader-timer[hidden] { display: none; }
.dir-loader-timer-label { font-size: 0.72rem; letter-spacing: 0.09em; text-transform: uppercase; color: #8f86ff; font-weight: 600; }
.dir-loader-timer-value { font-family: "Sora", sans-serif; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 2rem; line-height: 1; letter-spacing: 0.04em; color: #fff; }
.dir-loader-timer-note { font-size: 0.8rem; color: #a7a3c0; line-height: 1.4; max-width: 320px; }

/* Lightbox */
.dir-lightbox { position: fixed; inset: 0; z-index: 4000; display: flex; align-items: center; justify-content: center; background: rgba(6,6,12,0.9); backdrop-filter: blur(6px); padding: 24px; }
.dir-lightbox[hidden] { display: none; }
.dir-lightbox-body { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 96vw; max-height: 94vh; }
.dir-lightbox-media { max-width: 96vw; max-height: 88vh; border-radius: 12px; box-shadow: 0 20px 80px rgba(0,0,0,0.6); background: #000; }
.dir-lightbox-x { position: fixed; top: 18px; right: 22px; width: 42px; height: 42px; border-radius: 50%; border: none; background: rgba(255,255,255,0.12); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.dir-lightbox-x:hover { background: rgba(255,255,255,0.22); }
.dir-lightbox-foot { display: flex; gap: 12px; align-items: center; }
.dir-lightbox-link { color: #cfc9ff; text-decoration: none; font-size: 0.86rem; padding: 7px 14px; border-radius: 999px; background: rgba(120,110,255,0.18); }
.dir-lightbox-link:hover { background: rgba(120,110,255,0.3); }
.dir-sheet-item img { cursor: zoom-in; }
.dir-video-expand { cursor: pointer; }
.dir-select {
  border-radius: 9px; border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(18, 21, 30, 0.85); color: #fff;
  padding: 6px 9px; font-size: 0.78rem; font-family: inherit; cursor: pointer;
}
.dir-select:focus { outline: none; border-color: rgba(0, 212, 255, 0.6); }

/* storyboard sheet(s) — compact so several fit as the video gets longer */
.dir-sheet { margin: 6px 0 4px; display: flex; flex-wrap: wrap; gap: 14px; }
.dir-sheet-item { margin: 0; flex: 0 1 360px; max-width: 420px; }
.dir-sheet-item figcaption {
  font-size: 0.72rem; font-weight: 700; color: var(--landing-text-soft, #b3b9c8); margin-bottom: 6px;
}
.dir-sheet-item img {
  width: 100%; display: block; border-radius: 10px;
  border: 1px solid rgba(0, 212, 255, 0.25); background: #fff;
}
.dir-panels-label {
  font-size: 0.74rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  color: var(--text-muted, #8a90a3); margin: 18px 0 8px;
}

/* range */
.dir-range { width: 100%; accent-color: #00d4ff; height: 6px; cursor: pointer; }
.dir-range-scale { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--text-muted, #8a90a3); margin-top: 4px; }

/* ---------------------------------------------------------------- agent */
.dir-agent {
  flex: 0 0 336px;
  align-self: flex-start;
  position: sticky;
  top: 92px;
  border: 1px solid rgba(0, 212, 255, 0.18);
  background: linear-gradient(180deg, rgba(16, 20, 30, 0.94), rgba(12, 14, 20, 0.94));
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.4);
}
.dir-agent-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.dir-agent-id { display: flex; align-items: center; gap: 10px; }
.dir-agent-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.3rem;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.25), rgba(157, 77, 255, 0.25));
  border: 1px solid rgba(0, 212, 255, 0.3);
}
.dir-agent-name { font-weight: 700; font-size: 1rem; }
.dir-agent-role { font-size: 0.78rem; color: var(--landing-text-soft, #b3b9c8); }

.dir-lang { display: inline-flex; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 999px; overflow: hidden; }
.dir-lang-btn {
  border: none; cursor: pointer;
  padding: 6px 11px; font-size: 0.8rem; font-weight: 600;
  background: transparent; color: var(--landing-text-soft, #b3b9c8);
}
.dir-lang-btn.is-active { background: rgba(0, 212, 255, 0.16); color: #fff; }

.dir-agent-body {
  min-height: 150px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.28);
  padding: 15px;
  margin-bottom: 14px;
}
.dir-agent-bubble { font-size: 0.98rem; line-height: 1.55; color: #eef4fb; }

.dir-agent-controls { display: flex; gap: 8px; }
.dir-agent-ctrl {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--landing-text, #f6f7fb);
  border-radius: 11px; padding: 9px; cursor: pointer; font-weight: 600; font-size: 0.85rem;
  transition: border-color .18s, background .18s;
}
.dir-agent-ctrl:hover { border-color: rgba(0, 212, 255, 0.4); }
.dir-agent-ctrl.is-on { border-color: var(--warning, #ffbf69); color: var(--warning, #ffbf69); }

/* garment thumb tag + uploading state */
.dir-thumb-tag {
  position: absolute; left: 5px; bottom: 5px;
  font-size: 0.6rem; font-weight: 700;
  padding: 2px 6px; border-radius: 6px;
  background: rgba(0, 0, 0, 0.6); color: #dff6ff;
}
.dir-thumb.is-uploading::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(10, 12, 18, 0.5) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24'><circle cx='12' cy='12' r='9' fill='none' stroke='%2300d4ff' stroke-width='2.5' stroke-dasharray='40' stroke-linecap='round'/></svg>") center/28px no-repeat;
  animation: dirSpin 0.9s linear infinite;
}
@keyframes dirSpin { to { transform: rotate(360deg); } }

/* face checking state */
.dir-face-tile.is-checking { opacity: 0.55; }
.dir-face-tile.is-checking::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid rgba(0,212,255,0.35); border-top-color: #00d4ff;
  animation: dirSpin 0.8s linear infinite;
}

/* ---------------------------------------------------------------- results */
.dir-results {
  margin-top: 20px;
  border: 1px solid rgba(0, 212, 255, 0.18);
  background: rgba(14, 18, 26, 0.7);
  border-radius: 18px;
  padding: 18px;
}
.dir-results-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.dir-frames {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.dir-frame { margin: 0; }
.dir-frame-media {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid; place-items: center;
}
.dir-frame-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dir-frame.is-done .dir-frame-media { border-color: rgba(0, 212, 255, 0.4); }
.dir-frame.is-skipped .dir-frame-media { border-color: rgba(255, 109, 145, 0.5); }
.dir-frame-spin {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid rgba(0, 212, 255, 0.25); border-top-color: #00d4ff;
  animation: dirSpin 0.8s linear infinite;
}
.dir-frame-skip { font-size: 0.78rem; color: var(--danger, #ff6d91); font-weight: 600; }
.dir-frame figcaption {
  margin-top: 6px; font-size: 0.74rem; line-height: 1.25;
  color: var(--landing-text-soft, #b3b9c8);
  display: flex; align-items: baseline; gap: 6px;
}
.dir-frame-n {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%;
  display: inline-grid; place-items: center; font-size: 0.64rem; font-weight: 700;
  color: #001018; background: linear-gradient(135deg, #00d4ff, #8ff1ff);
}
/* per-frame edit control — only shown once the frame has rendered */
.dir-frame-edit { display: none; margin-top: 6px; gap: 6px; }
.dir-frame.is-done .dir-frame-edit { display: flex; }
.dir-frame-note {
  flex: 1; min-width: 0;
  border-radius: 9px; border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.32); color: #fff;
  padding: 6px 9px; font-size: 0.72rem; font-family: inherit;
}
.dir-frame-note:focus { outline: none; border-color: rgba(0, 212, 255, 0.6); }
.dir-frame-note::placeholder { color: var(--text-muted, #8a90a3); }
.dir-frame-redo {
  flex: 0 0 auto; width: 30px; border-radius: 9px; cursor: pointer;
  border: 1px solid rgba(0, 212, 255, 0.3); background: rgba(0, 212, 255, 0.1); color: #00d4ff;
  font-size: 0.95rem; line-height: 1;
}
.dir-frame-redo:hover { background: rgba(0, 212, 255, 0.2); }
.dir-frame-redo:disabled { opacity: 0.5; cursor: default; }

/* render bar + final video */
.dir-render-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.dir-render-model { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dir-render-model .dir-chips { margin: 0; }
.dir-render-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.dir-music-toggle { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 0 4px; padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 0.78rem; font-weight: 600; white-space: nowrap; flex: 0 0 auto; border: 1px solid rgba(120,110,255,0.4); background: rgba(120,110,255,0.16); color: #cfc9ff; }
.dir-music-toggle .dir-music-label, .dir-music-toggle .dir-music-ico { white-space: nowrap; flex: 0 0 auto; }
.dir-music-toggle.is-off { border-color: rgba(255,255,255,0.14); background: transparent; color: #8a8a99; }
.dir-music-toggle.is-off .dir-music-ico { opacity: 0.5; }
.dir-cost-badge { display: inline-flex; align-items: center; margin-left: 8px; padding: 2px 9px; border-radius: 999px; background: rgba(0,0,0,0.22); font-size: 0.76rem; font-weight: 700; white-space: nowrap; }
.dir-ghost {
  border: 1px solid rgba(255, 255, 255, 0.14); background: transparent;
  color: var(--landing-text, #f6f7fb); border-radius: 11px; padding: 9px 14px;
  font-weight: 600; font-size: 0.85rem; cursor: pointer; text-decoration: none;
}
.dir-ghost:hover { border-color: rgba(0, 212, 255, 0.4); }
.dir-frame.is-clip .dir-frame-media { box-shadow: inset 0 0 0 2px rgba(0, 212, 255, 0.55); }

.dir-video { margin-top: 16px; }
.dir-video-status {
  padding: 22px; text-align: center; border-radius: 12px;
  border: 1px dashed rgba(0, 212, 255, 0.3); color: var(--landing-text-soft, #b3b9c8);
  background: rgba(0, 212, 255, 0.04);
}
.dir-video-player {
  width: 100%; max-width: 340px; display: block; margin: 0 auto;
  border-radius: 14px; border: 1px solid rgba(0, 212, 255, 0.3); background: #000;
}
.dir-video-actions { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; }
.dir-video-meta { font-size: 0.8rem; color: var(--text-muted, #8a90a3); }

/* ---------------------------------------------------------------- dock */
.dir-dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  background: linear-gradient(180deg, rgba(10, 10, 15, 0.5), rgba(10, 10, 15, 0.94) 34%);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(0, 212, 255, 0.16);
  padding: 14px 22px 16px;
}
.dir-dock-inner {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

/* model */
.dir-model { position: relative; flex: 0 0 auto; }
.dir-model-btn {
  display: flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 13px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 21, 30, 0.85);
  color: #fff; cursor: pointer; font-weight: 600;
}
.dir-model-btn:hover { border-color: rgba(0, 212, 255, 0.4); }
.dir-model-logo { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; }
.dir-model-caret { color: var(--text-muted, #8a90a3); font-size: 0.75rem; }
.dir-model-menu {
  position: absolute; bottom: calc(100% + 8px); left: 0;
  min-width: 180px;
  background: rgba(18, 21, 30, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px; padding: 6px; box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}
.dir-model-opt {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 10px; border-radius: 9px; border: none; cursor: pointer;
  background: transparent; color: #fff; font-weight: 600; text-align: left;
}
.dir-model-opt.is-active, .dir-model-opt:hover { background: rgba(0, 212, 255, 0.12); }

/* prompt */
.dir-prompt-wrap { flex: 1; min-width: 0; }
.dir-prompt {
  width: 100%;
  min-height: 48px;
  max-height: 160px;
  resize: none;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.34);
  color: #fff;
  padding: 13px 15px;
  font-size: 0.98rem;
  line-height: 1.4;
  font-family: inherit;
  box-sizing: border-box;
}
.dir-prompt:focus { outline: none; border-color: rgba(0, 212, 255, 0.6); box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.14); }
.dir-prompt::placeholder { color: var(--text-muted, #8a90a3); }

/* attachments */
.dir-attach { display: flex; gap: 6px; flex: 0 0 auto; }
.dir-attach-btn {
  width: 52px; height: 48px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 21, 30, 0.85);
  color: var(--landing-text-soft, #b3b9c8);
  cursor: pointer; transition: border-color .18s, color .18s, transform .18s;
}
.dir-attach-btn:hover { border-color: rgba(0, 212, 255, 0.4); color: #fff; transform: translateY(-1px); }
.dir-attach-ic { font-size: 1rem; line-height: 1; }
.dir-attach-lbl { font-size: 0.62rem; font-weight: 600; }

/* generate */
.dir-generate {
  flex: 0 0 auto;
  min-height: 48px; padding: 8px 22px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 13px; cursor: pointer;
  font-weight: 700; font-size: 0.98rem; color: #001018;
  white-space: nowrap;
  background: linear-gradient(135deg, #00d4ff, #7af0d0);
  box-shadow: 0 10px 30px rgba(0, 212, 255, 0.28);
  transition: transform .18s, box-shadow .18s, opacity .18s;
}
.dir-generate > span { white-space: nowrap; }
.dir-generate-star { flex: 0 0 auto; }
.dir-cost-badge { flex: 0 0 auto; }
.dir-generate:hover { transform: translateY(-1px); box-shadow: 0 14px 38px rgba(0, 212, 255, 0.36); }
.dir-generate.is-busy { opacity: 0.75; pointer-events: none; }
.dir-generate-star { font-size: 1.05rem; }

/* attach chips strip */
.dir-attach-strip { display: flex; flex-wrap: wrap; gap: 7px; max-width: 1400px; margin: 10px auto 0; }
.dir-chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 26px 5px 11px;
  border-radius: 999px;
  font-size: 0.78rem; font-weight: 600;
  border: 1px solid rgba(0, 212, 255, 0.28);
  background: rgba(0, 212, 255, 0.08);
  color: #dff6ff;
}
.dir-chip-x { position: static; margin-left: 2px; width: 18px; height: 18px; background: rgba(255,255,255,0.12); font-size: 13px; }
.dir-chip-x:hover { background: var(--danger, #ff6d91); }

/* validation flash */
.dir-flash { animation: dirFlash 0.9s ease; }
@keyframes dirFlash {
  0%, 100% { box-shadow: none; }
  30% { box-shadow: 0 0 0 3px rgba(255, 109, 145, 0.5); border-color: var(--danger, #ff6d91) !important; }
}

/* simplified dock (just a note + Generate) */
.dir-dock-simple .dir-dock-inner { align-items: center; justify-content: space-between; }
.dir-dock-note { font-size: 0.9rem; color: var(--landing-text-soft, #b3b9c8); }
.dir-generate:disabled { opacity: 0.45; pointer-events: none; box-shadow: none; }

/* confirm modal */
.dir-confirm {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background: rgba(6, 8, 12, 0.66); backdrop-filter: blur(4px);
}
.dir-confirm[hidden] { display: none; }
.dir-confirm-card {
  width: min(440px, 92vw);
  border: 1px solid rgba(0, 212, 255, 0.22);
  background: linear-gradient(180deg, rgba(18, 22, 32, 0.98), rgba(12, 14, 20, 0.98));
  border-radius: 18px; padding: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
.dir-confirm-title { font-weight: 700; font-size: 1.12rem; margin-bottom: 10px; }
.dir-confirm-body { font-size: 0.92rem; line-height: 1.5; color: var(--landing-text-soft, #b3b9c8); margin-bottom: 20px; }
.dir-confirm-body strong { color: #dff6ff; }
.dir-confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
.dir-confirm-cancel, .dir-confirm-go {
  border-radius: 11px; padding: 10px 18px; font-weight: 700; cursor: pointer; font-size: 0.9rem;
}
.dir-confirm-cancel { border: 1px solid rgba(255,255,255,0.14); background: transparent; color: var(--landing-text, #f6f7fb); }
.dir-confirm-go { border: none; color: #001018; background: linear-gradient(135deg, #00d4ff, #7af0d0); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .dir-stage { flex-direction: column; padding-bottom: 240px; }
  .dir-agent { flex-basis: auto; width: 100%; position: static; order: -1; }
  .dir-dock-inner { flex-wrap: wrap; }
  .dir-prompt-wrap { order: 5; flex-basis: 100%; }
  .dir-model { order: 1; }
  .dir-attach { order: 2; flex: 1; }
  .dir-generate { order: 3; }
}

/* ============================================================= Easy / Advance */
.dir-body.dir-mode-easy .dir-adv-only { display: none !important; }
.dir-body.dir-mode-advance .dir-easy-only { display: none !important; }
/* Easy mode: step 1 is gone, so drop the number badges for a clean compact look */
.dir-body.dir-mode-easy .dir-step-num { display: none; }
.dir-body.dir-mode-easy #dirRenderBar { display: none !important; }
/* Easy mode: leave room for the fixed action bar */
.dir-body.dir-mode-easy .dir-stage { padding-bottom: 108px; }

/* Video config — each group (model / resolution / aspect / music) on its own row */
.dir-render-model { display: flex; flex-direction: column; align-items: stretch; gap: 12px; margin: 0; }
.dir-vrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dir-vrow > .dir-scene-label { flex: 0 0 96px; min-width: 96px; margin: 0; }
.dir-vrow > .dir-chips { margin: 0; flex: 1 1 auto; }
#dirVideoConfigSlot .dir-render-model { margin: 0; }

/* Sticky bottom action (Easy) */
.dir-sticky-gen {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 3600;
  display: flex; align-items: center; gap: 14px; padding: 11px 18px;
  background: rgba(12, 12, 20, 0.95); backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.dir-sticky-gen[hidden] { display: none; }
.dir-sticky-note { font-size: 0.84rem; color: var(--landing-text-soft, #b3b9c8); margin-right: auto; line-height: 1.3; }
.dir-sticky-gen .dir-generate { flex: 0 0 auto; margin: 0; }
.dir-generate:disabled { opacity: 0.5; cursor: not-allowed; }
.dir-generate.is-short { background: linear-gradient(90deg, #d98a2b, #c9701f); }
/* Desktop: contain the sticky action bar to the content column (max 1200px,
   centered) instead of spanning the full viewport. Centre with left:50% +
   translateX so it never over-constrains against the base left:0/right:0 (which
   some browsers resolve to a left-pinned bar → asymmetric gaps). Mobile (≤720px)
   keeps the edge-to-edge bar — untouched. */
@media (min-width: 721px) {
  .dir-sticky-gen {
    /* Match the content CARDS, not the viewport: the stage is max 1200px with
       22px side padding, so the visible cards span (1200 − 44)px. Size + centre
       the bar to that exact box (% + left:50% resolve against the same ICB the
       cards are centred in, so they align at every width — no overhang). */
    left: 50%; right: auto; transform: translateX(-50%);
    width: calc(100% - 44px); max-width: calc(1200px - 44px); margin: 0;
    padding: 11px 20px; box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px 14px 0 0;
  }
}
/* A dimmed/unaffordable option */
.dir-chip-opt.is-unaffordable { opacity: 0.34; cursor: not-allowed; position: relative; }

/* ============================================================= Mobile / compact */
@media (max-width: 720px) {
  .dir-stage { padding: 12px 12px 48px; gap: 14px; }
  .dir-body.dir-mode-easy .dir-stage { padding-bottom: 118px; }
  .dir-sessions-bar { flex-wrap: wrap; gap: 8px 10px; }
  .dir-mode { margin-left: auto; }               /* label ....... Easy/Advance on row 1 */
  .dir-sessions { flex: 1 1 100%; order: 3; min-width: 0; }  /* session chips on their own scroll row */
  .dir-cats { gap: 8px; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .dir-cat { flex: 0 0 auto; }
  .dir-step { padding: 14px; }
  .dir-step-head { gap: 8px; }
  .dir-step-title { font-size: 0.98rem; }
  .dir-step-sub { font-size: 0.78rem; }
  .dir-out-row { flex-wrap: wrap; gap: 8px; }
  .dir-chips { gap: 8px; }
  /* Chips grow to fill each row — no empty right gap, symmetric layout */
  .dir-chip-opt { padding: 8px 10px; font-size: 0.8rem; flex: 1 1 auto; justify-content: center; text-align: center; }
  .dir-chips-sm .dir-chip-opt { flex: 1 1 auto; }
  .dir-render-model, .dir-render-actions { flex-wrap: wrap; gap: 8px; }
  .dir-render-model .dir-chips { flex: 1 1 100%; }
  .dir-render-bar { gap: 10px; }
  .dir-action { flex-wrap: wrap; gap: 8px; }
  .dir-action-note { flex-basis: 100%; margin: 0; }
  .dir-action .dir-ghost { flex: 1 1 0; justify-content: center; }
  /* Both primary actions span full width on narrow screens for consistency */
  .dir-action .dir-generate,
  .dir-render-actions .dir-generate { flex: 1 1 100%; justify-content: center; order: 3; }
  .dir-render-actions .dir-ghost { flex: 1 1 0; justify-content: center; }
  .dir-sticky-gen { padding: 10px 12px; gap: 10px; }
  .dir-sticky-gen .dir-generate { flex: 1 1 auto; justify-content: center; }
  .dir-sticky-note { flex-basis: 100%; margin: 0 0 2px; }
  /* Stack the storyboard header so the count doesn't leave an empty right block */
  .dir-results-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .dir-plan-card, .dir-confirm-card { width: 96vw; max-height: 90vh; }
  .dir-loader-box { margin: 0 16px; padding: 26px 22px; }
  .dir-lightbox-x { top: 10px; right: 12px; }
}
@media (max-width: 420px) {
  .dir-face-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
  .dir-upload-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .dir-generate { padding: 10px 14px; font-size: 0.9rem; }
  .dir-cost-badge { margin-left: 6px; }
}
