/* CeevTech Video Studio - built on the public CeevTech design system (site.css v3):
   electric blue #005EFE on white, navy for text, soft blue tints, Inter + Plus Jakarta Sans, Cairo for Arabic. */
:root {
  --brand: #005efe; --brand-rgb: 0,94,254;
  --blue-50: #eef4ff; --blue-100: #dbe7ff; --blue-200: #b9d0ff; --blue-300: #7eabff;
  --blue-600: #0052e0; --blue-700: #0044bb; --red: #d93025;
  --bg: #ffffff; --bg-soft: #edf3fd; --surface: #ffffff; --surface-2: #f6f9ff;
  --border: #d6e2f3; --border-2: #bccde9;
  --text: #0a1a3a; --text-soft: #43557a; --text-mut: #6a7c9d;
  --shadow-sm: 0 1px 2px rgba(10,26,58,.05), 0 6px 16px -10px rgba(10,26,58,.16);
  --shadow-md: 0 10px 30px -12px rgba(10,26,58,.16), 0 2px 6px rgba(10,26,58,.04);
  --shadow-lg: 0 24px 50px -20px rgba(10,26,58,.28);
  --radius: 14px; --radius-sm: 10px; --radius-lg: 20px;
  --ease: cubic-bezier(.22,1,.36,1);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --font-ar: 'Cairo', 'Inter', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1224; --bg-soft: #0d1830; --surface: #111d36; --surface-2: #15233f;
    --border: #1f2f50; --border-2: #2c4170;
    --text: #eef3ff; --text-soft: #b6c3dd; --text-mut: #8a9abb;
    --blue-50: rgba(0,94,254,.14); --blue-100: rgba(0,94,254,.24); --blue-700: #8fb7ff;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow-md: 0 10px 30px -12px rgba(0,0,0,.55); --shadow-lg: 0 24px 50px -20px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); font-size: 16px; line-height: 1.55; background: var(--bg-soft); color: var(--text);
  min-height: 100vh; min-height: 100dvh; -webkit-font-smoothing: antialiased; overflow-x: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}
img, video { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(var(--brand-rgb),.4); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: 1.65rem; font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
.ar, [dir="rtl"] { font-family: var(--font-ar); }
.muted { color: var(--text-mut); }
.soft { color: var(--text-soft); }
.small { font-size: .86rem; }
.hidden { display: none !important; }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .74rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--brand); }

/* ---------- layout ---------- */
.wrap { width: min(100% - 32px, 720px); margin-inline: auto; }
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--border); padding-top: env(safe-area-inset-top); }
.topbar .wrap { display: flex; align-items: center; gap: 12px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 38px; height: 38px; }
.brand b { font-family: var(--font-display); font-weight: 800; font-size: 1.12rem; letter-spacing: -.02em; }
.brand small { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); line-height: 1; }
.topbar .spacer { flex: 1; }
.iconbtn { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--text-soft); }
.iconbtn:hover { background: var(--blue-50); color: var(--brand); }
.iconbtn svg { width: 22px; height: 22px; }
main { padding: 18px 0 120px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 20px; }
.card + .card, .card + .section, .section + .card, .section + .section { margin-top: 16px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 26px 2px 12px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 12px; font-weight: 700; font-size: .98rem; transition: transform .12s var(--ease), background .15s, box-shadow .15s; }
.btn:active { transform: scale(.98); }
.btn svg { width: 20px; height: 20px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px -10px rgba(var(--brand-rgb),.7); }
.btn-primary:hover { background: var(--blue-600); }
.btn-outline { background: var(--surface); color: var(--brand); border: 1.5px solid var(--blue-200); }
.btn-outline:hover { background: var(--blue-50); }
.btn-ghost { color: var(--text-soft); }
.btn-ghost:hover { background: var(--blue-50); color: var(--brand); }
.btn-danger { color: var(--red); border: 1.5px solid color-mix(in srgb, var(--red) 35%, transparent); background: var(--surface); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .btn { flex: 1 1 140px; }

/* ---------- forms ---------- */
label.field { display: block; margin-top: 14px; }
label.field span { display: block; font-size: .86rem; font-weight: 600; color: var(--text-soft); margin-bottom: 6px; }
.input, textarea.input { width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--border-2);
  background: var(--surface); font-size: 16px; transition: border-color .15s, box-shadow .15s; }
textarea.input { min-height: 84px; resize: vertical; line-height: 1.45; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(var(--brand-rgb),.14); }
.pw { position: relative; }
.pw .input { padding-right: 52px; }
.pw button { position: absolute; right: 4px; top: 4px; }
.error-box { margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-size: .92rem; font-weight: 600;
  color: var(--red); background: color-mix(in srgb, var(--red) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--red) 28%, transparent); }
.info-box { padding: 12px 14px; border-radius: 12px; font-size: .9rem; color: var(--blue-700); background: var(--blue-50);
  border: 1px solid var(--blue-100); }
.info-box b { color: var(--text); }

/* ---------- login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login .card { width: min(100%, 420px); padding: 30px 24px; box-shadow: var(--shadow-lg); }
.login .logo { width: 132px; margin: 0 auto 18px; }
.login h1 { margin: 6px 0 4px; }
.login .btn { margin-top: 20px; }
.login footer { text-align: center; margin-top: 18px; font-size: .8rem; color: var(--text-mut); }

/* ---------- upload ---------- */
.drop { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 26px 16px;
  border: 2px dashed var(--blue-200); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; transition: background .15s, border-color .15s; }
.drop:hover, .drop.over { background: var(--blue-50); border-color: var(--brand); }
.drop .bubble { width: 62px; height: 62px; border-radius: 18px; background: var(--brand); color: #fff; display: grid; place-items: center;
  box-shadow: 0 10px 24px -12px rgba(var(--brand-rgb),.8); }
.drop .bubble svg { width: 30px; height: 30px; }
.picked { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius); background: var(--blue-50); border: 1px solid var(--blue-100); }
.picked .meta { min-width: 0; flex: 1; }
.picked .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { height: 10px; border-radius: 99px; background: var(--blue-100); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 99px; transition: width .3s var(--ease); }
.bar.indet > i { width: 35% !important; animation: indet 1.3s infinite var(--ease); }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
.stats { display: flex; justify-content: space-between; gap: 10px; font-size: .84rem; color: var(--text-soft); margin-top: 8px; }
details.tips { margin-top: 14px; font-size: .88rem; color: var(--text-soft); }
details.tips summary { cursor: pointer; font-weight: 600; color: var(--brand); list-style: none; }
details.tips summary::-webkit-details-marker { display: none; }
details.tips ul { margin: 8px 0 0 18px; display: grid; gap: 4px; }

/* ---------- job list ---------- */
.jobs { display: grid; gap: 12px; }
.job { display: flex; gap: 14px; align-items: center; padding: 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); text-align: left; width: 100%; transition: border-color .15s, transform .12s; }
.job:hover { border-color: var(--blue-200); }
.job:active { transform: scale(.99); }
.thumb { width: 58px; height: 80px; border-radius: 10px; background: var(--blue-50) center/cover no-repeat; flex: none; border: 1px solid var(--border); }
.job .meta { min-width: 0; flex: 1; }
.job .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job .sub { font-size: .82rem; color: var(--text-mut); margin-top: 2px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .76rem; font-weight: 700;
  background: var(--blue-50); color: var(--blue-700); border: 1px solid var(--blue-100); margin-top: 6px; }
.pill.solid { background: var(--brand); color: #fff; border-color: var(--brand); }
.pill.err { color: var(--red); background: color-mix(in srgb, var(--red) 8%, var(--surface)); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.live .dot { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.empty { text-align: center; padding: 30px 16px; color: var(--text-mut); }

/* ---------- job detail ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text-soft); margin-bottom: 12px; min-height: 40px; }
.back svg { width: 18px; height: 18px; }
.steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 16px 0 6px; }
.steps i { height: 6px; border-radius: 99px; background: var(--blue-100); }
.steps i.on { background: var(--brand); }
.steps i.now { background: linear-gradient(90deg, var(--brand) 50%, var(--blue-100) 50%); background-size: 200% 100%; animation: stepnow 1.4s infinite linear; }
@keyframes stepnow { from { background-position: 100% 0; } to { background-position: 0 0; } }
.steplabels { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; font-size: .66rem; font-weight: 600; color: var(--text-mut); text-align: center; }
.status-line { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; font-weight: 600; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--blue-100); border-top-color: var(--brand); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 14px; }
.kv div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.kv b { display: block; font-size: 1.02rem; }
.kv span { font-size: .76rem; color: var(--text-mut); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

/* plan review */
.seg { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 14px; border-radius: var(--radius);
  border: 1.5px solid var(--border); background: var(--surface); transition: border-color .15s, background .15s, opacity .15s; }
.seg + .seg { margin-top: 10px; }
.seg.keep { border-color: var(--blue-200); }
.seg.cut { background: var(--surface-2); }
.seg.cut .text { color: var(--text-mut); text-decoration: line-through; text-decoration-color: var(--blue-300); }
.seg .time { font-size: .78rem; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.seg .text { margin-top: 4px; font-size: 1.02rem; line-height: 1.6; overflow-wrap: anywhere; }
.seg .text .low { text-decoration: underline wavy var(--blue-300); text-underline-offset: 4px; }
.seg .text .kw { color: var(--brand); font-weight: 700; }
.seg .why { margin-top: 4px; font-size: .82rem; color: var(--text-mut); }
.seg .ctrl { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.toggle { display: inline-flex; border-radius: 10px; border: 1.5px solid var(--blue-200); overflow: hidden; }
.toggle button { padding: 8px 12px; font-size: .82rem; font-weight: 700; color: var(--text-soft); min-height: 38px; }
.toggle button.on { background: var(--brand); color: #fff; }
.toggle button.on.cutbtn { background: var(--surface-2); color: var(--text); }
.must { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 700; color: var(--text-mut); padding: 4px 8px; border-radius: 8px; }
.must svg { width: 16px; height: 16px; }
.must.on { color: var(--brand); background: var(--blue-50); }
.cards-list { display: grid; gap: 8px; margin-top: 10px; }
.cards-list div { display: flex; gap: 10px; align-items: center; font-size: .9rem; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--blue-200); background: var(--surface); }
.cards-list b { color: var(--brand); }
.question { padding: 10px 12px; border-radius: 12px; background: var(--blue-50); border: 1px solid var(--blue-100); font-size: .92rem; }
.question + .question { margin-top: 8px; }

.actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -12px 30px -20px rgba(10,26,58,.35); padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); }
.actionbar .wrap { display: flex; gap: 10px; align-items: center; }
.actionbar .sum { font-size: .8rem; color: var(--text-mut); line-height: 1.25; min-width: 86px; }
.actionbar .sum b { display: block; font-size: 1.05rem; color: var(--text); }
.actionbar .btn { flex: 1; }

/* result */
.player { background: #000; border-radius: var(--radius); overflow: hidden; max-width: 380px; margin: 0 auto; aspect-ratio: 9/16; }
.player video { width: 100%; height: 100%; object-fit: contain; }
.checks { display: grid; gap: 6px; margin-top: 12px; }
.checks div { display: flex; gap: 10px; align-items: center; font-size: .9rem; }
.checks .ok, .checks .no { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.checks .ok { background: var(--brand); color: #fff; }
.checks .no { background: color-mix(in srgb, var(--red) 12%, var(--surface)); color: var(--red); }
.checks svg { width: 14px; height: 14px; }
.checks .v { margin-left: auto; color: var(--text-mut); font-size: .8rem; font-variant-numeric: tabular-nums; }
.vtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.vtabs button { padding: 6px 12px; border-radius: 99px; border: 1.5px solid var(--blue-200); font-size: .82rem; font-weight: 700; color: var(--brand); }
.vtabs button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.sheet img { border-radius: 12px; border: 1px solid var(--border); margin-top: 10px; }
.log { font-size: .82rem; color: var(--text-soft); display: grid; gap: 6px; margin-top: 10px; }
.log div { display: grid; grid-template-columns: 56px 1fr; gap: 8px; }
.log time { color: var(--text-mut); font-variant-numeric: tabular-nums; }
details.fold > summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "+"; font-size: 1.3rem; color: var(--brand); }
details.fold[open] > summary::after { content: "−"; }

#toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: .9rem;
  box-shadow: var(--shadow-lg); transition: all .25s var(--ease); z-index: 50; pointer-events: none; max-width: calc(100% - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 640px) {
  h1 { font-size: 1.9rem; }
  .card { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
