body{font-size:14px}button,a{transition:background .18s,border-color .18s}button:focus-visible,a:focus-visible{outline:3px solid #b7b1fb;outline-offset:3px}h1{font-size:27px;letter-spacing:-.8px;margin-bottom:8px;font-weight:650}h2{font-size:17px;letter-spacing:-.3px}h3{font-size:15px}p{line-height:1.65}.app{grid-template-columns:244px minmax(0,1fr)}.sidebar{background:#171d2b;color:#c0c5d2;padding:32px 20px 22px;display:flex;flex-direction:column}.brand{display:flex;align-items:center;gap:9px;color:#fff;font-size:17px;white-space:nowrap;font-weight:650;letter-spacing:-.5px}.brand-mark{background:#8f85f0;color:#fff;border-radius:9px;width:30px;height:30px;display:grid;place-items:center;font-size:25px}.brand-caption{font-size:8px;letter-spacing:2px;margin:9px 0 20px 39px;color:#828b9e}.section-title{font-size:10px;letter-spacing:1.3px;color:#8891a3;margin:28px 10px 12px;font-weight:650;display:flex;justify-content:space-between}.nav-home{border:0;text-align:left;padding:12px;background:#292e41;color:#eceafc;border-radius:7px;font-size:13px;cursor:pointer}.sidebar-search{background:#202637!important;border-color:#353b4b!important;color:#eee!important;font-size:12px!important;margin-bottom:10px}.project-list{overflow:auto;min-height:70px;flex:1}.project-item{flex-shrink:0;color:#a8b0bf;padding:11px 12px;border-radius:7px;line-height:1.8;overflow-wrap:anywhere}.project-item b{font-size:12px;font-weight:500}.project-item .small{font-size:10px;color:#7f899c}.project-item:hover,.project-item.active{background:#2a2d45;color:#e6e1ff;border-color:#3d3c5b}.sidebar-bottom{padding-top:20px}.local-note{font-size:11px;padding:14px 10px;border-top:1px solid #313746}.local-note small{display:block;color:#7f899c;font-size:10px;margin:8px 0 0 12px}.status-dot{display:inline-block;background:#75bc9d;width:5px;height:5px;border-radius:50%;margin-right:5px}.sidebar .btn:not(.primary){background:#242b3b;color:#c0c6d4;border-color:#343b4c;font-size:12px}.footer{position:static;font-size:10px;margin:12px 4px 0;color:#7f899c}.main{max-width:1800px;padding:35px 42px 40px}.topbar{margin-bottom:30px;min-height:70px}.eyebrow{font-size:9px;letter-spacing:1.8px;color:var(--muted);font-weight:650;margin-bottom:12px}.topbar .muted{font-size:12px}.toolbar{justify-content:flex-start;flex-wrap:wrap}.btn{display:inline-flex;justify-content:center;align-items:center;gap:10px;background:#fff;border-radius:7px;padding:10px 15px;color:#4e5666;font-size:12px;font-weight:550;min-height:37px}.btn:hover:not(:disabled){background:#f4f2ff;border-color:#c9c3f3;filter:none}.btn.primary,.btn.good{background:var(--accent);color:#fff;border-color:var(--accent);box-shadow:0 3px 6px #635bdf12}.btn.primary:hover:not(:disabled),.btn.good:hover:not(:disabled){background:#5148c9}.hero{border:1px solid #e4e1ef;border-radius:13px;background:#efedf7;min-height:322px;display:grid;grid-template-columns:1.1fr 1fr;overflow:hidden;position:relative;padding:0}.hero-copy{padding:36px 38px;z-index:1}.hero .eyebrow{color:#817799;font-size:9px}.hero h2{font-size:40px;line-height:1.16;letter-spacing:-1.6px;font-weight:650;margin:18px 0}.hero p{color:#7d788b;font-size:13px;max-width:360px;margin-bottom:22px}.hero-note{font-size:10px;color:#9890a7;margin-top:12px}.film-art{position:relative;display:grid;place-items:center;min-height:300px;background:radial-gradient(ellipse at center,#d7d0ec,transparent 70%)}.frame{width:280px;height:215px;background:#faf9fe;border:1px solid #fff;border-radius:9px;box-shadow:0 14px 35px #4a386528;position:absolute;padding:13px}.frame-back{transform:rotate(11deg) translate(13px,-12px);background:#d4cee3;border:6px solid #e8e3f0}.frame-front{transform:rotate(-6deg)}.frame-label,.frame-bottom{display:flex;justify-content:space-between;font-size:6px;letter-spacing:1px;color:#8e859f;margin:2px 0 12px}.frame-bottom{margin-top:12px}.frame-landscape{background:linear-gradient(#aba7c6,#d6c7ca 65%,#ceaf9e);height:151px;overflow:hidden;position:relative;border-radius:4px}.sun{width:35px;height:35px;background:#e9d9ce;border-radius:50%;position:absolute;right:48px;top:23px}.mountain{position:absolute;background:#555972;width:270px;height:155px;transform:rotate(35deg);left:75px;top:93px;border-radius:15px}.mountain-back{background:#9291a6;left:-97px;top:82px;transform:rotate(47deg)}.play-symbol{position:absolute;left:43%;top:35%;background:#ffffff22;color:white;border:1px solid #ffffff50;border-radius:50%;width:43px;height:43px;display:grid;place-items:center;font-size:26px;backdrop-filter:blur(4px)}.art-caption{position:absolute;bottom:25px;font-size:7px;letter-spacing:2px;color:#93899f}.library-heading{margin:30px 0 17px}.library-heading h2{margin-bottom:5px}.library-heading p{margin:0}.pill{font-size:10px;white-space:nowrap;border-radius:5px;background:#f5f5f8;color:#7c8090}.project-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.project-card{padding:0;text-align:left;border:1px solid var(--line);border-radius:10px;background:#fff;overflow:hidden;color:var(--text);cursor:pointer}.project-card:hover{border-color:#b6aee7;box-shadow:0 5px 16px #27213b0a}.project-cover{height:106px;background:#eae8f3;display:flex;align-items:center;justify-content:space-between;padding:22px;color:#8e83ac}.project-cover.cover-1{background:#e5efec;color:#729c8d}.project-cover.cover-2{background:#f0e9e3;color:#ab9181}.cover-glyph{font-size:40px;font-weight:200}.cover-label{font-size:8px;letter-spacing:2px}.project-card-body{padding:17px}.project-card h3{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0 0 9px;font-size:14px}.project-card p{font-size:11px;color:var(--muted);margin:0 0 16px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:36px}.project-card-footer{display:flex;justify-content:space-between;align-items:center;font-size:10px;color:var(--muted)}.guide-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:30px;margin-top:32px;padding:25px 0;border-top:1px solid var(--line)}.guide-grid span{font-size:8px;letter-spacing:1.2px;color:#9890ad}.guide-grid h3{font-size:13px;margin:12px 0 7px}.guide-grid p{font-size:11px;color:var(--muted);margin:0;max-width:270px}.card{border-radius:10px;padding:23px;margin-bottom:20px}.grid{gap:20px}.grid.two{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.workspace-tabs{display:flex;gap:26px;border-bottom:1px solid var(--line);margin-bottom:24px;overflow:auto}.workspace-tabs button{border:0;background:transparent;white-space:nowrap;color:var(--muted);padding:0 0 15px;font-size:12px;border-bottom:2px solid transparent;cursor:pointer}.workspace-tabs button.active{color:var(--accent);border-color:var(--accent);font-weight:650}.metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:15px;margin-bottom:22px}.metric{padding:18px;background:#fff;border:1px solid var(--line);border-radius:9px}.metric span{font-size:11px;color:var(--muted)}.metric strong{display:block;font-size:25px;letter-spacing:-1px;margin:10px 0 5px;font-weight:600}.metric small{font-size:10px;color:var(--muted)}.workflow{margin-top:18px;flex-wrap:nowrap}.step{justify-content:center;flex:1;background:#fafbfc;color:#707989;padding:12px 8px;border-radius:7px;font-size:11px;white-space:nowrap}.step b{width:22px;height:22px;border-radius:50%;background:#eaeef3;font-size:10px}.step.completed{background:#f0f7f4;border-color:#d9e9e2;color:#45836d;box-shadow:none}.step.completed b{background:#dcefe5;color:#45836d}.step.completed span{color:#45836d}.step:hover{background:#f4f2ff}.step.generating{border-color:var(--accent);color:var(--accent);box-shadow:none;animation:none}.step.current{border-color:#b9b1ef;background:#f4f2ff;color:var(--accent)}.step-arrow{font-size:12px;color:#b4bac6}.step-badge{font-size:10px}.next-step{font-size:12px;color:#7a7290;margin-top:20px;padding-top:16px;border-top:1px solid #f0edf6;line-height:1.6}.message{font-size:12px;padding:12px 16px;background:#efedf9;border:1px solid #e1dcf6;border-radius:7px;margin:0 0 20px;overflow-wrap:anywhere}.message:empty{display:none}.pre{font-size:13px;line-height:1.85;max-height:360px}.item{padding:15px 0;line-height:1.7}.item b{font-size:13px}.shot-filters{display:flex;gap:10px;margin:18px 0}.shot-filters input{flex:2}.shot-filters select{flex:1;min-width:0}.shots{gap:18px}.shot{border-radius:9px;padding:20px}.shot-title{font-weight:650;font-size:14px}.shot-meta{font-size:11px;margin-top:6px}.shot-grid{grid-template-columns:minmax(0,1.45fr) minmax(0,1fr);gap:25px;margin-top:20px}.prompt{background:#f7f7fb;border:1px solid #eae9f1;border-radius:7px;padding:15px;line-height:1.8;font-size:12px;color:#5b5972;margin-top:7px}.video-box{border:1px dashed #d9d4e9;border-radius:9px;background:#fcfbfe;padding:20px;justify-content:center;gap:14px;min-width:0}.video-ok{overflow-wrap:anywhere;font-size:12px}.video-missing{color:var(--muted);font-size:13px}.video-box input{font-size:11px;padding:8px;background:#fff}.shot .toolbar{align-items:flex-start}.shot .btn{font-size:11px;padding:8px 10px}.veo-check-label{font-size:10px;padding:6px}.pill-veo-done{background:#edf7f2;color:var(--good)}input,textarea,select{border-radius:6px;background:#fff;padding:10px 12px;color:var(--text);outline:none;font-size:12px}input:focus,textarea:focus,select:focus{border-color:#a59cde;box-shadow:0 0 0 3px #635bdf10}textarea{min-height:115px}label{font-size:12px;color:#646c7a;margin:14px 0}dialog{border-radius:14px;background:#fff;width:min(570px,94vw);padding:28px;max-height:90vh;overflow:auto;box-shadow:0 24px 100px #10182733}dialog::backdrop{background:#17203380;backdrop-filter:blur(4px)}.dialog-form h2{font-size:23px}.wide-dialog{width:min(920px,95vw)}.providers-layout{grid-template-columns:210px minmax(0,1fr);gap:25px}.provider-nav-btn{padding:11px;background:#fafbfc}.provider-nav-btn.active{background:#f1effa;border-color:#c6bfee}.provider-nav-btn b{font-size:12px}.provider-nav-btn .tag{font-size:10px;margin-top:6px}.presets-bar{background:#f6f7fa;padding:10px}.preset-btn{font-size:10px;padding:6px 8px;min-height:28px}.provider-selector-wrap{background:transparent;border:0;padding:0}.provider-dropdown{max-width:220px}.form-error{color:var(--danger);font-size:12px}.output-box{padding:18px;background:#f0f7f4;border:1px solid #d9e9e2;border-radius:8px;margin-top:16px}.empty-placeholder{padding:30px;text-align:center;color:var(--muted);font-size:13px;line-height:1.8;border:1px dashed var(--line);border-radius:9px;grid-column:1/-1}
@media(min-width:1550px){.hero{min-height:360px}.hero-copy{padding:45px}.hero h2{font-size:48px}}
@media(max-width:1200px){.app{grid-template-columns:215px minmax(0,1fr)}.sidebar{padding:28px 14px}.brand{font-size:15px}.main{padding:28px}.topbar{align-items:flex-start}.topbar .toolbar{justify-content:flex-end}.hero h2{font-size:33px}.hero-copy{padding:28px}.frame{width:225px}.project-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.workflow{flex-wrap:wrap}.step{flex:1 0 130px}.step-arrow{display:none}.shot-grid{grid-template-columns:1fr}.provider-dropdown{max-width:160px}}
@media(max-width:800px){.app{grid-template-columns:1fr}.sidebar{position:relative;height:auto;padding:16px 20px;display:grid;grid-template-columns:1fr auto;gap:10px}.brand-caption,.sidebar .section-title,.sidebar-search,.project-list,.local-note,.footer{display:none}.sidebar .full{margin:0}.sidebar-bottom{padding:0}.nav-home{font-size:11px}.main{padding:22px 18px}.topbar{flex-direction:column;gap:16px}.topbar .toolbar{justify-content:flex-start}.hero{grid-template-columns:1fr}.hero-copy{padding:28px}.film-art{display:none}.hero h2{font-size:37px}.project-grid{grid-template-columns:1fr 1fr}.grid.two,.providers-layout{grid-template-columns:1fr}.metrics{grid-template-columns:1fr 1fr}.workspace-tabs{gap:20px}.guide-grid{gap:15px}.guide-grid p{font-size:10px}.shot-filters{flex-wrap:wrap}.shot-filters input{flex-basis:100%}.section-head{flex-wrap:wrap}.shot{padding:15px}.card{padding:18px}.shot-head{flex-wrap:wrap}}
@media(max-width:480px){.project-grid,.guide-grid{grid-template-columns:1fr}.brand{font-size:13px}.sidebar{grid-template-columns:1fr 145px}.sidebar .btn{font-size:11px;padding:8px}.topbar .toolbar{gap:8px}.metric{padding:14px}.workflow .step{flex-basis:120px}.hero h2{font-size:32px}}
.project-list{scrollbar-width:thin;scrollbar-color:#42485a transparent}.topbar>div:first-child{min-width:0}.topbar h1{overflow-wrap:anywhere}.section-head p{margin:0}.small{line-height:1.6}
.studio-menu{display:flex;flex-direction:column;gap:8px;margin-top:24px}.studio-menu .nav-home{background:transparent;color:#a8b0bf;min-height:44px}.studio-menu .nav-home:hover{background:#242b3b;color:#fff}.studio-menu .nav-home.active{background:#2a2d45;color:#e6e1ff;box-shadow:inset 3px 0 #9288ed}.sidebar-bottom{margin-top:auto}.dashboard-metrics{margin-top:24px}.provider-overview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:22px}.provider-summary{border:1px solid var(--line);border-radius:8px;padding:16px;display:flex;flex-direction:column;gap:8px}.provider-summary-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.provider-summary strong{font-size:13px;overflow-wrap:anywhere}.provider-configured{color:var(--good);background:#edf7f2;border-color:#d9e9e2}.provider-note{margin:18px 0 0}.project-search-bar{max-width:400px;margin-bottom:22px}#projectsPage .library-heading{margin-top:0}#projectsPage .library-heading h2{display:flex;align-items:center;gap:12px}
@media(max-width:800px){.sidebar{display:flex;flex-direction:column;gap:12px}.studio-menu{flex-direction:row;margin:0;gap:8px}.studio-menu .nav-home{flex:1}.sidebar-bottom{margin:0;padding:0}.sidebar-bottom .btn{width:auto}.provider-overview{grid-template-columns:1fr}}
.project-list-page .topbar{min-height:0;margin-bottom:24px}.project-list-page .topbar .eyebrow{margin-bottom:0}.project-list-page #topbarToolbar{display:none}.project-actions{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:22px}.project-search-actions{display:flex;align-items:center;gap:10px;flex:1;min-width:0}.project-search-actions input{max-width:400px;min-width:0}.project-actions .btn{flex-shrink:0;white-space:nowrap}
@media(max-width:600px){.project-actions{flex-wrap:wrap;gap:12px}.project-search-actions{flex-basis:100%}.project-actions>#newProjectBtn{margin-left:auto}}
.project-cover{height:88px;display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:14px;padding:18px 20px}.project-cover h3{flex:1;min-width:0;margin:0;color:#252938;font-size:13px;line-height:1.35;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left}.project-cover .cover-glyph{flex:0 0 auto;font-size:32px}.project-cover .cover-label{flex:0 0 auto;white-space:nowrap;font-size:7px}.project-card-body{padding-top:14px}.project-card-body p{margin-top:0}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* Character Face References & Profiles (4 columns / col-3) */
.characters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  align-items: stretch;
  box-sizing: border-box;
}

.character-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 3px 14px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.character-card:hover {
  border-color: #b9b1ef;
  box-shadow: 0 6px 20px rgba(99, 91, 223, 0.08);
}

.character-info {
  margin-bottom: 12px;
}

.character-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
}

.character-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  color: #ffffff;
  font-weight: 700;
  font-size: 11px;
  border-radius: 6px;
  background: #735bf2;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.main-character-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  color: #5b48e8;
  font-size: 11px;
  font-weight: 600;
  background: #f0effe;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main-character-badge.supporting {
  color: #475569;
  background: #f1f5f9;
}

.character-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.35;
  margin: 0 0 5px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.character-description {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.45;
  margin: 0 0 10px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.character-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 8px;
  min-width: 0;
}

.meta-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.meta-icon.purple { background: #ede9fe; color: #6d28d9; }
.meta-icon.blue { background: #dbeafe; color: #1d4ed8; }
.meta-icon.red { background: #ffe4e6; color: #e11d48; }

.meta-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  overflow: hidden;
}

.meta-label {
  font-size: 9.5px;
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
}

.meta-value {
  font-size: 11px;
  font-weight: 650;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prompt-panel {
  background: #111827;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  color: #f1f5f9;
}

.prompt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 6px;
}

.prompt-title {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.prompt-title .spark-icon {
  font-size: 13px;
  color: #fbbf24;
}

.btn-regenerate {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  color: #1e293b;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.btn-regenerate:hover {
  background: #f1f5f9;
}

.btn-regenerate .reload-icon {
  font-size: 11px;
}

.warning-box {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(217, 119, 6, 0.4);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  color: #fbbf24;
  font-size: 11px;
  line-height: 1.45;
}

.warning-icon {
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}

.warning-content {
  flex: 1;
}

.warning-content strong {
  color: #fef08a;
  font-weight: 700;
}

.prompt-text {
  background: #0b0f19;
  border: 1px solid #1e293b;
  border-radius: 6px;
  padding: 8px 10px;
  color: #cbd5e1;
  font-size: 11px;
  line-height: 1.5;
  height: 90px;
  overflow-y: auto;
  white-space: pre-wrap;
  user-select: text;
  font-family: inherit;
}

.prompt-text::-webkit-scrollbar {
  width: 5px;
}

.prompt-text::-webkit-scrollbar-track {
  background: transparent;
}

.prompt-text::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 3px;
}

.prompt-tip {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 8px 0 10px;
  color: #94a3b8;
  font-size: 10.5px;
  line-height: 1.35;
}

.btn-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  background: #6355ee;
  color: #ffffff;
  border: none;
  border-radius: 7px;
  padding: 7px 12px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-copy:hover {
  background: #5244dd;
}

.result-panel {
  margin-bottom: 12px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 6px;
}

.result-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #1e293b;
  font-size: 12px;
  font-weight: 700;
}

.result-icon {
  font-size: 13px;
}

.result-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  background: #ecfdf5;
  color: #059669;
  white-space: nowrap;
}

.turnaround-display {
  width: 100%;
}

.turnaround-card {
  position: relative;
  width: 100%;
  aspect-ratio: 27 / 16;
  border-radius: 8px;
  overflow: hidden;
  background: #0d1117;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.turnaround-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  cursor: pointer;
}

.turnaround-card:hover .image-action {
  opacity: 1;
}

.turnaround-split-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: #1e293b;
}

.turnaround-panel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0d1117;
}

.turnaround-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.turnaround-panel .image-overlay {
  font-size: 8.5px;
  padding: 2px 4px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.image-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 9 / 16;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 6px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 600;
  pointer-events: none;
  text-align: center;
}

.image-action {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
  z-index: 2;
}

.image-card:hover .image-action {
  opacity: 1;
}

.image-action:hover {
  background: #dc2626;
}

.image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  gap: 3px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  padding: 8px;
  text-align: center;
}

.upload-section {
  width: 100%;
  margin-top: auto;
}

.btn-upload {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 9px 12px;
  background: #4f46e5;
  color: #ffffff;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
  box-sizing: border-box;
  border: none;
  gap: 8px;
}

.btn-upload:hover {
  background: #4338ca;
}

.btn-upload-left {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.upload-icon {
  font-size: 13px;
  flex-shrink: 0;
}

.upload-status {
  font-size: 10px;
  opacity: 0.85;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Scenes Grid (Full width, 4 columns per row) */
.scenes-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.scene-card {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 16px;
  background: #fff;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.scene-card:hover {
  border-color: #b9b1ef;
  box-shadow: 0 4px 14px rgba(99, 91, 223, 0.07);
}
.scene-card-header {
  margin-bottom: 10px;
}
.scene-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.pill-scene {
  background: #f0edf9;
  color: var(--accent);
  border-color: #ded9f7;
  font-weight: 650;
  font-size: 10px;
}
.pill-meta {
  font-size: 10px;
  color: var(--muted);
  background: #f8f9fc;
}
.pill-shot-count {
  background: #edf7f2;
  color: var(--good);
  border-color: #d9e9e2;
  font-weight: 600;
}
.scene-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  line-height: 1.4;
}
.scene-card-meta {
  margin-bottom: 8px;
}
.scene-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.scene-card-summary {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: #4b5262;
}
.scene-card-script-wrap {
  background: #f9fafc;
  border: 1px solid #ebedf3;
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: auto;
}
.scene-script-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  color: var(--muted);
}
.scene-card-script {
  font-size: 11px;
  line-height: 1.5;
  color: #555e6d;
  white-space: pre-wrap;
  max-height: 110px;
  overflow-y: auto;
}
.scene-card-chars {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.scene-char-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.scene-char-tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  background: #f3f4f8;
  color: #3b4252;
  border: 1px solid #e5e7ef;
}
@media(max-width:1400px) {
  .characters-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media(max-width:1050px) {
  .characters-grid, .scenes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media(max-width:650px) {
  .characters-grid, .scenes-grid {
    grid-template-columns: 1fr;
  }
  .character-card {
    padding: 14px 12px;
  }
  .character-meta {
    grid-template-columns: 1fr;
  }
}

/* Shot Characters & References */
.shot-chars-bar { margin: 12px 0; padding: 10px 12px; background: #fafbfc; border-radius: 8px; border: 1px solid #e4e7ec; }
.shot-chars-title { font-size: 11px; font-weight: 650; color: #5a6170; margin-bottom: 8px; letter-spacing: 0.3px; }
.shot-chars-chips { display: flex !important; flex-direction: row !important; flex-wrap: wrap !important; align-items: center !important; gap: 8px !important; }
.shot-char-chip {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 5px 9px !important;
  border-radius: 6px !important;
  border: 1px solid #dcdfe6 !important;
  background: #ffffff !important;
  font-size: 12px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  user-select: none !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
}
.shot-char-chip:hover { border-color: #b9b1ef !important; background: #fdfdff !important; }
.shot-char-chip.selected {
  border-color: #7267e8 !important;
  background: #f1effa !important;
  color: #4338ca !important;
  font-weight: 650 !important;
  box-shadow: 0 0 0 1px rgba(99, 91, 223, 0.2) !important;
}
.shot-char-chip input[type="checkbox"],
.shot-char-toggle {
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  max-width: 14px !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  accent-color: var(--accent) !important;
}
.shot-char-code { font-size: 12px !important; font-weight: 600 !important; letter-spacing: 0.3px !important; }
.shot-char-warn { font-size: 11px !important; line-height: 1 !important; margin-left: 2px !important; }

/* Shot Attached References Block */
.shot-refs-box { margin-top: 14px; padding: 12px; background: #fdfdfe; border: 1px solid #e7e5f2; border-radius: 8px; }
.shot-refs-title { font-size: 11px; font-weight: 600; color: #434856; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.shot-refs-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.shot-ref-item { display: flex; align-items: center; gap: 10px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 7px; }
.shot-ref-thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex-shrink: 0; cursor: pointer; border: 1px solid #eaeaea; }
.shot-ref-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.shot-ref-meta b { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.shot-ref-meta .pill { font-size: 9px; align-self: flex-start; }

/* Shot Dialogue & Audio Block */
.shot-dialogue-box { margin-top: 12px; padding: 10px 12px; background: #fbfbfd; border: 1px solid #ececf4; border-radius: 7px; }
.shot-dialogue-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.shot-dialogue-line { font-size: 12px; line-height: 1.6; margin-bottom: 4px; color: var(--text); }
.shot-ambient-line { font-size: 11px; color: #626978; line-height: 1.5; }

/* Dialogue Modal Item */
.dialogue-edit-item { display: grid; grid-template-columns: 140px 1fr auto auto; gap: 8px; align-items: center; padding: 8px; background: #fafbfc; border: 1px solid var(--line); border-radius: 6px; }
.dialogue-edit-item select, .dialogue-edit-item input { font-size: 11px; padding: 6px; }
.image-preview-dialog { max-width: 90vw; width: auto; }

/* Step Loading Spinner */
.workflow {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: nowrap;
}
.workflow-step {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 6px;
}
.step-actions {
  display: flex;
  align-items: stretch;
  gap: 4px;
  width: 100%;
}
.step-actions .step {
  flex: 1;
  min-width: 0;
}
.step-provider-select {
  width: 100%;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 500;
  background: #f8f9fc;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  outline: none;
  cursor: pointer;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  height: 28px;
  box-sizing: border-box;
  transition: border-color 0.15s, background 0.15s;
}
.step-provider-select:hover {
  background: #fff;
  border-color: #b9b1ef;
}
.step-provider-select:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99, 91, 223, 0.15);
}
.step-arrow {
  font-size: 13px;
  color: #b4bac6;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.step-rerun { flex-shrink:0; width:32px; border:1px solid #d9e9e2; border-radius:7px; background:#f0f7f4; color:#45836d; font-size:22px; cursor:pointer; }
.step-rerun:hover:not(:disabled) { background:#dcefe5; border-color:#75bc9d; }
.shot-generation-progress{margin-top:16px;padding:13px 15px;border:1px solid #ddd8f4;border-radius:8px;background:#f8f7fd;display:grid;gap:8px}.shot-progress-copy{display:flex;justify-content:space-between;gap:16px;align-items:center;font-size:11px}.shot-progress-copy strong{font-size:12px;color:#5148c9}.shot-progress-copy span{font-variant-numeric:tabular-nums;color:#68617f}.shot-progress-track{height:7px;border-radius:99px;background:#e8e5f3;overflow:hidden}.shot-progress-track span{display:block;width:0;height:100%;border-radius:inherit;background:#635bdf;transition:width .25s ease}.shot-generation-progress.is-running .shot-progress-track span{background:linear-gradient(90deg,#635bdf,#8f85f0)}.shot-generation-progress.is-complete{border-color:#d9e9e2;background:#f0f7f4}.shot-generation-progress.is-complete .shot-progress-copy strong{color:#25846d}.shot-generation-progress.is-complete .shot-progress-track span{background:#25846d}.shot-generation-progress small{font-size:10px;color:#858094}
.step-rerun:disabled { opacity:.45; cursor:not-allowed; }
.step:disabled { opacity:.46; cursor:not-allowed; background:#f3f4f6; border-color:#e3e6ea; color:#9da3ad; }
.step:disabled:hover { background:#f3f4f6; }
@media(max-width:1200px) { .workflow-step { flex:1 0 160px; } .workflow-step .step { flex:1; } }

.step-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid #c9c3f8;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: step-spin 0.75s linear infinite;
  margin-right: 6px;
  flex-shrink: 0;
  vertical-align: middle;
}
@keyframes step-spin {
  to { transform: rotate(360deg); }
}
.step.generating {
  border-color: var(--accent) !important;
  background: #f4f2ff !important;
  color: var(--accent) !important;
  box-shadow: 0 0 0 2px #635bdf25 !important;
}
.step.generating b {
  display: none !important;
}

.step.completed:hover {
  background: #e5f5ed !important;
  border-color: #75bc9d !important;
  cursor: pointer;
}

.project-card.is-running { border-color:#b9b1ef; box-shadow:0 0 0 2px #635bdf18; }
.project-running { display:inline-flex; align-items:center; color:var(--accent); background:#f1effa; }
.project-running .step-spinner { width:11px; height:11px; margin-right:4px; border-width:2px; }

/* Sidebar Menu & Provider Button Updates */
.studio-menu .nav-home {
  font-size: 14px !important;
  font-weight: 500;
  padding: 12px 16px;
}
.sidebar-bottom .btn {
  font-size: 13px !important;
  font-weight: 600;
  letter-spacing: 0.3px;
  justify-content: center;
  text-align: center;
}

/* Workflow Message Box */
.message {
  font-size: 13px;
  padding: 12px 18px;
  background: #efedf9;
  border: 1px solid #e1dcf6;
  border-radius: 9px;
  margin: 0 0 20px;
  color: var(--text);
  display: none;
  align-items: center;
  gap: 12px;
  overflow-wrap: anywhere;
}
.message.error {
  background: #fdf2f2 !important;
  border-color: #fca5a5 !important;
  color: #b91c1c !important;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.08);
}
.message:empty {
  display: none !important;
}
.message-icon {
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1;
}
.message-text {
  flex: 1;
  line-height: 1.5;
  font-weight: 500;
}
.message-close {
  background: transparent;
  border: 0;
  color: #ef4444;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.7;
}
.message-close:hover {
  opacity: 1;
}

/* Workflow Provider Selector */
.workflow-card .provider-selector-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f5f4fb;
  border: 1px solid #dfdaf3;
  border-radius: 8px;
  padding: 4px 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.workflow-card .provider-select-label {
  font-size: 11px;
  font-weight: 600;
  color: #635bdf;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.workflow-card .provider-dropdown {
  background: transparent;
  border: none;
  color: #2e285a;
  font-weight: 600;
  font-size: 12px;
  padding: 2px 4px;
  cursor: pointer;
  outline: none;
  max-width: 260px;
}
.workflow-card .provider-dropdown:focus-visible {
  outline: 2px solid #8f85f0;
  border-radius: 4px;
}
@media (max-width: 800px) {
  .workflow-card .provider-selector-wrap {
    width: 100%;
    margin-top: 8px;
  }
  .workflow-card .provider-dropdown {
    max-width: 100%;
    flex: 1;
  }
}

/* Stage Providers Dialog Styling */
.stage-providers-table {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.stage-provider-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}
.stage-provider-row:last-child {
  border-bottom: none;
}
.stage-provider-row.header-row {
  background: #f8f9fc;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 10px 16px;
}
.stage-name-col {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.stage-name-col .step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #eceafc;
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stage-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}
.stage-select-col {
  flex: 1;
  max-width: 280px;
}
.stage-provider-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  background: #fbfbfd;
  color: var(--text);
  font-weight: 500;
  outline: none;
  cursor: pointer;
}
.stage-provider-select:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 2px #635bdf25;
}

.stage-providers-dialog {
  width: min(860px, 95vw);
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px;
  box-sizing: border-box;
}
.stage-providers-dialog .dialog-content {
  width: 100%;
}
.stage-providers-dialog .stage-providers-table {
  width: 100%;
}
.stage-providers-dialog .stage-select-col {
  flex: 0 0 400px;
  max-width: 400px;
}

/* Project card delete button & danger styling */
.project-card {
  position: relative;
}
.btn-card-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #8e83ac;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s, transform 0.15s;
  z-index: 2;
  font-size: 13px;
  padding: 0;
  line-height: 1;
}
.project-card:hover .btn-card-delete,
.project-card:focus-within .btn-card-delete {
  opacity: 1;
}
.btn-card-delete:hover {
  background: #fff;
  color: #dc3545;
  border-color: #f5c2c7;
  transform: scale(1.08);
  box-shadow: 0 2px 6px rgba(220, 53, 69, 0.2);
}
.btn.danger {
  color: #dc3545;
  border-color: #f1aeb5;
  background: #fff;
}
.btn.danger:hover:not(:disabled) {
  background: #fdf2f2;
  border-color: #dc3545;
  color: #b02a37;
}

/* In-app Custom Confirm Dialog */
.confirm-dialog {
  width: min(480px, 92vw);
  border-radius: 12px;
  padding: 24px 26px;
  box-shadow: 0 20px 60px rgba(16, 24, 39, 0.25);
  border: 1px solid var(--line);
  background: #fff;
}
.confirm-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
}
.confirm-dialog-content {
  display: flex;
  flex-direction: column;
}
.confirm-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.confirm-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fee2e2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.confirm-title {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.confirm-message {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.6;
  margin: 0;
  white-space: pre-line;
  background: #f9fafb;
  border: 1px solid #f3f4f6;
  border-radius: 8px;
  padding: 12px 14px;
}
.danger-confirm-btn {
  background: #dc2626 !important;
  color: #fff !important;
  border-color: #dc2626 !important;
  font-weight: 600;
  padding: 9px 18px;
}
.danger-confirm-btn:hover {
  background: #b91c1c !important;
  border-color: #b91c1c !important;
}

/* Shot Layout & Copied State Updates */
.shot-main-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.shot-side-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.shot-side-panel .shot-chars-bar,
.shot-side-panel .shot-dialogue-box,
.shot-side-panel .video-box {
  margin: 0 !important;
}

.shot-actions-bar {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 8px !important;
  margin-top: 14px !important;
  width: 100%;
}

/* Shot Inner Boxes - Uniform subtle light border and size */
.prompt,
.shot-chars-bar,
.shot-dialogue-box,
.shot-refs-box,
.shot-ref-item,
.video-box,
.video-box.has-video,
.video-thumb-container {
  border: 1px solid #e4e7ec !important;
  border-radius: 8px !important;
}

.shot-char-chip {
  border: 1px solid #e4e7ec !important;
}

.prompt {
  background: #f7f7fb;
  transition: background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
}

.prompt.prompt-copied {
  background: #edf7f2 !important;
  border-color: #75bc9d !important;
  color: #134e3f !important;
  box-shadow: 0 0 0 1px rgba(117, 188, 157, 0.25);
}

/* Shot Card Frame - Prominent Outer Border */
.shots {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.shot {
  border: 1.5px solid #cfd4dc !important;
  background: #ffffff !important;
  border-radius: 12px !important;
  padding: 22px !important;
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.05) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.shot:hover {
  border-color: #b0b8c4 !important;
}

.shot.shot-loading {
  border-color: var(--accent) !important;
  box-shadow: 0 0 16px rgba(99, 91, 223, 0.2) !important;
}

/* Video Box & Interactive Thumbnail Player */
.video-box {
  background: #faf9fe !important;
  padding: 16px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  min-width: 0 !important;
}

.video-box.has-video {
  background: #ffffff !important;
}

.video-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pill-imported {
  font-size: 10px;
  background: #edf7f2;
  color: var(--good);
  border: 1px solid #c2e8d8;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}

.video-thumb-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 190px;
  background: #0d1117;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.video-thumb-container:hover {
  border-color: #c9c3f3 !important;
  box-shadow: 0 4px 14px rgba(99, 91, 223, 0.14);
  transform: translateY(-1px);
}

.shot-video-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

.video-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #fff;
  transition: background 0.18s ease;
}

.video-thumb-container:hover .video-play-overlay {
  background: rgba(0, 0, 0, 0.12);
}

.video-play-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(99, 91, 223, 0.92);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  padding-left: 3px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease, background 0.18s ease;
}

.video-thumb-container:hover .video-play-icon {
  transform: scale(1.1);
  background: var(--accent);
}

.video-play-hint {
  font-size: 11px;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  letter-spacing: 0.3px;
}

.video-details-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.video-meta-pills {
  display: flex;
  gap: 4px;
}

.video-actions-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.video-actions-row .btn {
  font-size: 11px;
  padding: 6px 10px;
  min-height: 30px;
}

.video-file-picker-wrap input[type="file"] {
  font-size: 11px;
  padding: 7px;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
}

.video-uploading {
  border-color: var(--accent) !important;
  background: rgba(99, 91, 223, 0.04) !important;
}

/* Square Video Preview Modal (Popup xem video hình vuông) */
.video-preview-dialog {
  width: min(650px, 92vw) !important;
  height: min(650px, 92vw) !important;
  max-width: 88vh !important;
  max-height: 88vh !important;
  aspect-ratio: 1 / 1 !important;
  padding: 18px !important;
  border-radius: 16px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.video-dialog-content {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  width: 100% !important;
  gap: 12px !important;
}

.video-preview-body {
  flex: 1 !important;
  min-height: 0 !important;
  width: 100% !important;
  background: #000000 !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#videoPreviewPlayer {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  outline: none !important;
  background: #000000 !important;
  display: block !important;
}

/* Workflow Card Metrics (Thông tin tổng quan luôn hiển thị trong panel Quy trình sản xuất) */
.workflow-metrics {
  margin-top: 18px !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  border-top: none !important;
}

.workflow-metrics .metric {
  background: #fafbfc !important;
  border: 1px solid #e4e7ec !important;
  border-radius: 8px !important;
  padding: 14px 16px !important;
}

.workflow-metrics .metric strong {
  font-size: 22px !important;
  margin: 6px 0 3px !important;
}

/* Active Step Styling */
.step.active-step {
  border-color: var(--accent) !important;
  background: #f4f2ff !important;
  color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(99, 91, 223, 0.28) !important;
  font-weight: 600 !important;
}

/* --- AUTH & USER PROFILE WIDGET STYLES --- */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.user-name-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-name {
  font-weight: 650;
  font-size: 13.5px;
  color: var(--text);
}

.badge-role {
  font-size: 10px;
  font-weight: 750;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-admin {
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #d8b4fe;
}

.badge-user {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.user-package-info {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}

.btn.small {
  padding: 4px 8px !important;
  font-size: 12px !important;
  min-height: 28px !important;
}

.btn.purple {
  background: #7e22ce !important;
  color: #ffffff !important;
  border-color: #6b21a8 !important;
}

.btn.purple:hover {
  background: #6b21a8 !important;
}

/* Auth Dialog */
.auth-dialog {
  max-width: 440px !important;
  border-radius: 12px !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1) !important;
}

.auth-brand-header {
  text-align: center;
  margin-bottom: 20px;
}

.auth-brand-header .brand {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.auth-tabs {
  display: flex;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 3px;
  gap: 4px;
}

.auth-tab-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-tab-btn.active {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.auth-hint {
  margin-top: 10px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  color: #475569;
}

/* Admin Management Modal */
.admin-users-dialog {
  max-width: 900px !important;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-top: 12px;
}

.admin-tab-btn {
  padding: 8px 16px;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.admin-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.table-responsive {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  background: #f8fafc;
  padding: 10px 12px;
  text-align: left;
  font-weight: 650;
  color: #475569;
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.admin-table tr:hover {
  background: #f8fafc;
}

.status-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
}

.status-active {
  background: #dcfce7;
  color: #15803d;
}

.status-inactive {
  background: #fee2e2;
  color: #b91c1c;
}

.pkg-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.project-owner-badge {
  display: inline-block;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
}

/* Provider Assignment Cards */
.provider-assign-item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.provider-assign-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.provider-assign-title {
  font-weight: 650;
  font-size: 14px;
}

.user-checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.user-checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

/* Project Card Header with Author */
.project-cover-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.project-cover-main h3 {
  margin: 0;
  color: #252938;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.project-cover-main .project-owner-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 550;
  color: #475569;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  padding: 1px 7px;
  width: fit-content;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0;
}

/* User Profile Topbar Button */
.user-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  min-height: 38px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.user-profile-btn:hover {
  background: #f8fafc;
  border-color: #b9b1ef;
  box-shadow: 0 3px 8px rgba(99, 91, 223, 0.1);
}

.user-profile-btn .user-avatar-icon {
  font-size: 14px;
  background: #ede9fe;
  color: #635bdf;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* User Profile Dialog */
.user-profile-dialog {
  width: min(900px, 95vw);
}

.profile-avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ede9fe;
  color: #635bdf;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d8b4fe;
  flex-shrink: 0;
}

.profile-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  padding: 16px 18px;
}

.profile-section-title {
  font-size: 13px;
  font-weight: 650;
  color: #1e293b;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.profile-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-info-item .label {
  font-size: 11px;
  color: #64748b;
}

.profile-info-item .value {
  font-size: 13px;
  font-weight: 550;
  color: #0f172a;
  overflow-wrap: anywhere;
}

.profile-services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.service-duration-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.service-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.service-card-head .service-icon {
  font-size: 22px;
}

.service-card-head h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  color: #0f172a;
}

.service-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px dashed #e2e8f0;
  padding-top: 8px;
}

.service-prop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.service-prop span {
  color: #64748b;
}

.service-dates-val {
  font-weight: 600;
  color: #0f172a;
  font-size: 11px;
}

/* Admin User Management Toolbar & Pagination */
.admin-toolbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0 12px;
}

.admin-search-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
  max-width: 440px;
}

.admin-search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  background: #ffffff;
  color: var(--text);
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 91, 223, 0.12);
}

.admin-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #94a3b8;
  pointer-events: none;
}

.table-pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  background: #ffffff;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: #475569;
  white-space: nowrap;
}

.pagination-left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.pagination-info {
  font-size: 12.5px;
  color: #64748b;
  font-weight: 500;
}

.pagination-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.pagination-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.pagination-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-size-select {
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12.5px;
  color: #1e293b;
  background: #ffffff;
  cursor: pointer;
  height: 32px;
}

.badge-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #4f46e5;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  padding: 2px 7px;
  border-radius: 5px;
  display: inline-block;
  user-select: all;
}

/* Provider Assign 3-Column Grid & Cards */
.provider-assign-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px 2px;
}

.provider-select-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fafbfc;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  user-select: none;
  min-height: 72px;
  box-sizing: border-box;
}

.provider-select-card:hover {
  border-color: #b9b1ef;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 91, 223, 0.08);
}

.provider-select-card.selected {
  background: #f5f3ff;
  border-color: #7c3aed;
  box-shadow: 0 0 0 1px #7c3aed, 0 3px 10px rgba(124, 58, 237, 0.12);
}

.provider-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.provider-card-name {
  font-size: 13px;
  font-weight: 650;
  color: #1e293b;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.provider-card-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: transparent;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.provider-select-card.selected .provider-card-check {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #ffffff;
}

.provider-card-status {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
}

.provider-card-status.ok {
  color: #059669;
}

.provider-card-status.missing {
  color: #d97706;
}

@media (max-width: 760px) {
  .provider-assign-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 500px) {
  .provider-assign-grid {
    grid-template-columns: 1fr;
  }
}

/* Sidebar Bottom Icon Actions (User Profile, Provider Config & Logout) */
.sidebar-bottom {
  margin-left: -20px;
  margin-right: -20px;
  padding-left: 20px;
  padding-right: 20px;
  padding-top: 18px;
  margin-bottom: -5px;
  border-top: 1px solid #283144;
}

.sidebar-icon-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-icon-btn {
  flex: 1;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #202737;
  border: none;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: none;
}

.sidebar-icon-btn:hover {
  background: #2a3348;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

.sidebar-icon-btn:active {
  transform: translateY(0);
}

.sidebar-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 16px;
}

/* Veo Agent Job Badges & UI */
.pill-warning {
  font-size: 10px;
  background: #fff8e6;
  color: #b7791f;
  border: 1px solid #fbd38d;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}

.pill-info {
  font-size: 10px;
  background: #ebf8ff;
  color: #2b6cb0;
  border: 1px solid #bee3f8;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}

.pill-primary {
  font-size: 10px;
  background: #f0f0ff;
  color: var(--accent, #635bdf);
  border: 1px solid #dcd7fc;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}

.pill-danger {
  font-size: 10px;
  background: #fff5f5;
  color: #c53030;
  border: 1px solid #feb2b2;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}

.video-box.has-agent-job {
  border: 1.5px dashed var(--accent, #635bdf);
  background: #fafaff;
}

.agent-job-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 8px;
  text-align: center;
}

.gen-agent-btn.running {
  background: #eef2ff !important;
  color: #4338ca !important;
  border-color: #c7d2fe !important;
  cursor: wait;
}

#resumePromptsBtn {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-size: 13px;
  font-weight: 600;
  padding: 0 16px;
  background: #2563eb;
  color: #ffffff;
  border: 1px solid #1d4ed8;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  cursor: pointer;
  transition: background 0.15s ease;
}

#resumePromptsBtn:hover:not(:disabled) {
  background: #1d4ed8;
}

#resumePromptsBtn.hidden {
  display: none !important;
}

#batchAgentBtn {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-size: 13px;
  font-weight: 600;
  padding: 0 16px;
}

#shotStats {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 0 14px;
  background: #ff7a00;
  color: #ffffff;
  border: 1px solid #e66a00;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(255, 122, 0, 0.25);
}
