/* =====================================================================
   TIA HUB — Design system
   Tier 1: reference tokens (brand palette pulled from tiaproductionhouse.com)
   Tier 2: semantic tokens (per theme)    Tier 3: component tokens
   ===================================================================== */
:root {
  /* — reference — */
  --red-400: #ff5a68; --red-500: #ed1c29; --red-600: #c8102e; --red-700: #8f0b21; --red-900: #3a0610;
  --ink-950: #09090c; --ink-900: #0d0d10; --ink-850: #121216; --ink-800: #17171c; --ink-750: #1c1c22; --ink-700: #222228; --ink-600: #2e2e36; --ink-500: #3d3d47;
  --paper-50: #f4f2ee; --paper-100: #e9e6df; --paper-200: #dcd8cf; --stone-300: #cfccc4; --stone-400: #a29f97; --stone-500: #8a877f; --stone-600: #66635d; --stone-700: #4a4842;
  --mint: #39c98c; --amber: #f2b544; --sky: #6aa8ff; --violet: #a98bff;

  --f-body: "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-disp: "Bricolage Grotesque", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", "IBM Plex Sans Arabic", ui-monospace, Menlo, monospace;
  --f-deck: "Readex Pro", "IBM Plex Sans Arabic", sans-serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px; --s8: 40px; --s9: 56px;
  --r-xs: 8px; --r-sm: 10px; --r: 14px; --r-lg: 18px; --r-xl: 24px; --r-pill: 999px;
  --fs-xs: 12px; --fs-sm: 13.5px; --fs: 15px; --fs-md: 17px; --fs-lg: 21px; --fs-xl: 28px; --fs-2xl: 40px;

  --ease: cubic-bezier(.2, .7, .2, 1);          /* brand easing from the site */
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --d1: 120ms; --d2: 220ms; --d3: 420ms; --d4: 700ms;
  --side-w: 268px; --top-h: 68px;
}

/* — semantic: INK (default, cinematic dark) — */
[data-theme="ink"] {
  color-scheme: dark;
  --bg: var(--ink-900); --bg-deep: var(--ink-950);
  --surface: var(--ink-850); --surface-2: var(--ink-800); --surface-3: var(--ink-700); --surface-4: var(--ink-600);
  --line: rgba(255, 255, 255, .09); --line-2: rgba(255, 255, 255, .16);
  --text: var(--paper-50); --text-2: var(--stone-400); --text-3: var(--stone-500);
  --accent: var(--red-600); --accent-hover: #dc1434; --accent-text: var(--red-400); --accent-soft: rgba(200, 16, 46, .16); --on-accent: #fff;
  --ok: var(--mint); --ok-soft: rgba(57, 201, 140, .14); --warn: var(--amber); --warn-soft: rgba(242, 181, 68, .14); --info: var(--sky); --info-soft: rgba(106, 168, 255, .14);
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 40px -24px rgba(0, 0, 0, .8);
  --shadow-pop: 0 30px 80px -20px rgba(0, 0, 0, .85), 0 0 0 1px var(--line-2);
  --glow: radial-gradient(60% 50% at 100% 0%, rgba(200, 16, 46, .14), transparent 70%);
  --logo: url("img/logo-light.webp");
}
/* — semantic: PAPER (light) — */
[data-theme="paper"] {
  color-scheme: light;
  --bg: var(--paper-50); --bg-deep: var(--paper-100);
  --surface: #fbfaf7; --surface-2: #ffffff; --surface-3: var(--paper-100); --surface-4: var(--paper-200);
  --line: rgba(13, 13, 16, .09); --line-2: rgba(13, 13, 16, .18);
  --text: var(--ink-900); --text-2: var(--stone-700); --text-3: var(--stone-600);
  --accent: var(--red-600); --accent-hover: #a50d26; --accent-text: #b30e29; --accent-soft: rgba(200, 16, 46, .09); --on-accent: #fff;
  --ok: #128a57; --ok-soft: rgba(18, 138, 87, .1); --warn: #a86b00; --warn-soft: rgba(168, 107, 0, .1); --info: #2563c9; --info-soft: rgba(37, 99, 201, .1);
  --shadow: 0 1px 2px rgba(13, 13, 16, .05), 0 12px 30px -18px rgba(13, 13, 16, .25);
  --shadow-pop: 0 30px 70px -20px rgba(13, 13, 16, .35), 0 0 0 1px var(--line-2);
  --glow: radial-gradient(60% 50% at 100% 0%, rgba(200, 16, 46, .07), transparent 70%);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 16px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--fs)/1.6 var(--f-body); -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
a { color: var(--accent-text); text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; }
p { margin: 0; }
.ic { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }
.mono { font-family: var(--f-mono); letter-spacing: .04em; }
.num { font-family: var(--f-disp); font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--text-2); } .dim { color: var(--text-3); } .red { color: var(--accent-text); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; top: -60px; inset-inline-start: 16px; z-index: 999; background: var(--accent); color: #fff; padding: 10px 16px; border-radius: var(--r-sm); transition: top var(--d2); }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent); color: #fff; }
.grain::after, body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 1; opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
[data-theme="paper"] body::after { opacity: .025; }

/* ---------- Boot ---------- */
.boot { position: fixed; inset: 0; z-index: 900; background: var(--ink-950); display: grid; place-items: center; align-content: center; gap: 22px; transition: opacity var(--d3) var(--ease), visibility var(--d3); }
.boot img { width: 120px; }
.boot-rec { font: 500 12px var(--f-mono); letter-spacing: .2em; color: var(--red-400); display: flex; gap: 8px; align-items: center; }
.boot-rec i { width: 8px; height: 8px; border-radius: 50%; background: var(--red-500); animation: blink 1s steps(2) infinite; }
.boot-bar { width: 160px; height: 2px; background: rgba(255, 255, 255, .1); overflow: hidden; border-radius: 2px; }
.boot-bar i { display: block; height: 100%; width: 40%; background: var(--red-600); animation: sweep 1.1s var(--ease-io) infinite; }
.boot.gone { opacity: 0; visibility: hidden; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes sweep { from { transform: translateX(260%); } to { transform: translateX(-160%); } }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; position: relative; z-index: 2; transition: grid-template-columns var(--d3) var(--ease); }
.shell.collapsed { --side-w: 84px; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--bg-deep); border-inline-end: 1px solid var(--line); padding: 20px 14px 14px; overflow: hidden; z-index: 30; }
.side-head { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; min-height: 64px; }
.side-logo { width: 74px; height: 52px; background: var(--logo) center/contain no-repeat; flex: none; transition: width var(--d3) var(--ease); }
[data-theme="paper"] .side-logo { background-image: url("img/logo-dark.webp"); }
.side-brand { display: grid; line-height: 1.2; }
.side-brand b { font: 800 17px var(--f-disp); letter-spacing: .02em; }
.side-brand span { font: 500 10.5px var(--f-mono); letter-spacing: .16em; color: var(--accent-text); }
.nav { flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; position: relative; }
.nav-group { font: 600 11.5px var(--f-body); letter-spacing: 0; color: var(--text-3); padding: 18px 12px 8px; text-transform: uppercase; white-space: nowrap; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin: 2px 0; border-radius: var(--r-sm); color: var(--text-2); text-decoration: none; font-weight: 500; white-space: nowrap; transition: color var(--d2), background var(--d2); }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] .ic { color: var(--accent-text); }
.nav a .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav a .tag { font: 500 11px var(--f-mono); color: var(--text-3); }
.nav a .lockico { width: 15px; height: 15px; color: var(--text-3); }
.nav a .cnt { min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--accent); color: #fff; font: 600 11px/20px var(--f-mono); text-align: center; }
.nav-ind { position: absolute; top: 0; inset-inline-start: 0; width: 3px; height: 26px; border-radius: 0 3px 3px 0; background: var(--accent); box-shadow: 0 0 18px var(--accent); transition: transform var(--d3) var(--ease-spring), opacity var(--d2); pointer-events: none; }
[dir="rtl"] .nav-ind { border-radius: 3px 0 0 3px; }
.collapsed .side-brand, .collapsed .nav-group, .collapsed .nav a .lbl, .collapsed .nav a .tag, .collapsed .nav a .cnt, .collapsed .nav a .lockico, .collapsed .me-card .who { display: none; }
.collapsed .side-logo { width: 54px; }
.collapsed .nav a { justify-content: center; }
.side-foot { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }
.me-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); background: none; border: 0; cursor: pointer; text-align: start; width: 100%; }
.me-card:hover { background: var(--surface-2); }
.me-card .who { display: grid; line-height: 1.3; min-width: 0; }
.me-card .who b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-card .who span { font-size: 12px; color: var(--text-3); }

.main { min-width: 0; display: flex; flex-direction: column; background: var(--glow), var(--bg); }
.top { position: sticky; top: 0; z-index: 25; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); border-bottom: 1px solid var(--line); }
.scanline { position: absolute; inset-inline: 0; bottom: -1px; height: 2px; overflow: hidden; pointer-events: none; }
.scanline i { position: absolute; top: 0; height: 100%; width: 30%; background: linear-gradient(90deg, transparent, var(--accent), transparent); transform: translateX(400%); }
.scanline.run i { animation: scan 900ms var(--ease-io) 1; }
@keyframes scan { from { transform: translateX(400%); } to { transform: translateX(-140%); } }
.crumb { display: grid; line-height: 1.2; min-width: 0; }
.crumb small { font: 500 11px var(--f-mono); letter-spacing: .12em; color: var(--accent-text); }
.crumb b { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .grow { flex: 1; }
.search-btn { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px 0 14px; min-width: 240px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text-3); cursor: pointer; transition: border-color var(--d2); }
.search-btn:hover { border-color: var(--line-2); color: var(--text-2); }
.search-btn kbd { margin-inline-start: auto; font: 500 11px var(--f-mono); padding: 2px 6px; border: 1px solid var(--line-2); border-radius: 6px; }
.rec-btn { white-space: nowrap; flex: none; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 600; transition: transform var(--d2) var(--ease), background var(--d2), border-color var(--d2); }
.rec-btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.rec-btn .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); box-shadow: 0 0 0 4px rgba(255, 255, 255, .06); }
.rec-btn.live { background: var(--accent-soft); border-color: rgba(255, 90, 104, .45); }
.rec-btn.live .dot { background: var(--red-500); animation: blink 1.2s steps(2) infinite; box-shadow: 0 0 0 4px rgba(237, 28, 41, .2); }
.rec-btn .tc { font: 500 13px var(--f-mono); letter-spacing: .06em; color: var(--text-2); direction: ltr; }
.rec-btn.done { opacity: .8; }

/* ---------- Buttons ---------- */
.btn { --b-bg: var(--surface-3); --b-fg: var(--text); --b-bd: transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--b-bd); background: var(--b-bg); color: var(--b-fg); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; position: relative; overflow: hidden; transition: background var(--d2), border-color var(--d2), transform var(--d1) var(--ease), box-shadow var(--d2); }
.btn:hover { background: var(--surface-4); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn .ic { width: 18px; height: 18px; }
.btn-primary { --b-bg: var(--accent); --b-fg: var(--on-accent); box-shadow: 0 10px 24px -12px var(--accent); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 14px 30px -12px var(--accent); }
.btn-ghost { --b-bg: transparent; --b-bd: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-quiet { --b-bg: transparent; }
.btn-quiet:hover { background: var(--surface-2); }
.btn-danger { --b-bg: transparent; --b-fg: var(--accent-text); --b-bd: rgba(255, 90, 104, .35); }
.btn-danger:hover { background: var(--accent-soft); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--r-xs); }
.btn-icon { width: 40px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn .ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .25; transform: scale(0); animation: ripple 600ms var(--ease) forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* ---------- Page ---------- */
.page { padding: 28px; max-width: 1480px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.eyebrow { display: flex; align-items: center; gap: 10px; font: 500 12.5px var(--f-mono); letter-spacing: 0; color: var(--accent-text); margin-bottom: 10px; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; }
.page-head h1 { font: 800 var(--fs-2xl)/1.05 var(--f-disp); letter-spacing: -.01em; }
.page-head p { color: var(--text-2); margin-top: 8px; max-width: 640px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Cards / KPIs ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); position: relative; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-h h2, .card-h h3 { font-size: var(--fs-md); display: flex; gap: 10px; align-items: center; }
.card-h h2 .ic, .card-h h3 .ic { color: var(--accent-text); }
.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); } .g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.kpi { overflow: hidden; isolation: isolate; }
.kpi::before { content: ""; position: absolute; inset: auto -40px -60px auto; width: 160px; height: 160px; border-radius: 50%; border: 1px solid var(--line); box-shadow: 0 0 0 22px transparent, 0 0 0 23px var(--line), 0 0 0 46px transparent, 0 0 0 47px var(--line); z-index: -1; opacity: .8; }
[dir="rtl"] .kpi::before { inset: auto auto -60px -40px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.kpi-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(255, 90, 104, .35); color: var(--accent-text); background: var(--accent-soft); }
.kpi-lbl { color: var(--text-2); font-size: 14px; }
.trk { letter-spacing: .14em; }
.kpi-val { font: 800 38px/1 var(--f-disp); letter-spacing: -.02em; display: flex; align-items: baseline; gap: 6px; }
.kpi-val small { font: 500 14px var(--f-body); color: var(--text-3); letter-spacing: 0; }
.kpi-foot { margin-top: 12px; font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.kpi-foot .up { color: var(--ok); } .kpi-foot .down { color: var(--accent-text); }

/* ---------- Chips / badges / avatars ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.chip .ic { width: 14px; height: 14px; }
.chip.red { background: var(--accent-soft); color: var(--accent-text); } .chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.warn { background: var(--warn-soft); color: var(--warn); } .chip.info { background: var(--info-soft); color: var(--info); }
.chip.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.av { --c: var(--accent); width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font: 700 13px var(--f-body); color: #fff; background: linear-gradient(140deg, var(--c), color-mix(in srgb, var(--c) 55%, #000)); position: relative; box-shadow: 0 0 0 2px var(--surface); }
.av.lg { width: 48px; height: 48px; font-size: 16px; } .av.sm { width: 26px; height: 26px; font-size: 11px; }
.av { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.av.on::after { content: ""; position: absolute; bottom: -1px; inset-inline-end: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2.5px var(--surface); }
.av-stack { display: flex; } .av-stack .av + .av { margin-inline-start: -9px; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 7px; }
.field > label, .lbl { font-size: 13.5px; font-weight: 600; color: var(--text-2); display: flex; gap: 6px; align-items: center; }
.field .hint { font-size: 12.5px; color: var(--text-3); }
.input, .select, .textarea { width: 100%; height: 44px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); transition: border-color var(--d2), box-shadow var(--d2), background var(--d2); }
.textarea { height: auto; min-height: 110px; padding: 12px 14px; resize: vertical; line-height: 1.7; }
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--text) 30%, transparent); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 4px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a29f97' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 16px; background-position: left 12px center; padding-inline-end: 36px; }
.input-wrap { position: relative; }
.input-wrap .ic { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 18px; height: 18px; pointer-events: none; }
.input-wrap .input { padding-inline-start: 40px; }
.input-wrap .suffix { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); font: 500 13px var(--f-mono); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); position: relative; }
.seg button { height: 32px; padding: 0 14px; border: 0; background: none; border-radius: 7px; cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 13px; position: relative; z-index: 1; transition: color var(--d2); display: inline-flex; gap: 6px; align-items: center; }
.seg button[aria-pressed="true"] { color: var(--text); background: var(--surface-4); }
.switch { position: relative; width: 44px; height: 26px; flex: none; appearance: none; border-radius: var(--r-pill); background: var(--surface-4); border: 1px solid var(--line-2); cursor: pointer; transition: background var(--d2); }
.switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform var(--d3) var(--ease-spring); }
.switch:checked { background: var(--accent); border-color: var(--accent); }
.switch:checked::after { transform: translateX(-18px); }
[dir="ltr"] .switch:checked::after { transform: translateX(18px); }
.check-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; }

/* plan tiles (offer builder) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
.tile { position: relative; display: grid; gap: 10px; align-content: start; padding: 14px; min-height: 104px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; text-align: start; transition: border-color var(--d2), background var(--d2), transform var(--d2) var(--ease); }
.tile:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent-text) 50%, transparent); }
.tile .ic { width: 24px; height: 24px; color: var(--text-2); transition: color var(--d2), transform var(--d3) var(--ease-spring); }
.tile b { font-size: 13.5px; line-height: 1.45; }
.tile .tick { position: absolute; top: 10px; inset-inline-end: 10px; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; transition: all var(--d2) var(--ease-spring); }
.tile .tick .ic { width: 13px; height: 13px; color: #fff; opacity: 0; transform: scale(.4); }
.tile[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.tile[aria-pressed="true"] > .ic { color: var(--accent-text); transform: scale(1.12) rotate(-6deg); }
.tile[aria-pressed="true"] .tick { background: var(--accent); border-color: var(--accent); }
.tile[aria-pressed="true"] .tick .ic { opacity: 1; transform: scale(1); }
.tile .order { position: absolute; bottom: 10px; inset-inline-end: 12px; font: 500 11px var(--f-mono); color: var(--accent-text); }
.bundle { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--r); background: linear-gradient(100deg, var(--accent-soft), transparent); border: 1px dashed rgba(255, 90, 104, .45); animation: rise var(--d3) var(--ease) both; }
.bundle .ic { color: var(--accent-text); width: 26px; height: 26px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: start; font: 600 12px var(--f-body); letter-spacing: 0; text-transform: uppercase; color: var(--text-3); padding: 14px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.t td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background var(--d1); }
.t tbody tr:hover { background: var(--surface-2); }
.t .row-actions { opacity: .35; transition: opacity var(--d2); display: flex; gap: 4px; justify-content: flex-end; }
.t tr:hover .row-actions, .t tr:focus-within .row-actions { opacity: 1; }
.cell-user { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.cell-user b { display: block; font-size: 14px; } .cell-user span { font-size: 12px; color: var(--text-3); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .input-wrap { flex: 1; min-width: 220px; max-width: 360px; }

/* file pills (marketing) */
.files { display: flex; flex-wrap: wrap; gap: 6px; }
.fpill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--r-xs); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all var(--d2); }
.fpill .ic { width: 15px; height: 15px; }
.fpill.has { color: var(--text); border-color: transparent; background: var(--surface-3); }
.fpill.has .ic { color: var(--accent-text); }
.fpill.has:hover { background: var(--accent-soft); }
.fpill.miss { border-style: dashed; color: var(--text-3); }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(260px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; min-height: 280px; transition: background var(--d2), border-color var(--d2); }
.col.drop { border-color: var(--accent); background: var(--accent-soft); }
.col-h { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; }
.col-h b { font-size: 14px; } .col-h .n { font: 500 12px var(--f-mono); color: var(--text-3); }
.col-h .bar { width: 8px; height: 8px; border-radius: 2px; background: var(--c, var(--text-3)); }
.col-h .btn { margin-inline-start: auto; }
.tcard { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin-bottom: 10px; cursor: grab; display: grid; gap: 10px; transition: transform var(--d2) var(--ease), box-shadow var(--d2), border-color var(--d2); position: relative; }
.tcard:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.tcard.dragging { opacity: .4; }
.tcard .tt { font-weight: 600; font-size: 14px; line-height: 1.5; }
.tcard .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.tcard .meta .ic { width: 14px; height: 14px; }
.tcard .meta .late { color: var(--accent-text); font-weight: 600; }
.tcard .prio { position: absolute; top: 12px; inset-inline-end: 12px; width: 8px; height: 8px; border-radius: 50%; }
.prio-high { background: var(--red-500); box-shadow: 0 0 0 4px var(--accent-soft); } .prio-med { background: var(--amber); } .prio-low { background: var(--stone-500); }
.progress { height: 4px; border-radius: 4px; background: var(--surface-4); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width var(--d4) var(--ease); }

/* ---------- Lists / feed ---------- */
.feed { display: grid; gap: 2px; }
.feed-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 8px; border-radius: var(--r-sm); transition: background var(--d1); }
.feed-item:hover { background: var(--surface-2); }
.feed-item .txt { min-width: 0; font-size: 13.5px; line-height: 1.5; }
.feed-item .txt b { font-weight: 600; }
.feed-item .txt small { display: block; color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-item time { font: 500 11.5px var(--f-mono); color: var(--text-3); white-space: nowrap; direction: ltr; }
.act-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.act-ic .ic { width: 16px; height: 16px; }
.act-create { background: var(--ok-soft); color: var(--ok); } .act-delete { background: var(--accent-soft); color: var(--accent-text); } .act-update { background: var(--info-soft); color: var(--info); } .act-login, .act-checkin { background: var(--warn-soft); color: var(--warn); }
.empty { display: grid; place-items: center; text-align: center; gap: 10px; padding: 40px 16px; color: var(--text-3); }
.empty .ic { width: 40px; height: 40px; color: var(--text-3); opacity: .7; }
.empty b { color: var(--text-2); font-size: 15px; }

/* ---------- Overlay: modal & drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 200; background: rgba(5, 5, 8, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade var(--d3) var(--ease) both; }
.modal { position: fixed; z-index: 210; top: 50%; left: 50%; width: min(var(--mw, 560px), calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; transform: translate(-50%, -50%); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: var(--shadow-pop); padding: 26px; animation: pop var(--d3) var(--ease-spring) both; }
.modal-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.modal-h h2 { font: 800 24px/1.2 var(--f-disp); }
.modal-f { display: flex; gap: 10px; justify-content: flex-start; margin-top: 24px; flex-wrap: wrap; }
.drawer { position: fixed; z-index: 210; top: 0; bottom: 0; inset-inline-end: 0; width: min(var(--dw, 980px), 100vw); background: var(--surface); border-inline-start: 1px solid var(--line-2); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; animation: drawerIn var(--d3) var(--ease) both; }
[dir="rtl"] .drawer { inset-inline-end: auto; inset-inline-start: 0; animation-name: drawerInR; }
.drawer-h { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-h h2 { font-size: 17px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 10px; }
.drawer-b { flex: 1; overflow: auto; position: relative; }
.drawer-b iframe { width: 100%; height: 100%; border: 0; background: #fff; display: block; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%) scale(.96); } }
@keyframes drawerIn { from { transform: translateX(40px); opacity: 0; clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }
@keyframes drawerInR { from { transform: translateX(-40px); opacity: 0; clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.lockcard { max-width: 440px; margin: 8vh auto; text-align: center; padding: 40px 32px; }
.lock-ic { width: 84px; height: 84px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); border: 1px solid rgba(255, 90, 104, .35); position: relative; }
.lock-ic .ic { width: 34px; height: 34px; }
.lock-ic::before, .lock-ic::after { content: ""; position: absolute; inset: -12px; border-radius: 50%; border: 1px solid var(--line-2); animation: pulse-ring 2.4s var(--ease) infinite; }
.lock-ic::after { animation-delay: 1.2s; }
@keyframes pulse-ring { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.shake { animation: shake 420ms var(--ease-io); }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 400; bottom: 22px; inset-inline-start: 22px; display: grid; gap: 10px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; min-width: 260px; max-width: 420px; padding: 12px 16px; border-radius: var(--r); background: var(--ink-750); color: var(--paper-50); border: 1px solid rgba(255, 255, 255, .12); box-shadow: var(--shadow-pop); animation: toastIn var(--d3) var(--ease-spring) both; font-size: 14px; }
.toast .ic { color: var(--red-400); }
.toast.ok .ic { color: var(--mint); }
.toast .slate { font: 600 11px var(--f-mono); letter-spacing: .14em; padding: 3px 7px; border-radius: 5px; background: rgba(255, 255, 255, .08); }
.toast.out { animation: toastOut var(--d2) var(--ease) forwards; }
.toast .undo { margin-inline-start: auto; background: none; border: 0; color: var(--red-400); font-weight: 700; cursor: pointer; }
@keyframes toastIn { from { opacity: 0; transform: translateY(18px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

/* ---------- Motion primitives ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } }
.reveal > * { animation: rise var(--d4) var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
.page-enter { animation: rise var(--d4) var(--ease) both; }
.iris { position: fixed; inset: 0; z-index: 800; background: var(--ink-950); pointer-events: none; clip-path: circle(150% at 50% 50%); animation: iris 900ms var(--ease-io) forwards; }
@keyframes iris { to { clip-path: circle(0% at 50% 50%); } }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); position: relative; z-index: 2; }
.login-form { display: grid; place-items: center; padding: 40px 28px; background: var(--bg); }
.login-form form { width: min(400px, 100%); display: grid; gap: 16px; }
.login-form h1 { font: 800 44px/1.05 var(--f-disp); margin: 4px 0 2px; }
.login-form .sub { color: var(--text-2); margin-bottom: 10px; }
.login-art { position: relative; overflow: hidden; background: radial-gradient(90% 80% at 0% 100%, #4a0714 0%, var(--ink-900) 58%), var(--ink-900); color: var(--paper-50); display: flex; flex-direction: column; justify-content: space-between; padding: 40px; }
.login-art .rings { position: absolute; width: 900px; height: 900px; left: -450px; bottom: -450px; animation: spin 80s linear infinite; }
.login-art .rings circle { fill: none; stroke: rgba(237, 28, 41, .35); stroke-width: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
.la-top { display: flex; justify-content: space-between; align-items: center; position: relative; }
.la-top img { width: 110px; }
.la-rec { font: 500 13px var(--f-mono); letter-spacing: .18em; display: flex; align-items: center; gap: 10px; color: rgba(255, 255, 255, .8); }
.la-rec i { width: 10px; height: 10px; border-radius: 50%; background: var(--red-500); animation: blink 1s steps(2) infinite; }
.la-mid { position: relative; }
.la-mid h2 { font: 800 clamp(40px, 5.2vw, 78px)/.98 var(--f-disp); letter-spacing: -.02em; direction: ltr; text-align: left; }
.la-mid { align-self: stretch; }
.la-mid h2 span { display: block; overflow: hidden; }
.la-mid h2 span em { display: block; font-style: normal; animation: lineUp 900ms var(--ease) both; animation-delay: calc(var(--i) * 120ms + 200ms); }
.la-mid h2 span:nth-child(2) em { color: var(--red-500); }
@keyframes lineUp { from { transform: translateY(105%); } }
.la-mid p { margin-inline-start: auto; text-align: right; margin-top: 18px; color: rgba(255, 255, 255, .62); max-width: 420px; }
.la-bot { position: relative; display: flex; gap: 26px; font: 500 12px var(--f-mono); letter-spacing: .12em; color: rgba(255, 255, 255, .5); }
.la-bot b { display: block; color: #fff; font-size: 15px; letter-spacing: .06em; direction: ltr; }
.clapper { position: absolute; top: 96px; left: 40px; width: 170px; transform: rotate(-8deg); opacity: .95; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .6)); }
.clapper .stick { transform-origin: 14px 54px; transition: transform 260ms var(--ease-io); transform: rotate(-24deg); }
.clapper.clap .stick { transform: rotate(0deg); }
.login .err { color: var(--accent-text); font-size: 14px; min-height: 20px; }
.pw-wrap { position: relative; }
.pw-wrap .btn { position: absolute; inset-inline-end: 4px; top: 4px; height: 36px; width: 36px; }

/* ---------- Offer builder ---------- */
.builder { display: grid; grid-template-columns: minmax(380px, 460px) minmax(0, 1fr); gap: 20px; align-items: start; }
.builder-form { position: sticky; top: calc(var(--top-h) + 16px); max-height: calc(100vh - var(--top-h) - 32px); overflow: auto; scrollbar-width: thin; }
.builder-form .step { display: grid; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.builder-form .step:first-child { padding-top: 0; }
.step-h { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.step-h .n { font: 500 11px var(--f-mono); color: var(--accent-text); letter-spacing: .1em; }
.preview-pane { display: grid; gap: 14px; }
.deck-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.deck-thumb { --s: .18; position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); cursor: zoom-in; transition: transform var(--d3) var(--ease), border-color var(--d2), box-shadow var(--d3); animation: rise var(--d4) var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.deck-thumb:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow-pop); }
.deck-thumb .dk { position: absolute; top: 0; left: 0; transform-origin: 0 0; transform: scale(var(--s)); pointer-events: none; }
.deck-thumb .n { position: absolute; bottom: 8px; inset-inline-start: 8px; z-index: 2; font: 500 11px var(--f-mono); background: rgba(0, 0, 0, .55); color: #fff; padding: 2px 7px; border-radius: 6px; }
.deck-hero { --s: .5; position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); background: #000; }
.deck-hero .dk { position: absolute; top: 0; left: 0; transform-origin: 0 0; transform: scale(var(--s)); }
.presenter { position: fixed; inset: 0; z-index: 300; background: #050507; display: grid; place-items: center; animation: fade var(--d3) both; }
.presenter .stage { --s: 1; width: calc(1440px * var(--s)); height: calc(810px * var(--s)); position: relative; overflow: hidden; border-radius: 6px; }
.presenter .stage .dk { position: absolute; top: 0; left: 0; transform-origin: 0 0; transform: scale(var(--s)); animation: slideIn 500ms var(--ease) both; }
@keyframes slideIn { from { opacity: 0; transform: scale(var(--s)) translateX(-30px); filter: blur(8px); } }
.presenter .pbar { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; background: rgba(23, 23, 28, .86); border: 1px solid rgba(255, 255, 255, .12); padding: 8px; border-radius: var(--r-pill); color: #fff; }
.presenter .pbar .mono { padding: 0 10px; font-size: 13px; }

/* ---------- Activity / security ---------- */
.vpn-flag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; }
.vpn-hi { background: var(--accent-soft); color: var(--accent-text); } .vpn-mid { background: var(--warn-soft); color: var(--warn); } .vpn-lo { background: var(--ok-soft); color: var(--ok); }
.map-frame { width: 100%; height: 260px; border: 0; border-radius: var(--r); background: var(--surface-3); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 14px; }
.kv dt { color: var(--text-3); } .kv dd { margin: 0; }
.heat { display: grid; grid-template-columns: repeat(var(--days, 31), minmax(16px, 1fr)); gap: 3px; }
.heat i { aspect-ratio: 1; border-radius: 4px; background: var(--surface-3); position: relative; }
.heat i.on { background: var(--ok); } .heat i.late { background: var(--amber); } .heat i.abs { background: var(--accent); opacity: .85; } .heat i.off { background: transparent; border: 1px dashed var(--line); }
.meter { --v: 0; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c, var(--ok)) calc(var(--v) * 1%), var(--surface-4) 0); position: relative; font: 700 14px var(--f-disp); }
.meter::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface); }
.meter span { position: relative; }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r); margin-bottom: 18px; background: var(--info-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--info) 40%, transparent); }
.banner.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.banner.red { background: var(--accent-soft); border-color: rgba(255, 90, 104, .4); }
.banner .ic { color: var(--info); } .banner.warn .ic { color: var(--warn); } .banner.red .ic { color: var(--accent-text); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { position: relative; height: 44px; padding: 0 16px; border: 0; background: none; color: var(--text-2); font-weight: 600; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.tabs button[aria-current="true"] { color: var(--text); }
.tabs button[aria-current="true"]::after { content: ""; position: absolute; inset-inline: 10px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; animation: grow var(--d3) var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }
.set-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; }
.set-nav { display: grid; gap: 2px; position: sticky; top: calc(var(--top-h) + 20px); }
.set-nav button { display: flex; gap: 10px; align-items: center; text-align: start; padding: 10px 12px; border-radius: var(--r-sm); border: 0; background: none; color: var(--text-2); cursor: pointer; font-weight: 500; }
.set-nav button:hover { background: var(--surface-2); color: var(--text); }
.set-nav button[aria-current="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset -3px 0 0 var(--accent); }
.perm-grid { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; }
.perm-grid .seg button { padding: 0 10px; height: 28px; font-size: 12px; }
.embed-wrap { position: relative; height: calc(100vh - var(--top-h) - 150px); min-height: 520px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line-2); background: var(--surface); }
.embed-wrap iframe { width: 100%; height: 100%; border: 0; }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin 700ms linear infinite; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--r-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }
.cmdk { --mw: 620px; padding: 0; overflow: hidden; top: 18%; transform: translate(-50%, 0); animation: cmdIn var(--d3) var(--ease-spring) both; }
@keyframes cmdIn { from { opacity: 0; transform: translate(-50%, -12px) scale(.97); } }
.cmdk .input-wrap .input { height: 58px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; font-size: 17px; box-shadow: none; }
.cmdk ul { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow: auto; }
.cmdk li button { width: 100%; display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 0; background: none; border-radius: var(--r-sm); cursor: pointer; text-align: start; }
.cmdk li button:hover, .cmdk li button.sel { background: var(--surface-3); }
.cmdk li small { margin-inline-start: auto; color: var(--text-3); font-size: 12px; }
.menu { position: fixed; z-index: 260; min-width: 210px; padding: 6px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow-pop); animation: pop2 var(--d2) var(--ease) both; }
.menu button { width: 100%; display: flex; gap: 10px; align-items: center; padding: 9px 10px; border: 0; background: none; border-radius: var(--r-xs); cursor: pointer; text-align: start; font-size: 14px; }
.menu button:hover { background: var(--surface-3); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
@keyframes pop2 { from { opacity: 0; transform: translateY(-6px) scale(.98); } }

/* ---------- Responsive ---------- */
.mob-only { display: none; }
@media (max-width: 1200px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .builder { grid-template-columns: 1fr; } .builder-form { position: static; max-height: none; } }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 280px; transform: translateX(100%); transition: transform var(--d3) var(--ease); box-shadow: var(--shadow-pop); }
  .shell.nav-open .side { transform: none; }
  .mob-only { display: inline-flex; }
  .shell { --col-d: none; }
  .shell.nav-open::before { content: ""; position: fixed; inset: 0; z-index: 29; background: rgba(5,5,8,.6); backdrop-filter: blur(4px); animation: fade var(--d3) both; }
  .la-bot, .la-mid p { display: none; }
  .login-art { min-height: 260px; gap: 24px; }
  .search-btn { min-width: 0; width: 40px; padding: 0; justify-content: center; } .search-btn span, .search-btn kbd { display: none; }
  .g-main, .g-3, .g-2, .set-layout { grid-template-columns: 1fr; }
  .set-nav { position: static; display: flex; overflow-x: auto; }
  .login { grid-template-columns: 1fr; } .login-art { min-height: 300px; order: -1; } .clapper { display: none; }
  .page { padding: 20px 16px; } .top { padding: 0 14px; }
  .rec-btn .tc { display: none; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) { #themeT { display: none; } .rec-btn { padding: 0 12px; } .g-4 { grid-template-columns: 1fr; } .page-head h1 { font-size: 32px; } .crumb small { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .login-art .rings { animation: none; }
}

/* =====================================================================
   OFFER DECK — 1440 × 810 slides in the TIA proposal style
   ===================================================================== */
.dk { --d-red: #ed1c29; --d-ink: #161417; --d-paper: #edebe7; --d-mute: #6a6761; width: 1440px; height: 810px; position: relative; overflow: hidden; font-family: var(--f-deck); direction: rtl; padding: 82px 90px 70px; color: var(--d-ink); background: var(--d-paper); line-height: 1.55; }
.dk .ic { width: 1em; height: 1em; }
.dk-dark { background: radial-gradient(70% 90% at 0% 100%, #5c0a12 0%, transparent 60%), linear-gradient(160deg, #19171a 0%, #141215 55%, #2a0a0e 100%); color: #f5f3ef; }
.dk h1 { font: 700 92px/1.12 var(--f-deck); letter-spacing: -.01em; }
.dk h2 { font: 700 54px/1.2 var(--f-deck); margin-bottom: 18px; }
.dk-eye { display: flex; align-items: center; gap: 14px; color: var(--d-red); font-size: 19px; font-weight: 500; margin-bottom: 14px; }
.dk-eye i { width: 32px; height: 2px; background: var(--d-red); }
.dk-eye.c { justify-content: center; }
.dk-lead { font-size: 22px; line-height: 1.75; color: #3a3833; max-width: 1000px; }
.dk-dark .dk-lead { color: rgba(245, 243, 239, .78); }
.dk-rings { position: absolute; width: 520px; height: 520px; fill: none; stroke: var(--d-red); stroke-width: 1.4; opacity: .7; }
.dk-rings.tl { top: 0; left: 0; } .dk-rings.bl { bottom: 0; left: 0; transform: scaleY(-1); } .dk-rings.tr { top: 0; right: 0; transform: scaleX(-1); }
.dk-logo { position: absolute; top: 70px; right: 90px; width: 180px; }
.dk-logo.c { position: relative; top: auto; right: auto; margin: 70px auto 34px; width: 210px; }
.dk-cover-body { position: absolute; right: 90px; top: 290px; text-align: right; }
.dk-to { color: var(--d-red); font-size: 38px; font-weight: 600; margin-top: 4px; }
.dk-meta { position: absolute; left: 90px; right: 90px; bottom: 72px; display: flex; align-items: center; gap: 0; border-top: 1px solid rgba(255, 255, 255, .18); padding-top: 26px; }
.dk-meta > div { padding-inline-end: 44px; margin-inline-end: 44px; border-inline-end: 1px solid rgba(255, 255, 255, .18); display: grid; gap: 4px; }
.dk-meta > div:nth-child(3) { border: 0; }
.dk-meta small { color: rgba(255, 255, 255, .55); font-size: 16px; } .dk-meta b { font-size: 26px; font-weight: 600; }
.dk-mark { margin-inline-start: auto; font: 600 17px var(--f-deck); letter-spacing: .01em; direction: ltr; }
.dk-mark b { color: var(--d-red); font-weight: 700; }
.dk-foot { position: absolute; left: 90px; right: 90px; bottom: 40px; display: flex; align-items: center; gap: 24px; direction: ltr; }
.dk-foot i { flex: 1; height: 1.5px; background: var(--d-ink); }
.dk-foot.on-dark i { background: rgba(255, 255, 255, .3); }
.dk-pg { font: 700 21px var(--f-deck); } .dk-foot .dk-mark { margin: 0; font-size: 15px; }
.dk-wm { position: absolute; top: 40px; left: 30px; font: 800 340px/1 var(--f-disp); color: transparent; -webkit-text-stroke: 1.5px rgba(22, 20, 23, .07); letter-spacing: .02em; }
.dk-intro h2 { margin-bottom: 18px; } .dk-intro .dk-lead { max-width: 1060px; }
.dk-pillars { position: absolute; left: 90px; right: 90px; bottom: 150px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 54px; }
.dk-pillars article { border-top: 1.5px solid var(--d-ink); padding-top: 26px; }
.dk-pi { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.dk-pi span { font-size: 17px; color: var(--d-mute); }
.dk-pi em { width: 64px; height: 64px; border-radius: 50%; border: 1.5px solid var(--d-red); display: grid; place-items: center; color: var(--d-red); font-size: 28px; }
.dk-pillars h3, .dk-fgrid h3, .dk-wgrid h3 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.dk-pillars p { font-size: 18.5px; color: #4b4943; }
.dk-split { display: flex; justify-content: space-between; align-items: flex-start; gap: 60px; margin-bottom: 34px; }
.dk-split h2 { margin: 0; white-space: nowrap; }
.dk-market .dk-split h2 { font-size: 48px; }
.dk-quote { max-width: 470px; font-size: 19px; color: #4b4943; line-height: 1.7; }
.dk-dark .dk-quote { color: rgba(245, 243, 239, .72); }
.dk-table .dk-th { display: grid; grid-template-columns: 70px 1fr 60px 1fr; padding-bottom: 12px; border-bottom: 1.5px solid var(--d-ink); font-size: 17px; font-weight: 600; }
.dk-table .dk-th span:first-child { grid-column: 2; } .dk-table .dk-th span:last-child { grid-column: 4; color: var(--d-red); }
.dk-tr { display: grid; grid-template-columns: 70px 1fr 60px 1fr; align-items: center; padding: 22px 0; border-bottom: 1px solid rgba(22, 20, 23, .14); }
.dk-n { font-size: 30px; color: #8d8a83; font-weight: 300; }
.dk-cell { display: flex; gap: 18px; align-items: flex-start; }
.dk-cell em { font-size: 30px; color: var(--d-ink); margin-top: 4px; } .dk-cell em.red { color: var(--d-red); }
.dk-cell h4 { font-size: 25px; font-weight: 700; } .dk-cell p { font-size: 17px; color: #4b4943; }
.dk-arrow { color: var(--d-red); font-size: 28px; text-align: center; }
.dk-big { position: absolute; left: 70px; top: 50px; font: 300 260px/1 var(--f-deck); color: transparent; -webkit-text-stroke: 2px rgba(237, 28, 41, .45); letter-spacing: -.02em; }
.dk-big.sm { font-size: 150px; top: 80px; -webkit-text-stroke: 0; color: rgba(237, 28, 41, .18); }
.dk-big.sm .ic { width: 210px; height: 210px; stroke-width: 1; }
.dk-date { display: flex; align-items: center; gap: 10px; font-size: 18px; color: #3a3833; margin: -6px 0 16px; }
.dk-date .ic { color: var(--d-red); }
.dk-stats { position: absolute; left: 90px; right: 90px; bottom: 270px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.dk-phases .dk-stats { bottom: 100px; }
.dk-stat { display: flex; align-items: center; gap: 22px; background: #f7f6f3; border: 1px solid rgba(22, 20, 23, .1); padding: 26px 28px; }
.dk-stat em { width: 74px; height: 74px; border-radius: 50%; border: 1.5px solid rgba(237, 28, 41, .5); display: grid; place-items: center; color: var(--d-red); font-size: 30px; flex: none; }
.dk-stat b { font: 700 64px/1 var(--f-deck); } .dk-stat span { font-size: 26px; font-weight: 600; }
.dk-stat small { display: block; color: var(--d-red); font-size: 14px; font-weight: 600; letter-spacing: .08em; margin-top: 4px; }
.dk-notes { position: absolute; left: 90px; right: 90px; bottom: 130px; background: var(--d-ink); color: #f5f3ef; display: flex; align-items: center; gap: 46px; padding: 30px 40px; font-size: 18px; }
.dk-notes strong { font-size: 25px; padding-inline-start: 18px; border-inline-start: 5px solid var(--d-red); white-space: nowrap; }
.dk-notes span { display: flex; gap: 12px; align-items: flex-start; flex: 1; } .dk-notes span .ic { color: var(--d-red); font-size: 24px; flex: none; margin-top: 2px; }
.dk-fgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.dk-fgrid article { background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .1); padding: 22px 24px; min-height: 190px; }
.dk-fgrid .dk-pi em { width: auto; height: auto; border: 0; font-size: 34px; }
.dk-fgrid h3 { font-size: 24px; } .dk-fgrid p { font-size: 16px; color: rgba(245, 243, 239, .62); }
.dk-ftotal { background: var(--d-red) !important; border: 0 !important; display: grid; align-content: space-between; }
.dk-ftotal b { font: 700 92px/1 var(--f-deck); } .dk-ftotal b span { font-size: 34px; } .dk-ftotal small { font-size: 17px; }
.dk-timeline { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 26px; margin-top: 30px; position: relative; }
.dk-timeline::before { content: ""; position: absolute; top: 9px; left: 0; right: 0; height: 1.5px; background: rgba(22, 20, 23, .2); }
.dk-timeline article { position: relative; padding-top: 34px; }
.dk-dot { position: absolute; top: 0; right: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--d-red); box-shadow: 0 0 0 6px rgba(237, 28, 41, .15); }
.dk-timeline small { font-size: 16px; color: var(--d-mute); } .dk-timeline h3 { font-size: 27px; font-weight: 700; margin: 2px 0 8px; } .dk-timeline p { font-size: 17px; color: #4b4943; }
.dk-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; } .dk-chips i { font-style: normal; font-size: 15px; padding: 4px 12px; border: 1px solid rgba(237, 28, 41, .4); color: #a50d1b; border-radius: 30px; }
.dk-bignums { display: grid; grid-template-columns: repeat(var(--n), 1fr); margin-top: 70px; }
.dk-bignums > div { text-align: right; padding: 0 34px; border-inline-start: 1px solid rgba(255, 255, 255, .14); display: grid; gap: 6px; }
.dk-bignums > div:last-child { border: 0; }
.dk-bignums em { color: var(--d-red); font-size: 30px; } .dk-bignums b { font: 700 150px/1 var(--f-deck); letter-spacing: -.03em; } .dk-bignums span { font-size: 30px; font-weight: 600; } .dk-bignums small { font-size: 16px; color: rgba(245, 243, 239, .5); direction: ltr; text-align: right; }
.dk-sum { position: absolute; right: 90px; left: 90px; bottom: 110px; border-top: 1px solid rgba(255, 255, 255, .14); padding-top: 26px; font-size: 25px; }
.dk-sum b { color: var(--d-red); font-size: 42px; margin-inline-end: 10px; }
.dk-wgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 50px; margin-top: 36px; }
.dk-wgrid article { display: flex; gap: 20px; padding: 26px 0; border-top: 1px solid rgba(22, 20, 23, .16); }
.dk-wgrid em { width: 62px; height: 62px; border-radius: 50%; border: 1.5px solid rgba(237, 28, 41, .5); display: grid; place-items: center; color: var(--d-red); font-size: 26px; flex: none; }
.dk-wgrid h3 { font-size: 24px; } .dk-wgrid p { font-size: 16.5px; color: #4b4943; }
.dk-bar { position: absolute; left: 90px; right: 90px; bottom: 120px; background: var(--d-ink); color: #f5f3ef; padding: 26px 40px; font-size: 22px; display: flex; gap: 16px; align-items: center; }
.dk-bar .ic { color: var(--d-red); font-size: 26px; }
.dk-nlist { list-style: none; margin: 36px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 60px; }
.dk-nlist li { display: flex; gap: 22px; padding: 22px 0; border-top: 1px solid rgba(22, 20, 23, .16); font-size: 21px; }
.dk-nlist span { color: var(--d-red); font-weight: 600; }
.dk-ptable { margin-top: 10px; }
.dk-pth, .dk-ptr, .dk-ptot, .dk-pdisc { display: grid; grid-template-columns: 90px 1.2fr 1.4fr 200px; align-items: center; padding: 18px 26px; }
.dk-pth { font-size: 16px; font-weight: 600; border-bottom: 1.5px solid var(--d-ink); padding-block: 12px; }
.dk-pth span:last-child, .dk-ptr strong, .dk-ptot strong, .dk-pdisc strong { text-align: left; }
.dk-ptr { border-bottom: 1px solid rgba(22, 20, 23, .14); font-size: 18px; }
.dk-ptr > span:first-child { color: #8d8a83; } .dk-ptr b { font-size: 24px; } .dk-ptr strong { color: var(--d-red); font-size: 28px; }
.dk-ptot { background: var(--d-ink); color: #f5f3ef; margin-top: 16px; font-size: 18px; }
.dk-ptot > span:first-child { color: var(--d-red); font-size: 26px; } .dk-ptot b { font-size: 25px; } .dk-ptot strong { font-size: 32px; }
.dk-pdisc { border: 1.5px solid var(--d-red); border-top: 0; font-size: 17px; }
.dk-pdisc b { color: var(--d-red); font-size: 23px; } .dk-pdisc strong { color: var(--d-red); font-size: 32px; }
.dk-close { text-align: center; }
.dk-close h2 { font-size: 78px; margin: 0 0 18px; } .dk-close .dk-lead { margin: 0 auto 26px; }
.dk-contact { position: absolute; bottom: 70px; left: 0; right: 0; display: flex; justify-content: center; align-items: center; gap: 28px; font-size: 18px; color: rgba(245, 243, 239, .8); direction: ltr; }
.dk-contact i { width: 1px; height: 46px; background: rgba(255, 255, 255, .3); }
.dk-contact .ic { color: var(--d-red); }

/* ---------- Print the deck ---------- */
#print-root { display: none; }
@media print {
  @page { size: 1440px 810px; margin: 0; }
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing::after { display: none; }
  body.printing #print-root { display: block; }
  body.printing #print-root .dk { break-after: page; page-break-after: always; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* =====================================================================
   TIA AI
   ===================================================================== */
.ai-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; align-items: start; }
.ai-modes { display: grid; gap: 6px; position: sticky; top: calc(var(--top-h) + 16px); }
.ai-mode { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: var(--r); border: 1px solid transparent; color: var(--text-2); text-decoration: none; transition: background var(--d2), border-color var(--d2), transform var(--d2) var(--ease); }
.ai-mode:hover { background: var(--surface-2); color: var(--text); transform: translateX(-2px); }
.ai-mode.on { background: var(--surface); border-color: var(--line-2); color: var(--text); box-shadow: var(--shadow); }
.ai-mode .ic { margin-top: 2px; color: var(--accent-text); }
.ai-mode b { display: block; font-size: 14px; }
.ai-mode small { display: block; font-size: 12px; color: var(--text-3); line-height: 1.5; }
.ai-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-height: calc(100vh - var(--top-h) - 200px); }
.ai-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ai-bar > .ic { color: var(--accent-text); }
.ai-tg { height: 36px; cursor: pointer; gap: 8px; }
.ai-tg .switch { width: 38px; height: 24px; } .ai-tg .switch::after { width: 16px; height: 16px; }
.ai-tg .switch:checked::after { transform: translateX(-14px); }
.ai-brief { border-bottom: 1px solid var(--line); padding: 14px 16px; background: var(--surface-2); }
.ai-brief summary { cursor: pointer; font-weight: 700; display: flex; gap: 8px; align-items: center; margin-bottom: 12px; list-style: none; }
.ai-thread { flex: 1; overflow-y: auto; padding: 18px 16px; display: grid; gap: 16px; align-content: start; max-height: 68vh; }
.ai-msg { display: flex; gap: 10px; align-items: flex-start; animation: rise var(--d3) var(--ease) both; }
.ai-msg.me { justify-content: flex-start; flex-direction: row-reverse; }
.ai-bub { max-width: min(860px, 100%); padding: 12px 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); line-height: 1.8; font-size: 14.5px; }
.ai-msg.me .ai-bub { background: var(--accent-soft); border-color: rgba(255, 90, 104, .3); }
.ai-av { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 30% 30%, #ff5a68, #8f0b21); color: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.ai-av .ic { width: 17px; height: 17px; }
.md h2, .md h3, .md h4, .md h5 { font-size: 16px; margin: 14px 0 6px; } .md h2 { font-size: 18px; }
.md p { margin: 6px 0; } .md ul, .md ol { margin: 6px 0; padding-inline-start: 22px; } .md li { margin: 3px 0; }
.md code { font-family: var(--f-mono); font-size: 13px; background: var(--surface-3); padding: 1px 6px; border-radius: 5px; }
.md blockquote { margin: 8px 0; padding: 6px 12px; border-inline-start: 3px solid var(--accent); color: var(--text-2); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.md-table { overflow-x: auto; margin: 10px 0; border: 1px solid var(--line); border-radius: 10px; }
.md-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.md-table th { background: var(--surface-3); text-align: start; padding: 8px 10px; white-space: nowrap; }
.md-table td { padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.ai-src { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line-2); display: grid; gap: 4px; font-size: 13px; }
.ai-src b { display: flex; gap: 6px; align-items: center; color: var(--text-2); }
.ai-src a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-acts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; opacity: .75; }
.ai-acts:hover { opacity: 1; }
.ai-compose { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); background: var(--surface); align-items: flex-end; }
.ai-compose .textarea { min-height: 52px; max-height: 200px; }
.ai-compose .btn { height: 52px; }
.ai-empty { display: grid; place-items: center; text-align: center; gap: 10px; padding: 40px 10px; }
.ai-orb { width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: radial-gradient(circle at 30% 30%, #ff5a68, #8f0b21 70%); box-shadow: 0 0 0 10px var(--accent-soft), 0 20px 50px -10px var(--accent); animation: orb 4s var(--ease-io) infinite; }
.ai-orb .ic { width: 36px; height: 36px; }
@keyframes orb { 50% { transform: translateY(-6px) scale(1.04); box-shadow: 0 0 0 16px var(--accent-soft), 0 30px 60px -10px var(--accent); } }
.ai-starters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 720px; margin-top: 8px; }
.ai-starters .fpill { height: auto; padding: 8px 12px; text-align: start; line-height: 1.5; }
.ai-typing { display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.ai-typing .rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red-500); animation: blink 1s steps(2) infinite; }
.ai-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: bounce 1s var(--ease-io) infinite; }
.ai-typing i:nth-of-type(2) { animation-delay: .15s; } .ai-typing i:nth-of-type(3) { animation-delay: .3s; }
@keyframes bounce { 50% { transform: translateY(-5px); opacity: .5; } }
.tool-head { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.mini-t { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-t th { text-align: start; color: var(--text-3); font-weight: 600; padding: 4px 6px; }
.mini-t td { padding: 3px 4px; } .mini-t td:first-child { color: var(--text-2); white-space: nowrap; }
.mini-t .input { height: 36px; padding: 0 10px; }
.cal-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 420px; overflow: auto; }
.cal-day { padding: 8px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.cal-day b { font: 500 12px var(--f-mono); color: var(--text-2); display: block; margin-bottom: 6px; }
.cal-day > div { display: flex; flex-wrap: wrap; gap: 4px; }
.cal-tg { height: 26px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line-2); background: none; color: var(--text-3); font-size: 11.5px; font-weight: 700; cursor: pointer; }
.cal-tg[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 1100px) { .ai-layout { grid-template-columns: 1fr; } .ai-modes { position: static; grid-auto-flow: column; overflow-x: auto; grid-auto-columns: 220px; } }

/* =====================================================================
   REPORT «ما وراء الكادر» — 1123×794
   ===================================================================== */
.rp { --rr: #e0242f; width: 1123px; height: 794px; position: relative; overflow: hidden; direction: rtl; background: #f7f6f2; color: #151416; font-family: "Almarai", "IBM Plex Sans Arabic", sans-serif; padding: 52px 74px 50px 64px; }
.rp-thumb, .rp-hero { aspect-ratio: 1123 / 794; }
.rp-thumb .rp, .rp-hero .rp { position: absolute; top: 0; left: 0; transform-origin: 0 0; transform: scale(var(--s)); }
.rp-red { background: radial-gradient(90% 90% at 100% 0%, #6b0a10 0%, #2a0507 55%, #120203 100%); color: #f3efe9; }
.rp-rail { position: absolute; left: 28px; top: 36px; bottom: 36px; width: 1px; background: rgba(224, 36, 47, .55); }
.rp-rail::before { content: ""; position: absolute; top: -3px; left: -3px; width: 7px; height: 7px; background: var(--rr); }
.rp-frame { position: absolute; top: 30px; left: 46px; font: 500 10px var(--f-mono); letter-spacing: .14em; color: #8b8781; direction: ltr; }
.rp-frame b { margin-left: 8px; font-weight: 500; }
.rp-frame.on-dark { top: auto; bottom: 30px; color: #bbb; }
.rp-cat { color: var(--rr); font: 600 13px "Changa", sans-serif; text-align: right; }
.rp-h { font: 400 48px/1.15 "Lalezar", "Changa", sans-serif; margin: 8px 0 4px; }
.rp-sub { font-size: 13.5px; color: #4d4a45; margin-bottom: 22px; }
.rp-red .rp-sub { color: rgba(243, 239, 233, .75); }
.rp-foot { position: absolute; left: 46px; right: 74px; bottom: 22px; display: flex; justify-content: space-between; font: 500 10px var(--f-mono); color: #8b8781; direction: ltr; }
.rp-foot span:last-child { font-family: "Almarai", sans-serif; direction: rtl; }
.rp-cover { padding: 0; background: #000; }
.rp-cimg { position: absolute; inset: 0; background: center/cover no-repeat; }
.rp-cimg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(270deg, rgba(0,0,0,.2), rgba(0,0,0,0) 60%); }
.rp-rec { position: absolute; top: 22px; left: 30px; font: 500 10px var(--f-mono); color: #ddd; letter-spacing: .14em; display: flex; gap: 8px; align-items: center; direction: ltr; z-index: 2; }
.rp-rec i { width: 7px; height: 7px; border-radius: 50%; background: var(--rr); }
.rp-corner { position: absolute; width: 18px; height: 18px; border: 1.5px solid #ddd; z-index: 2; }
.rp-corner.tl { top: 18px; left: 18px; border-right: 0; border-bottom: 0; } .rp-corner.br { bottom: 18px; right: 18px; border-left: 0; border-top: 0; }
.rp-ccard { position: absolute; top: 74px; bottom: 74px; right: 52px; width: 430px; background: #141313; color: #f3efe9; padding: 40px 40px 36px; border-inline-start: 3px solid var(--rr); display: flex; flex-direction: column; z-index: 2; }
.rp-ccard img { width: 74px; align-self: flex-end; margin-bottom: 60px; }
.rp-kick { font: 600 15px "Changa", sans-serif; }
.rp-ccard h1, .rp-end h1 { font: 400 84px/1.02 "Lalezar", sans-serif; margin: 10px 0 16px; }
.rp-ccard h1 span, .rp-end h1 span { display: block; } .rp-ccard h1 em, .rp-end h1 em { display: block; font-style: normal; color: var(--rr); }
.rp-ccard p { font: 600 16px "Changa", sans-serif; }
.rp-cmeta { margin-top: auto; display: flex; gap: 46px; font-size: 13px; } .rp-cmeta small { display: block; color: var(--rr); font-weight: 700; } .rp-cmeta b { font-weight: 400; }
.rp-tag { position: absolute; bottom: 30px; left: 560px; font: 500 9.5px var(--f-mono); color: #aaa; letter-spacing: .14em; z-index: 2; }
.rp-exec { border-top: 1px solid #d7d3cb; padding-top: 18px; }
.rp-exec h3 { font: 600 19px "Changa", sans-serif; margin-bottom: 14px; }
.rp-exec > div { padding: 12px 0; border-bottom: 1px solid #e3dfd7; }
.rp-exec b { color: var(--rr); font-size: 13.5px; } .rp-exec p { font-size: 14px; margin-top: 4px; line-height: 1.7; }
.rp-id { display: grid; grid-template-columns: 1.4fr 1fr; gap: 50px; }
.rp-id h4, .rp-defs h3 { font: 600 17px "Changa", sans-serif; margin-bottom: 12px; }
.rp-t2 { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rp-t2 th { background: var(--rr); color: #fff; padding: 9px 12px; text-align: center; font-weight: 700; }
.rp-t2 td { padding: 14px 12px; text-align: center; border-bottom: 1px solid rgba(255,255,255,.14); }
.rp-ref { width: 100%; max-height: 300px; object-fit: cover; border: 1px solid rgba(255,255,255,.2); }
.rp-ref.ph { height: 240px; display: grid; place-items: center; font: 500 12px var(--f-mono); color: rgba(255,255,255,.5); border-style: dashed; }
.rp-idlink { position: absolute; right: 74px; bottom: 60px; font-size: 13px; text-align: right; } .rp-idlink b { display: block; color: #ff5a68; }
.rp-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; border-top: 1px solid #d7d3cb; padding-top: 14px; margin-bottom: 22px; }
.rp-3 span { font: 500 11px var(--f-mono); color: var(--rr); } .rp-3 b { display: block; font: 600 18px "Changa", sans-serif; } .rp-3 p { font-size: 12.5px; color: #4d4a45; margin-top: 4px; }
.rp-t { width: 100%; border-collapse: collapse; font-size: 13px; }
.rp-t th { background: #151416; color: #fff; padding: 9px 12px; text-align: center; font-weight: 700; } .rp-t th:first-child, .rp-t td:first-child { text-align: right; }
.rp-t th.cur { background: var(--rr); } .rp-t td.cur { background: rgba(224, 36, 47, .07); font-weight: 700; }
.rp-t td { padding: 10px 12px; text-align: center; border-bottom: 1px solid #e3dfd7; }
.rp-t td.neg { color: #b3121b; direction: ltr; } .rp-t td.pos { color: #128a57; direction: ltr; }
.rp-fmt { width: 62%; margin-inline-start: auto; } .rp-fmt td { padding: 15px 12px; }
.rp-note { font-size: 11px; color: #8b8781; margin-top: 10px; }
.rp-plat { display: grid; grid-template-columns: 210px 1fr; gap: 40px; direction: ltr; }
.rp-plat > table { direction: rtl; }
.rp-side { direction: rtl; display: grid; gap: 18px; align-content: start; text-align: right; }
.rp-tagl { font: 500 10px var(--f-mono); color: var(--rr); letter-spacing: .14em; direction: ltr; text-align: left; }
.rp-side small { display: block; font-size: 13px; } .rp-side b { font: 500 22px var(--f-mono); color: var(--rr); direction: ltr; display: block; }
.rp-top3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 46px; padding: 0 30px; margin-bottom: 18px; direction: ltr; }
.rp-top3 figure { margin: 0; position: relative; } .rp-top3 img, .rp-top3 .ph { width: 100%; height: 200px; object-fit: cover; display: block; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); }
.rp-top3 figcaption { position: absolute; top: -18px; right: 0; font: 500 10px var(--f-mono); color: #ddd; letter-spacing: .12em; } .rp-top3 figcaption b { color: #ff5a68; font-weight: 500; }
.rp-onred th { background: var(--rr); } .rp-onred td { border-color: rgba(255,255,255,.14); color: #f3efe9; } .rp-onred small { color: #bbb; } .rp-onred u { text-decoration-color: rgba(255,255,255,.4); }
.rp-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; border-top: 1px solid #d7d3cb; padding-top: 12px; margin-bottom: 26px; font: 600 15px "Changa", sans-serif; }
.rp-steps span { font: 500 11px var(--f-mono); color: var(--rr); margin-inline-end: 10px; }
.rp-plan th:first-child { width: 26%; } .rp-plan td { text-align: right; padding: 12px; } .rp-plan td:first-child { font-weight: 700; }
.rp-an { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; }
.rp-an-h { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid #d7d3cb; padding-top: 10px; margin-bottom: 8px; }
.rp-an-h b { font: 600 17px "Changa", sans-serif; } .rp-an-h span { font: 500 10px var(--f-mono); color: var(--rr); }
.rp-an h5 { color: var(--rr); font-size: 13px; margin: 10px 0 2px; } .rp-an p { font-size: 12px; line-height: 1.75; color: #36332f; }
.rp-decision { position: absolute; left: 74px; right: 74px; bottom: 58px; background: #ece9e3; padding: 16px 20px; display: flex; gap: 30px; align-items: center; }
.rp-decision b { color: var(--rr); font: 600 16px "Changa", sans-serif; white-space: nowrap; } .rp-decision p { font-size: 12.5px; }
.rp-defs > div { padding: 10px 0; } .rp-defs b { font-size: 14px; display: block; } .rp-defs p { font-size: 12.5px; color: #4d4a45; }
.rp-end { padding: 0; display: grid; grid-template-columns: 1fr 1fr; direction: ltr; }
.rp-eimg { background: #000 center/cover no-repeat; position: relative; } .rp-eimg span { position: absolute; bottom: 30px; left: 40px; font: 500 10px var(--f-mono); color: #ddd; letter-spacing: .14em; }
.rp-ebody { direction: rtl; background: #fff; padding: 60px 70px 40px 50px; position: relative; display: flex; flex-direction: column; border-left: 3px solid var(--rr); }
.rp-elogo { width: 60px; align-self: center; margin-bottom: 30px; } .rp-ebody .rp-frame { left: auto; right: 40px; }
.rp-end h1 { font-size: 80px; color: #151416; }
.rp-ex b { display: block; color: var(--rr); font-size: 14px; margin-top: 18px; } .rp-ex p { font-size: 13px; line-height: 1.7; }
.rp-endtag { margin-top: auto; font: 500 9.5px var(--f-mono); color: #8b8781; letter-spacing: .14em; direction: ltr; text-align: left; }

/* =====================================================================
   CALENDAR — 1440×810
   ===================================================================== */
@font-face { font-family: "Perandory"; src: url("fonts/Perandory.woff2") format("woff2"), url("fonts/Perandory.otf") format("opentype"); font-display: swap; }
.deck-hero .cl, .deck-thumb .cl { position: absolute; top: 0; left: 0; transform-origin: 0 0; transform: scale(var(--s)); }
.cl { width: 1440px; height: 810px; position: relative; overflow: hidden; direction: ltr; color: #f3efe9; background: linear-gradient(100deg, #000 0%, #120203 30%, #3a0405 70%, #4d0506 100%); font-family: "Changa", sans-serif; padding: 60px 40px 0 40px; }
.cl-title { font: 400 58px/1 "Perandory", "Italiana", serif; letter-spacing: .02em; margin: 0 0 66px; transform: scaleY(1.08); transform-origin: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 1150px; }
.cl-month { position: absolute; top: 30px; right: 70px; width: 200px; text-align: center; font: 400 90px/.92 "Perandory", "Italiana", serif; }
.cl-month span { display: block; }
.cl-mnums { margin-top: 64px; font-size: 110px; line-height: 1; }
.cl-month.m1 .cl-mnums { font-size: 150px; } .cl-month.m3 .cl-mnums { margin-top: 30px; font-size: 64px; } .cl-month.m3 .cl-mnums i { font-size: 44px; } .cl-month.m4 .cl-mnums { margin-top: 24px; font-size: 48px; } .cl-month.m4 .cl-mnums i { font-size: 34px; } .cl-mnums b { display: block; font-weight: 400; } .cl-mnums i { display: block; font-style: normal; font-size: 80px; line-height: .8; }
.cl-grid { width: 960px; margin-left: 46px; }
.cl-dow { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid rgba(255,255,255,.75); padding-bottom: 8px; margin-left: -46px; padding-left: 46px; }
.cl-dow span { color: #e21b25; font-weight: 700; font-size: 16px; }
.cl-row { display: grid; grid-template-columns: repeat(7, 1fr); height: calc(480px / max(var(--rows), 5)); border-bottom: 1px solid rgba(255,255,255,.55); }
.cl-cell { border-left: 1px solid rgba(255,255,255,.55); padding: 8px 10px; position: relative; } .cl-cell:first-child { border-left: 0; }
.cl-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #fff; color: #111; font: 800 13px "Changa", sans-serif; }
.cl-num.dim { background: #cfcfcf; } .cl-cell.off .cl-num { background: transparent; }
.cl-cell ul { list-style: none; margin: -4px 0 0 34px; padding: 0; } .cl-cell li { font: 700 12.5px "Changa", sans-serif; line-height: 1.55; letter-spacing: .02em; }
.cl-cell li::before { content: "•"; margin-right: 8px; }
.cl-notes { position: absolute; right: 70px; top: 440px; width: 256px; height: 162px; border: 1px solid rgba(255,255,255,.85); padding: 14px 16px; }
.cl-notes b { color: #e21b25; font-size: 13px; } .cl-notes p { font-size: 13px; margin-top: 8px; line-height: 1.6; direction: rtl; text-align: right; font-family: "Almarai", sans-serif; }
.cl-foot { position: absolute; left: 70px; bottom: 50px; font: 700 13px "Changa", sans-serif; display: flex; align-items: center; gap: 10px; } .cl-foot b { color: #e21b25; }
.cl-foot i { width: 420px; height: 1px; background: rgba(255,255,255,.8); display: inline-block; }
.cl-empty { display: grid; place-items: center; height: 100%; font-size: 30px; color: #999; font-family: "Almarai", sans-serif; }
.cl-list table { width: 1100px; border-collapse: collapse; margin-top: -20px; }
.cl-list th { color: #e21b25; text-align: left; font-size: 14px; padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,.7); }
.cl-list th:nth-child(n+3), .cl-list td:nth-child(n+3) { text-align: right; direction: rtl; font-family: "Almarai", sans-serif; }
.cl-list td { padding: 11px 10px; border-bottom: 1px solid rgba(255,255,255,.2); font-size: 15px; vertical-align: top; }
.cl-list td span { font-weight: 700; font-size: 12px; padding: 2px 8px; border: 1px solid rgba(255,255,255,.6); border-radius: 20px; }
@media print { body.printing #print-root .rp, body.printing #print-root .cl { break-after: page; page-break-after: always; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ---- TIA AI · learning library ---- */
.ai-score { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; }
.btn-xs { padding: 3px 7px; min-height: 26px; font-size: 12px; }
.ln-kpis { margin-top: 4px; }
.ln-kpis .kpi-val { font-size: 30px; }
.ln-list { margin: 0; padding-inline-start: 20px; display: grid; gap: 10px; }
.ln-list li { line-height: 1.7; }
.ln-list .btn-xs { margin-inline-start: 6px; vertical-align: middle; }
.ln-add { display: flex; gap: 8px; margin-top: 14px; }
.ln-add .input { flex: 1; }
.ln-card details { margin-top: 10px; }
.ln-card summary { cursor: pointer; }
.ln-m { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 10px; }
.ln-m span { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; display: grid; gap: 2px; }
.ln-m small { color: var(--text-3); font-size: 11.5px; }
.ln-m b { font: 700 15px var(--f-disp); }
.ln-note { margin: 10px 0 0; padding: 8px 12px; border-inline-start: 3px solid var(--accent); background: var(--surface-2); border-radius: 8px; font-size: 13.5px; }
.ln-pick { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; line-height: 1.7; }
.ln-pick input { margin-top: 6px; }
@media (max-width: 900px) { .ln-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- TIA AI · brand profile + brand lab ---- */
.pf-gate { display: flex; align-items: center; gap: 14px; margin: 0 16px 12px; padding: 14px 16px; border: 1px dashed var(--accent); border-radius: 12px; background: var(--surface-2); }
.pf-gate > svg { width: 26px; height: 26px; color: var(--accent); flex: none; }
.pf-gate > div { display: grid; gap: 2px; flex: 1; }
.pf-gate.warn { border-color: var(--warn, #c98a12); }
.pf-gate.warn > svg { color: var(--warn, #c98a12); }
.pf-strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 16px 10px; }
.pf-src { padding: 14px; display: grid; gap: 10px; }
.pf-src-row { display: flex; align-items: center; gap: 10px; }
.pf-file { cursor: pointer; }
.pf-row { display: grid; grid-template-columns: 1fr 1.4fr 0.8fr auto; gap: 8px; margin-bottom: 8px; }
#p_aud .pf-row { grid-template-columns: 1fr 1.2fr 1.2fr 1.2fr auto; }
.req { color: var(--accent); }
.bl-card { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.bl-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.bl-prof { margin-top: 6px; }
.bl-one { font-size: 17px; font-weight: 600; margin: 0 0 12px; }
.bl-prof ul { margin: 6px 0 0; padding-inline-start: 18px; line-height: 1.8; }
.bb-head { margin-top: 16px; }
.bb-verdict { font-size: 16px; line-height: 1.8; margin: 6px 0 10px; }
.bb-promise { margin: 0 0 10px; padding: 12px 16px; border-inline-start: 4px solid var(--accent); background: var(--surface-2); border-radius: 10px; font-size: 18px; font-weight: 700; }
.bb-score { display: grid; grid-template-columns: 110px 1fr 46px; align-items: center; gap: 4px 10px; margin-bottom: 10px; }
.bb-score small { grid-column: 1 / -1; line-height: 1.6; }
.bb-bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bb-bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.bb-bar i.ok { background: var(--ok, #13a37a); } .bb-bar i.mid { background: var(--warn, #c98a12); }
.bb-seg { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 6px; align-content: start; }
.bb-seg p { margin: 0; line-height: 1.7; font-size: 14px; }
.bb-scene { background: var(--surface-2); border-radius: 8px; padding: 6px 10px; font-size: 13px !important; }
.bb-truths { margin: 0; padding-inline-start: 20px; display: grid; gap: 10px; }
.bb-truths li > div { display: grid; gap: 2px; }
.bb-truths li { display: list-item; }
.bb-truths li { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.bb-truths li > div, .bb-truths li > button { display: inline-flex; }
.bb-truths li { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.bb-truths li > div { display: grid; flex: 1; }
.bb-list { margin: 0; padding-inline-start: 20px; line-height: 1.9; }
@media (max-width: 900px) { .pf-row, #p_aud .pf-row { grid-template-columns: 1fr; } .pf-gate { flex-wrap: wrap; } }
.banner.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }

/* =====================================================================
   v3 · 24-11-2026 — calmer studio shell + TIA AI single interface
   ===================================================================== */
:root { --f-head: "Readex Pro", "IBM Plex Sans Arabic", system-ui, sans-serif; }
.page-head h1 { font: 700 clamp(28px, 3.2vw, 38px)/1.15 var(--f-head); letter-spacing: 0; }
.card-h h2, .card-h h3, .modal-h h2 { font-family: var(--f-head); font-weight: 600; }
.eyebrow { font: 500 13px var(--f-body); text-transform: none; }
.eyebrow::before { width: 18px; }
.nav a .tag { display: none; }
.nav-group { font: 500 12px var(--f-body); text-transform: none; padding: 16px 12px 6px; }
.nav a { padding: 9px 12px; }
.card { border-radius: 16px; }
[data-theme="ink"] .card { box-shadow: 0 1px 0 rgba(255, 255, 255, .035) inset; }
[data-theme="paper"] .card { box-shadow: 0 1px 2px rgba(13, 13, 16, .04); }
.crumb small { font: 500 12px var(--f-body); letter-spacing: 0; }

/* ---------- TIA AI: one interface (v4 · writer's room behind the viewfinder) ---------- */
@property --tx-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@property --gp { syntax: '<number>'; inherits: false; initial-value: 0; }
.page.page-ai { padding: 0; max-width: none; }
.tx { --tx-side: 268px; --tx-w: 800px; display: grid; grid-template-columns: var(--tx-side) minmax(0, 1fr); height: calc(100vh - var(--top-h)); position: relative; overflow: hidden; transition: grid-template-columns var(--d3) var(--ease); }
.tx.side-off { grid-template-columns: 0 minmax(0, 1fr); }

/* sidebar */
.tx-side { display: flex; flex-direction: column; gap: 10px; padding: 14px 12px 12px; border-inline-end: 1px solid var(--line); background: var(--bg-deep); min-width: 0; overflow: hidden; }
.tx.side-off .tx-side { visibility: hidden; padding: 0; border: 0; }
.tx-side-h { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 4px; }
.tx-logo { display: flex; align-items: center; gap: 9px; font: 600 15px var(--f-head); }
.tx-mark { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--accent); color: #fff; }
.tx-mark .ic { width: 15px; height: 15px; }
.tx-new { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer; transition: border-color var(--d2), background var(--d2); }
.tx-new span { flex: 1; text-align: start; }
.tx-new kbd { font: 500 11px var(--f-disp); color: var(--text-3); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; }
.tx-new:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line-2)); }
.tx-new .ic { color: var(--accent-text); }
.tx-find { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: 10px; background: var(--surface-2); color: var(--text-3); }
.tx-find input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 13.5px; color: var(--text); }
.tx-find .ic { width: 16px; height: 16px; }
.tx-list { flex: 1; overflow-y: auto; scrollbar-width: thin; margin: 0 -4px; padding: 0 4px; }
.tx-lg { font-size: 12px; color: var(--text-3); padding: 12px 8px 4px; }
.tx-li { display: flex; align-items: center; border-radius: 9px; position: relative; }
.tx-li a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 8px; color: var(--text-2); text-decoration: none; font-size: 13.5px; }
.tx-li a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-li a .ic { width: 16px; height: 16px; color: var(--text-3); flex: none; }
.tx-li button { opacity: 0; border: 0; background: none; color: var(--text-3); cursor: pointer; padding: 6px; border-radius: 7px; }
.tx-li button .ic { width: 15px; height: 15px; }
.tx-li button:hover { color: var(--accent-text); }
.tx-li:hover, .tx-li.on { background: var(--surface-2); }
.tx-li.on::before { content: ""; position: absolute; inset-inline-start: -4px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--accent); }
.tx-li:hover button, .tx-li button:focus-visible { opacity: 1; }
.tx-li.on a { color: var(--text); } .tx-li.on a .ic { color: var(--accent-text); }
.tx-empty-l { color: var(--text-3); font-size: 13px; padding: 10px 8px; line-height: 1.7; }
.tx-tools { border-top: 1px solid var(--line); padding-top: 2px; }
.tx-tools .tx-lg { padding-top: 8px; }
.tx-tools-g { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tx-tools-g a { display: grid; gap: 6px; padding: 10px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); text-decoration: none; font-size: 12.5px; line-height: 1.45; transition: border-color var(--d2), color var(--d2); }
.tx-tools-g a:first-child { grid-column: span 2; grid-template-columns: auto 1fr; align-items: center; }
.tx-tools-g a .ic { width: 17px; height: 17px; color: var(--text-3); }
.tx-tools-g a:hover { border-color: var(--line-2); color: var(--text); }
.tx-tools-g a.on { border-color: var(--accent); color: var(--text); } .tx-tools-g a.on .ic, .tx-tools-g a:hover .ic { color: var(--accent-text); }

/* main column */
.tx-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.tx-head { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.tx-crumb { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; color: var(--text-2); white-space: nowrap; }
.tx-crumb > span { display: inline-flex; align-items: center; gap: 7px; }
.tx-crumb .sep { font-style: normal; color: var(--line-2); }
.tx-crumb b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tx-status { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; border-radius: var(--r-pill); background: var(--surface-2); font-size: 12px; color: var(--text-2); }
.tx-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: txPing 2.4s ease-out infinite; }
.tx-status.off i { background: var(--warn); animation: none; }
@keyframes txPing { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }
.tx-scroll { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.tx-thread { max-width: var(--tx-w); margin: 0 auto; padding: 22px 24px 36px; display: grid; gap: 28px; }
.tx-dock { padding: 0 24px 14px; position: relative; }
.tx-dock::before { content: ""; position: absolute; inset-inline: 0; bottom: 100%; height: 36px; background: linear-gradient(to top, var(--bg), transparent); pointer-events: none; }
.tx-dock-in { max-width: var(--tx-w); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; container-type: inline-size; }
.tx-dock-in > * { min-width: 0; }
.tx-note { text-align: center; font-size: 12px; color: var(--text-3); display: flex; gap: 6px; justify-content: center; align-items: center; }
.tx-note .ic { width: 14px; height: 14px; }
.tx-note:empty::before { content: "TIA AI بيبني على الملف التعريفي، وكل فكرة بتنحفظ ببنك الأفكار وما بتتكرر."; }

/* hero: the viewfinder */
.tx-hero { display: grid; justify-items: center; gap: 22px; padding: clamp(10px, 5vh, 56px) 0 8px; }
.vf { position: relative; width: min(100%, 620px); padding: 44px 40px 46px; text-align: center; border-radius: 6px; background: radial-gradient(55% 60% at 50% 38%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 100%); }
.vf-k { position: absolute; width: 26px; height: 26px; border: 2px solid var(--text-3); }
.vf-k.tl { top: 0; inset-inline-start: 0; border-inline-end: 0; border-bottom: 0; border-start-start-radius: 6px; }
.vf-k.tr { top: 0; inset-inline-end: 0; border-inline-start: 0; border-bottom: 0; border-start-end-radius: 6px; }
.vf-k.bl { bottom: 0; inset-inline-start: 0; border-inline-end: 0; border-top: 0; border-end-start-radius: 6px; }
.vf-k.br { bottom: 0; inset-inline-end: 0; border-inline-start: 0; border-top: 0; border-end-end-radius: 6px; }
.vf-hud { position: absolute; inset-inline: 14px; top: 12px; display: flex; justify-content: space-between; align-items: center; font: 500 11.5px/1 var(--f-disp); letter-spacing: .06em; color: var(--text-3); font-variant-numeric: tabular-nums; }
.vf-hud.bot { top: auto; bottom: 12px; font-family: var(--f-body); letter-spacing: 0; }
.vf-hud.bot span:last-child { font-family: var(--f-disp); letter-spacing: .04em; }
.vf-rec { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-text); font-weight: 600; }
.vf-rec i { width: 8px; height: 8px; border-radius: 50%; background: var(--red-500); animation: blink 1.2s steps(2) infinite; }
.vf-h { font: 600 clamp(26px, 3.4vw, 40px)/1.25 var(--f-head); display: grid; gap: 2px; }
.vf-h .ln { display: block; overflow: hidden; padding-block: 2px; }
.vf-h .ln > span { display: inline-block; }
.vf-h .ln:last-child > span { color: var(--text-2); }
.vf-sub { margin-top: 14px; color: var(--text-2); display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.vf-sub b { color: var(--text); }

/* one orchestrated entrance: frame closes in, lines rise, controls settle */
.tx-hero.intro .vf-k { animation: vfIn .7s var(--ease) both; }
.tx-hero.intro .vf-k.tl { --x: -14px; --y: -14px; } .tx-hero.intro .vf-k.tr { --x: 14px; --y: -14px; }
.tx-hero.intro .vf-k.bl { --x: -14px; --y: 14px; } .tx-hero.intro .vf-k.br { --x: 14px; --y: 14px; }
[dir="rtl"] .tx-hero.intro .vf-k.tl, [dir="rtl"] .tx-hero.intro .vf-k.bl { --x: 14px; } [dir="rtl"] .tx-hero.intro .vf-k.tr, [dir="rtl"] .tx-hero.intro .vf-k.br { --x: -14px; }
@keyframes vfIn { from { opacity: 0; transform: translate(var(--x), var(--y)); } }
.tx-hero.intro .vf-h .ln > span { animation: lnUp .8s var(--ease) both; animation-delay: .25s; }
.tx-hero.intro .vf-h .ln:last-child > span { animation-delay: .38s; }
@keyframes lnUp { from { transform: translateY(105%); } }
.tx-hero.intro .vf-hud, .tx-hero.intro .vf-sub { animation: fadeIn .6s var(--ease) both .55s; }
.tx-hero.intro .tx-rail, .tx-hero.intro .tx-starts { animation: settle .6s var(--ease) both .7s; }
.tx-hero.intro .tx-starts { animation-delay: .8s; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes settle { from { opacity: 0; transform: translateY(10px); } }

/* skill rail with a sliding indicator */
.tx-rail { position: relative; display: flex; gap: 2px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tx-rail-ind { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 10px; background: var(--accent); box-shadow: 0 8px 22px -10px var(--accent); transition: transform var(--d3) var(--ease), width var(--d3) var(--ease), opacity var(--d2); pointer-events: none; }
.tx-rail button { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px; border: 0; border-radius: 10px; background: none; color: var(--text-2); font-size: 13.5px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: color var(--d2); }
.tx-rail button .ic { width: 16px; height: 16px; }
.tx-rail button:hover { color: var(--text); }
.tx-rail button[aria-selected="true"] { color: #fff; }
.tx-rail .more { color: var(--text-3); border-inline-start: 1px solid var(--line); border-radius: 0 10px 10px 0; margin-inline-start: 4px; }
[dir="rtl"] .tx-rail .more { border-radius: 10px 0 0 10px; }

/* starting points */
.tx-starts { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.tx-starts.swap > * { animation: settle .38s var(--ease) both; }
.tx-starts.swap > *:nth-child(2) { animation-delay: .05s; } .tx-starts.swap > *:nth-child(3) { animation-delay: .1s; }
.tx-start { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: start; cursor: pointer; transition: border-color var(--d2), background var(--d2); }
.tx-start > .ic:first-child { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: var(--surface-3); color: var(--accent-text); }
.tx-start span { display: grid; gap: 3px; min-width: 0; }
.tx-start b { font-size: 14px; font-weight: 600; } .tx-start small { font-size: 12.5px; color: var(--text-3); line-height: 1.5; }
.tx-start > .ic:last-child { width: 16px; height: 16px; color: var(--text-3); opacity: 0; transform: translateX(6px); transition: opacity var(--d2), transform var(--d2) var(--ease); }
.tx-start:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line-2)); background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.tx-start:hover > .ic:last-child { opacity: 1; transform: none; color: var(--accent-text); }
.tx-starts .tx-gate { grid-column: 1 / -1; }

/* composer: brief tray + text + controls, one object */
.tx-comp { position: relative; isolation: isolate; border: 1px solid var(--line-2); border-radius: 20px; background: var(--surface); padding: 8px 10px 10px; box-shadow: 0 18px 40px -28px rgba(0, 0, 0, .55); transition: border-color var(--d2), box-shadow var(--d2); }
.tx-comp::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; background: conic-gradient(from var(--tx-a), transparent 0 62%, color-mix(in srgb, var(--accent) 40%, transparent) 78%, var(--red-400) 88%, transparent 96%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity var(--d3); pointer-events: none; z-index: 2; }
.tx-comp.busy::before { opacity: 1; animation: txSpin 2.6s linear infinite; }
@keyframes txSpin { to { --tx-a: 360deg; } }
.tx-comp:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line-2)); box-shadow: 0 18px 44px -26px rgba(200, 16, 46, .35); }
.tx-comp textarea { width: 100%; border: 0; outline: none; background: none; resize: none; font-size: 15.5px; line-height: 1.65; padding: 8px 8px 8px; min-height: 30px; max-height: 220px; display: block; }
.tx-row { display: flex; align-items: center; gap: 6px; }
.tx-row .grow { flex: 1; }
.tx-ic { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--text-2); cursor: pointer; transition: background var(--d1), color var(--d1); }
.tx-ic .ic { width: 18px; height: 18px; }
.tx-ic:hover { background: var(--surface-2); color: var(--text); }
.tx-pill { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 13.5px; font-weight: 500; cursor: pointer; max-width: 210px; transition: border-color var(--d2); }
.tx-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-pill .ic { width: 16px; height: 16px; color: var(--text-3); flex: none; }
.tx-pill:hover { border-color: var(--line-2); }
.tx-tg { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--text-3); font-size: 12.5px; font-weight: 500; cursor: pointer; transition: background var(--d1), color var(--d1), border-color var(--d1); }
.tx-tg .ic { width: 16px; height: 16px; }
.tx-tg:hover { background: var(--surface-2); color: var(--text); }
.tx-tg[aria-pressed="true"] { color: var(--accent-text); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 28%, transparent); }
.tx-tg[disabled] { opacity: .35; pointer-events: none; }
.tx-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; display: inline-block; }
.tx-dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); } .tx-dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.tx-send { width: 38px; height: 38px; margin-inline-start: 4px; border-radius: 12px; border: 0; background: var(--accent); color: #fff; display: inline-grid; place-items: center; cursor: pointer; transition: transform var(--d1), background var(--d1), opacity var(--d2); }
.tx-send .ic { width: 18px; height: 18px; transform: scaleX(-1); }
.tx-send:hover { background: var(--accent-hover); } .tx-send:active { transform: scale(.92); }
.tx-send[disabled] { opacity: .35; pointer-events: none; }
.tx-comp.busy .tx-send { opacity: .5; pointer-events: none; }
@container (max-width: 660px) { .tx-tg span { display: none; } .tx-tg { padding: 0 8px; } .tx-pill { max-width: 150px; } }
@container (max-width: 470px) { .tx-pill { max-width: 104px; padding: 0 8px; gap: 5px; } .tx-pill > .ic:last-child { display: none; } #txSkill span { display: none; } .tx-tg { padding: 0 7px; } .tx-row { gap: 3px; } }

.tx-tray { display: flex; align-items: center; gap: 6px; padding: 2px 0 8px; margin-bottom: 2px; border-bottom: 1px dashed var(--line); min-width: 0; }
.tx-tray-l { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); white-space: nowrap; padding-inline: 4px 2px; }
.tx-tray-l .ic { width: 15px; height: 15px; color: var(--accent-text); }
.tx-tray-s { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0; mask-image: linear-gradient(to left, transparent, #000 18px); -webkit-mask-image: linear-gradient(to left, transparent, #000 18px); padding-inline-end: 14px; }
.tk { position: relative; display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 8px 0 10px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; white-space: nowrap; flex: none; cursor: pointer; transition: background var(--d1), box-shadow var(--d1); }
.tk span { color: var(--text-3); }
.tk b { font-weight: 600; color: var(--text-2); max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.tk .ic { width: 13px; height: 13px; color: var(--text-3); }
.tk select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; font-size: 14px; }
.tk:hover { background: var(--surface-3); }
.tk:focus-within { box-shadow: 0 0 0 2px var(--accent-text); }
.tk.set { background: var(--accent-soft); } .tk.set b { color: var(--accent-text); }
.tk-act { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px; border: 0; border-radius: 8px; background: none; color: var(--text-2); font-size: 12.5px; font-weight: 500; white-space: nowrap; cursor: pointer; flex: none; }
.tk-act .ic { width: 15px; height: 15px; color: var(--accent-text); }
.tk-act:hover { background: var(--surface-2); color: var(--text); }

.tx-gate { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px dashed color-mix(in srgb, var(--accent) 60%, transparent); background: var(--surface); text-align: start; }
.tx-gate > .ic { width: 24px; height: 24px; color: var(--accent-text); flex: none; }
.tx-gate > div { flex: 1; display: grid; gap: 2px; } .tx-gate span { font-size: 13px; color: var(--text-2); }
.tx-gate.warn { border-color: color-mix(in srgb, var(--warn) 60%, transparent); } .tx-gate.warn > .ic { color: var(--warn); }
.tx-gate.in-tray { border: 0; border-bottom: 1px dashed var(--line); border-radius: 0; padding: 4px 4px 10px; margin-bottom: 2px; background: none; }
.tx-gate.in-hero { padding: 18px 20px; }

/* messages */
.tx-msg.new { animation: settle .45s var(--ease) both; }
.tx-msg.me { display: flex; justify-content: flex-start; }
.tx-msg.me .tx-bub { max-width: 82%; background: var(--surface-2); border: 1px solid var(--line); padding: 11px 16px; border-radius: 18px; border-start-start-radius: 6px; line-height: 1.75; }
.tx-msg.bot { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
.tx-av { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent); color: #fff; }
.tx-av .ic { width: 16px; height: 16px; }
.tx-av.live { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px var(--accent-soft); } }
.tx-body { min-width: 0; }
.tx-meta { display: flex; align-items: center; gap: 10px; height: 30px; font-size: 12.5px; color: var(--text-3); }
.tx-meta b { color: var(--text); font: 600 13.5px var(--f-head); }
.tx-meta span { display: inline-flex; align-items: center; gap: 5px; } .tx-meta .ic { width: 14px; height: 14px; }
.tx-body .md { line-height: 1.9; font-size: 15px; }
.tx-body .md h2, .tx-body .md h3, .tx-body .md h4 { font-family: var(--f-head); margin-top: 20px; }
.tx-body .md blockquote { border-inline-start: 3px solid var(--accent); padding: 8px 14px; margin: 10px 0; background: var(--surface); border-radius: 0 10px 10px 0; }
.tx-body .md-table { border-radius: 12px; background: var(--surface); }
.tx-body .md-table th { background: var(--surface-3); font-weight: 600; font-size: 12.5px; color: var(--text-2); }
.tx-body .md-table td:first-child { font-family: var(--f-disp); font-variant-numeric: tabular-nums; color: var(--text-2); white-space: nowrap; }
.tx-body .md-table tr:hover td { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.tx-acts { display: flex; gap: 2px; margin-top: 10px; flex-wrap: wrap; opacity: .7; transition: opacity var(--d2); }
.tx-msg.bot:hover .tx-acts, .tx-acts:focus-within, .tx-msg.bot:last-child .tx-acts { opacity: 1; }
.tx-acts button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px; border: 0; border-radius: 8px; background: none; color: var(--text-3); font-size: 12.5px; cursor: pointer; transition: background var(--d1), color var(--d1); }
.tx-acts button .ic { width: 15px; height: 15px; }
.tx-acts button:hover { background: var(--surface-2); color: var(--text); }
.tx-acts button.done { color: var(--ok); }

/* score gauge */
.ai-score { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 4px 0 14px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.gauge { --g: var(--warn); --gp: var(--v); width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(closest-side, var(--surface) 77%, transparent 79% 100%), conic-gradient(var(--g) calc(var(--gp) * 1%), var(--surface-3) 0); }
.gauge.ok { --g: var(--ok); } .gauge.red { --g: var(--accent-text); }
.gauge b { font: 700 15px/1 var(--f-disp); font-variant-numeric: tabular-nums; }
.tx-msg.new .gauge { animation: gFill 1.2s var(--ease) both .15s; }
@keyframes gFill { from { --gp: 0; } }
.gauge-l { display: grid; line-height: 1.35; } .gauge-l b { font-size: 13.5px; } .gauge-l small { color: var(--text-3); font-size: 12px; }
.ai-score-t { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.ai-why { flex-basis: 100%; color: var(--text-2); font-size: 13px; line-height: 1.7; border-top: 1px dashed var(--line); padding-top: 8px; }

/* thinking: a slate that keeps clapping + the stage it's on */
.tx-think { display: flex; align-items: center; gap: 14px; position: relative; padding: 12px 14px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; max-width: 460px; }
.slate { position: relative; width: 34px; height: 28px; flex: none; }
.slate-b { position: absolute; inset: 8px 0 0; border-radius: 3px; background: var(--surface-4); }
.slate-b::after { content: ""; position: absolute; inset: 5px 6px auto; height: 2px; border-radius: 2px; background: var(--text-3); box-shadow: 0 5px 0 var(--text-3); opacity: .7; }
.slate-top { position: absolute; top: 1px; inset-inline: 0; height: 7px; border-radius: 2px; background: repeating-linear-gradient(-45deg, var(--text) 0 4px, var(--red-600) 4px 8px); transform-origin: 2px 100%; animation: clap 1.3s var(--ease-io) infinite; }
[dir="rtl"] .slate-top { transform-origin: calc(100% - 2px) 100%; }
@keyframes clap { 0%, 55%, 100% { transform: rotate(0); } 25%, 40% { transform: rotate(-24deg); } }
[dir="rtl"] .slate-top { animation-name: clapR; }
@keyframes clapR { 0%, 55%, 100% { transform: rotate(0); } 25%, 40% { transform: rotate(24deg); } }
.think-t { display: grid; gap: 1px; } .think-t b { font-weight: 600; font-size: 14px; } .think-t small { font-size: 12px; color: var(--text-3); }
.think-t b.in { animation: settle .35s var(--ease) both; }
.think-bar { position: absolute; inset-inline: 0; bottom: 0; height: 2px; background: var(--surface-3); overflow: hidden; }
.think-bar::after { content: ""; position: absolute; inset-block: 0; width: 35%; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: sweep 1.4s var(--ease-io) infinite; }

/* popovers */
.tx-pop { position: fixed; z-index: 120; min-width: 250px; max-width: 340px; max-height: 60vh; overflow-y: auto; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); animation: popUp .22s var(--ease) both; }
.tx-pop.down { animation-name: popDown; }
@keyframes popUp { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes popDown { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.tx-pop-h { font-size: 11.5px; color: var(--text-3); padding: 8px 10px 4px; }
.tx-pop hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.tx-pop button { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; background: none; color: var(--text); text-align: start; cursor: pointer; }
.tx-pop button > span { display: grid; gap: 1px; min-width: 0; }
.tx-pop button b { font-size: 13.5px; font-weight: 600; } .tx-pop button small { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.tx-pop button .ic { width: 18px; height: 18px; color: var(--text-2); margin-top: 1px; flex: none; }
.tx-pop button .tx-dot { margin-top: 6px; }
.tx-pop button:hover, .tx-pop button:focus-visible { background: var(--surface-2); outline: none; }
.tx-pop button.on { background: var(--accent-soft); } .tx-pop button.on .ic { color: var(--accent-text); }

/* canvas (tools) */
.tx-canvas { display: none; position: absolute; inset-block: 0; inset-inline-end: 0; width: min(1060px, calc(100% - 48px)); z-index: 40; flex-direction: column; background: var(--bg); border-inline-start: 1px solid var(--line-2); box-shadow: -40px 0 80px -40px rgba(0, 0, 0, .6); }
.tx-canvas.open { display: flex; animation: cvIn var(--d3) var(--ease); }
@keyframes cvIn { from { opacity: 0; transform: translateX(-24px); } }
.tx-cv-h { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.tx-cv-h .ic { color: var(--accent-text); } .tx-cv-h .grow { flex: 1; }
.tx-cv-b { flex: 1; overflow-y: auto; padding: 18px; }
.qa .form-grid { gap: 12px; }

.ib-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.ib-card { display: grid; gap: 8px; align-content: start; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); transition: border-color var(--d2); }
.ib-card:hover { border-color: var(--line-2); }
.ib-card header { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } .ib-card header .grow { flex: 1; }
.ib-card h4 { font: 600 15px/1.6 var(--f-head); }
.ib-card p { font-size: 13.5px; color: var(--text-2); line-height: 1.7; }
.ib-truth { display: flex; gap: 6px; align-items: flex-start; } .ib-truth .ic { width: 15px; height: 15px; color: var(--accent-text); margin-top: 4px; flex: none; }
.ib-card footer { display: flex; gap: 2px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 8px; }

[data-theme="paper"] .tx-comp { box-shadow: 0 14px 34px -24px rgba(13, 13, 16, .35); }
[data-theme="paper"] .vf-k { border-color: var(--stone-400); }
[data-theme="paper"] .slate-top { background: repeating-linear-gradient(-45deg, var(--ink-900) 0 4px, var(--red-600) 4px 8px); }

@media (max-width: 860px) {
  .tx { grid-template-columns: minmax(0, 1fr); }
  .tx.side-off { grid-template-columns: minmax(0, 1fr); }
  .tx-side { position: absolute; inset-block: 0; inset-inline-start: 0; width: 284px; z-index: 50; box-shadow: var(--shadow-pop); }
  .tx.side-off .tx-side { display: none; }
  .tx-canvas { width: 100%; }
  .tx-thread, .tx-dock { padding-inline: 12px; }
  .vf { padding: 40px 18px 42px; }
  .tx-rail button span { display: none; } .tx-rail [aria-selected="true"] span, .tx-rail .more span { display: inline; }
  .tx-status { display: none; }
  .tx-crumb > span:first-child, .tx-crumb > .sep:first-of-type { display: none; }
}
@media (max-height: 760px) and (min-width: 861px) { .vf { padding-block: 36px 38px; } .tx-hero { gap: 16px; padding-top: 8px; } .vf-h { font-size: clamp(24px, 3vw, 34px); } }
@media (prefers-reduced-motion: reduce) {
  .tx-canvas.open, .tx-av.live, .tx-msg.new, .tx-starts.swap > *, .tx-pop, .slate-top, .think-bar::after, .tx-status i, .vf-rec i, .tx-comp.busy::before, .tx-msg.new .gauge, .think-t b.in { animation: none !important; }
  .tx-rail-ind, .tx-start > .ic:last-child { transition: none; }
}

/* ---------- Invoices: builder ---------- */
.iv-b { display: grid; grid-template-columns: minmax(360px, 460px) minmax(0, 1fr); gap: 20px; align-items: start; }
.iv-form { display: grid; gap: 22px; }
.iv-form section > h3 { display: flex; align-items: center; gap: 8px; font: 600 16px var(--f-head); margin-bottom: 12px; }
.iv-form section > h3 .ic { color: var(--accent-text); width: 18px; height: 18px; }
.iv-imp { display: flex; gap: 8px; } .iv-imp .select { flex: 1; }
.iv-pk-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; color: var(--text-2); }
.iv-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; overflow-x: auto; }
.iv-tabs:empty { display: none; }
.iv-tabs button { border: 0; background: none; padding: 8px 12px; border-bottom: 2px solid transparent; cursor: pointer; color: var(--text-2); white-space: nowrap; font-weight: 500; }
.iv-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.iv-items { display: grid; gap: 10px; }
.iv-it { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 12px; margin: 0; }
.iv-it legend { font: 600 12px var(--f-mono); color: var(--text-3); padding: 0 6px; }
.iv-it .full { grid-column: 1 / -1; }
.iv-it-f { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
.iv-free { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.iv-free .ic { width: 16px; height: 16px; color: var(--accent-text); }
.iv-pk-f { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.iv-prev { position: sticky; top: calc(var(--top-h) + 16px); background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 16px; overflow: hidden; }
.iv-paper { --s: .7; zoom: var(--s); width: 794px; margin-inline: auto; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .5); }
@media (max-width: 1100px) { .iv-b { grid-template-columns: 1fr; } .iv-prev { position: static; } }

/* ---------- Invoice paper (A4 · 794 × 1123) — always light ---------- */
.inv { --ir: #e3141f; --ird: #c8102e; --ik: #141416; --ig: #6b6b70; --il: #e6e3de; width: 794px; min-height: 1123px; background: #fff; color: var(--ik); font: 400 12.5px/1.65 "IBM Plex Sans Arabic", sans-serif; direction: rtl; position: relative; display: flex; flex-direction: column; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.inv .ltr { direction: ltr; unicode-bidi: isolate; }
.inv .x-red { color: var(--ir); }
.inv-top { position: relative; height: 222px; background: radial-gradient(120% 140% at 0% 0%, #3a0a10 0%, #17090b 38%, #141416 70%); color: #fff; overflow: hidden; padding: 34px 46px 0; display: flex; justify-content: space-between; }
.inv .x-arcs { position: absolute; top: 0; left: 0; width: 420px; height: 260px; }
.inv-logo { position: relative; width: 120px; height: auto; align-self: flex-start; order: 2; margin-top: 2px; }
.inv-ttl { position: relative; display: grid; justify-items: start; }
.inv-ttl small { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #d8d6d2; }
.inv-ttl small i { width: 16px; height: 2px; background: var(--ir); }
.inv-ttl h1 { font: 700 50px/1.1 "Readex Pro", sans-serif; margin: 2px 0 0; color: #fff; }
.inv-ttl .x-en { font: 600 12.5px "IBM Plex Sans", sans-serif; letter-spacing: .5em; color: var(--ir); direction: ltr; }
.inv-strip { position: relative; margin: -34px 46px 0; display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border: 1px solid var(--il); box-shadow: 0 10px 24px -16px rgba(0, 0, 0, .35); }
.inv-strip > div { padding: 14px 16px; display: grid; gap: 2px; border-inline-start: 1px solid var(--il); }
.inv-strip > div:first-child { border-inline-start: 0; }
.inv-strip small { font-size: 11px; color: var(--ig); } .inv-strip b { font: 700 15px "Readex Pro", sans-serif; }
.inv-strip .x-duec { background: var(--ik); color: #fff; } .inv-strip .x-duec small { color: #bdbbb7; } .inv-strip .x-duec b { font-size: 17px; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; margin: 28px 46px 0; }
.inv-parties > div { border-top: 2px solid var(--ik); padding-top: 12px; display: grid; gap: 3px; align-content: start; }
.inv-parties small { color: var(--ird); font-weight: 600; font-size: 11.5px; } .inv-parties h3 { font: 700 18px "Readex Pro", sans-serif; margin: 2px 0; }
.inv-parties p { color: #3c3c41; font-size: 12.5px; } .inv-parties p.x-r { text-align: right; }
.inv-t { margin: 26px 46px 0; width: calc(100% - 92px); border-collapse: collapse; }
.inv-t thead th { background: var(--ik); color: #fff; font-weight: 600; font-size: 12.5px; padding: 12px 10px; text-align: start; }
.inv-t thead th:first-child { width: 34px; padding-inline-start: 14px; }
.inv-t thead th:nth-child(3), .inv-t thead th:nth-child(4), .inv-t thead th:nth-child(5) { width: 76px; text-align: start; }
.inv-t td { padding: 16px 10px; vertical-align: top; border-bottom: 1px solid var(--il); }
.inv-t td.x-n { color: #9a9894; padding-inline-start: 14px; font: 500 12px "IBM Plex Mono", monospace; }
.inv-t td.x-q, .inv-t td.x-u, .inv-t td.x-s { font-weight: 700; white-space: nowrap; direction: ltr; text-align: right; }
.inv-t .x-t { font: 700 15px "Readex Pro", sans-serif; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inv-t .x-desc p { color: #4a4a50; margin-top: 4px; font-size: 12px; }
.inv-t .x-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.inv-t .x-chips span { border: 1px solid #dcd9d3; background: #f5f4f1; border-radius: 99px; padding: 3px 10px; font-size: 11.5px; font-weight: 600; }
.inv-t .x-chips b { color: var(--ir); font-family: "IBM Plex Mono", monospace; }
.inv-t tr.x-free td { background: #f8f6f2; }
.inv-t .x-badge { display: inline-flex; align-items: center; gap: 4px; background: var(--ir); color: #fff; border-radius: 99px; padding: 1px 10px; font: 700 11px "IBM Plex Sans Arabic", sans-serif; }
.inv-t .x-badge .ic { width: 12px; height: 12px; }
.inv-t tr.x-pk td { background: #f1efeb; border-bottom: 0; padding: 10px 14px; font: 700 13px "Readex Pro", sans-serif; }
.inv-t tr.x-pk td i { font-style: normal; margin-inline-start: 10px; background: var(--ik); color: #fff; padding: 1px 10px; border-radius: 99px; font-size: 11px; }
.inv-t tr.x-pktot td { font-weight: 700; background: #fff; border-bottom: 2px solid var(--ik); padding: 10px; } .inv-t tr.x-pktot td:last-child { direction: ltr; text-align: right; white-space: nowrap; }
.inv-sum { display: grid; grid-template-columns: 1.15fr 1fr; gap: 34px; margin: 26px 46px 0; align-items: start; }
.inv-sum h4 { display: flex; align-items: center; gap: 8px; font: 700 14px "Readex Pro", sans-serif; margin-bottom: 10px; }
.inv-sum h4 i { width: 16px; height: 3px; background: var(--ir); }
.inv-sum ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.inv-sum li { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: #2c2c31; }
.inv-sum li .ic { width: 14px; height: 14px; color: var(--ir); flex: none; margin-top: 3px; }
.inv-sum .x-pay { margin-top: 14px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 12.5px; border-bottom: 1px dotted #9a9894; padding-bottom: 4px; }
.inv-sum .x-pay span { color: var(--ig); } .inv-sum .x-pay em { font-style: normal; color: #4a4a50; font-size: 12px; }
.inv .x-sums { display: grid; }
.inv .x-row { display: flex; justify-content: space-between; padding: 9px 2px; border-bottom: 1px solid var(--il); font-size: 13px; }
.inv .x-row span { color: #3c3c41; } .inv .x-row b { direction: ltr; }
.inv .x-row.x-on { font-weight: 700; } .inv .x-row.x-on span { color: var(--ik); }
.inv .x-due { display: flex; justify-content: space-between; align-items: center; background: var(--ik); color: #fff; padding: 18px; margin-top: 14px; }
.inv .x-due span { font-size: 13px; color: #e2e0dc; } .inv .x-due b { font: 700 28px "Readex Pro", sans-serif; color: var(--ir); direction: ltr; }
.inv .x-words { margin-top: 10px; border: 1px dashed #c9c6bf; background: #f6f4ef; padding: 10px 12px; font-size: 12px; line-height: 1.8; }
.inv-sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 28px 46px 0; }
.x-sig { border: 1px solid #dcd9d3; padding: 16px 18px; position: relative; display: grid; gap: 10px; }
.x-sig::before { content: ""; position: absolute; top: -1px; inset-inline-end: -1px; width: 50px; height: 4px; background: var(--ir); }
.x-sig small { color: var(--ird); font-weight: 600; font-size: 11.5px; } .x-sig b { font: 700 15px "Readex Pro", sans-serif; margin-top: -8px; }
.x-sig .x-ln { display: flex; align-items: flex-end; gap: 12px; font-size: 12px; color: #3c3c41; } .x-sig .x-ln i { flex: 1; border-bottom: 1px solid #a9a6a0; height: 14px; }
.x-sigb { display: flex; align-items: center; gap: 16px; } .x-sigb .x-ln { flex: 1; }
.x-sig .x-seal { width: 84px; height: 62px; border-radius: 50%; border: 1px dashed #b7b4ae; display: grid; place-items: center; color: #a3a09a; font-size: 11px; flex: none; }
.inv-legal { text-align: center; color: #6b6b70; font-size: 11.5px; margin: 18px 46px 0; }
.inv-foot { margin-top: auto; display: flex; align-items: center; gap: 18px; background: var(--ik); color: #fff; padding: 14px 46px; font-size: 11.5px; }
.inv-foot b { font-weight: 700; font-size: 12.5px; } .inv-foot i { flex: 1; height: 1px; background: #4a4a50; }
.inv-foot span { display: inline-flex; align-items: center; gap: 6px; color: #e8e6e2; } .inv-foot .ic { width: 13px; height: 13px; color: var(--ir); }
.inv-legal + .inv-foot { margin-top: auto; }
.inv > .inv-foot { margin-top: auto; }
.inv-sigs + .inv-legal { margin-bottom: 18px; }
@media print { body.printing #print-root .inv { break-after: page; } body.printing-inv #print-root { width: 794px; } }

/* ---------- Deck · packages slide (offer v2) ---------- */
.dk-opts { display: grid; grid-template-columns: repeat(var(--n, 2), 1fr); gap: 28px; margin-top: 34px; }
.dk-opts article { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 30px 32px; border: 1.5px solid rgba(22, 20, 23, .16); border-radius: 22px; background: #fff; }
.dk-opts article.hl { border-color: var(--d-red); box-shadow: 0 30px 60px -36px rgba(200, 16, 46, .55); }
.dk-opts article > small { font: 600 16px var(--f-mono); color: var(--d-red); }
.dk-opts h3 { font-size: 34px; font-weight: 700; }
.dk-onote { font-size: 17px; color: #5b5953; }
.dk-opts ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 12px; flex: 1; }
.dk-opts li { display: flex; gap: 12px; align-items: flex-start; font-size: 18px; }
.dk-opts li span { color: var(--d-red); flex: none; margin-top: 4px; } .dk-opts li span .ic { width: 20px; height: 20px; }
.dk-opts li div { display: grid; } .dk-opts li em { font-style: normal; font-size: 15px; color: #6b6963; }
.dk-oprice { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; border-top: 1px solid rgba(22, 20, 23, .14); padding-top: 16px; margin-top: 8px; }
.dk-oprice strong { font: 800 44px var(--f-disp); color: #161417; direction: ltr; } .dk-oprice s { color: #8b8983; font-size: 20px; direction: ltr; } .dk-oprice small { color: var(--d-red); font-size: 15px; font-weight: 600; }

/* ---------- Offer builder v2 controls ---------- */
.ob-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.ob-tabs button { border: 0; background: none; padding: 9px 12px; border-bottom: 2px solid transparent; cursor: pointer; color: var(--text-2); white-space: nowrap; font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.ob-tabs button .ic { width: 16px; height: 16px; }
.ob-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.ob-rows { display: grid; gap: 8px; }
.ob-row { display: grid; grid-template-columns: 1.2fr 1.6fr 110px 34px; gap: 8px; align-items: center; }
.ob-sec { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.ob-sec.off { opacity: .55; }
.ob-sec-h { display: flex; align-items: center; gap: 8px; }
.ob-sec-h b { flex: 1; } .ob-sec-h .chip { font-size: 11.5px; }
.ob-months { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; color: var(--text-2); font-size: 13.5px; }
.ob-months .input { width: 80px; }
@media (max-width: 700px) { .ob-row { grid-template-columns: 1fr 1fr; } }
.shell.ai-focus { --side-w: 76px; }
.ai-focus .side-brand, .ai-focus .nav-group, .ai-focus .nav a .lbl, .ai-focus .nav a .cnt, .ai-focus .nav a .lockico, .ai-focus .me-card .who { display: none; }
.ai-focus .side-logo { width: 48px; } .ai-focus .nav a { justify-content: center; } .ai-focus .side { padding-inline: 10px; }

.tx-sel select { max-width: 150px; }

/* script slate: «الفكرة · الحقيقة · القالب…» rendered as clapperboard cells */
.md-slate { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; margin: 10px 0 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line); }
.md-slate > div { background: var(--surface); padding: 9px 12px 10px; display: grid; gap: 2px; align-content: start; }
.md-slate dt { font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.md-slate dd { margin: 0; font-size: 14px; line-height: 1.65; color: var(--text); }
.md-slate > div:first-child, .md-slate > div:nth-child(2) { grid-column: span 2; }
.md-slate > div:first-child dd, .md-slate > div:nth-child(2) dd { font-weight: 600; }
.md-slate > div:nth-child(2) { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.md-slate > div:nth-child(2) dt { color: var(--accent-text); }
.md-slate-h { font: 600 13px var(--f-head); color: var(--text-2); margin: 14px 0 -4px; }
.md-slate-h + .md-slate > div { grid-column: auto; background: var(--surface); } .md-slate-h + .md-slate > div dd { font-weight: 500; } .md-slate-h + .md-slate > div dt { color: var(--text-3); }
@media (max-width: 600px) { .md-slate > div:first-child, .md-slate > div:nth-child(2) { grid-column: 1 / -1; } }
