/* Studio by Saqrion — design system. Dark navy side menu, coral red actions, Inter (Latin) + Cairo (Arabic),
   both bundled. All colours are tokens; [data-theme="dark"] swaps the surfaces. */
@font-face { font-family: "Inter"; src: url("/fonts/Inter-400Regular.ttf") format("truetype"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/Inter-600SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/Inter-700Bold.ttf") format("truetype"); font-weight: 700 800; font-display: swap; }
@font-face { font-family: "Cairo"; src: url("/fonts/Cairo-400Regular.ttf") format("truetype"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Cairo"; src: url("/fonts/Cairo-600SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Cairo"; src: url("/fonts/Cairo-700Bold.ttf") format("truetype"); font-weight: 700 800; font-display: swap; }
/* Arabic glyphs always come from Cairo, also inside Latin text */
@font-face { font-family: "Studio Arabic"; src: url("/fonts/Cairo-400Regular.ttf") format("truetype"); font-weight: 400 500;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; font-display: swap; }
@font-face { font-family: "Studio Arabic"; src: url("/fonts/Cairo-700Bold.ttf") format("truetype"); font-weight: 600 800;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; font-display: swap; }

:root {
  --font: "Studio Arabic", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-ar: "Cairo", "Studio Arabic", Tahoma, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 7px; --rl: 10px;
  --bg: #F4F5F8; --surface: #FFFFFF; --surface-2: #F8F9FB; --sunk: #EEF0F4; --hover: #F2F4F7;
  --line: #E0E3EA; --line-2: #ECEEF2; --field: #CDD2DC;
  --fg: #151A24; --fg-2: #3A4252; --muted: #5E6778;
  --accent: #D42A37; --accent-hover: #B81F2B; --accent-soft: #FDECEE; --accent-fg: #FFFFFF; --accent-ink: #B01E2A;
  --brand: #E2323F; --brand-2: #F96D80;
  --link: #B81F2B; --focus: #E2323F;
  --ok-bg: #E3F4EA; --ok-fg: #14653A; --ok-dot: #2E9E5B;
  --info-bg: #E6EEFB; --info-fg: #1D4C9A; --info-dot: #3A75D6;
  --wait-bg: #FDF1DC; --wait-fg: #7A4A00; --wait-dot: #D68A00;
  --draft-bg: #EDEFF3; --draft-fg: #4A5262; --draft-dot: #8A93A3;
  --err-bg: #FBE5E7; --err-fg: #9B1C2C; --err-dot: #C8323F;
  --side: #151A24; --side-fg: #C7CCD6; --side-group: #7C8496; --side-hover: #1E2532; --side-on: #262E3D;
  --side-bar: #F96D80; --side-badge: #E2323F;
  --shadow: 0 1px 2px rgba(21, 26, 36, .05), 0 4px 14px -6px rgba(21, 26, 36, .10);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0F131B; --surface: #171C26; --surface-2: #1B212C; --sunk: #12161E; --hover: #1F2633;
  --line: #2A3140; --line-2: #222937; --field: #39414F;
  --fg: #E8EBF0; --fg-2: #C5CBD5; --muted: #98A0AE;
  --accent: #E2323F; --accent-hover: #F0505C; --accent-soft: #3A1A1F; --accent-ink: #FF9AA5;
  --link: #FF8D99; --focus: #F96D80;
  --ok-bg: #123A27; --ok-fg: #7FDCA4; --info-bg: #182B4A; --info-fg: #A9C4F5;
  --wait-bg: #3D2E0F; --wait-fg: #F2C062; --draft-bg: #232A37; --draft-fg: #B5BCC8;
  --err-bg: #3D1820; --err-fg: #F4A3AC;
  --side: #0B0E14; --side-hover: #161B25; --side-on: #1E2430;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; line-height: 1.25; font-weight: 700; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 6px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
main:focus { outline: none; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: var(--r); }
.skip:focus { top: 8px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--sunk); padding: 1px 6px; border-radius: 4px; }
img, video { max-width: 100%; }
[dir="rtl"], .ar { font-family: var(--font-ar); }

/* ---------- frame ---------- */
.app { display: flex; min-height: 100vh; background: linear-gradient(to right, var(--side) 228px, transparent 228px); }
.sidenav { flex: 0 0 228px; width: 228px; background: var(--side); color: var(--side-fg); padding: 16px 12px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; z-index: 50; }
.logo { display: flex; align-items: center; gap: 10px; padding: 2px 6px 14px; color: #fff; }
.logo:hover { text-decoration: none; }
.logo img { border-radius: 8px; }
.logo b { display: block; font-size: 17px; color: #fff; line-height: 1.15; letter-spacing: -.01em; }
.logo b + span { display: block; font-size: 11.5px; color: var(--side-group); }
.ng { font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--side-group); padding: 14px 10px 5px; }
.nl { display: flex; flex-direction: column; gap: 2px; }
.sidenav .nl a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; min-height: 33px;
  border-radius: 7px; color: var(--side-fg); font-size: 13.5px; }
.sidenav .nl a:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.sidenav .nl a.on { background: var(--side-on); color: #fff; box-shadow: inset 3px 0 0 var(--side-bar); font-weight: 600; }
.nt { display: inline-flex; align-items: center; gap: 10px; }
.ni { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.sidenav .ni { opacity: .85; }
.nb { font-size: 11px; font-weight: 700; background: var(--side-badge); color: #fff; border-radius: 10px; padding: 0 7px; line-height: 18px; }
.navfoot { margin-top: auto; padding: 14px 4px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.navfoot .ver { font-size: 11px; color: var(--side-group); }
.cos { display: inline-flex; border: 1px solid #2E3647; border-radius: 7px; overflow: hidden; }
.cos button { border: 0; background: transparent; color: var(--side-fg); font: inherit; font-size: 12px; padding: 4px 10px; cursor: pointer; }
.cos button[aria-pressed="true"] { background: var(--side-on); color: #fff; font-weight: 600; }
.navscrim { display: none; }

.appmain { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 24px; min-height: 56px;
  background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.tb-l, .tb-r { display: flex; align-items: center; gap: 10px; min-width: 0; }
.crumbs { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--fg); }
.crumbs b { color: var(--fg); font-weight: 600; }
.crumbs .sep { margin: 0 6px; opacity: .6; }
.iconbtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r); border: 1px solid var(--field);
  background: var(--surface); color: var(--fg); cursor: pointer; padding: 0; }
.navtoggle { display: none; }
.jobchip { display: inline-flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--fg-2); padding: 4px 10px; border-radius: 20px;
  background: var(--sunk); border: 1px solid var(--line); }
.jobchip:hover { text-decoration: none; background: var(--hover); }
.spin { width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
.menupop { position: absolute; top: calc(100% + 6px); left: 0; min-width: 210px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--rl); padding: 6px; z-index: 60; box-shadow: 0 10px 30px -12px rgba(21, 26, 36, .4); display: flex; flex-direction: column; }
.menupop.right { left: auto; right: 0; }
.menupop a { padding: 7px 10px; border-radius: var(--r); color: var(--fg); font-size: 13px; }
.menupop a:hover { background: var(--hover); text-decoration: none; }
.menupop .who { padding: 6px 10px 8px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.menupop .who b { color: var(--fg); font-size: 13px; }
.av { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; }
.demo-ribbon { background: repeating-linear-gradient(-45deg, #FFF3D6, #FFF3D6 12px, #FDECC2 12px, #FDECC2 24px); color: #6B4300;
  text-align: center; font-size: 12.5px; padding: 5px 12px; border-bottom: 1px solid #F1D79A; }

main { padding: 22px 24px 40px; min-width: 0; width: 100%; max-width: 1480px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 0 0 18px; flex-wrap: wrap; }
.head .muted { margin: 4px 0 0; max-width: 78ch; }
.head .eyebrow { margin-bottom: 4px; }
.eyebrow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

/* ---------- panels ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--rl); padding: 16px 18px; margin-bottom: 16px;
  min-width: 0; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card.flat { box-shadow: none; }
.ch { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; margin-bottom: 12px; flex-wrap: wrap; }
.ch h2 { margin: 0; }
.panelhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.panelhead h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid > .card { margin-bottom: 0; }
.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)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.split.wide-r { grid-template-columns: minmax(0, 1fr) 440px; }
.sticky { position: sticky; top: 72px; }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; }
.empty .ni { width: 34px; height: 34px; stroke-width: 1.4; color: var(--field); margin-bottom: 6px; }
.empty h3 { color: var(--fg); }
.mt { margin-top: 16px; } .mb0 { margin-bottom: 0; }
hr.sep { border: 0; border-top: 1px solid var(--line-2); margin: 14px 0; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 13.5px; font-weight: 600;
  line-height: 1.3; padding: 8px 14px; border-radius: var(--r); border: 1px solid var(--accent); background: var(--accent); color: var(--accent-fg);
  cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-fg); text-decoration: none; }
.btn.ghost { background: var(--surface); color: var(--fg); border-color: var(--field); }
.btn.ghost:hover { background: var(--hover); color: var(--fg); }
.btn.danger { background: var(--surface); color: var(--err-fg); border-color: var(--field); }
.btn.danger:hover { background: var(--err-bg); }
.btn.ok { background: #1E7A45; border-color: #1E7A45; } .btn.ok:hover { background: #17633A; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.big { padding: 11px 20px; font-size: 15px; }
.btn.wide { width: 100%; margin-top: 18px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn .ni { stroke-width: 2.2; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--link); font: inherit; cursor: pointer; }
.linkbtn.danger { color: var(--err-fg); }
form.inline { display: inline; }

/* ---------- forms ---------- */
label { display: block; font-size: 12.5px; color: var(--fg-2); font-weight: 600; margin: 14px 0 6px; }
label .hint, .hint { font-weight: 400; color: var(--muted); }

input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search], input[type=file],
select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--field); border-radius: var(--r); font: inherit; font-size: 14px;
  color: var(--fg); background: var(--surface); min-height: 38px; }
input[type=file] { padding: 6px 8px; font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--focus) 35%, transparent); outline-offset: 0; border-color: var(--focus); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
input[type=color] { width: 44px; height: 38px; padding: 3px; border: 1px solid var(--field); border-radius: var(--r); background: var(--surface); cursor: pointer; }
input[type=range] { accent-color: var(--accent); width: 100%; }
textarea { min-height: 90px; resize: vertical; line-height: 1.55; }
textarea.code { font-family: var(--mono); font-size: 12.5px; min-height: 460px; tab-size: 2; white-space: pre; }
textarea[dir="rtl"], input[dir="rtl"] { font-family: var(--font-ar); font-size: 15px; }
::placeholder { color: var(--muted); opacity: .8; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--fg); margin: 8px 0; font-weight: 400; cursor: pointer; }
.check input { margin-top: 2px; flex: 0 0 auto; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips label { display: flex; gap: 8px; align-items: center; margin: 0; padding: 7px 12px; border-radius: var(--r); font-size: 13px; font-weight: 500;
  color: var(--fg); background: var(--surface); border: 1px solid var(--field); cursor: pointer; }
.chips label:has(input:checked) { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }
.chips.cards label { flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px; min-width: 180px; flex: 1 1 180px; position: relative; }
.chips.cards label input { position: absolute; top: 12px; right: 12px; }
.chips.cards b { font-size: 13.5px; } .chips.cards span { font-size: 12px; color: var(--muted); font-weight: 400; }
.chips.cards .badge-first { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-ink); }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.fgrid .full { grid-column: 1 / -1; }
.colors { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.colors .cf { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: var(--r); padding: 6px; background: var(--surface-2); }
.colors .cf input[type=text] { min-height: 30px; padding: 4px 6px; font-family: var(--mono); font-size: 12px; }
.colors label { margin-top: 0; }
.counter { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.over { color: var(--err-fg); font-weight: 700; }
.formfoot { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line-2);
  margin: 18px -18px -16px; padding: 12px 18px; background: var(--surface-2); border-radius: 0 0 var(--rl) var(--rl); }
.formfoot .muted { margin-right: auto; font-size: 12.5px; }

/* language tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs a, .tabs button { padding: 8px 14px; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--muted); background: none; border: 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.tabs a:hover, .tabs button:hover { color: var(--fg); text-decoration: none; }
.tabs .on, .tabs [aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--field); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.seg a, .seg button { padding: 6px 12px; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--fg); background: none; border: 0; cursor: pointer; }
.seg > * + * { border-left: 1px solid var(--field) !important; }
.seg .on, .seg [aria-pressed="true"] { background: var(--fg); color: var(--bg); font-weight: 600; }
.seg a:hover { text-decoration: none; }

/* ---------- messages ---------- */
.flash { padding: 10px 14px; border-radius: var(--r); margin: 0 0 14px; border: 1px solid transparent; border-left-width: 3px; font-size: 13.5px; }
.flash.ok { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-dot); }
.flash.err { background: var(--err-bg); color: var(--err-fg); border-color: var(--err-dot); }
.callout { border-radius: var(--r); padding: 11px 14px; background: var(--wait-bg); color: var(--wait-fg); margin-bottom: 14px; font-size: 13.5px;
  border-left: 3px solid var(--wait-dot); }
.callout.info { background: var(--info-bg); color: var(--info-fg); border-left-color: var(--info-dot); }
.callout.ok { background: var(--ok-bg); color: var(--ok-fg); border-left-color: var(--ok-dot); }
.callout.err { background: var(--err-bg); color: var(--err-fg); border-left-color: var(--err-dot); }
.callout ul { margin: 6px 0 0; padding-left: 18px; }
.callout a { color: inherit; text-decoration: underline; }
.callout .btn { text-decoration: none; }
.warnlist { list-style: none; padding: 0; margin: 6px 0 0; font-size: 12.5px; color: var(--wait-fg); }
.warnlist li::before { content: "⚠ "; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
td { padding: 11px 16px; border-top: 1px solid var(--line-2); vertical-align: middle; }
tr:first-child > td { border-top: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { text-align: right; white-space: nowrap; }
.tablewrap { overflow-x: auto; }
.tablewrap table { min-width: 640px; }
.tt { font-weight: 600; color: var(--fg); }
a.tt:hover { color: var(--accent-ink); }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; line-height: 1.6; white-space: nowrap;
  background: var(--draft-bg); color: var(--draft-fg); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.pill.st-rendering, .pill.job-running, .pill.job-queued { background: var(--info-bg); color: var(--info-fg); }
.pill.st-ready { background: var(--info-bg); color: var(--info-fg); }
.pill.st-in_review, .pill.st-changes_requested { background: var(--wait-bg); color: var(--wait-fg); }
.pill.st-approved, .pill.st-handed_over, .pill.job-done, .pill.sent, .pill.simulated, .pill.already { background: var(--ok-bg); color: var(--ok-fg); }
.pill.st-failed, .pill.job-failed, .pill.failed { background: var(--err-bg); color: var(--err-fg); }
.tag { display: inline-block; padding: 1px 8px; margin: 1px 3px 1px 0; border-radius: 4px; font-size: 11.5px; font-weight: 600; background: var(--sunk); color: var(--fg-2); border: 1px solid var(--line-2); white-space: nowrap; }
.tag.lang { font-family: var(--mono); letter-spacing: .03em; }
.tag.accent { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.cost { font-size: 11.5px; color: var(--ok-fg); background: var(--ok-bg); border-radius: 4px; padding: 1px 7px; font-weight: 600; white-space: nowrap; }

/* ---------- KPI and dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--rl); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px;
  box-shadow: var(--shadow); color: var(--fg); position: relative; overflow: hidden; }
a.kpi:hover { text-decoration: none; border-color: var(--field); }
.kpi .kl { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi .kv { font-size: 28px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .kd { font-size: 12px; color: var(--muted); }
.kpi.hl::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); }
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--rl); box-shadow: var(--shadow); overflow: hidden; }
.flow a { display: flex; gap: 12px; align-items: center; padding: 14px 16px; color: var(--fg); border-left: 1px solid var(--line-2); }
.flow a:first-child { border-left: 0; }
.flow a:hover { background: var(--surface-2); text-decoration: none; }
.flow .fn { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: var(--accent-soft); color: var(--accent-ink); flex: 0 0 auto; }
.flow b { display: block; font-size: 13.5px; } .flow span { font-size: 12px; color: var(--muted); }
.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.checklist li a { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-radius: var(--r); color: var(--fg); }
.checklist li a:hover { background: var(--hover); text-decoration: none; }
.checklist .tick { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--field); display: grid; place-items: center; flex: 0 0 auto; }
.checklist .done .tick { background: var(--ok-dot); border-color: var(--ok-dot); color: #fff; }
.checklist .done span { color: var(--muted); text-decoration: line-through; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 9px 0; border-top: 1px solid var(--line-2); font-size: 13px; display: flex; gap: 10px; justify-content: space-between; }
.feed li:first-child { border-top: 0; padding-top: 0; }
.feed .when { color: var(--muted); font-size: 12px; white-space: nowrap; }
.worker { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.worker i { width: 8px; height: 8px; border-radius: 50%; background: var(--draft-dot); }
.worker.on i { background: var(--ok-dot); box-shadow: 0 0 0 3px var(--ok-bg); }

/* video cards */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.vcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--rl); overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow); color: var(--fg); }
.vcard:hover { text-decoration: none; border-color: var(--field); }
.vthumb { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #1D2331, #2A3244); display: grid; place-items: center; color: #fff; position: relative; overflow: hidden; }
.vthumb img { width: 100%; height: 100%; object-fit: cover; }
.vthumb .ph { text-align: center; padding: 12px; font-weight: 700; font-size: 15px; line-height: 1.3; }
.vthumb .ph small { display: block; font-weight: 500; font-size: 11px; opacity: .65; margin-top: 4px; text-transform: uppercase; letter-spacing: .08em; }
.vthumb .lang { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 4px; }
.vbody { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; }
.vbody b { font-size: 13.5px; line-height: 1.35; }
.vmeta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: auto; }

/* progress */
.progress { height: 8px; background: var(--sunk); border-radius: 8px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 8px; transition: width .6s ease; }
.progress.indet i { width: 35% !important; animation: indet 1.3s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* ---------- scene editor ---------- */
.scenes { display: flex; flex-direction: column; gap: 10px; counter-reset: sc; }
.scene { border: 1px solid var(--line); border-radius: var(--rl); background: var(--surface); box-shadow: var(--shadow); }
.scene.drag { opacity: .5; }
.scene-h { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 12px; border-bottom: 1px solid var(--line-2); background: var(--surface-2); border-radius: var(--rl) var(--rl) 0 0; }
.scene-n { width: 24px; height: 24px; border-radius: 6px; background: var(--fg); color: var(--bg); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: 0 0 auto; }
.scene-t { font-weight: 600; font-size: 13.5px; }
.scene-h .dur { display: flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12px; color: var(--muted); }
.scene-h .dur input { width: 72px; min-height: 30px; padding: 3px 8px; font-size: 13px; }
.scene-h .tools { display: flex; gap: 2px; }
.scene-h .tools button { width: 30px; height: 30px; border-radius: 6px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.scene-h .tools button:hover { background: var(--hover); color: var(--fg); border-color: var(--line); }
.scene-h .tools button.rm:hover { color: var(--err-fg); background: var(--err-bg); }
.scene-b { padding: 4px 14px 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.scene-b .full { grid-column: 1 / -1; }
.scene-b label { margin-top: 10px; }
.imgpick { display: flex; gap: 10px; align-items: center; }
.imgpick img { width: 96px; height: 54px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); background: var(--sunk); flex: 0 0 auto; }
.zoomrow { display: flex; gap: 8px; } .zoomrow input { min-width: 0; }
.addscene { display: flex; gap: 8px; align-items: center; padding: 12px; border: 1.5px dashed var(--field); border-radius: var(--rl); justify-content: center; flex-wrap: wrap; }
.addscene select { width: auto; min-width: 200px; }
.timeline { display: flex; height: 26px; border-radius: 6px; overflow: hidden; margin: 2px 0 14px; border: 1px solid var(--line); background: var(--sunk); }
.timeline span { display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden;
  border-right: 1px solid rgba(255,255,255,.35); min-width: 18px; padding: 0 4px; }
.timeline span:nth-child(5n+1) { background: #E2323F; } .timeline span:nth-child(5n+2) { background: #2A3244; } .timeline span:nth-child(5n+3) { background: #F96D80; }
.timeline span:nth-child(5n+4) { background: #4A5468; } .timeline span:nth-child(5n) { background: #B81F2B; }

/* players */
.players { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.player { display: flex; flex-direction: column; gap: 6px; }
.player video, .player img { background: #000; border-radius: 8px; display: block; border: 1px solid var(--line); }
.player.s16x9 video { width: 100%; max-width: 520px; aspect-ratio: 16/9; }
.player.s9x16 video { height: 300px; aspect-ratio: 9/16; }
.player.s1x1 video { height: 300px; aspect-ratio: 1/1; }
.player .pl { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); align-items: center; }
.sizeset { display: flex; flex-direction: column; gap: 12px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs a img { height: 72px; border-radius: 6px; border: 1px solid var(--line); }
.dl { display: flex; flex-wrap: wrap; gap: 6px; }

/* posts */
.pgrid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.pcard .ph { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pf { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; color: #fff; font-size: 12px; font-weight: 800; flex: 0 0 auto; }
.pf.linkedin { background: #0A66C2; } .pf.x { background: #111; } .pf.instagram { background: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF); }
.pf.facebook { background: #1877F2; } .pf.tiktok { background: #111; box-shadow: inset -2px -2px 0 #25F4EE, inset 2px 2px 0 #FE2C55; } .pf.youtube { background: #E62117; }
.pmeta { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-top: 6px; }
.preview { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; font-size: 13.5px; }
.preview .pv-h { display: flex; gap: 10px; align-items: center; padding: 10px 12px; }
.preview .pv-av { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); flex: 0 0 auto; }
.preview .pv-n { font-weight: 700; font-size: 13px; } .preview .pv-s { font-size: 11.5px; color: var(--muted); }
.preview .pv-t { padding: 0 12px 10px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; }
.preview .pv-m { background: linear-gradient(135deg, #1D2331, #3A4458); aspect-ratio: 16/9; display: grid; place-items: center; color: rgba(255,255,255,.75); font-size: 12px; }
.preview .pv-m.v916 { aspect-ratio: 4/5; } .preview .pv-m video { width: 100%; height: 100%; object-fit: cover; }
.preview .pv-a { display: flex; gap: 18px; padding: 8px 12px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 12px; }
.ptabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.ptabs button { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: 20px; padding: 3px 10px 3px 3px; cursor: pointer; font: inherit; font-size: 12px; color: var(--fg); }
.ptabs button .pf { width: 22px; height: 22px; font-size: 10px; border-radius: 50%; }
.ptabs button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }

/* brand kits */
.kits { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.kit { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.kit .kit-hero { height: 110px; display: flex; align-items: center; gap: 14px; padding: 0 18px; color: #fff; }
.kit .kit-hero img, .kit .kit-hero .lm { width: 56px; height: 56px; border-radius: 12px; object-fit: contain; background: rgba(255,255,255,.12); flex: 0 0 auto; }
.kit .kit-hero .lm { display: grid; place-items: center; font-size: 24px; font-weight: 800; }
.kit .kit-hero b { font-size: 18px; display: block; } .kit .kit-hero span { font-size: 12px; opacity: .75; }
.kit .sw { display: flex; height: 8px; } .kit .sw i { flex: 1 1 auto; }
.kit .kit-b { padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kitprev { border: 1px solid var(--line); border-radius: var(--rl); overflow: hidden; aspect-ratio: 16/9; display: flex; flex-direction: column; justify-content: center; padding: 8%; gap: 8px; color: #fff; position: relative; }
.kitprev .k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; padding: 3px 9px; border-radius: 20px; align-self: flex-start; }
.kitprev .t { font-size: 24px; font-weight: 800; line-height: 1.15; }
.kitprev .b { align-self: flex-start; padding: 7px 14px; border-radius: 8px; font-weight: 700; font-size: 13px; }
.kitprev img { position: absolute; right: 6%; top: 8%; width: 44px; height: 44px; object-fit: contain; }

/* media */
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.mitem { border: 1px solid var(--line); border-radius: var(--rl); overflow: hidden; background: var(--surface); }
.mitem .mi { aspect-ratio: 16/10; background: var(--sunk); display: grid; place-items: center; }
.mitem .mi img, .mitem .mi video { width: 100%; height: 100%; object-fit: cover; }
.mitem .mb { padding: 8px 10px; font-size: 12px; display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.mitem .mb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop { border: 1.5px dashed var(--field); border-radius: var(--rl); padding: 18px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--surface-2); }
.drop input[type=file] { flex: 1 1 260px; width: auto; }

/* review */
.review-actions textarea { min-height: 80px; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { padding: 9px 0 9px 18px; border-left: 2px solid var(--line); position: relative; font-size: 13px; }
.hist li::before { content: ""; position: absolute; left: -6px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--draft-dot); border: 2px solid var(--surface); }
.hist li.approved::before { background: var(--ok-dot); } .hist li.changes_requested::before { background: var(--wait-dot); }
.hist li.submitted::before { background: var(--info-dot); }
.hist .c { margin-top: 3px; white-space: pre-wrap; color: var(--fg-2); background: var(--surface-2); border-radius: 6px; padding: 6px 9px; }
.lockbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 11px 14px; border-radius: var(--rl);
  margin-bottom: 16px; background: var(--ok-bg); color: var(--ok-fg); border: 1px solid color-mix(in srgb, var(--ok-dot) 40%, transparent); }
.lockbar.wait { background: var(--wait-bg); color: var(--wait-fg); border-color: color-mix(in srgb, var(--wait-dot) 40%, transparent); }
.lockbar .row b { font-weight: 700; }
.bigcta { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 16px 18px; border-radius: var(--rl);
  background: linear-gradient(120deg, #151A24, #2A1F2A); color: #fff; margin-bottom: 16px; }
.bigcta p { margin: 2px 0 0; color: rgba(255,255,255,.7); font-size: 13px; }
.bigcta b { font-size: 15px; }

/* sign-in for recording */
.signin-shot { border: 1px solid var(--line); border-radius: var(--rl); background: var(--sunk); min-height: 200px; display: grid; place-items: center; overflow: hidden; }
.signin-shot img { display: block; width: 100%; }

/* ---------- auth pages ---------- */
.authx-page { min-height: 100vh; display: flex; flex-direction: column; }
.authx { flex: 1 1 auto; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr); }
.authx-side { background: radial-gradient(1200px 600px at 10% 0%, #2A1F2A 0%, #151A24 55%), #151A24; color: #fff; padding: 40px 48px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 30px; overflow: hidden; position: relative; }
.authx-brand { display: flex; gap: 12px; align-items: center; }
.authx-brand img { border-radius: 10px; }
.authx-brand b { font-size: 22px; display: block; line-height: 1.1; } .authx-brand span span { font-size: 12.5px; opacity: .65; }
.ax-stage { position: relative; height: 330px; }
.ax-frame { position: absolute; border-radius: 14px; padding: 18px; display: flex; flex-direction: column; justify-content: center; gap: 10px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); animation: float 7s ease-in-out infinite; }
.ax-frame .ax-sz { position: absolute; bottom: 10px; right: 12px; font-size: 10px; font-weight: 700; opacity: .6; letter-spacing: .05em; }
.ax-frame.ar .ax-sz { right: auto; left: 12px; }
.ax-k { align-self: flex-start; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; background: rgba(255,255,255,.2); padding: 3px 9px; border-radius: 20px; }
.ax-t { font-weight: 800; font-size: 20px; line-height: 1.15; }
.ax-bar { height: 4px; border-radius: 4px; background: rgba(255,255,255,.2); } .ax-bar i { display: block; height: 100%; width: 60%; background: #fff; border-radius: 4px; animation: grow 4s ease-in-out infinite; }
.f169 { left: 0; top: 30px; width: 340px; height: 191px; background: linear-gradient(135deg, #E2323F, #F96D80); }
.f916 { left: 300px; top: 0; width: 150px; height: 267px; background: linear-gradient(160deg, #2A3244, #151A24); border: 1px solid rgba(255,255,255,.12); animation-delay: -2s; }
.f916 .ax-t { font-size: 16px; }
.ax-cur { width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 6px rgba(255,255,255,.2); animation: cur 3s ease-in-out infinite; }
.f11 { left: 120px; top: 200px; width: 180px; height: 130px; background: #fff; color: #151A24; animation-delay: -4s; }
.f11 .ax-t { font-size: 16px; } .ax-btn { align-self: flex-start; background: #E2323F; color: #fff; font-weight: 700; font-size: 12px; padding: 4px 12px; border-radius: 7px; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes grow { 0% { width: 10%; } 100% { width: 95%; } }
@keyframes cur { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(60px, 30px); } }
.authx-lead { font-size: 26px; font-weight: 700; line-height: 1.25; max-width: 480px; letter-spacing: -.01em; }
.ax-chips { list-style: none; padding: 0; margin: 14px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.ax-chips li { font-size: 12.5px; padding: 5px 11px; border-radius: 20px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
.authx-main { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 24px; background: var(--bg); }
.authx-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 30px 30px 26px; box-shadow: var(--shadow); }
.authx-card h1 { margin-bottom: 4px; }
.authx-foot { margin-top: 18px; font-size: 12px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split, .split.wide-r, .pgrid { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  .colors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { background: none; }
  .sidenav { position: fixed; left: -240px; transition: left .2s; }
  .sidenav.open { left: 0; }
  .navtoggle { display: inline-grid; }
  .navscrim:not([hidden]) { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 45; }
  .g2, .g3, .g4, .fgrid, .scene-b, .flow { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .authx { grid-template-columns: 1fr; } .authx-side { display: none; }
  main { padding: 16px; } .topbar { padding: 8px 14px; }
}
