/* Sulong Studio v2.0 — Reliability + Operator Layer */
:root {
  --v15-bg: rgba(4, 10, 9, .97);
  --v15-panel: rgba(10, 19, 17, .98);
  --v15-panel-2: rgba(14, 27, 24, .96);
  --v15-border: rgba(58, 223, 166, .22);
  --v15-accent: #42dca9;
  --v15-accent-2: #5fe6ff;
  --v15-warn: #f1b95b;
  --v15-danger: #ff7182;
  --v15-muted: #86a49b;
  --v15-shadow: 0 28px 90px rgba(0,0,0,.72);
}

.v15-command-bar {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:center; gap:7px; margin-left:auto; width:min(250px,100%);
}
.v15-command-button,
.v15-button {
  appearance:none; border:1px solid var(--v15-border); background:rgba(12,29,25,.86);
  color:#dcfff3; border-radius:9px; padding:8px 11px; font:700 10px/1 Inter,system-ui,sans-serif;
  letter-spacing:.7px; text-transform:uppercase; cursor:pointer; transition:.18s ease;
}
.v15-command-button:hover,.v15-button:hover { border-color:rgba(66,220,169,.65); transform:translateY(-1px); background:rgba(18,50,41,.95); }
.v15-button.primary { background:linear-gradient(135deg,#13634e,#15806a); border-color:#43d9ad; }
.v15-button.danger { border-color:rgba(255,113,130,.45); color:#ffd8de; background:rgba(84,19,30,.55); }
.v15-button:disabled { opacity:.4; cursor:not-allowed; transform:none; }
.v15-button.small { padding:6px 8px; font-size:9px; }

.v15-modal-backdrop {
  position:fixed; inset:0; z-index:14000; display:none; place-items:center; padding:20px;
  background:rgba(0,0,0,.76); backdrop-filter:blur(9px);
}
.v15-modal-backdrop.open { display:grid; }
.v15-modal {
  width:min(1100px,calc(100vw - 28px)); max-height:min(900px,calc(100vh - 28px)); overflow:hidden;
  border:1px solid rgba(66,220,169,.33); border-radius:20px; background:var(--v15-bg); box-shadow:var(--v15-shadow);
  display:flex; flex-direction:column;
}
.v15-modal.wide { width:min(1320px,calc(100vw - 22px)); }
.v15-modal-header {
  flex:0 0 auto; display:flex; align-items:center; gap:12px; padding:16px 18px;
  border-bottom:1px solid var(--v15-border); background:linear-gradient(180deg,rgba(23,55,47,.65),rgba(7,16,14,.95));
}
.v15-modal-title { min-width:0; flex:1; }
.v15-modal-title strong { display:block; color:#effff9; font:800 15px/1.2 Inter,system-ui,sans-serif; letter-spacing:.5px; }
.v15-modal-title span { display:block; margin-top:4px; color:var(--v15-muted); font:500 10px/1.35 Inter,system-ui,sans-serif; }
.v15-modal-actions { display:flex; gap:7px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.v15-modal-body { min-height:0; overflow:auto; padding:18px; }
.v15-close { width:34px; height:34px; padding:0; border-radius:9px; font-size:16px; }

.v15-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.v15-grid.three { grid-template-columns:repeat(3,minmax(0,1fr)); }
.v15-card { border:1px solid var(--v15-border); border-radius:13px; background:rgba(10,22,19,.78); padding:13px; }
.v15-card h3 { margin:0 0 5px; color:#effff9; font:800 11px/1.2 Inter,sans-serif; text-transform:uppercase; letter-spacing:1.2px; }
.v15-card p { margin:0; color:var(--v15-muted); font:500 10px/1.5 Inter,sans-serif; }
.v15-card-row { display:flex; align-items:center; gap:10px; margin-top:11px; }
.v15-card-row > :first-child { flex:1; min-width:0; }
.v15-status-pill { border:1px solid rgba(134,164,155,.28); border-radius:999px; padding:5px 8px; color:#a8bdb7; font:800 9px/1 Inter,sans-serif; letter-spacing:.7px; white-space:nowrap; }
.v15-status-pill.ok { color:#aaffdf; border-color:rgba(66,220,169,.45); background:rgba(16,95,73,.25); }
.v15-status-pill.bad { color:#ffd4da; border-color:rgba(255,113,130,.45); background:rgba(105,22,36,.28); }
.v15-status-pill.warn { color:#ffe7b7; border-color:rgba(241,185,91,.45); background:rgba(102,67,10,.26); }
.v15-detail { margin-top:8px; color:#86a49b; font:500 9px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace; word-break:break-word; }
.v15-progress { height:6px; border-radius:999px; overflow:hidden; background:#07100e; border:1px solid rgba(255,255,255,.05); }
.v15-progress > span { display:block; width:0%; height:100%; background:linear-gradient(90deg,var(--v15-accent),var(--v15-accent-2)); transition:width .2s ease; }

.v15-queue-dock {
  position:fixed; right:18px; bottom:18px; z-index:12500; width:min(390px,calc(100vw - 26px)); max-height:min(610px,calc(100vh - 34px));
  display:none; flex-direction:column; border:1px solid rgba(66,220,169,.35); border-radius:16px; background:var(--v15-bg); box-shadow:var(--v15-shadow); overflow:hidden;
}
.v15-queue-dock.open { display:flex; }
.v15-queue-header { display:flex; align-items:center; gap:9px; padding:13px; border-bottom:1px solid var(--v15-border); background:rgba(18,43,36,.78); }
.v15-queue-title { flex:1; min-width:0; }
.v15-queue-title strong { display:block; font:800 11px/1 Inter,sans-serif; color:#eafff7; }
.v15-queue-title span { display:block; margin-top:4px; color:#7e9e94; font:500 9px/1.3 Inter,sans-serif; }
.v15-queue-controls { display:flex; gap:5px; flex-wrap:wrap; padding:10px 12px; border-bottom:1px solid rgba(66,220,169,.12); }
.v15-queue-summary { padding:11px 12px; }
.v15-queue-summary-line { display:flex; justify-content:space-between; gap:10px; margin-bottom:7px; color:#bed6ce; font:700 9px/1 Inter,sans-serif; }
.v15-queue-items { overflow:auto; padding:0 9px 11px; display:grid; gap:6px; }
.v15-queue-item { display:grid; grid-template-columns:26px 1fr auto; gap:8px; align-items:center; padding:8px; border-radius:9px; background:rgba(255,255,255,.025); border:1px solid rgba(255,255,255,.05); }
.v15-queue-num { display:grid; place-items:center; width:26px; height:26px; border-radius:7px; background:#07120f; color:#90ada3; font:800 9px/1 Inter,sans-serif; }
.v15-queue-copy { min-width:0; color:#d9eee7; font:600 9px/1.35 Inter,sans-serif; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.v15-queue-error { display:block; color:#ff98a5; font-size:8px; margin-top:3px; white-space:normal; }
.v15-queue-state { font:800 8px/1 Inter,sans-serif; text-transform:uppercase; letter-spacing:.7px; color:#78978d; }
.v15-queue-state.done { color:#62e4b5; }
.v15-queue-state.running { color:#7deeff; }
.v15-queue-state.failed { color:#ff7f8f; }

.v15-recovery-banner {
  position:fixed; z-index:13000; left:50%; top:14px; transform:translateX(-50%); width:min(720px,calc(100vw - 28px));
  display:none; align-items:center; gap:11px; padding:11px 12px; border:1px solid rgba(241,185,91,.5); border-radius:12px;
  background:rgba(58,38,8,.96); box-shadow:0 16px 50px rgba(0,0,0,.55); color:#ffe8bb;
}
.v15-recovery-banner.open { display:flex; }
.v15-recovery-copy { flex:1; min-width:0; font:600 10px/1.45 Inter,sans-serif; }

.v15-timeline-list { display:grid; gap:8px; }
.v15-timeline-scene { margin:13px 0 7px; color:#65e6b8; font:800 10px/1 Inter,sans-serif; letter-spacing:1.2px; text-transform:uppercase; }
.v15-timeline-row {
  display:grid; grid-template-columns:56px minmax(170px,1.35fr) minmax(170px,.8fr) auto; gap:10px; align-items:center;
  padding:9px; border:1px solid rgba(66,220,169,.13); background:rgba(255,255,255,.018); border-radius:11px;
}
.v15-timeline-thumb { width:54px; aspect-ratio:9/16; object-fit:cover; border-radius:7px; background:#07100e; border:1px solid rgba(255,255,255,.08); }
.v15-timeline-text { min-width:0; }
.v15-timeline-text strong { display:block; color:#e8fff7; font:800 9px/1.2 Inter,sans-serif; }
.v15-timeline-text textarea { width:100%; min-height:48px; margin-top:5px; resize:vertical; background:#050b0a; color:#cde1da; border:1px solid rgba(255,255,255,.09); border-radius:7px; padding:7px; font:500 9px/1.35 Inter,sans-serif; }
.v15-timeline-controls { display:grid; grid-template-columns:1fr 74px; gap:6px; align-items:center; }
.v15-timeline-controls input[type=range] { width:100%; }
.v15-timeline-controls input[type=number],.v15-timeline-controls select { width:100%; background:#050b0a; color:#dffff4; border:1px solid rgba(255,255,255,.1); border-radius:7px; padding:7px; font-size:9px; }
.v15-timeline-actions { display:flex; gap:4px; flex-wrap:wrap; justify-content:flex-end; max-width:150px; }
.v15-timeline-time { margin-top:5px; color:#77978c; font:600 8px/1 ui-monospace,monospace; }

.v15-thumb-layout { display:grid; grid-template-columns:minmax(280px,430px) minmax(280px,1fr); gap:18px; align-items:start; }
.v15-thumb-stage { position:relative; width:min(100%,360px); aspect-ratio:9/16; margin:auto; background:#030706; overflow:hidden; border-radius:14px; border:1px solid rgba(66,220,169,.28); box-shadow:0 18px 55px rgba(0,0,0,.48); }
.v15-thumb-stage img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.v15-safe-guide { position:absolute; inset:5%; border:1px dashed rgba(95,230,255,.5); pointer-events:none; border-radius:7px; }
.v15-drag-layer { position:absolute; z-index:2; cursor:grab; user-select:none; touch-action:none; }
.v15-drag-layer:active { cursor:grabbing; }
.v15-drag-layer.brand,.v15-drag-layer.category { padding:5px 8px; border-radius:5px; font:900 8px/1 Inter,sans-serif; white-space:nowrap; }
.v15-drag-layer.brand { color:white; background:#2d7a62; }
.v15-drag-layer.category { color:#2d7a62; background:white; }
.v15-drag-layer.title { width:88%; transform:translateX(-50%); color:#ffe700; text-shadow:0 2px 0 #000,0 0 8px #000; text-align:center; font:900 28px/.9 Impact,Anton,sans-serif; pointer-events:auto; }
.v15-control-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.v15-field label { display:block; margin-bottom:5px; color:#8bada1; font:800 8px/1 Inter,sans-serif; text-transform:uppercase; letter-spacing:1px; }
.v15-field input,.v15-field select { width:100%; box-sizing:border-box; border:1px solid rgba(255,255,255,.1); border-radius:8px; padding:9px; background:#050b0a; color:#e7fff7; font:600 10px/1 Inter,sans-serif; }
.v15-field.full { grid-column:1/-1; }
.v15-preset-row { display:flex; gap:7px; margin-top:12px; }
.v15-preset-row input { flex:1; }

.v15-chat-operator-bar { display:flex; gap:5px; flex-wrap:wrap; padding:7px 12px; border-bottom:1px solid rgba(66,220,169,.11); background:rgba(4,12,10,.95); }
.v15-chat-operator-bar button { border:1px solid rgba(66,220,169,.18); background:rgba(18,46,38,.65); color:#bff4e2; border-radius:999px; padding:6px 9px; cursor:pointer; font:700 8px/1 Inter,sans-serif; }
.v15-action-card { margin-top:10px; padding:9px; border:1px solid rgba(95,230,255,.28); border-radius:9px; background:rgba(12,40,43,.48); }
.v15-action-card strong { display:block; margin-bottom:6px; color:#c9fbff; font:800 9px/1 Inter,sans-serif; text-transform:uppercase; letter-spacing:.8px; }
.v15-action-list { display:flex; gap:6px; flex-wrap:wrap; }
.v15-action-button { border:1px solid rgba(95,230,255,.35); background:rgba(20,72,79,.65); color:#d9fcff; border-radius:7px; padding:6px 8px; cursor:pointer; font:700 8px/1 Inter,sans-serif; }
.v15-action-button.applied { border-color:rgba(66,220,169,.45); color:#c8ffe9; background:rgba(20,86,65,.65); }

.v15-selftest-list { margin-top:12px; display:grid; gap:6px; }
.v15-selftest-item { display:grid; grid-template-columns:1fr auto; gap:10px; padding:8px 9px; border-radius:8px; background:rgba(255,255,255,.02); color:#cfe3dc; font:600 9px/1.3 Inter,sans-serif; }
.v15-selftest-item span:last-child { font-weight:800; }
.v15-selftest-item.ok span:last-child { color:#5ee4b4; }
.v15-selftest-item.bad span:last-child { color:#ff7c8e; }

@media (max-width:900px) {
  .v15-grid,.v15-grid.three { grid-template-columns:1fr; }
  .v15-thumb-layout { grid-template-columns:1fr; }
  .v15-timeline-row { grid-template-columns:48px 1fr; }
  .v15-timeline-controls,.v15-timeline-actions { grid-column:2; max-width:none; }
}
@media (max-width:600px) {
  .v15-modal-backdrop { padding:6px; }
  .v15-modal { width:calc(100vw - 12px); max-height:calc(100vh - 12px); border-radius:14px; }
  .v15-modal-header { padding:11px; align-items:flex-start; }
  .v15-modal-body { padding:11px; }
  .v15-command-bar { width:100%; margin-top:7px; }
  .v15-command-button { flex:1; }
  .v15-control-grid { grid-template-columns:1fr; }
  .v15-field.full { grid-column:auto; }
  .v15-recovery-banner { top:7px; }
}

.v15-selftest-item.optional span:last-child { color:#f1b95b; }
.v15-thumb-stage::before {
  content:""; position:absolute; inset:0; z-index:1; pointer-events:none;
  background:linear-gradient(180deg,rgba(0,0,0,.78) 0%,rgba(0,0,0,.42) 32%,rgba(0,0,0,0) 62%),linear-gradient(0deg,rgba(20,100,78,.55),rgba(20,100,78,0) 34%);
}
.v15-safe-guide { z-index:3; }
.v15-drag-layer { z-index:4; }


/* Faceless Memories visual style */
.visual-style-panel{margin:14px 0 10px;padding:12px;border:1px solid #1f2a24;background:rgba(8,13,11,.72);border-radius:10px}
.visual-style-helper{margin:5px 0 8px;text-align:left!important;text-transform:none!important;letter-spacing:normal!important}
.visual-style-faceless{margin-top:10px;padding-top:10px;border-top:1px solid rgba(255,255,255,.08)}
.visual-style-active{min-height:40px;padding:10px 12px;border-radius:8px;background:#0e1511;border:1px solid rgba(115,200,156,.18);font-size:12px;display:flex;align-items:center;color:#e7f3ed}
.visual-style-toggles{display:grid;gap:8px;margin:10px 0}
.visual-style-toggles label{display:block;padding:10px 12px;border-radius:8px;background:#0d1311;border:1px solid rgba(255,255,255,.06);font-size:12px;color:#f3f5f2}
.visual-style-toggles label span{display:block;color:#9fb2a9;font-size:11px;margin-top:4px;line-height:1.35}
.visual-style-preview-wrap textarea{min-height:130px;font-size:11px;line-height:1.45}
.visual-style-warning{text-align:left!important;text-transform:none!important;letter-spacing:normal!important}


/* Sulong Studio content-brand selector */
.content-brand-controls .cost-note{margin-top:6px;text-align:left;text-transform:none;letter-spacing:normal;line-height:1.4}
#customContentBrandField input{min-height:44px}


/* Sulong Emotional Core v2.1 */
.emotional-core-card{
  margin-top:14px;padding:14px;border:1px solid rgba(66,220,169,.2);border-radius:12px;
  background:linear-gradient(145deg,rgba(7,18,15,.92),rgba(10,16,14,.72));box-shadow:inset 0 1px 0 rgba(255,255,255,.025)
}
.emotional-core-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.emotional-core-switch{display:flex;align-items:flex-start;gap:10px;cursor:pointer;min-width:0}
.emotional-core-switch input{margin-top:3px;accent-color:#42dca9}
.emotional-core-switch span{display:block;min-width:0}
.emotional-core-switch strong{display:block;color:#eafff7;font:800 12px/1.2 Inter,sans-serif;letter-spacing:.2px}
.emotional-core-switch small{display:block;margin-top:4px;color:#84a79b;font:500 9px/1.35 Inter,sans-serif}
.emotional-core-badge{flex-shrink:0;padding:6px 8px;border-radius:999px;border:1px solid rgba(66,220,169,.25);background:rgba(36,116,89,.18);color:#8ff0ca;font:800 8px/1 Inter,sans-serif;letter-spacing:.7px}
.emotional-core-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.emotional-core-grid .field{margin-bottom:0}
.emotional-core-grid input[type=range]{width:100%;accent-color:#42dca9}
.emotional-core-options{display:grid;gap:7px;margin-top:11px}
.emotional-core-options label{display:flex;align-items:flex-start;gap:8px;padding:9px 10px;border:1px solid rgba(255,255,255,.055);border-radius:8px;background:rgba(255,255,255,.018);color:#b7cec6;font:600 9px/1.4 Inter,sans-serif;cursor:pointer}
.emotional-core-options input{margin-top:1px;accent-color:#42dca9}
.emotional-core-card.disabled .emotional-core-grid,.emotional-core-card.disabled .emotional-core-options{opacity:.38;filter:saturate(.45);pointer-events:none}
.emotional-score-card{display:grid;grid-template-columns:minmax(150px,.75fr) minmax(270px,1.5fr);gap:12px;align-items:center;margin-top:12px;padding:12px;border-radius:10px;border:1px solid rgba(66,220,169,.2);background:rgba(4,12,10,.78)}
.emotional-score-card.waiting{border-color:rgba(255,255,255,.08)}
.emotional-score-card.good{border-color:rgba(66,220,169,.38);box-shadow:0 0 22px rgba(66,220,169,.06)}
.emotional-score-card.warn{border-color:rgba(241,185,91,.42);box-shadow:0 0 22px rgba(241,185,91,.05)}
.emotional-score-card.stale{border-style:dashed;opacity:.82}
.emotional-score-main{min-width:0}
.emotional-score-label{display:block;color:#78978d;font:800 8px/1 Inter,sans-serif;letter-spacing:1.2px}
.emotional-score-main strong{display:block;margin-top:5px;color:#eafff7;font:900 24px/1 Inter,sans-serif;letter-spacing:-.8px}
.emotional-score-card.good .emotional-score-main strong{color:#72e8ba}
.emotional-score-card.warn .emotional-score-main strong{color:#f1c36e}
.emotional-score-main small{display:block;margin-top:5px;color:#89a59c;font:500 8px/1.4 Inter,sans-serif}
.emotional-score-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.emotional-score-grid span{display:flex;justify-content:space-between;gap:8px;padding:7px;border-radius:7px;background:rgba(255,255,255,.025);color:#8fa9a0;font:600 8px/1.2 Inter,sans-serif}
.emotional-score-grid b{color:#d8f3ea;font-weight:800}
.emotional-core-note{margin-top:9px!important;text-align:left!important;text-transform:none!important;letter-spacing:normal!important;line-height:1.45!important}
@media (max-width:700px){
  .emotional-core-head{align-items:flex-start}.emotional-core-badge{font-size:7px}
  .emotional-core-grid{grid-template-columns:1fr}.emotional-score-card{grid-template-columns:1fr}.emotional-score-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
