/* Handi Studio — design system */
:root {
  --bg: #060504;
  --bg-2: #0b0807;
  --surface: #120f0d;
  --surface-2: #191512;
  --surface-3: #221d19;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --text: #f7f3ef;
  --text-2: #c4bab2;
  --muted: #8c8079;
  --accent: #ff5a0a;
  --accent-2: #ff9a3c;
  --accent-soft: rgba(255, 90, 10, .14);
  --grad: linear-gradient(135deg, #ff5a0a 0%, #ff8a1f 100%);
  --on-accent: #0a0503;
  --ok: #3ddc97;
  --warn: #ffc857;
  --err: #ff5c6c;
  --info: #6aa8ff;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .45);
  --font: "Inter", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Sora", "IBM Plex Sans Arabic", "Inter", system-ui, sans-serif;
  --side: 248px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
[dir="rtl"] { --font: "IBM Plex Sans Arabic", "Inter", system-ui, sans-serif; --display: "IBM Plex Sans Arabic", "Sora", system-ui, sans-serif; }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img, video { display: block; max-width: 100%; }
::selection { background: var(--accent); color: #000; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2c241f; border-radius: 10px; border: 2px solid var(--bg); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.t2 { color: var(--text-2); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.hide { display: none !important; }
.mobile-only { display: none !important; }
@media (max-width: 900px) { .mobile-only { display: inline-flex !important; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; font-weight: 600; font-size: 14px; white-space: nowrap; transition: transform .15s var(--ease), background .2s, border-color .2s, opacity .2s; border: 1px solid transparent; }
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--grad); color: var(--on-accent); box-shadow: 0 8px 24px rgba(255, 90, 10, .28); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-light { background: #f4f2ee; color: #0b0c10; }
.btn-light:hover { background: #fff; }
.btn-ghost { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); border-color: var(--line-2); }
.btn-line { border-color: var(--line-2); }
.btn-line:hover { background: var(--surface-2); }
.btn-danger { background: rgba(255, 92, 108, .12); color: var(--err); border-color: rgba(255, 92, 108, .25); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 52px; padding: 0 24px; font-size: 16px; }
.btn-icon { width: 40px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--text-2); transition: background .2s, color .2s, border-color .2s; }
.pill:hover { color: var(--text); border-color: var(--line-2); }
.pill svg { width: 15px; height: 15px; }
.pill.on { color: var(--text); border-color: rgba(255, 90, 10, .5); background: var(--accent-soft); }
.pill .chev { width: 12px; height: 12px; opacity: .6; }
.chip svg { flex: none; width: 15px; height: 15px; }
.h2 svg { width: 20px; height: 20px; vertical-align: -3px; margin-inline-end: 4px; color: var(--accent-2); }
.chip { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); transition: .2s; }
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.on { background: #f4f2ee; color: #0b0c10; border-color: transparent; }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--surface-3); color: var(--text-2); }
.badge.new { background: rgba(61, 220, 151, .14); color: var(--ok); }
.badge.top { background: var(--accent-soft); color: #ffb07a; }
.badge.pro { background: rgba(255, 200, 87, .14); color: var(--warn); }
.badge.fast { background: rgba(106, 168, 255, .14); color: var(--info); }
.badge.demo { background: rgba(255, 200, 87, .14); color: var(--warn); }

/* ---------- inputs ---------- */
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input, .textarea, .select { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 13px; outline: none; transition: border-color .2s, background .2s; }
.input:focus, .textarea:focus, .select:focus { border-color: rgba(255, 90, 10, .6); background: var(--surface-3); }
.textarea { resize: vertical; min-height: 110px; line-height: 1.55; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%239aa0b2' stroke-width='2'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
[dir="rtl"] .select { background-position: left 12px center; padding-right: 13px; padding-left: 34px; }
.switch { position: relative; width: 40px; height: 24px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-2); transition: .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: .2s var(--ease); }
.switch.on { background: var(--accent); border-color: transparent; }
.switch.on::after { inset-inline-start: 19px; background: #fff; }
input[type="range"] { width: 100%; accent-color: var(--accent); }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 18px 14px; border-inline-end: 1px solid var(--line); background: linear-gradient(180deg, #0a0c10, #060504); }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 21px; letter-spacing: .04em; padding: 4px 8px 16px; }
.logo-mark { width: 30px; height: 30px; flex: none; }
.logo small { font-family: var(--font); font-weight: 600; font-size: 10px; letter-spacing: .18em; color: var(--muted); display: block; margin-top: -2px; }
.nav-sec { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 11px; border-radius: 11px; color: var(--text-2); font-weight: 500; transition: background .2s, color .2s; }
.nav a svg { width: 19px; height: 19px; opacity: .9; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.nav a.active svg { color: var(--accent); }
.nav a .badge { margin-inline-start: auto; }
.side-foot { margin-top: auto; display: grid; gap: 10px; }
.credits-card { padding: 14px; border-radius: var(--r); background: radial-gradient(120% 140% at 0% 0%, rgba(255, 90, 10, .18), transparent 60%), var(--surface); border: 1px solid var(--line); }
.credits-card .num { font-family: var(--display); font-size: 24px; font-weight: 700; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; transition: background .2s; }
.user-chip:hover { background: var(--surface); }
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--grad); color: var(--on-accent); }

.main { min-width: 0; position: relative; }
.topbar { position: sticky; top: 0; z-index: 20; display: none; align-items: center; justify-content: space-between; height: 58px; padding: 0 16px; background: rgba(6, 5, 4, .82); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.page { padding: 28px 36px 80px; max-width: 1280px; margin: 0 auto; }
.page-narrow { max-width: 980px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.h1 { font-family: var(--display); font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.h2 { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.h3 { font-size: 16px; font-weight: 700; margin: 0; }
.sub { color: var(--text-2); margin: 6px 0 0; }
.section { margin-top: 40px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

.bottom-nav { display: none; }

/* ---------- cards & grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card-pad { padding: 20px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.auto-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.studio-card { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; min-height: 190px; padding: 20px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); transition: transform .25s var(--ease), border-color .25s; isolation: isolate; }
.studio-card:hover { transform: translateY(-3px); border-color: var(--line-2); }
.studio-card .art { position: absolute; inset: 0; z-index: -1; opacity: .9; }
.studio-card .art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 20%, rgba(6, 5, 4, .92)); }
.studio-card .k { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--text-2); }
.studio-card .t { font-family: var(--display); font-size: 22px; font-weight: 700; margin-top: 4px; }
.studio-card .d { color: var(--text-2); font-size: 13.5px; margin-top: 4px; }
.studio-card .go { position: absolute; top: 16px; inset-inline-end: 16px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); backdrop-filter: blur(8px); }
.studio-card .go svg { width: 16px; height: 16px; }
[dir="rtl"] .studio-card .go svg, [dir="rtl"] .flip-rtl { transform: scaleX(-1); }

.engine-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, transform .2s var(--ease); }
.engine-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.engine-mark { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); border: 1px solid var(--line); flex: none; }
.engine-mark svg { width: 24px; height: 24px; }
.engine-card .n { font-weight: 700; font-size: 16px; }
.engine-card .v { color: var(--muted); font-size: 13px; }

.tool-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px; min-height: 170px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: .25s var(--ease); }
.tool-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.tool-card::before { content: ""; position: absolute; inset: auto -30% -60% auto; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 90, 10, .16), transparent 70%); transition: .4s; }
.tool-card:hover::before { transform: scale(1.3); }
.tool-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); border: 1px solid var(--line); }
.tool-ico svg { width: 21px; height: 21px; color: var(--accent-2); }
.tool-card .n { font-weight: 700; font-size: 16px; }
.tool-card .d { color: var(--text-2); font-size: 13.5px; }
.tool-card .badge { position: absolute; top: 16px; inset-inline-end: 16px; }

.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }

/* ---------- composer ---------- */
.studio-hero { text-align: center; padding: 26px 0 18px; }
.studio-hero .h1 { font-size: 38px; }
.reel { display: flex; justify-content: center; align-items: flex-end; gap: 10px; height: 150px; margin-bottom: 14px; perspective: 900px; }
.reel > div { width: 86px; height: 128px; border-radius: 14px; border: 1px solid var(--line-2); box-shadow: var(--shadow); transition: transform .6s var(--ease); }
.reel > div:nth-child(1) { transform: rotate(-12deg) translateY(10px); }
.reel > div:nth-child(2) { transform: rotate(-5deg); }
.reel > div:nth-child(3) { width: 100px; height: 150px; transform: translateY(-8px); }
.reel > div:nth-child(4) { transform: rotate(5deg); }
.reel > div:nth-child(5) { transform: rotate(12deg) translateY(10px); }
.studio-hero:hover .reel > div:nth-child(1) { transform: rotate(-16deg) translate(-8px, 12px); }
.studio-hero:hover .reel > div:nth-child(5) { transform: rotate(16deg) translate(8px, 12px); }

.dir-chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.dir-chip { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; color: var(--text-2); text-align: start; transition: .2s; min-width: 0; }
.dir-chip:hover { border-color: var(--line-2); color: var(--text); }
.dir-chip > span { white-space: nowrap; flex: none; }
.dir-chip b { min-width: 0; color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dir-chip svg { width: 16px; height: 16px; flex: none; color: var(--accent-2); }
.dir-chip .chev { margin-inline-start: auto; opacity: .5; color: inherit; }
.dir-chip.set { border-color: rgba(255, 90, 10, .45); }

.composer { position: relative; border-radius: var(--r-lg); background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); transition: border-color .2s, box-shadow .2s; }
.composer:focus-within { border-color: rgba(255, 90, 10, .4); box-shadow: 0 30px 80px rgba(0, 0, 0, .35), 0 0 0 4px rgba(255, 90, 10, .08); }
.composer.drag { border-color: var(--accent); border-style: dashed; }
.composer textarea { display: block; width: 100%; min-height: 96px; max-height: 340px; padding: 18px 20px 6px; background: none; border: 0; outline: none; resize: none; font-size: 16px; line-height: 1.55; }
.composer textarea::placeholder { color: var(--muted); }
.composer .meta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 0 20px 6px; font-size: 12.5px; color: var(--muted); min-height: 30px; }
.composer .meta-row .pill { height: 30px; }
@media (max-width: 640px) { .composer .meta-row .grow { display: none; } .composer .meta-row { padding: 0 14px 6px; } }
.composer .meta-row .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer .tools { display: flex; align-items: center; gap: 8px; padding: 10px 12px 12px; flex-wrap: wrap; }
.composer .tools .sp { flex: 1; }
.refs { display: flex; gap: 8px; padding: 12px 16px 0; flex-wrap: wrap; }
.ref { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); background: var(--surface-3); }
.ref img, .ref video { width: 100%; height: 100%; object-fit: cover; }
.ref .x { position: absolute; top: 3px; inset-inline-end: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 0, 0, .7); display: grid; place-items: center; }
.ref .x svg { width: 12px; height: 12px; }
.ref .tag { position: absolute; inset-inline-start: 4px; bottom: 4px; font-size: 9.5px; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: rgba(0, 0, 0, .7); }
.ref { width: 76px; height: 76px; }
.ref .tag.role { display: inline-flex; align-items: center; gap: 2px; max-width: calc(100% - 8px); color: #fff; cursor: pointer; white-space: nowrap; overflow: hidden; }
.ref .tag.role:hover { background: var(--accent); color: var(--on-accent); }
.ref .tag.role .chev { width: 9px; height: 9px; flex: none; }
.ref .ref-name { position: absolute; inset-inline-start: 4px; top: 4px; font-size: 9.5px; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: var(--accent); color: var(--on-accent); }
.ref .ref-audio { display: grid; place-items: center; width: 100%; height: 100%; color: var(--accent-2, #ff8a1f); }
.ref .ref-audio svg { width: 28px; height: 28px; }
.refs-note { align-self: center; font-size: 12px; color: var(--text-3, #8b8580); padding-inline-start: 4px; }
.recipes { display: flex; gap: 8px; align-items: center; overflow-x: auto; scrollbar-width: none; padding: 2px 0 12px; margin-bottom: 2px; }
.recipes::-webkit-scrollbar { display: none; }
.recipes-label { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 12.5px; font-weight: 600; color: var(--text-2); padding-inline-end: 4px; }
.recipes-label svg { width: 15px; height: 15px; color: var(--accent); }
.chip.recipe { flex: none; }
.chip.recipe.on { background: var(--accent-soft); color: var(--text); border-color: rgba(255, 90, 10, .55); }
.final-prompt { white-space: pre-wrap; font-size: 13.5px; line-height: 1.6; color: var(--text); background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; max-height: 52vh; overflow: auto; }
.dir-preview { max-height: 150px; overflow: auto; line-height: 1.55; }
.light-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.light-opt { display: grid; justify-items: center; gap: 6px; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; color: var(--text-2); cursor: pointer; transition: .2s; }
.light-opt img { width: 58px; height: 58px; border-radius: 50%; }
.light-opt:hover { color: var(--text); border-color: var(--line-2); }
.light-opt.on { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.sec-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ref.loading::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='white' stroke-width='3' stroke-dasharray='40 20'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='.8s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") center/24px no-repeat; }
.gen-btn { height: 42px; padding: 0 18px; }
.gen-btn .cost { opacity: .85; font-weight: 500; }
.eng-pill .dot { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; }
.eng-pill .dot svg { width: 14px; height: 14px; }
.suggest { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }

/* ---------- popover menu ---------- */
.menu { position: fixed; z-index: 120; min-width: 220px; max-width: min(360px, calc(100vw - 24px)); max-height: min(420px, 70vh); overflow: auto; padding: 6px; border-radius: 16px; background: rgba(25, 21, 18, .97); backdrop-filter: blur(20px); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: pop .16s var(--ease); }
.menu-title { padding: 8px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.menu-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border-radius: 10px; text-align: start; transition: background .15s; }
.menu-item:hover, .menu-item.focus { background: var(--surface-3); }
.menu-item .mi-t { font-weight: 600; font-size: 14px; }
.menu-item .mi-d { font-size: 12px; color: var(--muted); }
.menu-item .check { margin-inline-start: auto; width: 16px; height: 16px; color: var(--accent); }
.menu-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.menu-grid .menu-item { justify-content: center; padding: 9px 4px; font-weight: 600; font-size: 13px; }
.menu-grid .menu-item.on { background: var(--accent-soft); color: #ffb07a; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(3, 4, 6, .72); backdrop-filter: blur(6px); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { position: relative; width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: pop .22s var(--ease); }
.modal-wide { width: min(980px, 100%); }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; background: var(--surface); border-bottom: 1px solid var(--line); }
.modal-body { padding: 22px; }
.modal-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; background: var(--surface); border-top: 1px solid var(--line); }

/* director */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.tabs button { flex: 1; height: 38px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--text-2); transition: .2s; }
.tabs button.on { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.subtabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin: 16px 0; overflow-x: auto; scrollbar-width: none; }
.subtabs button { position: relative; padding: 10px 0; font-size: 13.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.subtabs button.on { color: var(--text); }
.subtabs button.on::after { content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }
.subtabs button .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-inline-start: 6px; vertical-align: middle; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.opt { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px; min-height: 96px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); text-align: start; transition: .18s; }
.opt:hover { border-color: var(--line-2); background: var(--surface-3); }
.opt.on { border-color: var(--accent); background: linear-gradient(180deg, rgba(255, 90, 10, .14), var(--surface-2)); }
.opt .oi { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--bg-2); color: var(--accent-2); }
.opt .oi svg { width: 17px; height: 17px; }
.opt .sw { width: 100%; height: 30px; border-radius: 8px; }
.opt .on-mark { position: absolute; top: 10px; inset-inline-end: 10px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); display: none; place-items: center; }
.opt.on .on-mark { display: grid; }
.opt .on-mark svg { width: 11px; height: 11px; color: var(--on-accent); }
.opt .ol { font-size: 13px; font-weight: 600; line-height: 1.25; }
.opt .oh { font-size: 11.5px; color: var(--muted); margin-top: -6px; }
/* option cards with a preview photo (Cloudinary) */
.opt-grid.has-ph { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
.opt .ph { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: var(--bg-2); }
.opt .ph img, .opt .ph video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.opt:hover .ph img, .opt:hover .ph video { transform: scale(1.05); }
.opt .ph.none { display: none; }
.opt .ph.gear { position: relative; background: radial-gradient(70% 80% at 50% 55%, rgba(255, 106, 26, .18), transparent 70%), var(--bg-2); }
.opt .ph.gear .g { object-fit: contain; padding: 2% 6%; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .55)); }
.opt .ph.gear .r { position: absolute; inset: 0; opacity: 0; transition: opacity .25s ease, transform .35s ease; }
.opt:hover .ph.gear .r, .opt:focus-visible .ph.gear .r { opacity: 1; }
.opt:hover .ph.gear .g { transform: none; }
@media (hover: none) { .opt .ph.gear .r { display: none; } }
.opt .ph:not(.none) ~ .oi, .opt .ph:not(.none) ~ .sw { display: none; }
.opt .ph:not(.none) ~ .on-mark { top: 18px; inset-inline-end: 18px; box-shadow: 0 2px 8px rgba(0, 0, 0, .45); }
.opt-grid.has-ph .opt { padding: 8px 8px 10px; gap: 8px; }
.opt-grid.has-ph .opt .ol { padding: 0 4px; }
.opt-grid.has-ph .opt .oh { padding: 0 4px; margin-top: -4px; }
.dir-preview { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px dashed var(--line-2); font-size: 13px; color: var(--text-2); }

/* ---------- results ---------- */
.results { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.job { position: relative; display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); overflow: hidden; animation: pop .3s var(--ease); }
.job-media { position: relative; background: #050608; aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden; cursor: zoom-in; }
.job-media img, .job-media video { width: 100%; height: 100%; object-fit: contain; }
.job-media.multi { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; place-items: stretch; }
.job-media.multi img { object-fit: cover; aspect-ratio: auto; height: 100%; }
.job-media audio { width: calc(100% - 28px); }
.job-media .wave { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 3px; opacity: .5; pointer-events: none; padding-bottom: 46px; }
.job-media .wave i { width: 4px; border-radius: 4px; background: var(--grad); }
.job-pending { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; background: radial-gradient(80% 80% at 50% 40%, rgba(255, 90, 10, .12), transparent 70%), #08090c; }
.job-pending::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .05) 50%, transparent 70%); background-size: 200% 100%; animation: shimmer 1.8s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.job-pending .ring { width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .08); border-top-color: var(--accent); animation: spin 1s linear infinite; }
.job-pending .st { font-weight: 600; font-size: 14px; text-transform: capitalize; }
.job-pending .el { font-size: 12px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.job-failed { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; background: #0d0709; }
.job-failed .e { font-size: 13px; color: #ff9aa4; max-height: 100%; overflow: auto; }
.job-body { display: grid; gap: 8px; padding: 12px 14px 14px; }
.job-prompt { font-size: 13.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.job-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.job-meta .sep { opacity: .4; }
.job-actions { display: flex; gap: 6px; }
.job-actions .btn { height: 30px; padding: 0 10px; font-size: 12.5px; }
.job-actions .btn svg { width: 15px; height: 15px; }
.job .demo-tag { position: absolute; top: 10px; inset-inline-start: 10px; z-index: 2; }

.empty { display: grid; place-items: center; gap: 10px; text-align: center; padding: 56px 20px; border-radius: var(--r-lg); border: 1px dashed var(--line-2); color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: var(--text-2); opacity: .7; }
.empty .h3 { color: var(--text); }

/* lightbox */
.lightbox { display: grid; grid-template-columns: 1fr 340px; min-height: 60vh; }
.lightbox .lb-media { background: #020203; display: grid; place-items: center; padding: 10px; min-height: 50vh; }
.lightbox .lb-media img, .lightbox .lb-media video { max-height: 78vh; width: auto; max-width: 100%; border-radius: 8px; }
.lightbox .lb-side { padding: 22px; display: flex; flex-direction: column; gap: 14px; border-inline-start: 1px solid var(--line); overflow: auto; max-height: 86vh; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: end; }
.prompt-box { padding: 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); white-space: pre-wrap; max-height: 200px; overflow: auto; }

/* ---------- toast ---------- */
.toasts { position: fixed; z-index: 200; bottom: 24px; inset-inline-end: 24px; display: grid; gap: 10px; }
.toast { display: flex; align-items: flex-start; gap: 10px; min-width: 260px; max-width: 400px; padding: 13px 16px; border-radius: 14px; background: rgba(25, 21, 18, .97); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: pop .25s var(--ease); font-size: 14px; }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast.ok svg { color: var(--ok); }
.toast.err svg { color: var(--err); }
.toast.info svg { color: var(--info); }

/* ---------- Handi Director chat ---------- */
.dchat { display: grid; grid-template-columns: 270px 1fr; height: 100vh; }
.dchat-side { display: flex; flex-direction: column; gap: 10px; padding: 18px 14px; border-inline-end: 1px solid var(--line); background: var(--bg-2); overflow: auto; }
.chat-link { display: block; padding: 10px 12px; border-radius: 12px; color: var(--text-2); transition: .2s; }
.chat-link:hover { background: var(--surface); color: var(--text); }
.chat-link.active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.chat-link .ct { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-link .cd { font-size: 12px; color: var(--muted); }
.dchat-main { display: flex; flex-direction: column; min-width: 0; height: 100vh; position: relative; }
.dchat-head { display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.dchat-scroll { flex: 1; overflow: auto; padding: 26px 24px 30px; }
.dchat-inner { max-width: 860px; margin: 0 auto; display: grid; gap: 20px; }
.dchat-glow { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(60% 40% at 50% 0%, rgba(255, 122, 89, .14), transparent 70%); }
.dchat-empty { flex: 1; display: grid; place-items: center; padding: 20px; position: relative; }
.dchat-empty .inner { width: min(760px, 100%); text-align: center; }
.dchat-compose { padding: 12px 24px 22px; }
.dchat-compose .composer { max-width: 860px; margin: 0 auto; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); }
.seg button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button svg { width: 15px; height: 15px; }
.seg button.on { background: var(--surface-3); color: var(--text); }
.msg { display: flex; gap: 12px; }
.msg.user { justify-content: flex-end; }
.msg .bubble { max-width: 80%; padding: 12px 16px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); white-space: pre-wrap; }
.msg.user .bubble { background: #f4f2ee; color: #0b0c10; border-color: transparent; border-end-end-radius: 6px; }
.msg.assistant .bubble { border-end-start-radius: 6px; }
.msg .av { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); border: 1px solid var(--line); }
.msg .av svg { width: 20px; height: 20px; }
.plan { margin-top: 12px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-2); overflow: hidden; }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 18px; border-bottom: 1px solid var(--line); background: radial-gradient(100% 140% at 0% 0%, rgba(255, 90, 10, .12), transparent 60%); }
.plan-vo { padding: 14px 18px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.shot { display: grid; grid-template-columns: 34px 1fr; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.shot:last-child { border-bottom: 0; }
.shot-n { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-family: var(--display); background: var(--surface-3); }
.shot textarea { min-height: 76px; font-size: 13.5px; }
.shot .job { margin-top: 10px; max-width: 300px; }
.shot .job .job-media { max-height: 360px !important; }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-2); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.plan-vo b { white-space: nowrap; }
.dchat-toggle { display: none !important; }
@media (max-width: 1200px) {
  .dchat { grid-template-columns: 1fr; }
  .dchat-side { display: none; }
  .dchat-side.open { display: flex; position: fixed; top: 0; bottom: 0; inset-inline-start: var(--side); width: 290px; z-index: 30; box-shadow: var(--shadow); }
  .dchat-toggle { display: inline-flex !important; }
}

/* ---------- voice ---------- */
.voice-layout { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
.voice-list { display: grid; gap: 8px; max-height: 520px; overflow: auto; padding-inline-end: 4px; }
.voice { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); text-align: start; width: 100%; transition: .15s; }
.voice:hover { border-color: var(--line-2); }
.voice.on { border-color: var(--accent); background: linear-gradient(90deg, rgba(255, 90, 10, .12), var(--surface-2)); }
.voice .vav { width: 38px; height: 38px; flex: none; border-radius: 12px; display: grid; place-items: center; font-weight: 700; background: var(--surface-3); }
.voice .vn { font-weight: 600; }
.voice .vl { font-size: 12px; color: var(--muted); }
.voice .play { margin-inline-start: auto; }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: start; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.pos { color: var(--ok); } .neg { color: var(--text-2); }
.table-wrap { overflow-x: auto; }

/* ---------- landing ---------- */
.land-nav { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 68px; padding: 0 28px; background: rgba(6, 5, 4, .72); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.land-nav .links { display: flex; gap: 22px; color: var(--text-2); font-size: 14px; }
.land-nav .links a:hover { color: var(--text); }
.land { max-width: 1200px; margin: 0 auto; padding: 0 24px 80px; overflow-x: clip; }
.hero { position: relative; text-align: center; padding: 84px 0 40px; }
.hero::before { content: ""; position: absolute; inset: -40px -30vw auto; height: 620px; z-index: -1; background: radial-gradient(40% 50% at 50% 30%, rgba(255, 90, 10, .22), transparent 70%), radial-gradient(30% 40% at 70% 60%, rgba(255, 154, 60, .14), transparent 70%); }
.hero-glow { position: relative; width: 132px; height: 132px; margin: -12px auto 18px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(closest-side, #ff7414 0%, #f24e04 45%, rgba(184, 53, 10, .55) 75%, transparent 100%); animation: glow 4.5s ease-in-out infinite; }
.hero-glow .hand-mark { width: 58px; height: auto; color: #0a0503; transform: translate(-2px, 2px); }
@keyframes glow { 50% { transform: scale(1.06); filter: brightness(1.08); } }
@media (prefers-reduced-motion: reduce) { .hero-glow { animation: none; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255, 90, 10, .35); background: var(--accent-soft); color: #ffb07a; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: blink 1.4s infinite; }
.hero h1 { font-family: var(--display); font-size: clamp(40px, 7vw, 76px); line-height: 1.02; letter-spacing: -.035em; margin: 20px 0 16px; }
.hero p.lead { font-size: 18px; color: var(--text-2); max-width: 640px; margin: 0 auto 30px; }
.hero .composer { max-width: 780px; margin: 0 auto; text-align: start; }
.stats { display: flex; justify-content: center; gap: 48px; margin-top: 46px; flex-wrap: wrap; }
.stats .s b { display: block; font-family: var(--display); font-size: 34px; font-weight: 700; }
.stats .s span { color: var(--muted); font-size: 13px; }
.l-sec { margin-top: 96px; }
.l-sec .kicker { font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--accent-2); }
.l-sec h2 { font-family: var(--display); font-size: clamp(28px, 4vw, 44px); line-height: 1.08; letter-spacing: -.025em; margin: 10px 0 12px; }
.l-sec p.lead { color: var(--text-2); font-size: 16.5px; max-width: 620px; margin: 0 0 28px; }
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee .track { display: flex; gap: 10px; width: max-content; animation: marq 50s linear infinite; }
[dir="rtl"] .marquee .track { animation-direction: reverse; }
@keyframes marq { to { transform: translateX(-50%); } }
.director-show { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; align-items: stretch; }
.frame { position: relative; border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line-2); min-height: 360px; background: #050608; }
.frame .corners { position: absolute; inset: 18px; pointer-events: none; }
.frame .corners::before, .frame .corners::after { content: ""; position: absolute; width: 34px; height: 34px; border: 2px solid rgba(255, 255, 255, .7); }
.frame .corners::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.frame .corners::after { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.frame .hud { position: absolute; top: 22px; inset-inline-end: 26px; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .1em; }
.frame .hud i { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: blink 1.2s infinite; }
.frame .cap { position: absolute; inset-inline-start: 28px; bottom: 26px; }
.frame .cap .k { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--text-2); }
.frame .cap .t { font-family: var(--display); font-size: 26px; font-weight: 700; }
.scene { position: absolute; inset: 0; transition: transform 1.2s var(--ease); }
.scene .mv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s ease; }
.scene .mv.on { opacity: 1; }

/* ---------- Camera Guide ---------- */
.gd-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin: 4px 0 20px; }
.gd-tabs button { padding: 8px 12px; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: 14px; }
.gd-tabs button small { color: var(--muted); font-weight: 600; margin-inline-start: 4px; }
.gd-tabs button.on { background: var(--accent-soft); color: var(--accent-2); }
.gd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.gd-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.gd-ph { display: block; aspect-ratio: 16 / 9; background: var(--bg-2); position: relative; overflow: hidden; }
.gd-ph img, .gd-ph video { width: 100%; height: 100%; object-fit: cover; display: block; }
.gd-ph.none { display: none; }
.gd-ph.soon { display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--accent-2); background: radial-gradient(80% 90% at 50% 40%, rgba(255, 106, 26, .16), transparent 70%), var(--bg-2); }
.gd-ph.soon svg { width: 28px; height: 28px; }
.gd-ph.soon small { font-size: 12px; color: var(--muted); font-weight: 600; }
.gd-ph.gear { background: radial-gradient(70% 80% at 50% 55%, rgba(255, 106, 26, .2), transparent 70%), var(--bg-2); }
.gd-ph.gear .g { object-fit: contain; padding: 4% 8%; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .55)); }
.gd-ph.gear .r { position: absolute; inset: 0; opacity: 0; transition: opacity .25s ease; }
.gd-card:hover .gd-ph.gear .r { opacity: 1; }
@media (hover: none) { .gd-ph.gear .r { display: none; } }
.gd-body { padding: 12px 14px 14px; display: grid; gap: 6px; align-content: start; flex: 1; }
.gd-body b { font-size: 15px; }
.gd-body p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.45; }
.gd-body .btn { justify-self: start; margin-top: 4px; }
.gd-body .row .btn { margin-top: 0; }
.gd-body code { font-size: 12px; color: var(--text-2); white-space: pre-wrap; display: block; max-height: 7.5em; overflow: auto; background: var(--bg-2); border-radius: 8px; padding: 8px; }

.src-box { display: grid; gap: 4px; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); }
.src-box b { display: flex; align-items: center; gap: 6px; color: var(--text); font-size: 13px; }
.src-box svg { width: 14px; height: 14px; }

/* Save camera move */
.rp-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.rp-kind { display: grid; gap: 4px; text-align: start; padding: 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); }
.rp-kind b { font-size: 14px; }
.rp-kind span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.rp-kind.on { border-color: var(--accent); background: var(--accent-soft); }
.rp-list { display: grid; gap: 10px; }
.rp-item { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.rp-item.done { opacity: .55; }
.rp-item .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); align-items: center; }
.rp-item p { margin: 0; white-space: pre-wrap; }
.io-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.io-row .sp { flex: 1; }
.io-row .btn.on { background: var(--accent-soft); color: var(--accent-2); }
.io-t { width: 92px; padding: 7px 10px; font-variant-numeric: tabular-nums; text-align: center; }
.io-len { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent-2); min-width: 46px; }
.io-len.bad { color: var(--danger, #ff5d5d); }
.io-track { position: relative; height: 14px; border-radius: 7px; background: var(--surface-3); border: 1px solid var(--line); cursor: pointer; overflow: hidden; }
.io-sel { position: absolute; top: 0; bottom: 0; background: linear-gradient(90deg, rgba(255, 90, 10, .55), rgba(255, 154, 60, .55)); border-inline: 2px solid var(--accent-2); }
.mv-detail { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.mv-detail div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; gap: 2px; font-size: 13px; }
.mv-detail small { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.mv-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; max-height: 340px; overflow: auto; }
.mv-pick button { display: grid; gap: 4px; padding: 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); text-align: start; font-size: 12.5px; font-weight: 600; }
.mv-pick button:hover { border-color: var(--accent); }
.mv-pick video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 7px; background: var(--bg-2); }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 16px; }
.faq summary::after { content: "+"; font-size: 22px; color: var(--muted); transition: .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { color: var(--text-2); margin: 10px 0 0; }
.cta-band { margin-top: 96px; padding: 48px; border-radius: var(--r-xl); text-align: center; border: 1px solid var(--line-2); background: radial-gradient(60% 120% at 50% 0%, rgba(255, 90, 10, .25), transparent 70%), var(--surface); }
.foot { margin-top: 70px; padding: 26px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }

/* auth */
.auth { display: grid; gap: 14px; }
.auth .or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.auth .or::before, .auth .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; gap: 10px; font-weight: 600; text-decoration: none; }
.btn-google:hover { background: #f4f6fb; color: #1f1f1f; }
.btn-google svg { flex: none; }
.auth .or-line { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.auth .or-line::before, .auth .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.err-box { padding: 10px 12px; border-radius: 10px; background: rgba(255, 92, 108, .1); border: 1px solid rgba(255, 92, 108, .25); color: #ff9aa4; font-size: 13px; }
.note { padding: 12px 14px; border-radius: 12px; background: rgba(255, 200, 87, .08); border: 1px solid rgba(255, 200, 87, .22); color: #ffd98a; font-size: 13px; }
.note a { text-decoration: underline; }

/* drop zone */
.drop { display: grid; place-items: center; gap: 8px; min-height: 180px; padding: 20px; border-radius: var(--r-lg); border: 1.5px dashed var(--line-2); background: var(--surface-2); text-align: center; color: var(--text-2); cursor: pointer; transition: .2s; }
.drop:hover, .drop.drag { border-color: var(--accent); background: var(--accent-soft); }
.drop svg { width: 30px; height: 30px; color: var(--accent-2); }
.drop img, .drop video { max-height: 260px; border-radius: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .voice-layout { grid-template-columns: 1fr; }
  .lightbox { grid-template-columns: 1fr; }
  .lightbox .lb-side { border-inline-start: 0; border-top: 1px solid var(--line); max-height: none; }
  .director-show { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { display: flex; }
  .page { padding: 18px 16px 110px; }
  .h1 { font-size: 28px; }
  .studio-hero .h1 { font-size: 28px; }
  .g3 { grid-template-columns: 1fr; }
  .bottom-nav { position: fixed; z-index: 40; inset: auto 0 0 0; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; height: 72px; padding: 0 6px env(safe-area-inset-bottom); background: rgba(10, 11, 15, .92); backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
  .bottom-nav a, .bottom-nav button { display: grid; justify-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); }
  .bottom-nav svg { width: 22px; height: 22px; }
  .bottom-nav .active { color: var(--text); }
  .bottom-nav .create { display: grid; place-items: center; width: 62px; height: 42px; margin: 0 auto; border-radius: 999px; background: var(--grad); color: var(--on-accent); box-shadow: 0 8px 24px rgba(255, 90, 10, .35); }
  .dchat { grid-template-columns: 1fr; height: calc(100vh - 58px); }
  .dchat-side { display: none; }
  .dchat-side.open { display: flex; position: fixed; inset: 58px 0 72px 0; width: auto; z-index: 30; }
  .dchat-main { height: calc(100vh - 58px - 72px); }
  .dchat-scroll { padding: 18px 14px; }
  .dchat-compose { padding: 8px 12px 12px; }
  .msg .bubble { max-width: 92%; }
  .toasts { inset-inline: 12px; bottom: 86px; }
  .toast { max-width: none; }
  .land-nav { padding: 0 16px; }
  .land-nav .links { display: none; }
  .land { padding: 0 16px 60px; }
  .hero { padding-top: 48px; }
  .cta-band { padding: 30px 18px; }
}
@media (max-width: 640px) {
  .g2, .g4 { grid-template-columns: 1fr; }
  .dir-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .dir-chips > :first-child { grid-column: 1 / -1; }
  .dir-chip { height: 40px; }
  .results { grid-template-columns: 1fr; }
  .composer .tools { gap: 6px; }
  .composer .tools .sp { flex-basis: 100%; height: 0; }
  .gen-btn { flex: 1; }
  .modal { border-radius: 22px; }
  .overlay { padding: 10px; align-items: end; }
  .opt-grid { grid-template-columns: repeat(2, 1fr); }
  .reel { height: 110px; } .reel > div { width: 62px; height: 92px; } .reel > div:nth-child(3) { width: 74px; height: 110px; }
  .menu-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.cost { display: inline-flex; align-items: center; gap: 4px; padding-inline-start: 8px; margin-inline-start: 2px; border-inline-start: 1px solid rgba(255, 255, 255, .3); font-variant-numeric: tabular-nums; }
.btn-light .cost { border-color: rgba(0, 0, 0, .2); }
.cost svg { width: 14px !important; height: 14px !important; opacity: .85; }
.job-meta .sep { font-size: 8px; }

/* ---------- buying credits ---------- */
.pack { display: grid; gap: 8px; align-content: start; transition: border-color .2s, transform .2s; }
.pack:hover { border-color: var(--line-2); transform: translateY(-2px); }
.pack-pop { border-color: rgba(255, 90, 10, .55); background: radial-gradient(120% 120% at 100% 0%, rgba(255, 90, 10, .16), transparent 60%), var(--surface); }
.pack-credits { font-family: var(--display); font-size: 30px; font-weight: 700; line-height: 1.1; margin-top: 6px; }
.pack-credits span { font-size: 14px; font-weight: 500; color: var(--muted); }
.pack-price { font-size: 20px; font-weight: 700; }
.pack .btn { margin-top: 6px; }
.modal .empty { border: 0; }
.hook { display: grid; gap: 6px; padding: 12px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line); font-size: 13px; }
.hook code { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; word-break: break-all; color: var(--text); }
.pack-row td { vertical-align: middle; }
.empty .btn svg { width: 16px; height: 16px; opacity: 1; color: inherit; }

/* Motion Control */
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.seg > button { height: auto; min-height: 60px; line-height: 1.3; display: flex; align-items: center; gap: 10px; text-align: start; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); transition: border-color .15s, background .15s; }
.seg > button:hover { border-color: var(--line-2); color: var(--text); }
.seg > button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.seg > button b { display: block; font-size: 14px; color: var(--text); }
.seg > button small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.seg .dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); flex: none; }
.ref.add { display: grid; place-items: center; border: 1.5px dashed var(--line-2); background: var(--surface-2); color: var(--text-2); cursor: pointer; }
.ref.add svg { width: 20px; height: 20px; }
.tips summary { cursor: pointer; list-style: none; }
.tips summary::-webkit-details-marker { display: none; }
.tips ul { margin: 12px 0 0; padding-inline-start: 20px; display: grid; gap: 8px; color: var(--text-2); font-size: 14px; line-height: 1.55; }
@media (max-width: 720px) { .mc-inputs { grid-template-columns: 1fr; } }
.forgot { font-size: 13px; color: var(--text-2); margin-top: -4px; }
.forgot summary { cursor: pointer; list-style: none; color: var(--accent-2); font-weight: 600; width: max-content; }
.forgot summary::-webkit-details-marker { display: none; }
.forgot p { margin: 8px 0 0; line-height: 1.5; }
.logo > span { white-space: nowrap; }
.side .logo { font-size: 18px; letter-spacing: .03em; }
.seg .dot svg { width: 20px; height: 20px; }
@media (max-width: 560px) { .land-nav .logo > span { display: none; } .land-nav .row { gap: 6px; } }

/* ---------- Ad Archive ---------- */
.arc { display: block; }
.arc-hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: end; margin: 6px 0 18px; }
.arc-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.arc-eyebrow svg { width: 15px; height: 15px; }
.arc-hero .sub { max-width: 60ch; }
.arc-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.arc-stats div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 2px; }
.arc-stats b { font-size: 26px; line-height: 1.05; font-weight: 800; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.arc-stats span { font-size: 12.5px; color: var(--muted); }
.arc-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 18px; padding-bottom: 8px; }
.arc-tabs a, .arc-tabs > button:not(.btn) { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; color: var(--text-2); font-size: 14px; font-weight: 600; }
.arc-tabs a svg { width: 16px; height: 16px; }
.arc-tabs a.on, .arc-tabs > button.on { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.arc-tabs .sp { flex: 1; }
.arc-search { position: relative; display: flex; gap: 8px; align-items: center; }
.arc-search .ico { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); display: grid; }
.arc-card .qbadge { position: absolute; top: 8px; inset-inline-end: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: rgba(6, 5, 4, .78); color: var(--accent-2); border: 1px solid rgba(255, 154, 60, .45); backdrop-filter: blur(6px); }
.arc-card .qbadge.cinematic { color: #0a0503; background: linear-gradient(135deg, #ff9a3c, #ff5a0a); border-color: transparent; }
.arc-card .qbadge svg { width: 11px; height: 11px; }
.arc-paste { position: relative; display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.arc-paste .ico { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); display: grid; }
.arc-paste .ico svg { width: 16px; height: 16px; }
.arc-paste .input { height: 44px; padding-inline-start: 40px; border-radius: 12px; border-style: dashed; }
.arc-used { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; font-size: 13px; }
.arc-used:empty { display: none; }
.arc-used .chip { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; }
.arc-used .chip img { width: 34px; height: 20px; object-fit: cover; border-radius: 4px; }
.arc-used .chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arc-search .input { height: 52px; font-size: 16px; padding-inline-start: 42px; border-radius: 14px; border-color: rgba(255, 90, 10, .35); }
.arc-search .btn { flex: none; height: 52px; border-radius: 14px; }
.arc-quick { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 12px 0 4px; }
.arc-quick::-webkit-scrollbar { display: none; }
.arc-quick .chip { flex: none; }
.arc-quick .chip.on, .chips-pick .chip.on { background: var(--accent-soft); color: var(--text); border-color: rgba(255, 90, 10, .55); }
.arc-filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0 12px; }
.arc-filters .pill b { font-weight: 600; color: var(--text); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arc-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; font-size: 13px; }
.arc-bar .sp { flex: 1; }
.select-sm { width: auto; padding: 7px 34px 7px 12px; font-size: 13px; }
.arc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.arc-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer; transition: border-color .2s, transform .2s; display: grid; grid-template-rows: auto 1fr; }
.arc-card:hover, .arc-card:focus-visible { border-color: rgba(255, 90, 10, .5); transform: translateY(-2px); outline: none; }
.arc-card .thumb, .arc-item .thumb { position: relative; aspect-ratio: 16 / 9; background: var(--surface-3); overflow: hidden; display: block; width: 100%; }
.arc-card .thumb img, .arc-item .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.arc-card .noimg { display: grid; place-items: center; height: 100%; color: var(--muted); }
.arc-card .yr { position: absolute; top: 8px; inset-inline-start: 8px; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: rgba(0, 0, 0, .72); color: #fff; }
.arc-card .dur { position: absolute; bottom: 8px; inset-inline-end: 8px; font-size: 11.5px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: rgba(0, 0, 0, .72); color: #fff; font-variant-numeric: tabular-nums; }
.arc-card .play, .arc-item .play { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .2s; background: rgba(0, 0, 0, .25); color: #fff; }
.arc-card .play svg, .arc-item .play svg { width: 34px; height: 34px; }
.arc-card:hover .play, .arc-item .thumb:hover .play { opacity: 1; }
.arc-card .body { padding: 12px 14px 14px; display: grid; gap: 6px; align-content: start; }
.arc-card .tags, .arc-ad .tags { display: flex; flex-wrap: wrap; gap: 5px; }
.arc-card .tags span, .arc-ad .tags span { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); }
.arc-card .tags .t, .arc-ad .tags span:nth-child(4) { border-color: rgba(255, 90, 10, .45); color: #ffb07a; }
.arc-card .tags .o { border-color: rgba(255, 200, 87, .4); color: var(--warn); }
.arc-ad .tags .s { border-style: dashed; }
.arc-card .brand, .arc-item .brand { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.arc-card h3, .arc-item h3 { margin: 0; font-size: 15px; line-height: 1.35; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.arc-card .hit { font-size: 12.5px; color: var(--text-2); background: var(--accent-soft); border-radius: 8px; padding: 6px 8px; display: flex; gap: 6px; align-items: baseline; }
.arc-card .hit svg { width: 11px; height: 11px; flex: none; color: var(--accent); }
.arc-ad { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; }
.arc-ad .player, .arc-editor .player { aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.arc-ad .player iframe, .arc-editor .player iframe { width: 100%; height: 100%; border: 0; display: block; }
.arc-ad .info { display: grid; gap: 12px; align-content: start; min-width: 0; }
.arc-ad .info h2 { margin: 0; }
.arc-ad .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.arc-ad .lbl { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.arc-ad .scenes { display: grid; gap: 4px; max-height: 240px; overflow: auto; }
.arc-ad .arc-scene { display: flex; gap: 10px; text-align: start; padding: 7px 9px; border-radius: 9px; font-size: 13.5px; color: var(--text-2); }
.arc-ad .arc-scene b { color: var(--accent-2); font-variant-numeric: tabular-nums; flex: none; }
.arc-ad .arc-scene:hover, .arc-ad .arc-scene.on { background: var(--surface-2); color: var(--text); }
.arc-ad .credits { display: grid; gap: 4px; font-size: 13px; }
.arc-ad .credits div { display: flex; gap: 8px; justify-content: space-between; }
.arc-ad .credits span { color: var(--muted); }
.arc-ad .rights { font-size: 12px; color: var(--muted); margin: 0; }
.mini-row { display: flex; gap: 8px; overflow-x: auto; }
.mini { flex: none; width: 140px; display: grid; gap: 4px; text-align: start; font-size: 12px; color: var(--text-2); }
.mini img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; }
.mini span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chips-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-pick .chip { padding: 6px 11px; font-size: 12.5px; }
.arc-more { display: grid; gap: 16px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.arc-boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.arc-board { display: grid; gap: 6px; padding: 10px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); transition: border-color .2s; }
.arc-board:hover { border-color: rgba(255, 90, 10, .5); }
.arc-board .covers { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; }
.arc-board .covers img, .arc-board .covers span { width: 100%; height: 100%; object-fit: cover; background: var(--surface-3); display: block; }
.arc-board .n { font-weight: 700; padding: 4px 2px 0; }
.arc-board .muted { font-size: 12.5px; padding: 0 2px; display: flex; align-items: center; gap: 4px; }
.arc-board .muted svg { width: 13px; height: 13px; }
.arc-board-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.arc-items { display: grid; gap: 12px; }
.arc-item { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: 14px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); align-items: start; }
.arc-item .thumb { border-radius: 10px; }
.arc-item .body { display: grid; gap: 6px; min-width: 0; }
.arc-item .textarea { font-size: 13px; padding: 8px 10px; min-height: 0; }
.arc-item .side-btns { display: grid; gap: 4px; }
.rot90 { transform: rotate(90deg); }
.arc-rows { display: grid; gap: 8px; }
.arc-row { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: start; }
.arc-row:hover { border-color: rgba(255, 90, 10, .45); }
.arc-row img, .arc-row .noimg { width: 112px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; flex: none; background: var(--surface-3); }
.arc-row .grow { display: grid; gap: 2px; min-width: 0; }
.arc-row .grow b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arc-row .muted { font-size: 12.5px; }
.arc-editor { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; }
.arc-editor .ed-left, .arc-editor .ed-right { display: grid; gap: 12px; align-content: start; min-width: 0; }
.arc-editor .ed-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.arc-shared { max-width: 1100px; margin: 0 auto; padding-top: 32px; }
.deck-print { display: none; }
@media (max-width: 900px) {
  .arc-hero, .arc-ad, .arc-editor { grid-template-columns: 1fr; }
  .arc-item { grid-template-columns: 120px minmax(0, 1fr); }
  .arc-item .side-btns { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
}
@media (max-width: 560px) {
  .arc-search .btn { width: 52px; padding: 0; justify-content: center; font-size: 0; }
  .arc-search .btn svg { width: 18px; height: 18px; }
  .arc-grid { grid-template-columns: 1fr; }
  .arc-stats b { font-size: 22px; }
}
@media print {
  @page { size: A4 landscape; margin: 14mm; }
  body { background: #fff !important; color: #111 !important; }
  .side, .topbar, .bottom-nav, .overlay, .toasts, #view .page.arc > :not(.deck-print) { display: none !important; }
  .main { padding: 0 !important; margin: 0 !important; }
  .deck-print { display: block; }
  .deck-page { page-break-after: always; break-after: page; display: grid; gap: 10px; align-content: start; color: #111; font-family: system-ui, sans-serif; }
  .deck-page img { width: 70%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; }
  .deck-cover { min-height: 160mm; align-content: center; }
  .deck-cover h1 { font-size: 40pt; margin: 0; }
  .deck-mark { font-size: 10pt; letter-spacing: .16em; color: #c2410c; font-weight: 700; }
  .deck-num { font-size: 28pt; font-weight: 800; color: #c2410c; }
  .deck-page h2 { margin: 0; font-size: 18pt; }
  .deck-meta, .deck-tags, .deck-link { font-size: 10.5pt; color: #555; margin: 0; }
  .deck-note { font-size: 12pt; margin: 0; border-inline-start: 3px solid #ff5a0a; padding-inline-start: 10px; }
}
.arc-manage { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; }
.arc-manage .h3 svg { width: 18px; height: 18px; vertical-align: -3px; color: var(--accent); }
.arc-manage .ed-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.arc-bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0 12px; font-size: 13px; }
.arc-bulk .sp { flex: 1; }
.arc-bulk .pill[disabled] { opacity: .45; pointer-events: none; }
.arc-row { padding: 6px 8px; }
.arc-row.on { border-color: rgba(255, 90, 10, .55); background: var(--accent-soft); }
.arc-row input[type=checkbox] { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.arc-row-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-align: start; }
.arc-row .tagline { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.arc-row .tagline span { font-size: 11px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); }
@media (max-width: 900px) { .arc-manage { grid-template-columns: 1fr; } }
/* Remake this shot + AI index */
.arc-ad .remake-box { display: grid; gap: 6px; padding: 12px; border-radius: 12px; border: 1px solid rgba(255, 90, 10, .35); background: var(--accent-soft); }
.arc-ad .remake-box p { margin: 0; font-size: 12.5px; }
.arc-ad .remake-box .lbl { display: flex; align-items: center; gap: 6px; color: var(--accent-2); margin: 0; }
.arc-ad .remake-box .lbl svg { width: 14px; height: 14px; }
.arc-scene-row { display: flex; align-items: center; gap: 4px; }
.arc-scene-row .arc-scene { flex: 1; min-width: 0; }
.arc-scene-row .btn-icon { opacity: .55; }
.arc-scene-row:hover .btn-icon { opacity: 1; color: var(--accent-2); }
.remake { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; }
.remake .player { aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.remake .player iframe { width: 100%; height: 100%; border: 0; display: block; }
.remake-out { display: grid; gap: 12px; align-content: start; min-width: 0; }
.remake-out .lbl { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.remake-out .summary { margin: 0; font-size: 14.5px; color: var(--text); }
.remake-wait { display: flex; align-items: center; gap: 10px; color: var(--text-2); padding: 20px 0; }
.rchips { display: flex; flex-wrap: wrap; gap: 6px; }
.rchip { display: grid; gap: 1px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.rchip small { font-size: 10.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ai-index { display: grid; gap: 10px; }
.ai-index .h3 svg { width: 18px; height: 18px; vertical-align: -3px; color: var(--accent); }
.ai-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.ai-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: inherit; transition: width .6s; }
@media (max-width: 900px) { .remake { grid-template-columns: 1fr; } }

/* ---------- Creative Ideas ---------- */
.id-steps { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 18px; font-size: 13px; font-weight: 700; color: var(--muted); }
.id-steps span.on { color: var(--accent-2); }
.id-steps span.done { color: var(--text-2); }
.id-steps i { display: grid; opacity: .5; }
.id-steps i svg { width: 12px; height: 12px; }
.id-steps .sp { flex: 1; }
.id-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.id-brief { display: grid; gap: 14px; }
.id-brief .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.id-brief .chip small { font-weight: 500; margin-inline-start: 4px; }
.id-side { display: grid; gap: 14px; }
.id-methods { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.id-methods li { display: grid; gap: 2px; font-size: 13px; }
.id-methods span { color: var(--muted); line-height: 1.4; }
.id-proj { display: grid; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.id-proj:last-child { border-bottom: 0; }
.id-nudge { margin-bottom: 16px; }
.id-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.id-card { display: grid; gap: 10px; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); }
.id-card-head { display: flex; align-items: center; gap: 8px; }
.id-card-head .sp { flex: 1; }
.id-card h3 { margin: 0; font-size: 19px; font-family: var(--display); }
.id-big { margin: 0; font-size: 15.5px; color: var(--text); line-height: 1.5; font-weight: 600; }
.id-scores { display: inline-flex; gap: 4px; }
.id-scores b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--surface-3); font-size: 12px; }
.id-dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; margin: 0; font-size: 13.5px; }
.id-dl dt { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
.id-dl dd { margin: 0; color: var(--text-2); line-height: 1.45; }
.id-story { margin: 0; padding-inline-start: 20px; display: grid; gap: 4px; font-size: 13.5px; color: var(--text-2); }
.id-cd { font-size: 13px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--text-2); line-height: 1.45; }
.id-cd svg { width: 13px; height: 13px; vertical-align: -2px; }
.chip.sm { padding: 2px 8px; font-size: 12px; }
.id-vo p { margin: 6px 0 0; line-height: 1.6; }
.id-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 14px 0; }
.id-frame { display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: var(--surface); border: 1px solid var(--line-2); }
.id-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--bg-2); }
.id-thumb img, .id-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.id-thumb .n, .id-thumb .d { position: absolute; top: 8px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; background: rgba(6, 5, 4, .75); }
.id-thumb .n { inset-inline-start: 8px; color: var(--accent-2); }
.id-thumb .d { inset-inline-end: 8px; }
.id-fbody { display: grid; gap: 8px; padding: 12px; }
.id-tags { display: flex; gap: 4px; flex-wrap: wrap; font-size: 11.5px; font-weight: 700; }
.id-tags span { padding: 2px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); }
.id-tags .mv { color: var(--accent-2); display: inline-flex; gap: 3px; align-items: center; }
.id-tags svg { width: 11px; height: 11px; }
.id-fbody .textarea { font-size: 13px; }
.id-produce { margin-top: 6px; }
@media (max-width: 900px) { .id-layout { grid-template-columns: 1fr; } .id-grid { grid-template-columns: 1fr; } .id-dl { grid-template-columns: 1fr; } }
@media print {
  .side, .topbar, .bottom-nav, .id-produce, .id-nudge, [data-back], [data-print], .id-fbody .row, .id-fbody details { display: none !important; }
  body, .page { background: #fff !important; color: #000 !important; }
  .id-frame { break-inside: avoid; border-color: #ccc; }
  .id-board { grid-template-columns: repeat(3, 1fr); }
}
.pay-guide { padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255, 90, 10, .35); background: var(--accent-soft); font-size: 13.5px; }
.pay-guide b:first-child { display: flex; align-items: center; gap: 6px; }
.pay-guide b:first-child svg { width: 15px; height: 15px; }
.pay-guide ol { margin: 8px 0 0; padding-inline-start: 20px; display: grid; gap: 8px; color: var(--text-2); line-height: 1.5; }
.pay-guide .btn { margin: 2px 0; }

/* buy window: pay in EGP (Paymob) or USD (Stripe) */
.pay-via { display: inline-flex; flex-wrap: wrap; justify-self: center; padding: 3px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); }
.pay-via button { height: 34px; padding: 0 16px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.pay-via button.on { background: var(--accent); color: var(--on-accent); }
.pm-box { display: grid; gap: 12px; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }

/* home tiles with cover photos ("One hand, six crafts"): photo behind, dark wash on the left/bottom for the text */
.studio-card.has-photo { background: #060504; }
.studio-card .photo { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 62% 38%; transition: transform .6s var(--ease), filter .6s var(--ease); filter: saturate(1.05); }
.studio-card.has-photo .art { opacity: 1; background: linear-gradient(90deg, rgba(6, 5, 4, .9) 0%, rgba(6, 5, 4, .55) 38%, rgba(6, 5, 4, 0) 68%) !important; }
.studio-card.has-photo .art::after { background: linear-gradient(180deg, transparent 35%, rgba(6, 5, 4, .85)); }
.studio-card.has-photo:hover .photo { transform: scale(1.05); filter: saturate(1.15) brightness(1.08); }
.studio-card.has-photo:hover { border-color: rgba(255, 90, 10, .45); }

/* Ad Archive edit mode (owner): keep / remove on each card */
.arc-card .pick-bar { position: absolute; inset-inline: 8px; bottom: 8px; display: flex; gap: 6px; z-index: 2; }
.arc-card .pick-bar .btn { flex: 1; justify-content: center; backdrop-filter: blur(8px); box-shadow: 0 2px 10px rgba(0, 0, 0, .45); }
.arc-card.editing .play { display: none; }
.arc-card.kept { border-color: rgba(255, 90, 10, .65); }
.arc-card.gone { opacity: 0; transform: scale(.96); transition: opacity .25s, transform .25s; }
.btn-danger-soft { background: rgba(58, 12, 10, .9); color: #ffc2c2; border: 1px solid rgba(255, 93, 93, .55); }
.btn-danger-soft:hover { background: #8a1c14; color: #fff; }

/* Archive → Manage: the same cards as the archive, with the owner's buttons */
.mcard { cursor: default; grid-template-rows: auto 1fr auto; }
.mcard .thumb, .mcard .body { cursor: pointer; }
.mcard.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.mcard .mpick { position: absolute; top: 8px; inset-inline-start: 8px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: rgba(6, 5, 4, .72); backdrop-filter: blur(6px); cursor: pointer; }
.mcard .mpick input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.mcard .yr { inset-inline-start: 46px !important; }
.mcard .mstate { position: absolute; bottom: 8px; inset-inline-start: 8px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; background: rgba(6, 5, 4, .78); color: var(--text-2); border: 1px solid var(--line-2); }
.mcard .mstate.live { color: #3ddc97; border-color: rgba(61, 220, 151, .45); }
.mcard .mactions { display: flex; gap: 6px; padding: 0 12px 12px; }
.mcard .mactions .btn { flex: 1; justify-content: center; }
.mcard .mactions .btn-danger-soft { flex: 0 0 auto; }
