/* Nama studio theme — plum night with a saffron-to-rose accent. Loaded after styles.css on the member
   studio only (body.studio); the admin panel keeps styles.css. Fonts: see typography.css (Plus Jakarta Sans / Sora + Vazirmatn / Estedad),
   Persian: Vazirmatn. */
@font-face{font-family:Inter;src:url('/static/fonts/Inter-latin-wght.woff2') format('woff2');font-weight:100 900;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:Outfit;src:url('/static/fonts/Outfit-latin-wght.woff2') format('woff2');font-weight:100 900;font-style:normal;font-display:swap;unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

body.studio{
 --bg:#0d0b12;--surface:#15121c;--raised:#1d1926;--line:rgba(255,255,255,.075);--line-strong:rgba(255,255,255,.14);
 --text:#f6f3f8;--muted:#9c95ab;--soft:#cfc9d8;
 --accent:#ffb454;--accent-2:#ff6f91;--accent-rgb:255,180,84;--ink:#1d0f0a;
 --grad:linear-gradient(120deg,#ffc56b 0%,#ff9a5c 45%,#ff6f91 100%);
 --grad-soft:linear-gradient(120deg,rgba(255,197,107,.16),rgba(255,111,145,.14));
 --chip:rgba(255,255,255,.045);--chip-hover:rgba(255,255,255,.085);
 --display:Outfit,Inter,ui-sans-serif,system-ui,sans-serif;
 --r-card:22px;--r-control:14px;--r-chip:12px;
 color-scheme:dark;font-family:var(--ui);font-size:14px;line-height:1.55;color:var(--text);
 background:radial-gradient(900px 500px at 100% -10%,rgba(var(--accent2-rgb),.08),transparent 60%),radial-gradient(800px 600px at -10% 110%,rgba(var(--accent-rgb),.06),transparent 60%),var(--bg);background-attachment:fixed}
html[lang=fa] body.studio{font-family:var(--ui);--display:Vazirmatn,Tahoma,system-ui,sans-serif}
body.studio ::selection{background:var(--accent);color:var(--ink)}
body.studio *{scrollbar-width:thin;scrollbar-color:var(--panel-2) transparent}
body.studio a{color:inherit}
body.studio select option,body.studio select optgroup{background-color:var(--pop);color:var(--text)}
body.studio select option:checked{background-color:var(--option-selected);color:var(--accent)}

/* ---- Controls ---- */
body.studio .btn{margin:0;border-radius:12px;font-weight:600;font-size:13px;padding:9px 15px;line-height:1.3;box-shadow:none}
body.studio .btn.primary{background:var(--grad);color:var(--ink);border:0}
body.studio .btn.primary:hover:not(:disabled){filter:brightness(1.05) saturate(1.05)}
body.studio .btn.secondary{background:var(--chip);color:var(--text);border:1px solid var(--line)}
body.studio .btn.secondary:hover{background:var(--chip-hover)}
body.studio .btn.ghost{background:transparent;color:var(--muted);border:1px solid transparent}
body.studio .btn.ghost:hover{color:var(--text);background:var(--chip)}
body.studio .btn.small{padding:6px 11px;font-size:12px;border-radius:10px}
body.studio .btn:disabled{opacity:.45;cursor:not-allowed}
body.studio .input,body.studio .select,body.studio .textarea{background:var(--chip);border:1px solid var(--line);border-radius:12px;color:var(--text);font:inherit;font-size:13.5px;padding:10px 12px;box-shadow:none}
body.studio .select{padding-inline-end:30px}
body.studio .input:focus,body.studio .select:focus,body.studio .textarea:focus{outline:none;border-color:rgba(var(--accent-rgb),.6);box-shadow:0 0 0 3px rgba(var(--accent-rgb),.14)}
body.studio .input::placeholder,body.studio .textarea::placeholder{color:var(--muted)}
body.studio .icon-btn{background:var(--chip);border:1px solid var(--line);color:var(--text);border-radius:12px}
body.studio .muted{color:var(--muted)}
body.studio .notice{background:var(--chip);border:1px solid var(--line);color:var(--soft);border-radius:12px}
body.studio .error{background:rgba(var(--bad-rgb),.08);border:1px solid rgba(var(--bad-rgb),.25);color:var(--rose-text);border-radius:12px;padding:8px 10px;font-size:12.5px}
body.studio .success{color:var(--good)}
body.studio .nm-kicker,body.studio .eyebrow{font-family:var(--display);font-weight:600;font-size:12.5px;letter-spacing:.02em;text-transform:none;background:var(--grad);-webkit-background-clip:text;background-clip:text;color:transparent}
body.studio .live-dot{background:var(--accent);box-shadow:0 0 0 3px rgba(var(--accent-rgb),.18)}

/* ---- Top bar: logo, segmented switch, balance ---- */
body.studio .nm-top{position:sticky;top:0;z-index:50;display:flex;align-items:center;gap:18px;height:64px;padding:0 20px;background:rgba(var(--bg-rgb),.78);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);border-bottom:1px solid var(--line)}
body.studio .brand{display:inline-flex;align-items:center;gap:10px;text-decoration:none;flex:none}
body.studio .brand-mark{width:36px;height:36px;border-radius:12px;background:var(--grad);color:var(--ink);display:grid;place-items:center;box-shadow:0 6px 18px rgba(var(--glow-rgb),.25)}
body.studio .brand-mark .icon{width:21px;height:21px}
body.studio .brand-name{display:flex;align-items:baseline;gap:8px;line-height:1}
body.studio .brand-en{font-family:var(--display);font-weight:700;font-size:20px;letter-spacing:.01em;color:var(--text-strong)}
body.studio .brand-fa{font-size:15px;font-weight:800;color:var(--accent)}
body.studio .nm-nav{display:flex;align-items:center;gap:4px;padding:4px;border-radius:14px;background:var(--chip);border:1px solid var(--line)}
body.studio .nm-nav .nav-link{display:inline-flex;align-items:center;height:34px;padding:0 16px;border:0;border-radius:10px;background:none;font-size:14px;font-weight:600;color:var(--muted);text-decoration:none;white-space:nowrap;transition:background .15s,color .15s}
body.studio .nm-nav .nav-link:hover{color:var(--text-strong)}
body.studio .nm-nav .nav-link.active{background:rgba(var(--fg-rgb),.1);color:var(--text-strong);box-shadow:inset 0 0 0 1px rgba(var(--fg-rgb),.06)}
body.studio .nm-nav .nav-link .icon{display:none}
body.studio .nm-nav .nm-nav-logout{display:none}
body.studio .nm-top-right{display:flex;align-items:center;gap:8px;margin-inline-start:auto;flex:none}
body.studio .nm-top .language-select{background:var(--chip);border:1px solid var(--line);color:var(--text);border-radius:12px;height:38px;min-width:112px;padding:0 28px 0 12px;font-size:13px}
body.studio .nm-balance{display:inline-flex;align-items:center;gap:6px;height:38px;padding:0 14px;border-radius:12px;border:1px solid transparent;background:linear-gradient(var(--raised),var(--raised)) padding-box,var(--grad) border-box;color:var(--text-strong);font-weight:700;font-size:13.5px;cursor:pointer}
body.studio .nm-balance:hover{filter:brightness(1.1)}
body.studio .nm-balance-unit{color:var(--muted);font-weight:500}
body.studio .nm-spark{color:var(--accent)}
body.studio .nm-cta{height:38px;padding:0 16px;border-radius:12px;border:0;background:var(--grad);color:var(--ink);font-weight:700;font-size:13.5px;cursor:pointer}
body.studio .nm-cta:hover{filter:brightness(1.05)}
body.studio .account-email{font-size:12px;color:var(--muted);max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.studio .menu-toggle{display:none}

/* ---- Workspace ---- */
body.studio #app{display:block}
body.studio .nm-workspace{display:grid;grid-template-columns:392px minmax(0,1fr);gap:20px;padding:20px;max-width:none;margin:0}
body.studio .nm-panel{position:sticky;top:84px;align-self:start;border-radius:var(--r-card)}
body.studio .nm-panel-card{position:relative;display:flex;flex-direction:column;max-height:calc(100vh - 104px);padding:0;overflow:hidden;border-radius:var(--r-card);border:1px solid transparent;
 background:linear-gradient(var(--surface),var(--surface)) padding-box,linear-gradient(160deg,rgba(var(--accent-rgb),.35),rgba(var(--accent2-rgb),.12) 40%,rgba(var(--fg-rgb),.05)) border-box}

/* Model card: aurora art, sentence-case name, edit pill */
body.studio .nm-model-card{position:relative;height:118px;border-radius:18px;overflow:hidden;isolation:isolate;background:var(--panel)}
body.studio .nm-model-art{position:absolute;inset:0;z-index:-1;background:
 radial-gradient(60% 90% at 90% 0%,rgba(var(--accent2-rgb),.55),transparent 70%),radial-gradient(60% 90% at 30% 110%,rgba(var(--accent-rgb),.45),transparent 70%),radial-gradient(40% 60% at 0% 20%,rgba(var(--violet-rgb),.35),transparent 70%),var(--panel)}
body.studio .nm-model-card[data-kind=image] .nm-model-art{background:radial-gradient(60% 90% at 90% 0%,rgba(var(--good-rgb),.5),transparent 70%),radial-gradient(60% 90% at 30% 110%,rgba(var(--accent-rgb),.4),transparent 70%),radial-gradient(40% 60% at 0% 20%,rgba(var(--accent2-rgb),.3),transparent 70%),var(--panel)}
body.studio .nm-model-card[data-kind=audio] .nm-model-art{background:radial-gradient(60% 90% at 90% 0%,rgba(var(--violet-rgb),.55),transparent 70%),radial-gradient(60% 90% at 30% 110%,rgba(var(--accent2-rgb),.35),transparent 70%),var(--panel)}
body.studio .nm-model-art::after{content:'';position:absolute;inset:0;background:linear-gradient(180deg,rgba(var(--bg-rgb),0) 30%,rgba(var(--bg-rgb),.72))}
body.studio .nm-model-text{position:absolute;inset:auto 14px 12px 14px;display:flex;flex-direction:column;gap:2px}
body.studio .nm-model-title{font-family:var(--display);font-weight:700;font-size:25px;line-height:1.1;color:var(--text-strong);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.studio .nm-model-sub{font-size:12.5px;color:var(--soft);opacity:.85;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.studio .nm-change{position:absolute;top:10px;inset-inline-end:10px;display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 12px;border-radius:999px;border:1px solid rgba(var(--fg-rgb),.18);background:rgba(var(--bg-rgb),.45);backdrop-filter:blur(8px);color:var(--text-strong);font-size:12px;font-weight:600;cursor:pointer}
body.studio .nm-change .icon{width:13px;height:13px}
body.studio .nm-change:hover{background:rgba(var(--bg-rgb),.7)}

body.studio .nm-row{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:10px;width:100%;padding:11px 14px;border-radius:var(--r-control);border:1px solid var(--line);background:var(--chip);color:var(--text-strong);text-align:start;cursor:pointer}
body.studio .nm-row:hover{background:var(--chip-hover)}
body.studio .nm-row-label{font-size:12px;font-weight:600;color:var(--muted);padding:3px 8px;border-radius:8px;background:rgba(var(--fg-rgb),.05)}
body.studio .nm-row-value{font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.studio .nm-chev{width:16px;height:16px;color:var(--muted);transform:rotate(90deg)}
body.studio .nm-row[aria-expanded=true] .nm-chev{transform:rotate(-90deg)}
body.studio .nm-meta{font-size:12px;color:var(--muted);padding:0 4px}
body.studio .nm-meta:empty{display:none}

/* Model picker popover */
body.studio .nm-picker{position:fixed;z-index:70;top:120px;left:12px;width:380px;display:flex;flex-direction:column;max-height:560px;background:var(--pop);border:1px solid var(--line-strong);border-radius:20px;box-shadow:0 30px 70px rgba(0,0,0,.65);overflow:hidden}
body.studio .nm-picker-search{display:flex;align-items:center;gap:8px;padding:12px 14px;border-bottom:1px solid var(--line)}
body.studio .nm-picker-search .icon{width:18px;height:18px;color:var(--muted);flex:none}
body.studio .nm-picker-search .input{border:0;background:transparent;padding:4px 2px;font-size:14px;box-shadow:none}
body.studio .nm-picker-body{overflow:auto;padding:10px;display:flex;flex-direction:column;gap:10px}
body.studio .nm-picker-foot{display:flex;justify-content:flex-end;padding:10px 12px;border-top:1px solid var(--line)}
body.studio .picker-label{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:600;color:var(--muted);margin:2px 4px 6px}
body.studio .picker-step label{font-size:12px;color:var(--muted)}
body.studio #modeStep,body.studio #versionStep{padding:4px 4px 12px;border-bottom:1px solid var(--line)}
body.studio .category-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;max-height:none;overflow:visible;padding:0}
body.studio .category-chip{position:relative;display:grid;grid-template-columns:36px 1fr;grid-template-rows:auto auto;column-gap:10px;row-gap:1px;align-items:center;padding:9px;border:1px solid var(--line);border-radius:14px;background:rgba(var(--fg-rgb),.02);color:var(--text-strong);text-align:start;transform:none}
body.studio .category-chip:hover{background:var(--chip-hover);transform:none}
body.studio .category-chip .icon{grid-row:1/3;width:36px;height:36px;padding:9px;border-radius:11px;background:rgba(var(--fg-rgb),.06);color:var(--soft);box-sizing:border-box}
body.studio .category-chip .cat-name{font-size:13px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.studio .category-chip small{font-size:11px;color:var(--muted)}
body.studio .category-chip[aria-pressed=true]{border-color:transparent;background:linear-gradient(var(--panel),var(--panel)) padding-box,var(--grad) border-box}
body.studio .category-chip[aria-pressed=true] .icon{background:var(--grad);color:var(--ink)}
body.studio .mode-list{display:flex;flex-wrap:wrap;gap:6px}
body.studio .mode-chip{height:34px;padding:0 13px;border-radius:999px;border:1px solid var(--line);background:var(--chip);color:var(--text-strong);font-size:12.5px;font-weight:600}
body.studio .mode-chip:hover{background:var(--chip-hover)}
body.studio .mode-chip[aria-pressed=true]{border-color:transparent;background:var(--grad);color:var(--ink)}

/* Settings */
body.studio .nm-params{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
body.studio .nm-params>*{grid-column:span 6;min-width:0;margin:0}
body.studio .nm-params>.field:not(.full-field){grid-column:span 2}
body.studio .nm-params>.field:not(.full-field):has(select){grid-column:span 3}
body.studio .nm-params>.param-check{grid-column:span 3}
body.studio .nm-params:has(.media-field+.media-field)>.media-field{grid-column:span 3}
body.studio .nm-params .field>label{font-size:12px;font-weight:600;color:var(--muted);margin:0 2px 5px;text-transform:none;letter-spacing:0}
body.studio .nm-params .field:not(.full-field) .input{height:40px;padding:0 12px;font-size:13px;font-weight:600;border-radius:12px}
body.studio .nm-params .param-check{display:flex;flex-wrap:nowrap;align-items:center;gap:8px;min-height:40px;padding:8px 12px;line-height:1.25;min-width:0;border-radius:12px;background:var(--chip);border:1px solid var(--line);font-size:13px;font-weight:600;color:var(--text-strong)}
body.studio .nm-params .param-check input{accent-color:var(--accent-mid)}
body.studio .nm-params .param-check>span,body.studio .nm-params .param-check>label{min-width:0;overflow-wrap:anywhere}
body.studio .nm-params .full-field:has(textarea[data-type=textarea]){padding:12px 14px;border-radius:16px;background:rgba(var(--fg-rgb),.035);border:1px solid var(--line)}
body.studio .nm-params .full-field:has(textarea[data-type=textarea])>label{font-size:12px;color:var(--soft);margin:0 0 6px}
body.studio .nm-params textarea[data-type=textarea]{min-height:100px;width:100%;padding:0;border:0;background:transparent;box-shadow:none;font-size:14.5px;line-height:1.6;resize:vertical}
body.studio .nm-params textarea[data-type=textarea]:focus{box-shadow:none}
body.studio .nm-params .full-field:has(textarea[data-type=textarea]:focus){border-color:rgba(var(--accent-rgb),.5);box-shadow:0 0 0 3px rgba(var(--accent-rgb),.1)}
body.studio .nm-params .textarea.mono{font-size:12px}
body.studio .media-field>label{font-size:12px;font-weight:600;color:var(--soft)}
body.studio .dropzone{min-height:136px;border:1.5px dashed rgba(var(--fg-rgb),.14);border-radius:18px;background:rgba(var(--fg-rgb),.025)}
body.studio .dropzone:hover{border-color:rgba(var(--accent-rgb),.45);background:rgba(var(--accent-rgb),.04)}
body.studio .dropzone.dragging{border-style:solid;border-color:var(--accent);background:rgba(var(--accent-rgb),.08)}
body.studio .dropzone:focus-visible{border-color:rgba(var(--accent-rgb),.6);box-shadow:0 0 0 3px rgba(var(--accent-rgb),.14)}
body.studio .drop-icon{width:38px;height:38px;border-radius:12px;background:var(--grad-soft);color:var(--accent)}
body.studio .media-tile,body.studio .media-add{border-radius:12px;border-color:var(--line)}
body.studio .media-add{border:1.5px dashed rgba(var(--fg-rgb),.14)}
body.studio .nm-advanced{border:1px solid var(--line);border-radius:var(--r-control);background:transparent;padding:10px 14px}
body.studio .nm-advanced summary{font-size:12.5px;color:var(--muted);cursor:pointer}

/* Generate: gradient pill */
body.studio .nm-panel-scroll{position:relative;flex:1 1 auto;min-height:0;overflow-x:hidden;overflow-y:auto;display:flex;flex-direction:column;gap:12px;padding:14px;overscroll-behavior:contain}
body.studio .nm-generate{position:relative;flex:none;padding:12px 14px 14px;background:var(--surface);border-top:1px solid var(--line);display:flex;flex-direction:column;gap:8px;box-shadow:0 -12px 24px rgba(var(--bg-rgb),.45)}
body.studio .nm-generate .quote{margin:0;padding:0;background:none;border:0;font-size:12.5px;color:var(--muted);text-align:center}
body.studio .nm-generate .quote.short{display:flex;align-items:center;justify-content:center;gap:8px;color:var(--accent-soft-text)}
body.studio .generate-btn{width:100%;height:54px;border-radius:999px;background:var(--grad);color:var(--ink);font-family:var(--display);font-weight:700;font-size:16px;letter-spacing:.01em;text-transform:none;box-shadow:0 10px 28px rgba(var(--glow-rgb),.3),inset 0 1px 0 rgba(var(--fg-rgb),.35)}
body.studio .generate-btn:hover:not(:disabled){filter:brightness(1.05);transform:translateY(-1px);box-shadow:0 14px 34px rgba(var(--glow-rgb),.38),inset 0 1px 0 rgba(var(--fg-rgb),.35)}
body.studio .generate-btn:disabled{background:var(--panel-2);color:var(--muted);box-shadow:none;opacity:1}
body.studio #genMsg:empty{display:none}
body.studio #genMsg{font-size:12.5px;text-align:center}

/* ---- Results: card gallery ---- */
body.studio .nm-feed{min-width:0;display:flex;flex-direction:column;gap:14px;padding:0}
body.studio .nm-feed-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:2px}
body.studio .nm-feed-head h2{margin:0;font-family:var(--display);font-weight:700;font-size:26px;letter-spacing:.005em;display:flex;align-items:center;gap:10px}
body.studio .count-badge{font-family:var(--ui);font-size:12px;font-weight:700;background:var(--grad);color:var(--ink);border:0;border-radius:999px;padding:1px 9px}
body.studio .select.compact{height:36px;padding:0 28px 0 12px;font-size:12.5px}
body.studio .nm-usage{display:flex;flex-wrap:wrap;gap:10px}
body.studio .nm-usage .stat{display:flex;align-items:baseline;gap:8px;padding:10px 14px;border-radius:16px;background:var(--surface);border:1px solid var(--line);min-width:0}
body.studio .nm-usage .stat .muted{font-size:12px}
body.studio .nm-usage .stat .value{font-family:var(--display);font-weight:700;font-size:19px}
body.studio .nm-usage .stat-action{cursor:pointer;color:var(--accent);font-weight:700;font-size:13px;align-items:center;border-color:rgba(var(--accent-rgb),.3)}
body.studio .nm-usage .stat-action:hover{background:rgba(var(--accent-rgb),.07)}
body.studio .nm-jobs{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,360px),1fr));gap:16px;align-items:start}
body.studio .job{display:flex;flex-direction:column;padding:0;border:1px solid var(--line);background:var(--surface);border-radius:var(--r-card);overflow:hidden;min-width:0;transition:border-color .2s,transform .2s}
body.studio .job:hover{border-color:var(--line-strong)}
body.studio .nm-job-stage{position:relative;min-width:0;aspect-ratio:16/9;background:var(--deep);display:flex;align-items:center;justify-content:center;overflow:hidden}
body.studio .nm-job-stage .video,body.studio .nm-job-stage .media-image{width:100%;height:100%;max-height:none;margin:0;border-radius:0;object-fit:contain;background:#000;display:block}
body.studio .nm-job-stage .media-audio{margin:0;width:88%}
body.studio .nm-job-placeholder{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:18px;background:linear-gradient(110deg,var(--panel) 30%,var(--panel) 50%,var(--panel) 70%);background-size:220% 100%;animation:nm-shimmer 2.4s linear infinite}
body.studio .nm-job-placeholder.completed,body.studio .nm-job-placeholder.failed,body.studio .nm-job-placeholder.needs_review,body.studio .nm-job-placeholder.cancelled{animation:none;background:radial-gradient(60% 80% at 50% 50%,var(--panel),var(--deep))}
@keyframes nm-shimmer{to{background-position:-220% 0}}
body.studio .nm-ph-icon{font-size:38px;background:var(--grad);-webkit-background-clip:text;background-clip:text;color:transparent;opacity:.5}
body.studio .nm-job-placeholder .gen-progress{width:min(420px,92%);margin:0;padding:14px 16px;border-radius:16px;background:rgba(var(--bg-rgb),.78);border:1px solid var(--line);backdrop-filter:blur(8px)}
body.studio .gen-fill{background:var(--grad)}
body.studio .nm-job-side{display:flex;flex-direction:column;gap:10px;padding:14px 16px 16px;min-width:0}
body.studio .nm-job-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
body.studio .nm-tag{display:inline-flex;align-items:center;max-width:70%;padding:4px 10px;border-radius:999px;background:var(--grad-soft);border:1px solid rgba(var(--accent-rgb),.22);font-size:11.5px;font-weight:700;color:var(--accent-soft-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.studio .status{font-size:10.5px;font-weight:700;border-radius:999px;padding:3px 9px;background:rgba(var(--fg-rgb),.07);color:var(--soft)}
body.studio .status.completed{background:rgba(var(--good-rgb),.13);color:var(--good)}
body.studio .status.running,body.studio .status.submitted,body.studio .status.submitting{background:rgba(var(--violet-rgb),.16);color:var(--violet-text)}
body.studio .status.queued{background:rgba(var(--fg-rgb),.08);color:var(--soft)}
body.studio .status.failed,body.studio .status.needs_review,body.studio .status.cancelled{background:rgba(var(--bad-rgb),.13);color:var(--rose-text)}
body.studio .job-prompt{margin:0;font-size:13.5px;line-height:1.6;color:var(--soft);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
body.studio .nm-thumbs{display:flex;flex-wrap:wrap;gap:6px}
body.studio .nm-thumb{width:38px;height:38px;border-radius:10px;object-fit:cover;background:var(--panel);border:1px solid var(--line)}
body.studio .nm-thumb-icon{display:grid;place-items:center;color:var(--muted);font-size:12px}
body.studio .nm-job-chips{display:flex;flex-wrap:wrap;gap:6px}
body.studio .nm-job-chips span{font-size:11px;font-weight:600;color:var(--soft);background:var(--chip);border:1px solid var(--line);border-radius:999px;padding:2px 9px}
body.studio .nm-job-meta small{font-size:11.5px;color:var(--muted)}
body.studio .job-actions{display:flex;flex-wrap:wrap;gap:6px;padding-top:2px}
body.studio .job-actions .btn{height:32px;padding:0 12px;font-size:12px;border-radius:999px}
body.studio .job-actions .btn .icon{width:14px;height:14px}
body.studio .empty-state{grid-column:1/-1;padding:64px 24px;text-align:center;border:1.5px dashed var(--line-strong);border-radius:var(--r-card);background:rgba(var(--fg-rgb),.015)}
body.studio .empty-state h3{font-family:var(--display);font-weight:700;font-size:22px;margin:8px 0}
body.studio .empty-state .empty-symbol{background:var(--grad);-webkit-background-clip:text;background-clip:text;color:transparent;font-size:28px}
body.studio .skeleton{height:320px;border-radius:var(--r-card);background:linear-gradient(110deg,var(--panel) 30%,var(--panel) 50%,var(--panel) 70%);background-size:220% 100%;animation:nm-shimmer 2.4s linear infinite}
body.studio .workspace-footer{display:flex;justify-content:space-between;gap:12px;padding:24px 2px 12px;border-top:1px solid var(--line);margin-top:10px;font-size:12px;color:var(--muted)}
body.studio .brand-foot{font-family:var(--display);font-weight:700;background:var(--grad);-webkit-background-clip:text;background-clip:text;color:transparent}

/* ---- Sign-in ---- */
body.studio .nm-auth{min-height:100vh;display:flex;flex-direction:column}
body.studio .nm-auth-body{flex:1;display:grid;grid-template-columns:minmax(0,1.2fr) minmax(320px,430px);gap:64px;align-items:center;max-width:1240px;width:100%;margin:0 auto;padding:48px 32px}
body.studio .nm-display{font-family:var(--display);font-weight:700;font-size:clamp(42px,5vw,68px);line-height:1.05;letter-spacing:-.01em;margin:14px 0 16px;color:var(--text-strong)}
body.studio .nm-display em{font-style:normal;background:var(--grad);-webkit-background-clip:text;background-clip:text;color:transparent}
html[lang=fa] body.studio .nm-display{line-height:1.35}
body.studio .nm-auth-hero>p{font-size:17px;color:var(--soft);margin:0 0 34px}
body.studio .nm-auth-card{padding:30px;border-radius:26px;border:1px solid transparent;display:flex;flex-direction:column;gap:12px;
 background:linear-gradient(var(--surface),var(--surface)) padding-box,linear-gradient(160deg,rgba(var(--accent-rgb),.4),rgba(var(--accent2-rgb),.15) 45%,rgba(var(--fg-rgb),.05)) border-box}
body.studio .nm-auth-card h2{font-family:var(--display);font-weight:700;font-size:30px;margin:0}
body.studio .nm-auth-card label{font-size:12px;font-weight:600;color:var(--muted)}
body.studio .auth-tabs{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;border-radius:14px;background:var(--chip);border:1px solid var(--line)}
body.studio .auth-tabs .btn{background:transparent;color:var(--muted);border:0}
body.studio .auth-tabs .btn[aria-pressed=true]{background:rgba(var(--fg-rgb),.1);color:var(--text-strong)}
body.studio .auth-submit{height:50px;border-radius:999px;font-family:var(--display);font-weight:700;font-size:16px}
body.studio .auth-note{font-size:12px;color:var(--muted)}
body.studio .password-toggle{color:var(--muted)}

/* ---- Buy tokens ---- */
body.studio .buy-dialog{background:var(--pop);color:var(--text);border:1px solid var(--line-strong);border-radius:26px;padding:26px;max-width:780px;width:calc(100% - 32px)}
body.studio .buy-dialog::backdrop{background:rgba(var(--bg-rgb),.72);backdrop-filter:blur(5px)}
body.studio .buy-head h2{font-family:var(--display);font-weight:700;font-size:28px;margin:6px 0}
body.studio .package-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(165px,1fr));gap:12px;margin-top:16px}
body.studio .package{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:20px 16px 16px;border-radius:20px;background:var(--surface);border:1px solid var(--line);color:var(--text-strong);text-align:start;cursor:pointer;transition:transform .15s,border-color .15s}
body.studio .package:hover{border-color:var(--line-strong);transform:translateY(-2px)}
body.studio .package.popular{border-color:transparent;background:linear-gradient(var(--raised),var(--raised)) padding-box,var(--grad) border-box}
body.studio .package-ribbon{position:absolute;top:-11px;inset-inline-start:14px;background:var(--grad);color:var(--ink);font-size:11px;font-weight:700;padding:2px 10px;border-radius:999px}
body.studio .package-tokens b{font-family:var(--display);font-weight:700;font-size:30px}
body.studio .package-bonus{color:var(--accent);font-size:12px;font-weight:700}
body.studio .package-price b{font-size:16px}
body.studio .package-cta{margin-top:8px;width:100%;text-align:center;padding:9px;border-radius:999px;background:var(--grad);color:var(--ink);font-weight:700;font-size:12.5px}
body.studio .toast{background:var(--pop);border:1px solid var(--line-strong);color:var(--text-strong);border-radius:14px}

/* ---- Picture dropdowns (select-plus.js) ---- */
body.studio .sp{position:relative;min-width:0}
body.studio .sp-native{position:absolute!important;width:1px!important;height:1px!important;opacity:0;pointer-events:none;overflow:hidden;clip:rect(0 0 0 0)}
body.studio .sp-button{display:flex;align-items:center;gap:8px;width:100%;height:40px;padding:0 10px;border-radius:12px;background:var(--chip);border:1px solid var(--line);color:var(--text-strong);font:inherit;font-size:13px;font-weight:600;text-align:start;cursor:pointer}
body.studio .sp-button:hover{background:var(--chip-hover)}
body.studio .sp-button:focus-visible{outline:none;border-color:rgba(var(--accent-rgb),.6);box-shadow:0 0 0 3px rgba(var(--accent-rgb),.14)}
body.studio .sp-button[aria-expanded=true]{border-color:rgba(var(--accent-rgb),.5)}
body.studio .sp-text{flex:0 0 auto;white-space:nowrap}
body.studio .sp-option .sp-text{flex:1 1 auto}
body.studio .sp-price{flex:0 100 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:11px;font-weight:500;color:var(--muted);white-space:nowrap}
body.studio .sp-caret{flex:none;margin-inline-start:auto;width:14px;height:14px;color:var(--muted)}
body.studio .sp-list{position:absolute;z-index:40;top:calc(100% + 6px);inset-inline-start:0;min-width:100%;width:max-content;max-width:min(320px,calc(100vw - 24px));max-height:300px;overflow:auto;padding:6px;background:var(--pop);border:1px solid var(--line-strong);border-radius:16px;box-shadow:0 20px 48px rgba(0,0,0,.6);outline:none}
body.studio .sp-option{display:flex;align-items:center;gap:10px;min-height:42px;padding:6px 10px;border-radius:12px;color:var(--text);font-size:13px;font-weight:500;cursor:pointer}
body.studio .sp-option.active,body.studio .sp-option:hover{background:rgba(var(--fg-rgb),.07)}
body.studio .sp-option.selected{color:var(--accent);font-weight:700}
body.studio .sp-option.disabled{opacity:.4;cursor:not-allowed}
body.studio .sp-check{margin-inline-start:auto;color:var(--accent);visibility:hidden}
body.studio .sp-option.selected .sp-check{visibility:visible}
body.studio .sp-option .sp-price{margin-inline-start:8px}
body.studio .sp-thumb{flex:none;display:inline-grid;place-items:center;width:30px;height:26px;border-radius:8px;background:rgba(var(--fg-rgb),.06);color:var(--soft)}
body.studio .sp-aspect i{display:block;border:1.5px solid currentColor;border-radius:3px;background:var(--grad-soft)}
body.studio .sp-aspect .sp-auto{width:16px;height:16px;border-style:dashed;background:none}
body.studio .sp-option.selected .sp-thumb{color:var(--accent)}
body.studio .sp-res{font-family:var(--display);font-size:10px;font-weight:700;letter-spacing:.02em;width:34px}
body.studio .sp-res.sp-sd{color:var(--soft)}
body.studio .sp-res.sp-hd{color:var(--violet-text)}
body.studio .sp-res.sp-fhd{color:var(--accent)}
body.studio .sp-res.sp-2k,body.studio .sp-res.sp-4k{color:var(--ink);background:var(--grad)}
body.studio .sp-icon svg{width:15px;height:15px}
body.studio .sp-bars{display:inline-flex;align-items:flex-end;justify-content:center;gap:2px;padding-bottom:5px}
body.studio .sp-bars i{display:block;width:3px;border-radius:1px;background:rgba(var(--fg-rgb),.2)}
body.studio .sp-bars i.on{background:var(--accent)}
body.studio .sp-button .sp-thumb{width:26px;height:22px}
body.studio .sp-button .sp-res{width:30px}

/* ---- Responsive ---- */

@media (max-width:980px){
 body.studio .nm-workspace{grid-template-columns:minmax(0,1fr);padding:14px}
 body.studio .nm-panel{position:static}
 body.studio .nm-panel-card{max-height:none;overflow:visible}
 body.studio .nm-panel-scroll{overflow:visible}
 body.studio .nm-generate{box-shadow:none}
 body.studio .nm-auth-body{grid-template-columns:minmax(0,1fr);gap:32px;padding:28px 16px}
}
@media (max-width:760px){
 body.studio .nm-top{gap:10px;padding:0 12px;height:60px}
 body.studio .menu-toggle{display:inline-grid;place-items:center;width:38px;height:38px}
 body.studio .nm-nav{position:absolute;top:60px;left:0;right:0;display:none;flex-direction:column;align-items:stretch;gap:2px;padding:10px 12px 14px;border-radius:0;border:0;border-bottom:1px solid var(--line);background:var(--deep)}
 body.studio.nav-open .nm-nav{display:flex}
 body.studio .nm-nav .nav-link{height:44px;border-radius:12px}
 body.studio .nm-nav .nm-nav-logout{display:flex;cursor:pointer;font:inherit;font-size:14px;font-weight:600;color:var(--muted)}
 body.studio .nm-cta,body.studio .brand-name,body.studio #logoutBtn,body.studio .nm-balance-unit{display:none}
 body.studio .nm-top .language-select{min-width:104px;height:36px;padding:0 24px 0 8px;font-size:12px}
 body.studio .nm-balance{height:36px;padding:0 11px}
 body.studio .category-list{grid-template-columns:minmax(0,1fr)}
 body.studio .nm-params>.field:not(.full-field),body.studio .nm-params>.field:not(.full-field):has(select),body.studio .nm-params>.param-check{grid-column:span 3}
}
@media (prefers-reduced-motion:reduce){body.studio .nm-job-placeholder,body.studio .skeleton{animation:none}}

/* ---- Token balance bar under the email ---- */
body.studio .nm-account{display:grid;grid-template-columns:auto;gap:3px;min-width:150px;max-width:210px}
body.studio .nm-account .account-email{max-width:none;font-size:12px;color:var(--soft);line-height:1.2}
body.studio .nm-health{position:relative;display:block;height:7px;border-radius:999px;background:rgba(var(--fg-rgb),.08);overflow:hidden;box-shadow:inset 0 0 0 1px rgba(var(--fg-rgb),.05)}
body.studio .nm-health-fill{position:absolute;inset:0 auto 0 0;width:0;border-radius:inherit;transition:width .6s cubic-bezier(.2,.8,.2,1),background .3s}
html[dir=rtl] body.studio .nm-health-fill{inset:0 0 0 auto}
body.studio .nm-health[data-level=good] .nm-health-fill{background:linear-gradient(90deg,var(--good),var(--good))}
body.studio .nm-health[data-level=mid] .nm-health-fill{background:linear-gradient(90deg,var(--accent-mid),var(--accent-0))}
body.studio .nm-health[data-level=low] .nm-health-fill{background:linear-gradient(90deg,var(--rose-text),var(--rose-text));animation:nm-low 1.6s ease-in-out infinite}
body.studio .nm-health-fill::after{content:'';position:absolute;inset:0 0 50% 0;background:rgba(var(--fg-rgb),.25);border-radius:999px 999px 0 0}
@keyframes nm-low{50%{opacity:.55}}
body.studio .nm-health-text{font-size:10.5px;color:var(--muted);line-height:1.2}
body.studio .nm-nav .nm-account{display:none}
@media (max-width:1280px){body.studio .nm-top-right .nm-account{display:none}}
@media (max-width:760px){
 body.studio .nm-nav .nm-account{display:grid;max-width:none;margin:4px 4px 8px;padding:10px 12px;border-radius:12px;background:var(--chip);border:1px solid var(--line)}
 body.studio .nm-nav .nm-health{height:9px}
}
@media (prefers-reduced-motion:reduce){body.studio .nm-health-fill{transition:none;animation:none!important}}
body.studio .nm-account .account-email{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Prompt length counter */
body.studio .nm-count{margin-top:6px;text-align:end;font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}
body.studio .nm-count.near{color:var(--accent-soft-text)}
body.studio .nm-count.full{color:var(--rose-text);font-weight:700}
/* Items in the scrolling panel keep their size (the model card has no in-flow content to stop it shrinking). */
body.studio .nm-panel-scroll>*{flex-shrink:0}
/* Internal modality names (image-to-video, motion-control) are not useful to members; the price is on the button. */
body.studio .nm-meta{display:none}

/* ---- Mode bar: big colour-coded mode buttons ---- */
body.studio .nm-modebar{display:grid;grid-template-columns:repeat(auto-fit,minmax(118px,1fr));gap:8px}
body.studio .nm-mode{--c:#9c95ab;--c2:#9c95ab;display:flex;flex-direction:column;align-items:flex-start;gap:6px;min-height:72px;padding:11px 12px;border-radius:16px;border:1px solid color-mix(in srgb,var(--c) 30%,transparent);
 background:color-mix(in srgb,var(--c) 9%,transparent);color:var(--text-strong);font:inherit;font-size:13px;font-weight:700;line-height:1.2;text-align:start;cursor:pointer;transition:transform .15s,background .15s,border-color .15s}
body.studio .nm-mode svg{width:22px;height:22px;color:var(--c)}
body.studio .nm-mode:hover{transform:translateY(-1px);background:color-mix(in srgb,var(--c) 16%,transparent)}
body.studio .nm-mode[aria-pressed=true]{background:linear-gradient(135deg,var(--c),var(--c2));border-color:transparent;color:var(--ink);box-shadow:0 8px 22px color-mix(in srgb,var(--c) 35%,transparent)}
body.studio .nm-mode[aria-pressed=true] svg{color:var(--ink)}
body.studio .nm-mode.k-t2v{--c:#a78bfa;--c2:#c4b5fd}
body.studio .nm-mode.k-i2v{--c:#2dd4bf;--c2:#99f6e4}
body.studio .nm-mode.k-ref{--c:#ffb454;--c2:#ffd08a}
body.studio .nm-mode.k-v2v{--c:#ff6f91;--c2:#ffa3b8}
body.studio .nm-mode.k-extend{--c:#60a5fa;--c2:#a5cdfd}
body.studio .nm-mode.k-motion{--c:#f472b6;--c2:#f9a8d4}
body.studio .nm-mode.k-t2i{--c:#4ade80;--c2:#a7f3c0}
body.studio .nm-mode.k-i2i{--c:#facc15;--c2:#fde68a}

/* ---- Upload reference badges and @ mentions ---- */
body.studio .media-ref{position:absolute;left:6px;bottom:6px;z-index:2;padding:2px 7px;border-radius:999px;border:0;background:var(--grad);color:var(--ink);font:700 11px/1.4 var(--ui);cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,.4)}
body.studio .media-ref:hover{filter:brightness(1.08)}
body.studio .nm-mentions{position:fixed;z-index:80;max-height:300px;overflow:auto;padding:6px;background:var(--pop);border:1px solid var(--line-strong);border-radius:16px;box-shadow:0 20px 48px rgba(0,0,0,.6)}
body.studio .nm-mention{display:flex;align-items:center;gap:10px;padding:6px 8px;border-radius:12px;cursor:pointer}
body.studio .nm-mention.active,body.studio .nm-mention:hover{background:rgba(var(--fg-rgb),.08)}
body.studio .nm-mention-thumb{flex:none;width:38px;height:38px;border-radius:9px;overflow:hidden;display:grid;place-items:center;background:var(--panel-2);color:var(--accent)}
body.studio .nm-mention-thumb img,body.studio .nm-mention-thumb video{width:100%;height:100%;object-fit:cover}
body.studio .nm-mention-thumb svg{width:18px;height:18px}
body.studio .nm-mention-text{display:flex;flex-direction:column;min-width:0}
body.studio .nm-mention-text b{font-size:13px;color:var(--accent)}
body.studio .nm-mention-text small{font-size:11px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.studio .nm-mention-empty{padding:10px 12px;font-size:12.5px;color:var(--soft);line-height:1.5}
body.studio .nm-ref-tip{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:8px}
body.studio .nm-ref-tip-label{font-size:11.5px;color:var(--muted)}
body.studio .nm-ref-chip{padding:2px 9px;border-radius:999px;border:1px solid rgba(var(--accent-rgb),.35);background:rgba(var(--accent-rgb),.1);color:var(--accent);font:700 11.5px/1.5 var(--ui);cursor:pointer}
body.studio .nm-ref-chip.k-video{border-color:rgba(var(--accent2-rgb),.4);background:rgba(var(--accent2-rgb),.1);color:var(--rose-text)}
body.studio .nm-ref-chip.k-audio{border-color:rgba(var(--violet-rgb),.4);background:rgba(var(--violet-rgb),.1);color:var(--violet-text)}
body.studio .nm-ref-tip-example{flex-basis:100%;font-size:11px;color:var(--muted)}

/* ---- Shared reference area (composer.js) ---- */
body.studio .nm-refs{display:flex;flex-direction:column;gap:10px;padding:12px;border-radius:16px;border:1.5px dashed rgba(var(--fg-rgb),.14);background:rgba(var(--fg-rgb),.025);transition:border-color .15s,background .15s}
body.studio .nm-refs.dragging{border-style:solid;border-color:var(--accent);background:rgba(var(--accent-rgb),.07)}
body.studio .nm-refs.has-items{border-style:solid;border-color:var(--line)}
body.studio .nm-refs-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;flex-wrap:wrap}
body.studio .nm-refs-head strong{font-size:13px}
body.studio .nm-refs-head small{font-size:11px;color:var(--muted)}
body.studio .nm-ref-files{display:flex;flex-wrap:wrap;gap:8px;min-height:64px}
body.studio .nm-ref-item{position:relative;margin:0;width:72px;height:72px;border-radius:12px;overflow:hidden;background:var(--panel);border:1px solid var(--line)}
body.studio .nm-ref-item.cropped{width:auto;height:96px;min-width:54px;max-width:170px;aspect-ratio:var(--ar)}
body.studio .nm-ref-item.cropped .media-ref{left:50%;transform:translateX(-50%);white-space:nowrap}
body.studio .nm-ref-item img,body.studio .nm-ref-item video{width:100%;height:100%;object-fit:cover;display:block}
body.studio .nm-ref-audio{display:grid;place-items:center;width:100%;height:100%;color:var(--violet-text)}
body.studio .nm-ref-audio svg{width:24px;height:24px}
body.studio .nm-ref-item .media-ref{left:4px;bottom:4px;font-size:10px;padding:1px 6px}
body.studio .nm-ref-remove{position:absolute;top:3px;right:3px;width:20px;height:20px;border-radius:50%;border:0;background:rgba(var(--bg-rgb),.75);color:var(--text-strong);font-size:14px;line-height:20px;cursor:pointer;opacity:.85}
body.studio .nm-ref-remove:hover{opacity:1;background:var(--accent-2);color:var(--ink)}
body.studio .nm-ref-progress{position:absolute;left:6px;right:6px;bottom:28px;height:4px;border-radius:999px;background:rgba(0,0,0,.5);overflow:hidden}
body.studio .nm-ref-progress i{display:block;height:100%;background:var(--grad)}
body.studio .nm-ref-error{position:absolute;inset:0;display:grid;place-items:center;background:rgba(var(--bad-rgb),.55);color:var(--text-strong);font-weight:800;font-size:22px}
body.studio .nm-ref-add{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:72px;height:72px;padding:0 12px;border-radius:12px;border:1.5px dashed rgba(var(--accent-rgb),.45);background:rgba(var(--accent-rgb),.06);color:var(--accent);font:inherit;font-size:12px;font-weight:700;cursor:pointer}
body.studio .nm-refs:not(.has-items) .nm-ref-add{flex:1;flex-direction:row;gap:10px}
body.studio .nm-ref-add svg{width:20px;height:20px}
body.studio .nm-ref-add small{font-size:10.5px;font-weight:500;color:var(--muted)}
body.studio .nm-route,body.studio .nm-crop{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
body.studio .nm-route-label{flex-basis:100%;font-size:11.5px;font-weight:600;color:var(--muted)}
body.studio .nm-route-btn,body.studio .nm-crop-btn{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 12px;border-radius:999px;border:1px solid var(--line);background:var(--chip);color:var(--text-strong);font:inherit;font-size:12.5px;font-weight:600;cursor:pointer}
body.studio .nm-crop-btn{padding:0 10px 0 6px}
body.studio .nm-crop-btn .sp-thumb{width:24px;height:22px}
body.studio .nm-route-btn[aria-pressed=true],body.studio .nm-crop-btn[aria-pressed=true]{border-color:transparent;background:var(--grad);color:var(--ink)}
body.studio .nm-crop-btn[aria-pressed=true] .sp-thumb{background:rgba(var(--ink-rgb),.2);color:var(--ink)}
body.studio .nm-modebar{display:none!important}

/* ---- Projects rail (left column; a chip bar on narrower screens) ---- */
body.studio .nm-workspace{grid-template-columns:226px 392px minmax(0,1fr)}
body.studio .nm-projects{position:sticky;top:84px;align-self:start;display:flex;flex-direction:column;gap:10px;max-height:calc(100vh - 104px);min-width:0;padding:14px 10px;border-radius:var(--r-card);background:rgba(var(--surface-rgb),.72);border:1px solid var(--line)}
body.studio .nm-proj-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 6px}
body.studio .nm-proj-head strong{font-family:var(--display);font-size:15px}
body.studio .nm-proj-add{display:grid;place-items:center;width:30px;height:30px;border-radius:10px;border:1px solid rgba(var(--accent-rgb),.35);background:var(--grad-soft);color:var(--accent);cursor:pointer;transition:transform .15s,background .15s}
body.studio .nm-proj-add:hover{transform:rotate(90deg);background:rgba(var(--accent-rgb),.2)}
body.studio .nm-proj-add svg{width:16px;height:16px}
body.studio .nm-proj-new{display:flex;gap:6px}
body.studio .nm-proj-new .input{flex:1;min-width:0;height:34px;padding:0 10px;font-size:13px}
body.studio .nm-proj-list{display:flex;flex-direction:column;gap:2px;overflow:auto;min-height:0;scrollbar-width:thin}
body.studio .nm-proj-item{position:relative;display:flex;align-items:center;gap:8px;min-height:38px;padding:0 6px 0 8px;border-radius:12px;color:var(--soft);transition:background .15s,color .15s}
body.studio .nm-proj-item:hover{background:var(--chip-hover);color:var(--text-strong)}
body.studio .nm-proj-item.active{background:var(--grad-soft);color:var(--text-strong);box-shadow:inset 0 0 0 1px rgba(var(--accent-rgb),.28)}
body.studio .nm-proj-item.active .nm-proj-icon{color:var(--accent)}
body.studio .nm-proj-icon{display:grid;place-items:center;flex:none;width:18px;height:18px;color:var(--muted)}
body.studio .nm-proj-icon svg{width:17px;height:17px}
body.studio .nm-proj-check{flex:none;width:16px;height:16px;margin:0 1px;accent-color:var(--accent-mid);cursor:pointer}
body.studio .nm-proj-name{flex:1;min-width:0;display:block;padding:9px 0;border:0;background:none;color:inherit;font:inherit;font-size:13.5px;font-weight:600;text-align:start;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.studio .nm-proj-name>span{pointer-events:none}
body.studio .nm-proj-count{flex:none;min-width:22px;padding:1px 7px;border-radius:999px;background:rgba(var(--fg-rgb),.06);color:var(--muted);font-size:11px;font-weight:700;text-align:center}
body.studio .nm-proj-more{flex:none;display:grid;place-items:center;width:26px;height:26px;border:0;border-radius:8px;background:none;color:var(--muted);cursor:pointer;opacity:0;transition:opacity .15s,background .15s}
body.studio .nm-proj-item:hover .nm-proj-more,body.studio .nm-proj-more:focus-visible,body.studio .nm-proj-item.active .nm-proj-more{opacity:1}
body.studio .nm-proj-more:hover{background:rgba(var(--fg-rgb),.08);color:var(--text-strong)}
body.studio .nm-proj-more svg{width:16px;height:16px}
body.studio .nm-proj-input{flex:1;min-width:0;height:30px;padding:0 8px;font-size:13px}
body.studio .nm-proj-sep{display:flex;align-items:center;gap:8px;margin:8px 8px 4px;color:var(--muted);font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}
body.studio .nm-proj-sep:empty{height:1px;margin:6px 8px;background:var(--line)}
body.studio .nm-proj-empty{margin:4px 8px;font-size:12px;line-height:1.5;color:var(--muted)}
body.studio .nm-proj-item.is-trash .nm-proj-icon{color:var(--rose-text)}
body.studio .nm-proj-pop{position:fixed;z-index:90;display:flex;flex-direction:column;min-width:170px;padding:6px;border-radius:14px;background:var(--pop);border:1px solid var(--line-strong);box-shadow:0 18px 44px rgba(0,0,0,.6)}
body.studio .nm-proj-pop button{padding:9px 12px;border:0;border-radius:10px;background:none;color:var(--text-strong);font:inherit;font-size:13px;text-align:start;cursor:pointer}
body.studio .nm-proj-pop button:hover,body.studio .nm-proj-pop button:focus-visible{background:rgba(var(--fg-rgb),.08);outline:none}
body.studio .nm-proj-pop button.danger{color:var(--rose-text)}
@media (max-width:1279px){
 body.studio .nm-workspace{grid-template-columns:392px minmax(0,1fr)}
 body.studio .nm-projects{grid-column:1/-1;position:static;max-height:none;flex-direction:row;align-items:center;flex-wrap:wrap;padding:8px 10px}
 body.studio .nm-proj-head{padding:0 4px}
 body.studio .nm-proj-list{flex-direction:row;flex:1 1 300px;overflow-x:auto;overflow-y:hidden;gap:6px;padding-bottom:2px}
 body.studio .nm-proj-item{flex:none;min-height:34px;border-radius:999px;border:1px solid var(--line);background:var(--chip);padding:0 6px 0 10px}
 body.studio .nm-proj-name{max-width:160px;padding:6px 0}
 body.studio .nm-proj-more{opacity:1}
 body.studio .nm-proj-sep,body.studio .nm-proj-empty{display:none}
 body.studio .nm-proj-new{flex-basis:100%;order:3}
}
@media (max-width:980px){body.studio .nm-workspace{grid-template-columns:minmax(0,1fr)}}

/* ---- "Save to" project, above Generate ---- */
body.studio .nm-saveto{display:flex;align-items:center;gap:8px;min-width:0;font-size:12.5px;color:var(--muted);font-weight:600}
body.studio .nm-saveto svg{flex:none;width:16px;height:16px;color:var(--accent)}
body.studio .nm-saveto select{flex:1;min-width:0;height:32px;padding:0 28px 0 10px;border-radius:10px;border:1px solid var(--line);background-color:var(--chip);color:var(--text-strong);font:inherit;font-size:13px;font-weight:600;cursor:pointer;
 appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239c95ab' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-size:14px;background-position:right 9px center}
html[dir=rtl] body.studio .nm-saveto select{padding:0 10px 0 28px;background-position:left 9px center}

/* ---- Generation cards: full prompt (scrolls), move / delete ---- */
body.studio .job-prompt{display:block;-webkit-line-clamp:unset;max-height:8.2em;overflow:auto;padding-inline-end:4px;overscroll-behavior:contain;scrollbar-width:thin;white-space:pre-wrap;overflow-wrap:anywhere}
body.studio .nm-job-manage{display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding-top:10px;border-top:1px solid var(--line)}
body.studio .nm-move{display:inline-flex;align-items:center;gap:6px;flex:1 1 140px;min-width:0;height:32px;padding:0 4px 0 10px;border-radius:10px;border:1px solid var(--line);background:var(--chip);color:var(--muted)}
body.studio .nm-move svg{flex:none;width:15px;height:15px}
body.studio .nm-move select{flex:1;min-width:0;height:30px;border:0;background:transparent;color:var(--soft);font:inherit;font-size:12.5px;font-weight:600;cursor:pointer;outline:none}
body.studio .nm-job-manage .btn svg{width:15px;height:15px}
body.studio .btn.nm-danger{color:var(--rose-text)}
body.studio .btn.nm-danger:hover:not(:disabled){background:rgba(var(--accent2-rgb),.12);color:var(--rose-soft-text)}

/* ---- Reference tiles: drag to reorder ---- */
body.studio .nm-ref-item[draggable=true]{cursor:grab}
body.studio .nm-ref-item.is-dragged{opacity:.4}
body.studio .nm-ref-item.drop-before{box-shadow:-4px 0 0 0 var(--accent)}
html[dir=rtl] body.studio .nm-ref-item.drop-before{box-shadow:4px 0 0 0 var(--accent)}
body.studio .nm-ref-earlier{position:absolute;top:4px;inset-inline-start:4px;z-index:2;display:none;width:22px;height:22px;border:0;border-radius:50%;background:rgba(var(--bg-rgb),.75);color:var(--text-strong);font-size:15px;line-height:1;cursor:pointer}
@media (hover:none){body.studio .nm-ref-earlier{display:grid;place-items:center}}

/* ---- @references highlighted inside the prompt ---- */
body.studio .nm-params .full-field:has(textarea[data-param=prompt]){position:relative}
body.studio .nm-hl-layer{position:absolute;z-index:0;overflow:hidden;pointer-events:none}
body.studio .nm-hl-inner{color:transparent;white-space:pre-wrap;overflow-wrap:break-word;word-break:normal;margin:0}
body.studio .nm-hl-inner mark{color:transparent;border-radius:6px;background:rgba(var(--accent-rgb),.24);box-shadow:0 0 0 2px rgba(var(--accent-rgb),.24)}
body.studio .nm-hl-inner mark.k-video{background:rgba(var(--accent2-rgb),.24);box-shadow:0 0 0 2px rgba(var(--accent2-rgb),.24)}
body.studio .nm-hl-inner mark.k-audio{background:rgba(var(--violet-rgb),.26);box-shadow:0 0 0 2px rgba(var(--violet-rgb),.26)}
body.studio .nm-hl-inner mark.missing{background:transparent;box-shadow:inset 0 -2px 0 var(--accent-2)}
body.studio textarea.nm-hl-ta{position:relative;z-index:1;background:transparent!important}
body.studio .nm-refcard{position:fixed;z-index:95;width:250px;padding:10px;border-radius:16px;background:var(--pop);border:1px solid var(--line-strong);box-shadow:0 22px 50px rgba(0,0,0,.6)}
body.studio .nm-refcard-media{display:grid;place-items:center;height:132px;border-radius:12px;overflow:hidden;background:var(--deep);color:var(--accent)}
body.studio .nm-refcard-media img,body.studio .nm-refcard-media video{width:100%;height:100%;object-fit:cover}
body.studio .nm-refcard-media svg{width:34px;height:34px}
body.studio .nm-refcard-none{font:700 34px/1 var(--display);color:var(--rose-text)}
body.studio .nm-refcard-body{display:flex;flex-direction:column;gap:2px;padding:8px 2px 4px;min-width:0}
body.studio .nm-refcard-body b{color:var(--accent);font-size:14px}
body.studio .nm-refcard-body small{color:var(--muted);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.studio .nm-refcard-label{margin:6px 2px;color:var(--muted);font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase}
body.studio .nm-refcard-swaps{display:flex;gap:6px;overflow-x:auto;padding-bottom:2px}
body.studio .nm-refcard-swap{flex:none;display:flex;flex-direction:column;align-items:center;gap:3px;width:58px;padding:4px;border-radius:10px;border:1px solid var(--line);background:var(--chip);color:var(--text-strong);font:700 10.5px/1.2 var(--ui);cursor:pointer}
body.studio .nm-refcard-swap:hover{border-color:rgba(var(--accent-rgb),.5);background:var(--grad-soft)}
body.studio .nm-refcard-swap img,body.studio .nm-refcard-swap video{width:48px;height:40px;border-radius:7px;object-fit:cover}
body.studio .nm-refcard-swap svg{width:22px;height:40px;color:var(--accent)}
body.studio .nm-refcard-remove{width:100%;margin-top:8px;padding:7px;border:0;border-radius:10px;background:none;color:var(--rose-text);font:inherit;font-size:12.5px;font-weight:600;cursor:pointer}
body.studio .nm-refcard-remove:hover{background:rgba(var(--accent2-rgb),.1)}
@media (prefers-reduced-motion:no-preference){body.studio .nm-refcard,body.studio .nm-proj-pop{animation:fx-rise .16s ease both}}

/* ---- Use the full width of large screens ---- */
@media (min-width:1800px){body.studio .nm-workspace{grid-template-columns:240px 420px minmax(0,1fr);gap:24px;padding:24px 28px}}
@media (min-width:2400px){body.studio .nm-workspace{grid-template-columns:260px 460px minmax(0,1fr)}body.studio .nm-jobs{grid-template-columns:repeat(auto-fit,minmax(400px,1fr))}}

/* ---- Model picker: create-type tabs, search behind a button ---- */
body.studio .nm-picker-top{display:flex;align-items:center;gap:8px;padding:12px 12px 10px;border-bottom:1px solid var(--line)}
body.studio .nm-kind-tabs{flex:1;min-width:0;display:flex;gap:6px;overflow-x:auto;scrollbar-width:none}
body.studio .nm-kind-tab{flex:1 0 auto;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:40px;padding:0 12px;border-radius:12px;border:1px solid var(--line);background:var(--chip);color:var(--soft);font:inherit;font-size:13px;font-weight:700;cursor:pointer;transition:background .15s,border-color .15s,color .15s}
body.studio .nm-kind-tab svg{width:17px;height:17px;flex:none}
body.studio .nm-kind-tab small{min-width:18px;padding:0 6px;border-radius:999px;background:rgba(var(--fg-rgb),.08);font-size:10.5px;font-weight:700;color:var(--muted)}
body.studio .nm-kind-tab:hover{background:var(--chip-hover);color:var(--text-strong)}
body.studio .nm-kind-tab[aria-selected=true]{background:var(--grad);border-color:transparent;color:var(--ink)}
body.studio .nm-kind-tab[aria-selected=true] small{background:rgba(var(--ink-rgb),.18);color:var(--ink)}
body.studio .nm-picker-searchbtn,body.studio .nm-picker-searchclose{flex:none;display:grid;place-items:center;width:40px;height:40px;border-radius:12px;border:1px solid var(--line);background:var(--chip);color:var(--soft);cursor:pointer}
body.studio .nm-picker-searchbtn[aria-expanded=true]{border-color:rgba(var(--accent-rgb),.5);color:var(--accent)}
body.studio .nm-picker-searchbtn .icon{width:18px;height:18px}
body.studio .nm-picker-searchclose{width:30px;height:30px;font-size:18px;line-height:1}
body.studio .nm-picker-search .input{flex:1;min-width:0}

/* ---- Continue with Google ---- */
body.studio .nm-google-box{display:flex;flex-direction:column;gap:14px;margin:4px 0 16px}
body.studio .nm-google{display:flex;align-items:center;justify-content:center;gap:10px;height:48px;border-radius:999px;background:#fff;color:#1f1f1f;font:600 14.5px/1 var(--ui);text-decoration:none;border:1px solid #dadce0;box-shadow:0 6px 18px rgba(0,0,0,.25);transition:transform .15s,box-shadow .15s}
body.studio .nm-google:hover{transform:translateY(-1px);box-shadow:0 10px 26px rgba(0,0,0,.35)}
body.studio .nm-google:focus-visible{outline:3px solid rgba(var(--accent-rgb),.6);outline-offset:2px}
body.studio .nm-google svg{width:20px;height:20px;flex:none}
body.studio .nm-or{display:flex;align-items:center;gap:12px;color:var(--muted);font-size:12px}
body.studio .nm-or::before,body.studio .nm-or::after{content:"";flex:1;height:1px;background:var(--line-strong)}

/* ---- Email code step ---- */
body.studio .nm-verify-note{margin:0 0 4px;font-size:13.5px;line-height:1.6;color:var(--soft)}
body.studio .nm-verify-note b{color:var(--text-strong);overflow-wrap:anywhere}
body.studio .nm-code-input{height:56px;text-align:center;font:700 26px/1 ui-monospace,Consolas,monospace;letter-spacing:12px}
body.studio .nm-verify-links{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:4px}
body.studio .nm-verify-links .link-btn:disabled{opacity:.55;cursor:default;text-decoration:none}

/* ---- Gift code box (Add tokens window) ---- */
body.studio .nm-gift{display:flex;flex-direction:column;gap:8px;margin:6px 24px 4px;padding:14px;border-radius:16px;border:1px dashed rgba(var(--accent-rgb),.45);background:var(--grad-soft)}
body.studio .nm-gift label{display:flex;align-items:center;gap:8px;font-size:13.5px;font-weight:700;color:var(--text-strong)}
body.studio .nm-gift label svg{width:18px;height:18px;color:var(--accent)}
body.studio .nm-gift-row{display:flex;gap:8px}
body.studio .nm-gift-row .input{flex:1;min-width:0;font:600 14px/1 ui-monospace,Consolas,monospace;letter-spacing:1px;text-transform:uppercase}
body.studio .nm-gift-row .input::placeholder{text-transform:none;letter-spacing:0}
body.studio #giftMsg:empty{display:none}
body.studio #giftMsg{font-size:13px}
@media (max-width:520px){body.studio .nm-gift{margin:6px 14px 4px}}

/* ---- More options (replaces the JSON box) ---- */
body.studio .nm-advanced>summary{display:flex;align-items:center;gap:8px;font-weight:700;color:var(--soft)}
body.studio .nm-adv-count{min-width:20px;padding:0 7px;border-radius:999px;background:rgba(var(--fg-rgb),.08);color:var(--muted);font-size:11px;text-align:center}
body.studio .nm-adv{padding:12px 14px 14px}
body.studio .nm-adv-help{display:block;margin-top:2px;font-size:11.5px;line-height:1.45;color:var(--muted);font-weight:500}
body.studio .nm-switch{flex-wrap:wrap!important;align-items:flex-start!important;row-gap:2px}
body.studio .nm-switch .nm-adv-help{flex-basis:100%;padding-inline-start:24px}
body.studio .nm-seed-row{display:flex;gap:6px}
body.studio .nm-seed-row .input{flex:1;min-width:0;font-variant-numeric:tabular-nums}
body.studio .nm-seed-row .btn{min-width:40px;font-size:16px}
body.studio .nm-slider label{display:flex;justify-content:space-between;align-items:baseline}
body.studio .nm-slider output{font-size:12px;font-weight:700;color:var(--accent)}
body.studio .nm-slider input[type=range]{width:100%;accent-color:var(--accent-mid)}
body.studio .nm-adv-text{min-height:70px}
body.studio .nm-shot-list{display:flex;flex-direction:column;gap:8px;margin:6px 0}
body.studio .nm-shot{display:grid;grid-template-columns:24px minmax(0,1fr) 78px 32px;gap:6px;align-items:start}
body.studio .nm-shot-n{display:grid;place-items:center;width:24px;height:24px;margin-top:8px;border-radius:50%;background:var(--grad-soft);color:var(--accent);font-size:12px;font-weight:800}
body.studio .nm-shot textarea{min-height:56px;font-size:13px}
body.studio .nm-shot-len{display:flex;align-items:center;gap:4px;color:var(--muted);font-size:12px}
body.studio .nm-shot-len .input{width:56px;padding:8px 6px;text-align:center}
body.studio .nm-color-list{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}
body.studio .nm-color{position:relative;display:inline-flex}
body.studio .nm-color input[type=color],body.studio .nm-bg input[type=color]{width:40px;height:40px;padding:0;border:1px solid var(--line-strong);border-radius:12px;background:none;cursor:pointer}
body.studio .nm-color button{position:absolute;top:-6px;inset-inline-end:-6px;width:18px;height:18px;border:0;border-radius:50%;background:var(--panel-2);color:var(--text-strong);font-size:11px;line-height:1;cursor:pointer}
body.studio .nm-color-add{width:40px;height:40px;border:1px dashed rgba(var(--accent-rgb),.5);border-radius:12px;background:var(--grad-soft);color:var(--accent);font-size:20px;cursor:pointer}
body.studio .nm-bg-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
body.studio .nm-bg input[type=color]:disabled{opacity:.35;cursor:not-allowed}

/* ---- Generation timer, Cancel, live strip, Reset ---- */
body.studio .gen-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px}
body.studio .nm-timer{font:600 12.5px/1 var(--ui);font-variant-numeric:tabular-nums;color:var(--soft);white-space:nowrap}
body.studio .nm-cancel{color:var(--rose-text);border:1px solid rgba(var(--bad-rgb),.35)}
body.studio .nm-cancel:hover:not(:disabled){background:rgba(var(--bad-rgb),.12)}
body.studio .nm-genlive{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:14px;background:var(--grad-soft);border:1px solid rgba(var(--accent-rgb),.3);font-size:12.5px;min-width:0}
body.studio .nm-genlive-text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--soft)}
body.studio .nm-genlive-text b{color:var(--text-strong)}
body.studio .nm-genlive-dot{flex:none;width:9px;height:9px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 0 rgba(var(--accent-rgb),.6);animation:nm-live 1.6s ease-out infinite}
@keyframes nm-live{to{box-shadow:0 0 0 9px rgba(var(--accent-rgb),0)}}
body.studio .nm-gen-row{display:flex;align-items:center;gap:8px;min-width:0}
body.studio .nm-gen-row .nm-saveto{flex:1}
body.studio .nm-reset{flex:none;display:inline-flex;align-items:center;gap:5px;color:var(--soft)}
body.studio .nm-reset svg{width:15px;height:15px}
@media (prefers-reduced-motion:reduce){body.studio .nm-genlive-dot{animation:none}}

/* ---- Send countdown (ring) and the Haft Khan menu entry ---- */
body.studio .nm-senddelay{display:flex;align-items:center;gap:12px;min-height:54px;padding:6px 8px 6px 6px;border-radius:999px;background:var(--grad-soft);border:1px solid rgba(var(--accent-rgb),.4);position:relative}
body.studio .nm-senddelay.hidden{display:none}
body.studio .nm-ring{flex:none;width:44px;height:44px;transform:rotate(-90deg)}
body.studio .nm-ring circle{fill:none;stroke-width:4}
body.studio .nm-ring-bg{stroke:rgba(var(--fg-rgb),.12)}
body.studio .nm-ring-fg{stroke:var(--accent);stroke-linecap:round;stroke-dasharray:119.4;stroke-dashoffset:0}
@keyframes nm-ring{to{stroke-dashoffset:119.4}}
body.studio .nm-ring-num{position:absolute;left:6px;top:50%;width:44px;margin-top:-11px;text-align:center;font:800 18px/22px var(--display);color:var(--text-strong);font-variant-numeric:tabular-nums}
html[dir=rtl] body.studio .nm-ring-num{left:auto;right:6px}
body.studio .nm-senddelay-text{flex:1;min-width:0;display:flex;flex-direction:column;font-size:13px;font-weight:700;color:var(--text-strong);line-height:1.3}
body.studio .nm-senddelay-text small{font-size:11.5px;font-weight:500;color:var(--soft)}
body.studio .nm-senddelay .btn{border-radius:999px}
body.studio .generate-btn.hidden{display:none}
body.studio .nm-play-link{display:inline-flex;align-items:center;gap:6px;border:0;background:none;font:inherit;cursor:pointer}
body.studio .nm-play-icon{display:inline-flex}
@media (prefers-reduced-motion:reduce){body.studio .nm-ring-fg{animation:none!important}}

/* ---- Generating card: compact so it always fits the video area; "Play" bubble above the ibex ---- */
body.studio .nm-job-placeholder .gen-progress{padding:10px 12px;max-height:calc(100% - 14px);overflow:hidden}
body.studio .nm-job-placeholder .gen-progress-top{margin-bottom:4px}
body.studio .nm-job-placeholder .gen-actions{margin-top:6px}
body.studio .nm-job-placeholder .nm-tip{margin-top:4px;font-size:11.5px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
body.studio .nm-job-placeholder .gen-detail:empty,body.studio .nm-job-placeholder .gen-note{display:none}
body.studio .px-lane{height:30px;margin-top:20px}
body.studio .px-runner{display:block}
body.studio .px-bubble{position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);z-index:2;display:inline-flex;align-items:center;gap:4px;padding:3px 10px;border:0;border-radius:999px;
 background:var(--grad);color:var(--ink);font:800 11px/1.4 var(--ui);white-space:nowrap;cursor:pointer;box-shadow:0 4px 14px rgba(var(--accent-rgb),.45);animation:px-bubble 1.8s ease-in-out infinite}
body.studio .px-bubble::after{content:"";position:absolute;top:100%;left:50%;margin-left:-5px;border:5px solid transparent;border-top-color:var(--accent-mid)}
body.studio .px-bubble:hover,body.studio .px-bubble:focus-visible{animation-play-state:paused;transform:translateX(-50%) scale(1.08);outline:none}
@keyframes px-bubble{0%,100%{transform:translateX(-50%) translateY(0)}50%{transform:translateX(-50%) translateY(-4px)}}
@media (prefers-reduced-motion:reduce){body.studio .px-bubble{animation:none}}

/* Leftovers from the old dark base sheet */
body.studio .package{background:var(--chip);border-color:var(--line)}
body.studio .quote.short{background:rgba(var(--accent-rgb),.12);border-color:rgba(var(--accent-rgb),.35);color:var(--text)}
body.studio .nm-job-placeholder:has(.gen-progress){padding:10px}
body.studio .nm-job-placeholder .gen-progress{max-height:100%}
body.studio .nm-job-placeholder .px-lane{margin-top:12px}

/* ---- Logo picture only (no name text beside it) ---- */
body.studio .brand-mark,body.admin .brand-mark{width:42px;height:42px;border-radius:13px}
.brand-mark .px-logo{width:30px;height:30px}
body.admin .sidebar .brand{justify-content:flex-start}

/* ---- Category colours: video blue, image pink (also the model picker's tabs) ---- */
body.studio .k-video{--cat:#4fa8ff;--cat-rgb:79,168,255}
body.studio .k-image{--cat:#ff6fb5;--cat-rgb:255,111,181}
body.studio .k-audio{--cat:#ffcf3f;--cat-rgb:255,207,63}
body.studio .k-other{--cat:#a78bfa;--cat-rgb:167,139,250}
html:is([data-theme=cloud],[data-theme=clay]) body.studio .k-video{--cat:#1f6fd1;--cat-rgb:31,111,209}
html:is([data-theme=cloud],[data-theme=clay]) body.studio .k-image{--cat:#c4247a;--cat-rgb:196,36,122}
body.studio .nm-cat-link{display:inline-flex;align-items:center;gap:7px;cursor:pointer}
body.studio .nm-cat-link svg{width:16px;height:16px;color:var(--cat)}
body.studio .nm-cat-link[aria-expanded=true]{background:rgba(var(--cat-rgb),.14);color:var(--text-strong);box-shadow:inset 0 0 0 1px rgba(var(--cat-rgb),.4)}
body.studio .nm-kind-tab.k-video[aria-selected=true]{background:linear-gradient(120deg,#4fa8ff,#7b8cff);color:#061630}
body.studio .nm-kind-tab.k-image[aria-selected=true]{background:linear-gradient(120deg,#ff6fb5,#ff9a7a);color:#2a0716}
body.studio .nm-kind-tab.k-video svg{color:#4fa8ff}
body.studio .nm-kind-tab.k-image svg{color:#ff6fb5}
body.studio .nm-kind-tab[aria-selected=true] svg{color:inherit}

/* ---- Category hover panel ---- */
body.studio .nm-catpop{position:fixed;z-index:110;width:min(560px,calc(100vw - 16px));max-height:min(70vh,520px);overflow:auto;padding:12px;border-radius:20px;background:var(--pop);
 border:1px solid rgba(var(--cat-rgb),.45);box-shadow:0 24px 60px rgba(0,0,0,.5),0 0 0 4px rgba(var(--cat-rgb),.08);color:var(--text)}
@media (prefers-reduced-motion:no-preference){body.studio .nm-catpop{animation:fx-rise .18s ease both}}
body.studio .nm-catpop-head{display:flex;align-items:center;gap:8px;margin:2px 4px 10px}
body.studio .nm-catpop-head b{font-family:var(--display);font-size:15px}
body.studio .nm-catpop-head small{margin-inline-start:auto;padding:1px 8px;border-radius:999px;background:rgba(var(--cat-rgb),.16);color:var(--cat);font-weight:800;font-size:11.5px}
body.studio .nm-catpop-dot{width:10px;height:10px;border-radius:50%;background:var(--cat);box-shadow:0 0 0 4px rgba(var(--cat-rgb),.18)}
body.studio .nm-catpop-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
@media (max-width:520px){body.studio .nm-catpop-grid{grid-template-columns:minmax(0,1fr)}}
body.studio .nm-catpop-brand{padding:10px;border-radius:14px;background:var(--chip);border:1px solid var(--line);border-inline-start:3px solid var(--cat)}
body.studio .nm-catpop-name{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:8px;font-weight:700;font-size:13.5px}
body.studio .nm-catpop-name small{color:var(--muted);font-weight:600;font-size:11px}
body.studio .nm-catpop-versions{display:flex;flex-wrap:wrap;gap:6px}
body.studio .nm-catpop-ver{padding:4px 10px;border-radius:999px;border:1px solid rgba(var(--cat-rgb),.35);background:rgba(var(--cat-rgb),.08);color:var(--text);font:inherit;font-size:12px;font-weight:700;cursor:pointer;transition:background .15s,transform .15s}
body.studio .nm-catpop-ver:hover,body.studio .nm-catpop-ver:focus-visible{background:rgba(var(--cat-rgb),.22);transform:translateY(-1px);outline:none}
body.studio .nm-catpop-ver.current{background:var(--cat);color:#fff;border-color:transparent}
@media (max-width:760px){body.studio .nm-cat-link{height:44px}}

/* ---- Popular model families ---- */
body.studio .nm-popular{flex:none;padding:1px 7px;border-radius:999px;background:var(--cat,var(--accent));color:#fff;font-size:10.5px;font-weight:800;letter-spacing:.02em;white-space:nowrap}
body.studio .nm-catpop-name{align-items:center}
body.studio .nm-catpop-name>span[dir]{margin-inline-end:auto}
body.studio .nm-catpop-brand.popular{background:linear-gradient(135deg,rgba(var(--cat-rgb),.14),var(--chip) 70%);border-color:rgba(var(--cat-rgb),.35)}

/* ---- Category panel: the whole brand card is a button, with a lively hover ---- */
body.studio .nm-catpop-brand{position:relative;overflow:hidden;cursor:pointer;transition:transform .25s cubic-bezier(.2,1.2,.4,1),box-shadow .25s,border-color .25s,background .25s;outline:none}
body.studio .nm-catpop-brand:hover,body.studio .nm-catpop-brand:focus-visible{transform:translateY(-3px) scale(1.02);border-color:rgba(var(--cat-rgb),.7);
 background:linear-gradient(135deg,rgba(var(--cat-rgb),.22),var(--chip) 75%);box-shadow:0 14px 30px rgba(0,0,0,.35),0 0 0 1px rgba(var(--cat-rgb),.35),0 0 26px rgba(var(--cat-rgb),.28)}
body.studio .nm-catpop-brand:active{transform:translateY(-1px) scale(.99)}
body.studio .nm-catpop-shine{position:absolute;inset:0;pointer-events:none;background:linear-gradient(115deg,transparent 30%,rgba(255,255,255,.22) 48%,transparent 66%);transform:translateX(-120%)}
body.studio .nm-catpop-brand:hover .nm-catpop-shine,body.studio .nm-catpop-brand:focus-visible .nm-catpop-shine{transition:transform .7s ease;transform:translateX(120%)}
body.studio .nm-catpop-go{position:absolute;bottom:10px;inset-inline-end:12px;font-weight:800;color:var(--cat);opacity:0;transform:translateX(-6px);transition:opacity .2s,transform .25s}
html[dir=rtl] body.studio .nm-catpop-go{transform:translateX(6px) scaleX(-1)}
body.studio .nm-catpop-brand:hover .nm-catpop-go,body.studio .nm-catpop-brand:focus-visible .nm-catpop-go{opacity:1;transform:none}
html[dir=rtl] body.studio .nm-catpop-brand:hover .nm-catpop-go{transform:scaleX(-1)}
body.studio .nm-catpop-brand:hover .nm-catpop-name>span[dir]{color:var(--cat)}
body.studio .nm-catpop-brand:hover .nm-popular{animation:nm-pop-badge .6s ease}
@keyframes nm-pop-badge{40%{transform:scale(1.15) rotate(-4deg)}}
body.studio .nm-catpop-ver{position:relative;z-index:1}
@media (prefers-reduced-motion:reduce){body.studio .nm-catpop-brand,body.studio .nm-catpop-go{transition:none}body.studio .nm-catpop-brand:hover{transform:none}body.studio .nm-catpop-shine{display:none}}

/* ---- Glass text logo, centred in the header between the categories and the account buttons ---- */
body.studio .nm-glass{position:relative;overflow:hidden;flex:none;margin-inline:auto;display:inline-flex;align-items:center;gap:10px;height:42px;padding:0 20px;border-radius:999px;text-decoration:none;isolation:isolate;
 background:linear-gradient(135deg,rgba(255,255,255,.16),rgba(255,255,255,.04) 45%,rgba(var(--accent-rgb),.10));
 backdrop-filter:blur(14px) saturate(160%);-webkit-backdrop-filter:blur(14px) saturate(160%);
 border:1px solid rgba(255,255,255,.22);
 box-shadow:inset 0 1px 0 rgba(255,255,255,.35),inset 0 -1px 0 rgba(0,0,0,.18),0 8px 24px rgba(0,0,0,.22),0 0 0 1px rgba(var(--accent-rgb),.12);
 transition:transform .3s cubic-bezier(.2,1.2,.4,1),box-shadow .3s}
body.studio .nm-glass::before{content:"";position:absolute;inset:1px 1px 50% 1px;border-radius:999px 999px 40% 40%;background:linear-gradient(180deg,rgba(255,255,255,.22),rgba(255,255,255,0));z-index:-1;pointer-events:none}
body.studio .nm-glass-fa{font-family:Estedad,var(--display);font-weight:900;font-size:22px;line-height:1;padding-top:2px;
 background:linear-gradient(180deg,#fff 0%,rgba(255,255,255,.75) 55%,rgb(var(--accent-rgb)) 130%);-webkit-background-clip:text;background-clip:text;color:transparent;
 filter:drop-shadow(0 1px 0 rgba(0,0,0,.25)) drop-shadow(0 0 10px rgba(var(--accent-rgb),.35))}
body.studio .nm-glass-en{font-family:var(--display);font-weight:700;font-size:12.5px;letter-spacing:.32em;margin-inline-end:-.32em;color:rgba(var(--fg-rgb),.78)}
body.studio .nm-glass-dot{width:5px;height:5px;border-radius:50%;background:var(--accent);box-shadow:0 0 8px var(--accent)}
body.studio .nm-glass-shine{position:absolute;inset:0;z-index:1;pointer-events:none;background:linear-gradient(110deg,transparent 35%,rgba(255,255,255,.35) 50%,transparent 65%);transform:translateX(-130%);animation:nm-glass-shine 7s ease-in-out 1.5s infinite}
@keyframes nm-glass-shine{0%,70%{transform:translateX(-130%)}100%{transform:translateX(130%)}}
body.studio .nm-glass:hover{transform:translateY(-1px) scale(1.03);box-shadow:inset 0 1px 0 rgba(255,255,255,.4),inset 0 -1px 0 rgba(0,0,0,.18),0 12px 30px rgba(0,0,0,.28),0 0 22px rgba(var(--accent-rgb),.3)}
html:is([data-theme=cloud],[data-theme=clay]) body.studio .nm-glass{background:linear-gradient(135deg,rgba(255,255,255,.75),rgba(255,255,255,.35) 50%,rgba(var(--accent-rgb),.12));border-color:rgba(255,255,255,.9);box-shadow:inset 0 1px 0 #fff,0 8px 22px rgba(20,30,60,.12),0 0 0 1px rgba(var(--accent-rgb),.18)}
html:is([data-theme=cloud],[data-theme=clay]) body.studio .nm-glass-fa{background:linear-gradient(180deg,rgb(var(--fg-rgb)) 10%,rgb(var(--accent-rgb)) 120%);-webkit-background-clip:text;background-clip:text;filter:drop-shadow(0 1px 0 rgba(255,255,255,.8))}
body.studio .nm-top-right{margin-inline-start:0}
/* The header compacts step by step so nothing is pushed off the edge (admins have one more link). */
@media (max-width:1680px){body.studio .nm-glass-en,body.studio .nm-glass-dot{display:none}body.studio .nm-glass{padding:0 18px}}
@media (max-width:1500px){
 body.studio .nm-top{gap:12px}
 body.studio .nm-nav .nav-link{padding:0 11px}
 body.studio .nm-cta,body.studio .nm-balance-unit{display:none}
}
@media (max-width:1180px) and (min-width:761px){
 body.studio .menu-toggle{display:inline-grid;place-items:center;width:38px;height:38px}
 body.studio .nm-nav{position:absolute;top:100%;left:0;right:0;display:none;flex-direction:column;align-items:stretch;gap:2px;padding:10px 16px 14px;border-radius:0;border:0;border-bottom:1px solid var(--line);background:var(--deep)}
 body.studio.nav-open .nm-nav{display:flex}
 body.studio .nm-nav .nav-link{height:44px;border-radius:12px;padding:0 16px}
 body.studio .nm-nav .nm-nav-logout{display:flex;cursor:pointer;font:inherit;font-size:14px;font-weight:600;color:var(--muted)}
 body.studio #logoutBtn{display:none}
 body.studio .nm-nav .nm-account{display:grid;max-width:none;margin:4px 4px 8px;padding:10px 12px;border-radius:12px;background:var(--chip);border:1px solid var(--line)}
}
@media (max-width:760px){body.studio .nm-glass{height:36px;padding:0 12px}body.studio .nm-glass-fa{font-size:18px}}
@media (max-width:430px){body.studio .nm-glass{display:none}body.studio .nm-top-right{margin-inline-start:auto}}
@media (prefers-reduced-motion:reduce){body.studio .nm-glass-shine{animation:none;display:none}}


/* ---- New logo placements (studio) ---- */
body.studio .nm-glass .rk-logo{--rk-h:40px}
body.studio .rk-brand{display:inline-flex;align-items:center;text-decoration:none}
body.studio .nm-hero-logo{display:block;margin:0 0 18px;line-height:0}
body.studio .brand-foot{display:inline-flex;align-items:center}
/* The left horse tile is gone from the studio header, so the centred logo also shows on small phones. */
@media (max-width:760px){body.studio .nm-glass .rk-logo{--rk-h:36px!important}}
@media (max-width:430px){body.studio .nm-glass{display:inline-flex;padding:0 2px}body.studio .nm-glass .rk-logo{--rk-h:28px!important}body.studio .nm-top-right{margin-inline-start:0}
 body.studio .nm-top .language-select{min-width:0;width:92px;padding:0 18px 0 6px}}
@media (max-width:560px){body.studio .nm-hero-logo .rk-logo{--rk-h:84px!important}}

/* ---- Upload panel tabs: Uploads (this generation) / Elements (your saved references) ---- */
body.studio .nm-refs-tabs{display:inline-flex;gap:2px;padding:3px;border-radius:12px;background:rgba(var(--fg-rgb),.05);border:1px solid var(--line)}
body.studio .nm-refs-tab{border:0;background:none;color:var(--muted);font:inherit;font-size:12.5px;font-weight:700;padding:5px 12px;border-radius:9px;cursor:pointer;display:inline-flex;align-items:center;gap:6px}
body.studio .nm-refs-tab.active{background:var(--surface);color:var(--text-strong);box-shadow:0 1px 3px rgba(0,0,0,.18)}
body.studio .nm-el-count:empty{display:none}
body.studio .nm-el-count{min-width:18px;padding:0 5px;border-radius:999px;background:rgba(var(--el-rgb),.2);color:var(--el);font-size:11px;line-height:18px;text-align:center}
body.studio{--el:#f2b441;--el-rgb:242,180,65}
html:is([data-theme=cloud],[data-theme=clay]) body.studio{--el:#a8650a;--el-rgb:168,101,10}
body.studio .nm-refs-pane.hidden{display:none}
body.studio .nm-el-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:10px}
body.studio .nm-el-new,body.studio .nm-el-card{position:relative;margin:0;border-radius:14px;overflow:hidden;aspect-ratio:3/4;border:1px solid var(--line);background:var(--panel-2);cursor:pointer;transition:transform .15s,border-color .15s,box-shadow .15s}
body.studio .nm-el-new{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;border:1.5px dashed rgba(var(--el-rgb),.55);background:rgba(var(--el-rgb),.06);color:var(--text);font:inherit;text-align:center;padding:8px}
body.studio .nm-el-new span{font-size:26px;line-height:1;color:var(--el)}
body.studio .nm-el-new b{font-size:12.5px}
body.studio .nm-el-new small{font-size:10.5px;color:var(--muted)}
body.studio .nm-el-card img{width:100%;height:100%;object-fit:cover;display:block}
body.studio .nm-el-card figcaption{position:absolute;inset:auto 0 0 0;padding:18px 8px 7px;background:linear-gradient(180deg,transparent,rgba(0,0,0,.78));color:#fff;display:flex;flex-direction:column;gap:1px}
body.studio .nm-el-card figcaption b{font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.studio .nm-el-card figcaption small{font-size:10.5px;opacity:.8}
body.studio .nm-el-card:hover,body.studio .nm-el-new:hover{transform:translateY(-2px);border-color:rgba(var(--el-rgb),.7);box-shadow:0 8px 20px rgba(0,0,0,.25)}
body.studio .nm-el-card.in-prompt{border-color:var(--el);box-shadow:0 0 0 2px rgba(var(--el-rgb),.5)}
body.studio .nm-el-used{position:absolute;top:6px;inset-inline-start:6px;padding:2px 7px;border-radius:999px;background:var(--el);color:#1d1404;font-size:10px;font-weight:800}
body.studio .nm-el-edit{position:absolute;top:5px;inset-inline-end:5px;width:26px;height:26px;border-radius:8px;border:0;background:rgba(0,0,0,.55);color:#fff;font-size:15px;line-height:1;cursor:pointer;opacity:0;transition:opacity .15s}
body.studio .nm-el-card:hover .nm-el-edit,body.studio .nm-el-edit:focus-visible{opacity:1}
@media (hover:none){body.studio .nm-el-edit{opacity:1}}
body.studio .nm-el-empty{grid-column:span 2;align-self:center;margin:0;font-size:12px;color:var(--muted);line-height:1.5}
/* elements the prompt mentions, shown with your uploads */
body.studio .nm-ref-item.is-element{border-color:rgba(var(--el-rgb),.6)}
body.studio .nm-ref-item.is-element .media-ref{background:var(--el);color:#1d1404}
body.studio .nm-el-badge{position:absolute;top:4px;inset-inline-start:4px;padding:1px 6px;border-radius:999px;background:rgba(0,0,0,.6);color:#fff;font-size:9.5px;font-weight:700}
/* @Element in the prompt and in the @ menu */
body.studio .nm-hl-inner mark.k-element{background:rgba(var(--el-rgb),.28);box-shadow:0 0 0 2px rgba(var(--el-rgb),.3)}
body.studio .nm-ref-chip.k-element{border-color:rgba(var(--el-rgb),.55);color:var(--el)}
body.studio .nm-refcard-media.k-element img{object-fit:contain;background:var(--panel-2)}
body.studio .nm-refcard-all{display:block;margin:-2px 12px 6px;font-size:11px;color:var(--muted);text-transform:none;letter-spacing:0}
body.studio .nm-ref-tip-warn{flex-basis:100%;color:var(--rose-text);font-size:11.5px}

/* ---- New / edit element window ---- */
.nm-el-dialog{width:min(480px,calc(100vw - 24px));padding:0;border:1px solid var(--line-strong);border-radius:20px;background:var(--pop);color:var(--text);box-shadow:0 30px 80px rgba(0,0,0,.55)}
.nm-el-dialog::backdrop{background:rgba(0,0,0,.55);backdrop-filter:blur(3px)}
.nm-el-form{display:flex;flex-direction:column;gap:14px;padding:18px}
.nm-el-dlg-head{display:flex;align-items:center;justify-content:space-between}
.nm-el-dlg-head b{font:800 17px/1.2 var(--display)}
.nm-el-x{width:32px;height:32px;border-radius:9px;border:1px solid var(--line);background:var(--chip);color:var(--text);font-size:18px;cursor:pointer}
.nm-el-drop{position:relative;display:grid;place-items:center;min-height:170px;max-height:260px;border-radius:14px;border:1.5px dashed rgba(var(--el-rgb,242,180,65),.6);background:rgba(var(--el-rgb,242,180,65),.06);cursor:pointer;overflow:hidden;text-align:center;padding:10px}
.nm-el-drop.over{border-style:solid;background:rgba(var(--el-rgb,242,180,65),.14)}
.nm-el-drop.locked{cursor:default}
.nm-el-drop img{max-width:100%;max-height:240px;object-fit:contain;border-radius:10px}
.nm-el-drop b{display:block;font-size:14px}
.nm-el-drop small{display:block;margin-top:4px;font-size:12px;color:var(--muted);line-height:1.5;max-width:300px}
.nm-el-field{display:flex;flex-direction:column;gap:6px;font-size:12.5px;font-weight:700}
.nm-el-field>small{font-weight:400;color:var(--muted)}
.nm-el-name{display:flex;align-items:center;border:1px solid var(--line-strong);border-radius:11px;background:var(--surface);padding:0 10px}
.nm-el-name span{color:var(--el,#f2b441);font-weight:800}
.nm-el-name input{flex:1;min-width:0;height:40px;border:0;background:none;color:var(--text);font:inherit;font-size:14px;outline:none}
.nm-el-cats{display:flex;flex-wrap:wrap;gap:6px}
.nm-el-cat input{position:absolute;opacity:0;pointer-events:none}
.nm-el-cat span{display:inline-block;padding:6px 12px;border-radius:999px;border:1px solid var(--line);background:var(--chip);font-weight:600;font-size:12.5px;cursor:pointer}
.nm-el-cat input:checked+span{border-color:var(--el,#f2b441);background:rgba(var(--el-rgb,242,180,65),.16);color:var(--text-strong)}
.nm-el-cat input:focus-visible+span{outline:2px solid var(--accent);outline-offset:2px}
.nm-el-msg{min-height:16px;font-size:12.5px}
.nm-el-msg.error{color:var(--rose-text)}
.nm-el-actions{display:flex;align-items:center;gap:8px}
.nm-el-actions>span{flex:1}
.nm-el-delete{color:var(--rose-text)}

/* Phones: the token balance keeps its "tokens" label (small, under the number) and is never cut off */
@media (max-width:760px){
 body.studio .nm-top-right{flex:none;gap:6px}
 body.studio .nm-balance{flex:none;display:inline-grid;grid-template-columns:auto auto;align-content:center;justify-items:center;column-gap:4px;row-gap:1px;padding:0 10px;white-space:nowrap;line-height:1}
 body.studio .nm-balance .nm-balance-unit{display:block;grid-column:1/-1;font-size:10px;line-height:1}
}
@media (max-width:430px){
 body.studio .nm-top{gap:6px;padding:0 8px}
 body.studio .nm-top .language-select{width:90px;padding:0 15px 0 6px;font-size:12px;background-position:right 4px center}
 body.studio .nm-glass .rk-logo{--rk-h:24px!important}
 body.studio .nm-top .nm-theme-btn{width:34px;height:34px}
 body.studio .menu-toggle{width:34px;height:34px}
}
