/* Yesmora · app styles. Tokens first; dark mode redefines tokens only. */
/* Arabic letters: Noto Sans Arabic (SIL Open Font License), downloaded only when a page shows Arabic */
@font-face { font-family: 'Inter'; font-weight: 100 900; font-display: swap; src: url(fonts/noto-sans-arabic-wght.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 100 900; font-display: swap; src: url(fonts/noto-sans-arabic-wght.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Inter'; font-weight: 100 900; font-display: swap; src: url(fonts/inter-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-weight: 100 900; font-display: swap; src: url(fonts/inter-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 200 800; font-display: swap; src: url(fonts/bricolage-grotesque-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 200 800; font-display: swap; src: url(fonts/bricolage-grotesque-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --plum: #1E1530; --plum-2: #2A1F42; --plum-3: #3A2D57;
  --nod: #2BD47D; --nod-d: #13955A; --nod-t: #E2F8EC;
  --lilac: #EFEAFB; --lilac-2: #E2D9F7; --violet: #6F4FD8;
  --paper: #FAF8F4; --coral: #FF6B4A; --coral-d: #C8432A; --coral-t: #FFE9E3;
  --sky: #4A9DFF; --sky-d: #1F6FD1; --sky-t: #E5F0FF;
  --amber: #F2B33D; --amber-d: #9A6A07; --amber-t: #FDF2DA;

  --bg: var(--paper); --surface: #fff; --surface-2: #F6F3FB; --sunken: #F2EEE8;
  --line: #E7E2EE; --line-2: #F0ECF4; --text: #1E1530; --muted: #6B6479; --faint: #9A94A6;
  --ink: var(--plum); --on-ink: #fff; --focus: rgba(43,212,125,.35);
  --shadow: 0 1px 2px rgba(30,21,48,.05), 0 8px 24px rgba(30,21,48,.07);
  --shadow-lg: 0 10px 40px rgba(30,21,48,.18);
  --radius: 14px; --radius-sm: 10px;
  --display: 'Bricolage Grotesque', Inter, system-ui, sans-serif;
  --logo-tile: #1E1530;
  --mora: #13955A;

  /* Status colours: identical in the site, the tool and the client view */
  --st-draft: #8A8598;     --st-draft-t: #EEECF2;     --st-draft-x: #4D4759;
  --st-internal: #8B6CF0;  --st-internal-t: #EFEAFD;  --st-internal-x: #5236B8;
  --st-waiting: #4A9DFF;   --st-waiting-t: #E5F0FF;   --st-waiting-x: #1A5FB8;
  --st-changes: #FF6B4A;   --st-changes-t: #FFE9E3;   --st-changes-x: #B23A20;
  --st-approved: #2BD47D;  --st-approved-t: #E2F8EC;  --st-approved-x: #11784A;
  --st-scheduled: #F2B33D; --st-scheduled-t: #FDF2DA; --st-scheduled-x: #8A5C00;
  --st-published: #1E1530; --st-published-t: #E6E2EE; --st-published-x: #1E1530;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) {
  --bg: #120C1E; --surface: #1C1530; --surface-2: #231B3A; --sunken: #170F27;
  --line: #2F2645; --line-2: #261E3A; --text: #F3EFFA; --muted: #ABA3BE; --faint: #7D7592;
  --ink: #F3EFFA; --on-ink: #1E1530; --focus: rgba(43,212,125,.45);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35); --shadow-lg: 0 10px 40px rgba(0,0,0,.55);
  --nod-t: #12352A; --coral-t: #3A1D1A; --sky-t: #142A47; --amber-t: #3A2D12; --lilac: #2A2140; --lilac-2: #33284D;
  --logo-tile: #2A1F42;
  --mora: #2BD47D; --mk1: #8B7FA8; --mk2: #B9AECF; --mk3: #EFEAFB;
  --st-draft-t: #2A2638; --st-draft-x: #C9C3D6; --st-internal-t: #2B2250; --st-internal-x: #C6B6FF;
  --st-waiting-t: #142A47; --st-waiting-x: #9CC8FF; --st-changes-t: #3A1D1A; --st-changes-x: #FFAE9B;
  --st-approved-t: #12352A; --st-approved-x: #7EEBB2; --st-scheduled-t: #3A2D12; --st-scheduled-x: #FFD27A;
  --st-published: #EFEAFB; --st-published-t: #2C2540; --st-published-x: #EFEAFB;
  color-scheme: dark;
} }
:root[data-theme=dark] {
  --bg: #120C1E; --surface: #1C1530; --surface-2: #231B3A; --sunken: #170F27;
  --line: #2F2645; --line-2: #261E3A; --text: #F3EFFA; --muted: #ABA3BE; --faint: #7D7592;
  --ink: #F3EFFA; --on-ink: #1E1530; --focus: rgba(43,212,125,.45);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35); --shadow-lg: 0 10px 40px rgba(0,0,0,.55);
  --nod-t: #12352A; --coral-t: #3A1D1A; --sky-t: #142A47; --amber-t: #3A2D12; --lilac: #2A2140; --lilac-2: #33284D;
  --logo-tile: #2A1F42;
  --mora: #2BD47D; --mk1: #8B7FA8; --mk2: #B9AECF; --mk3: #EFEAFB;
  --st-draft-t: #2A2638; --st-draft-x: #C9C3D6; --st-internal-t: #2B2250; --st-internal-x: #C6B6FF;
  --st-waiting-t: #142A47; --st-waiting-x: #9CC8FF; --st-changes-t: #3A1D1A; --st-changes-x: #FFAE9B;
  --st-approved-t: #12352A; --st-approved-x: #7EEBB2; --st-scheduled-t: #3A2D12; --st-scheduled-x: #FFD27A;
  --st-published: #EFEAFB; --st-published-t: #2C2540; --st-published-x: #EFEAFB;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font: 14px/1.5 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: var(--violet); text-decoration: none; }
:root[data-theme=dark] a, :root:not([data-theme=light]) a { }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.015em; margin: 0; line-height: 1.15; }
h1 { font-size: 28px; font-weight: 700; } h2 { font-size: 19px; font-weight: 700; } h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
code, kbd { background: var(--sunken); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; font-family: inherit; }
.ic { flex: none; vertical-align: -3px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; } .tiny { font-size: 11.5px; } .center { text-align: center; }
.hidden { display: none !important; } .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; inset-inline-start: 0; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip:focus { inset-inline-start: 8px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.stack { display: grid; gap: 14px; } .stack-sm { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .row.between { justify-content: space-between; } .row.nowrap { flex-wrap: nowrap; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- Buttons and inputs ---------- */
button, .btn { font: inherit; cursor: pointer; border-radius: var(--radius-sm); border: 1px solid transparent; padding: 9px 15px; background: none; color: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; }
button:disabled, [aria-disabled=true] { opacity: .5; cursor: not-allowed; }
.primary, a.primary { background: var(--ink); color: var(--on-ink); font-weight: 600; border-radius: var(--radius-sm); padding: 9px 16px; display: inline-flex; align-items: center; gap: 7px; justify-content: center; min-height: 38px; border: 1px solid transparent; }
.primary:hover:not(:disabled) { filter: brightness(1.15); text-decoration: none; }
.nod-btn, a.nod-btn { background: var(--nod); color: #0B2A1B; font-weight: 700; border-radius: var(--radius-sm); padding: 9px 16px; display: inline-flex; align-items: center; gap: 7px; justify-content: center; min-height: 38px; }
.nod-btn:hover:not(:disabled) { background: #3DE08C; text-decoration: none; }
.ghost, a.ghost { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: var(--radius-sm); padding: 8px 14px; display: inline-flex; align-items: center; gap: 7px; justify-content: center; min-height: 38px; }
.ghost:hover:not(:disabled) { background: var(--surface-2); text-decoration: none; }
.ghost.on { background: var(--lilac); border-color: var(--lilac-2); }
.danger, a.danger { background: var(--coral-t); color: var(--coral-d); border: 1px solid transparent; border-radius: var(--radius-sm); font-weight: 600; }
:root[data-theme=dark] .danger { color: #FFAE9B; }
.big, a.big { padding: 13px 22px; font-size: 15.5px; border-radius: 12px; min-height: 48px; }
.block, a.block { display: flex; width: 100%; }
.small.primary, .small.ghost, .small.danger, .small.nod-btn, button.small, a.small { padding: 6px 11px; font-size: 13px; border-radius: 9px; min-height: 32px; }
.link { border: 0; padding: 0; min-height: 0; color: var(--violet); font-size: 12.5px; font-weight: 600; background: none; display: inline; }
.link:hover { text-decoration: underline; }
.icon-btn { width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); flex: none; }
.icon-btn:hover { background: var(--surface-2); }
input, select, textarea { font: inherit; color: inherit; width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); min-height: 40px; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--focus); border-color: var(--nod-d); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--nod-d); }
input[type=color] { padding: 3px; width: 48px; height: 40px; }
textarea { resize: vertical; line-height: 1.5; }
label, .lbl { display: block; font-weight: 600; font-size: 13px; }
label > input, label > select, label > textarea, label > .pw, label > .field-row { margin-top: 6px; font-weight: 400; }
.hint { font-weight: 400; color: var(--muted); font-size: 12.5px; display: block; margin-top: 4px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; min-height: 32px; }
.check input { margin: 0; }
fieldset { border: 0; padding: 0; margin: 0; }
.field-row { display: flex; gap: 8px; align-items: center; }
.pw { position: relative; display: block; }
.pw-toggle { position: absolute; inset-inline-end: 4px; top: 4px; min-height: 32px; padding: 4px 10px; font-size: 12px; color: var(--muted); }
.seg { display: inline-flex; background: var(--sunken); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button, .seg a { border-radius: 8px; padding: 6px 12px; min-height: 32px; font-size: 13px; color: var(--muted); font-weight: 600; border: 0; background: none; display: inline-flex; align-items: center; gap: 6px; }
.seg .on, .seg [aria-pressed=true], .seg [aria-selected=true] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg a:hover { text-decoration: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--sunken); font-size: 12px; font-weight: 600; color: var(--muted); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.alert { background: var(--coral-t); color: var(--coral-d); border-radius: 12px; padding: 10px 14px; font-weight: 500; }
:root[data-theme=dark] .alert { color: #FFAE9B; }
.notice { background: var(--nod-t); color: var(--st-approved-x); border-radius: 12px; padding: 10px 14px; font-weight: 500; }
.infobox { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }

/* ---------- Status chips: colour plus a text label, never colour alone ---------- */
.st { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; line-height: 1.4; }
.st i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.st small { font-weight: 500; opacity: .8; }
.st-draft { background: var(--st-draft-t); color: var(--st-draft-x); } .st-draft i { background: var(--st-draft); }
.st-internal { background: var(--st-internal-t); color: var(--st-internal-x); } .st-internal i { background: var(--st-internal); }
.st-waiting { background: var(--st-waiting-t); color: var(--st-waiting-x); } .st-waiting i { background: var(--st-waiting); }
.st-changes { background: var(--st-changes-t); color: var(--st-changes-x); } .st-changes i { background: var(--st-changes); }
.st-approved { background: var(--st-approved-t); color: var(--st-approved-x); } .st-approved i { background: var(--st-approved); }
.st-scheduled { background: var(--st-scheduled-t); color: var(--st-scheduled-x); } .st-scheduled i { background: var(--st-scheduled); }
.st-published { background: var(--st-published-t); color: var(--st-published-x); } .st-published i { background: var(--st-published); }
.badge-overdue { background: var(--coral); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 2px 8px; }

/* ---------- App chrome ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: var(--surface); border-bottom: 1px solid var(--line); min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand .logo { flex: none; }
.mainnav { display: flex; gap: 2px; margin-inline-start: 4px; }
.mainnav > a, .navgroup > summary { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 10px; color: var(--muted); font-weight: 600; white-space: nowrap; min-height: 38px; }
.mainnav > a:hover, .navgroup > summary:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.mainnav > a.on, .navgroup > summary.on, .navgroup[open] > summary { background: var(--lilac); color: var(--text); }
.navgroup > summary .ic-chevron { opacity: .6; margin-inline-start: -2px; }
.navpop { inset-inline-start: 0; inset-inline-end: auto; min-width: 320px; }
.navpop > a { align-items: flex-start; padding: 10px 12px; }
.navpop > a .ic { margin-top: 2px; color: var(--muted); flex: none; }
.navpop > a span { display: grid; gap: 1px; }
.navpop > a small { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.navpop > a.on { background: var(--lilac); }
.navgroup:last-child .navpop { inset-inline-start: auto; inset-inline-end: 0; }
.me { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.icon-link { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: var(--muted); position: relative; cursor: pointer; }
.icon-link:hover { background: var(--surface-2); color: var(--text); }
.dot-count { position: absolute; top: 3px; inset-inline-end: 2px; background: var(--coral); color: #fff; border-radius: 999px; font-size: 10px; font-weight: 700; padding: 0 5px; line-height: 16px; min-width: 16px; text-align: center; }
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
.ws-switch summary { display: flex; align-items: center; gap: 8px; padding: 5px 9px 5px 6px; border-radius: 10px; border: 1px solid var(--line); max-width: 210px; min-height: 38px; }
.ws-switch summary:hover { background: var(--surface-2); }
.ws-name { font-weight: 600; }
.ws-badge, .brand-badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: #fff; font-weight: 700; font-size: 11px; flex: none; object-fit: cover; }
img.ws-logo { border-radius: 8px; object-fit: cover; }
.brand-badge { border-radius: 50%; }
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 700; font-size: 11.5px; flex: none; }
.me-sum { display: block; padding: 3px; border-radius: 50%; }
.menu-pop { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); min-width: 250px; padding: 6px; z-index: 50; display: grid; }
.ws-switch .menu-pop { inset-inline-start: 0; inset-inline-end: auto; }
.menu-pop > a, .menu-pop > button, .ws-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--text); font-weight: 500; text-align: start; width: 100%; border: 0; background: none; min-height: 40px; justify-content: flex-start; }
.menu-pop > a:hover, .menu-pop > button:hover, .ws-item:hover { background: var(--surface-2); text-decoration: none; }
.ws-item.on { background: var(--lilac); }
.ws-item .muted { margin-inline-start: auto; }
.menu-head { display: grid; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 8px 10px 4px; }
.menu-sep { height: 1px; background: var(--line); margin: 5px 0; }
.danger-link { color: var(--coral-d) !important; }
.notif-pop { width: min(380px, calc(100vw - 24px)); padding: 0; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-list { max-height: 420px; overflow: auto; }
.notif-item { display: grid; grid-template-columns: 26px 1fr; gap: 8px; padding: 11px 14px; color: var(--text); border-bottom: 1px solid var(--line-2); }
.notif-item:hover { background: var(--surface-2); text-decoration: none; }
.notif-item.unread { background: color-mix(in srgb, var(--nod) 8%, var(--surface)); }
.n-ic { width: 26px; height: 26px; border-radius: 8px; background: var(--lilac); display: inline-flex; align-items: center; justify-content: center; }
.n-text { display: block; }
.trial-bar { background: var(--amber-t); color: var(--st-scheduled-x); text-align: center; padding: 8px 14px; font-weight: 600; font-size: 13px; }
.trial-bar.bad { background: var(--coral-t); color: var(--st-changes-x); }
.trial-bar a { color: inherit; text-decoration: underline; }
@media (max-width: 1380px) { .mainnav > a span, .navgroup > summary span { display: none; } .mainnav > a, .navgroup > summary { padding: 8px 10px; } }
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .brand .brand-name, .ws-switch .ws-name { display: none; }
  .mainnav { order: 3; width: 100%; margin: 0; justify-content: space-between; }
  .mainnav > a, .navgroup { flex: 1; } .mainnav > a, .navgroup > summary { justify-content: center; }
  .navgroup { position: static; } .navgroup > summary .ic-chevron { display: none; }
  .navpop { position: fixed; inset-inline: 10px !important; top: auto; margin-top: 8px; min-width: 0; max-height: 70vh; overflow: auto; }
  .new-post-btn span { display: none; }
}

main.page { max-width: 1320px; margin: 0 auto; padding: 26px 22px 70px; }
main.page.narrow { max-width: 880px; }
main.page.wide { max-width: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 4px; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--violet); }
@media (max-width: 600px) { main.page { padding: 18px 14px 60px; } h1 { font-size: 23px; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2 { font-size: 16px; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 700; margin: 26px 0 10px; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: start; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl-wrap { overflow-x: auto; position: relative; }

/* ---------- Dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--text); display: grid; gap: 4px; position: relative; overflow: hidden; }
.stat:hover { text-decoration: none; border-color: var(--lilac-2); }
.stat b { font-family: var(--display); font-size: 32px; line-height: 1; letter-spacing: -.02em; }
.stat .st { justify-self: start; }
.stat::after { content: ''; position: absolute; inset: auto 0 0 0; height: 3px; background: var(--bar, var(--line)); }
@media (max-width: 1000px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, 1fr); } .stat b { font-size: 26px; } }
.dash { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 960px) { .dash { grid-template-columns: 1fr; } }
.post-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--line-2); color: var(--text); border-radius: 10px; }
.post-row:hover { background: var(--surface-2); text-decoration: none; }
.post-row:last-child { border-bottom: 0; }
.thumb-sm { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--sunken); display: block; }
.thumb-ph { width: 52px; height: 52px; border-radius: 10px; background: var(--lilac); display: flex; align-items: center; justify-content: center; color: var(--violet); }
.feed-item { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.feed-item:last-child { border-bottom: 0; }
.checklist { display: grid; gap: 6px; }
.checklist a, .checklist div { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; color: var(--text); background: var(--surface-2); }
.checklist .done { color: var(--muted); text-decoration: line-through; }
.checklist .tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.checklist .done .tick { background: var(--nod); border-color: var(--nod); color: #0B2A1B; }

/* ---------- Empty states that teach ---------- */
.empty-state { position: relative; overflow: hidden; border: 1px dashed var(--lilac-2); border-radius: 18px; padding: 40px 24px; text-align: center; background: var(--surface); }
.es-art { position: absolute; inset: 0; color: var(--violet); opacity: .09; pointer-events: none; }
.es-body { position: relative; display: grid; gap: 10px; justify-items: center; max-width: 460px; margin: 0 auto; }
.es-body p { color: var(--muted); }

/* ---------- Calendar ---------- */
.cal-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.cal-toolbar .title { font-family: var(--display); font-weight: 700; font-size: 21px; min-width: 170px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters select { width: auto; min-width: 130px; padding: 7px 10px; min-height: 36px; font-size: 13px; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--line); gap: 1px; }
.cal-dow { background: var(--surface-2); padding: 8px 10px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.cal-day { background: var(--surface); min-height: 132px; padding: 6px; display: flex; flex-direction: column; gap: 4px; position: relative; outline: none; }
.cal-day.other { background: var(--bg); }
.cal-day.other .num { color: var(--faint); }
.cal-day .num { font-size: 12px; font-weight: 700; color: var(--muted); display: flex; justify-content: space-between; align-items: center; padding: 2px 4px; }
.cal-day.today .num b { background: var(--ink); color: var(--on-ink); border-radius: 999px; padding: 1px 7px; }
.cal-day:focus-visible { box-shadow: inset 0 0 0 3px var(--focus); }
.cal-day.drop { background: var(--nod-t); }
.cal-day .add { opacity: 0; width: 24px; height: 24px; min-height: 24px; padding: 0; border-radius: 7px; color: var(--muted); }
.cal-day:hover .add, .cal-day:focus-within .add { opacity: 1; }
.cal-day .add:hover { background: var(--lilac); color: var(--text); }
.cal-day .gap { margin-top: auto; border: 1px dashed var(--lilac-2); border-radius: 8px; font-size: 11px; color: var(--faint); text-align: center; padding: 4px; }
.pcard { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 6px; align-items: center; padding: 4px 6px 4px 4px; border-radius: 9px; background: var(--surface-2); border-inline-start: 3px solid var(--sc, var(--line)); color: var(--text); font-size: 12px; cursor: grab; user-select: none; touch-action: manipulation; }
.pcard:hover { text-decoration: none; background: var(--lilac); }
.pcard.dragging { opacity: .45; }
.pcard img, .pcard .ph { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; background: var(--lilac-2); display: block; }
.pcard .t { font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .m { font-size: 10.5px; color: var(--muted); display: flex; gap: 4px; align-items: center; }
.pcard .m .sl { font-weight: 700; color: var(--sx, var(--muted)); }
.pcard[data-status=draft] { --sc: var(--st-draft); --sx: var(--st-draft-x); }
.pcard[data-status=internal] { --sc: var(--st-internal); --sx: var(--st-internal-x); }
.pcard[data-status=waiting] { --sc: var(--st-waiting); --sx: var(--st-waiting-x); }
.pcard[data-status=changes] { --sc: var(--st-changes); --sx: var(--st-changes-x); }
.pcard[data-status=approved] { --sc: var(--st-approved); --sx: var(--st-approved-x); }
.pcard[data-status=scheduled] { --sc: var(--st-scheduled); --sx: var(--st-scheduled-x); }
.pcard[data-status=published] { --sc: var(--st-published); --sx: var(--st-published-x); }
.more-day { font-size: 11px; font-weight: 700; color: var(--violet); padding: 2px 6px; border: 0; background: none; min-height: 0; justify-content: flex-start; }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.cal-week .cal-day { min-height: 420px; border: 1px solid var(--line); border-radius: 14px; }
.cal-week .pcard { grid-template-columns: 1fr; }
.cal-week .pcard img, .cal-week .pcard .ph { width: 100%; height: auto; aspect-ratio: 1; }
.cal-list .day-group { margin-bottom: 18px; }
.cal-list h3 { font-size: 13px; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.gaps-hint { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 5px 12px; }
.plat-ics { display: inline-flex; gap: 2px; }
.plat-ic { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 16px; padding: 0 3px; border-radius: 4px; background: var(--sunken); font-size: 9.5px; font-weight: 800; color: var(--muted); letter-spacing: -.02em; }
@media (max-width: 900px) {
  .cal-month { grid-template-columns: 1fr; background: none; border: 0; gap: 8px; }
  .cal-dow, .cal-day.other.empty-other { display: none; }
  .cal-day { min-height: 0; border: 1px solid var(--line); border-radius: 12px; }
  .cal-day.other { display: none; }
  .cal-day .add { opacity: 1; }
  .cal-week { grid-template-columns: 1fr; }
  .cal-week .cal-day { min-height: 0; }
  .cal-week .pcard { grid-template-columns: 28px 1fr; }
  .cal-week .pcard img { width: 28px; height: 28px; }
}

/* Grid planner */
.grid-wrap { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 26px; align-items: start; }
@media (max-width: 900px) { .grid-wrap { grid-template-columns: 1fr; } }
.ig-profile { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 16px 0 0; overflow: hidden; }
.ig-profile .ig-head { display: flex; gap: 14px; align-items: center; padding: 0 16px 14px; }
.ig-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.ig-cell { aspect-ratio: 4 / 5; background: var(--sunken); position: relative; cursor: grab; overflow: hidden; }
.ig-cell img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.ig-cell .badge { position: absolute; inset-inline-start: 6px; bottom: 6px; }
.ig-cell .kind { position: absolute; inset-inline-end: 6px; top: 6px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.ig-cell.live { cursor: default; }
.ig-cell.live::after { content: ''; position: absolute; inset: 0; background: rgba(250,248,244,.35); }
.ig-cell.dragging { opacity: .4; }
.ig-cell.over { outline: 3px solid var(--nod); outline-offset: -3px; }
.ig-cell .when { position: absolute; inset-inline-start: 0; inset-inline-end: 0; top: 0; background: linear-gradient(rgba(0,0,0,.55), transparent); color: #fff; font-size: 10.5px; font-weight: 700; padding: 5px 7px 12px; }

/* ---------- Modals ---------- */
dialog.modal { border: 0; border-radius: 20px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.modal.wide { width: min(820px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(18,12,30,.5); }
.modal-body { padding: 22px; }
.modal-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-size: 13px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 200; justify-items: center; pointer-events: none; }
.toast { background: var(--plum); color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; opacity: 0; transform: translateY(8px); transition: .22s ease; display: flex; gap: 8px; align-items: center; pointer-events: auto; max-width: calc(100vw - 30px); }
.toast.show { opacity: 1; transform: none; }
.toast.ok::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--nod); }
.toast.err { background: var(--coral-d); }
:root[data-theme=dark] .toast { background: #EFEAFB; color: #1E1530; }

/* ---------- Auth and onboarding ---------- */
body.auth { background: var(--bg); }
.auth-split { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-side { position: relative; overflow: hidden; background: var(--plum); color: #fff; padding: 36px 44px; display: flex; flex-direction: column; justify-content: space-between; gap: 30px; --mx: 50%; --my: 40%; }
.auth-side .brand { color: #fff; --logo-tile: #2A1F42; --mora: #2BD47D; --mk1: #8B7FA8; --mk2: #B9AECF; --mk3: #EFEAFB; position: relative; }
.auth-side .pat { position: absolute; inset: 0; color: #EFEAFB; opacity: .07; }
.auth-side .pat.spot { opacity: .22; color: var(--nod); -webkit-mask-image: radial-gradient(260px circle at var(--mx) var(--my), #000, transparent 70%); mask-image: radial-gradient(260px circle at var(--mx) var(--my), #000, transparent 70%); }
.auth-side .skyline { position: absolute; inset-inline-start: 0; inset-inline-end: 0; bottom: 0; height: 110px; width: 100%; color: #EFEAFB; opacity: .22; }
.auth-quote { position: relative; display: grid; gap: 14px; max-width: 460px; }
.auth-quote h2 { font-size: 36px; line-height: 1.08; }
.auth-quote h2 em { font-style: normal; color: var(--nod); }
.auth-quote p { color: rgba(255,255,255,.75); font-size: 15.5px; }
.auth-side .small { position: relative; color: rgba(255,255,255,.6); padding-bottom: 80px; }
.side-steps { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 10px; }
.side-steps li { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.6); }
.side-steps li span { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.35); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.side-steps li.on { color: #fff; } .side-steps li.on span { background: var(--nod); border-color: var(--nod); color: var(--plum); }
.side-steps li.done span { background: rgba(43,212,125,.25); border-color: var(--nod); color: var(--nod); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 22px; }
.auth-card { width: min(440px, 100%); display: grid; gap: 16px; }
.auth-card.wide { width: min(760px, 100%); }
.auth-card h1 { font-size: 30px; }
.auth-links { display: flex; justify-content: space-between; }
.signed-as { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.pw-meter { display: block; height: 4px; background: var(--line); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.pw-meter i { display: block; height: 100%; background: var(--nod); transform: scaleX(0); transform-origin: left; transition: transform .2s; }
.top-lang { position: absolute; top: 16px; inset-inline-end: 18px; z-index: 3; }
.lang-switch { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 36px; border: 1px solid var(--line); border-radius: 10px; font-weight: 700; font-size: 12.5px; color: var(--text); background: var(--surface); }
@media (max-width: 860px) { .auth-split { grid-template-columns: 1fr; } .auth-side { padding: 22px; min-height: 0; } .auth-quote h2 { font-size: 26px; } .auth-side .small { padding-bottom: 50px; } .auth-side .skyline { height: 60px; } }
.ob-steps { display: flex; gap: 6px; }
.ob-steps i { flex: 1; height: 5px; border-radius: 5px; background: var(--line); }
.ob-steps i.on { background: var(--nod); }
.ob-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
@media (max-width: 760px) { .ob-grid { grid-template-columns: 1fr; } }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label { position: relative; }
.swatches input { position: absolute; opacity: 0; }
.swatches span { display: block; width: 36px; height: 36px; border-radius: 10px; cursor: pointer; border: 3px solid transparent; }
.swatches input:checked + span { border-color: var(--text); }
.swatches input:focus-visible + span { outline: 3px solid var(--focus); }

/* ---------- Composer ---------- */
.composer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 460px); gap: 22px; align-items: start; }
@media (max-width: 1060px) { .composer { grid-template-columns: 1fr; } }
.composer .card + .card { margin-top: 14px; }
.plat-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.plat-pick label { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 12.5px; min-height: 36px; background: var(--surface); }
.plat-pick input { position: absolute; opacity: 0; pointer-events: none; }
.plat-pick label:has(input:checked) { background: var(--plum); color: #fff; border-color: var(--plum); }
:root[data-theme=dark] .plat-pick label:has(input:checked) { background: var(--nod); color: #0B2A1B; border-color: var(--nod); }
.plat-pick label:has(input:focus-visible) { outline: 3px solid var(--focus); }
.cap-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.cap-tabs button { padding: 5px 11px; min-height: 32px; border-radius: 999px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); background: var(--surface); }
.cap-tabs button.on { background: var(--lilac); border-color: var(--lilac-2); }
.cap-tabs button .ovr { width: 6px; height: 6px; background: var(--violet); border-radius: 50%; }
.counters { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.counter { font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 7px; background: var(--sunken); color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.warn { background: var(--amber-t); color: var(--st-scheduled-x); }
.counter.over { background: var(--coral-t); color: var(--st-changes-x); }
.media-strip { display: flex; gap: 10px; flex-wrap: wrap; }
.media-tile { width: 112px; display: grid; gap: 5px; position: relative; }
.media-tile .mt-img { width: 112px; height: 112px; border-radius: 12px; overflow: hidden; background: var(--sunken); position: relative; cursor: grab; }
.media-tile img, .media-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-tile .num { position: absolute; inset-inline-start: 6px; top: 6px; background: rgba(30,21,48,.75); color: #fff; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 6px; }
.media-tile .rm { position: absolute; inset-inline-end: 4px; top: 4px; width: 26px; height: 26px; min-height: 26px; padding: 0; border-radius: 8px; background: rgba(30,21,48,.75); color: #fff; }
.media-tile input { font-size: 11.5px; padding: 5px 7px; min-height: 30px; }
.media-tile.dragging { opacity: .4; }
.media-add { width: 112px; height: 112px; border: 2px dashed var(--lilac-2); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 600; text-align: center; background: var(--surface); }
.media-add:hover { border-color: var(--violet); color: var(--text); }
.drop-over { outline: 3px dashed var(--nod); outline-offset: 4px; }
.crop-stage { position: relative; display: inline-block; max-width: 100%; border-radius: 12px; overflow: hidden; background: #000; }
.crop-stage img { display: block; max-width: 100%; max-height: 380px; }
.crop-guide { position: absolute; border: 2px solid var(--nod); box-shadow: 0 0 0 9999px rgba(0,0,0,.45); left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.crop-guide::after { content: attr(data-r); position: absolute; inset-inline-start: 6px; top: 6px; background: var(--nod); color: #0B2A1B; font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 5px; }
.ai-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-bar button { font-size: 12.5px; padding: 5px 10px; min-height: 32px; border-radius: 999px; border: 1px solid var(--lilac-2); background: var(--surface-2); color: var(--text); }
.ai-bar button:hover { background: var(--lilac); }
.ai-out { border: 1px solid var(--lilac-2); background: var(--surface-2); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.ai-opt { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px; white-space: pre-wrap; }
.preview-pane { position: sticky; top: 76px; }
.pv-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.pv-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.pv-tabs button { font-size: 12px; padding: 5px 10px; min-height: 32px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; }
.pv-tabs button.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.pv-stage { background: var(--sunken); border-radius: 22px; padding: 22px 14px; display: flex; justify-content: center; min-height: 300px; }
.pv-stage.desktop .fnp { width: 520px; max-width: 100%; }
.thread { display: grid; gap: 10px; }
.cm { display: grid; grid-template-columns: 30px 1fr; gap: 10px; }
.cm .bub { background: var(--surface-2); border-radius: 4px 14px 14px 14px; padding: 9px 12px; }
.cm.client .bub { background: var(--sky-t); }
.cm .who { font-weight: 700; font-size: 12.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.cm .quote { border-inline-start: 3px solid var(--coral); padding-inline-start: 8px; color: var(--muted); font-style: italic; margin: 4px 0; font-size: 12.5px; }
.cm.resolved { opacity: .55; }
.vbadge { font-size: 10.5px; font-weight: 800; background: var(--lilac); color: var(--violet); border-radius: 6px; padding: 1px 6px; }
.decision-line { display: flex; gap: 8px; align-items: center; padding: 7px 0; font-size: 13px; border-bottom: 1px solid var(--line-2); }
.diff ins { background: var(--nod-t); color: var(--st-approved-x); text-decoration: none; border-radius: 3px; padding: 0 1px; }
.diff del { background: var(--coral-t); color: var(--st-changes-x); border-radius: 3px; padding: 0 1px; }
.save-state { font-size: 12.5px; color: var(--muted); }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); padding: 12px 0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line); margin-top: 16px; }

/* ---------- Brand cards, media library, approvals ---------- */
.brand-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.brand-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: grid; gap: 10px; color: var(--text); position: relative; overflow: hidden; }
.brand-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--bc, var(--violet)); }
.brand-card:hover { text-decoration: none; border-color: var(--lilac-2); }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.lib-item { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: grid; }
.lib-item .li-img { aspect-ratio: 1; background: var(--sunken); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.lib-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-item .li-meta { padding: 8px 10px; font-size: 12px; display: grid; gap: 2px; }
.lib-item.pick { cursor: pointer; }
.lib-item.pick:hover, .lib-item.sel { outline: 3px solid var(--nod); }
.progress { height: 8px; background: var(--line); border-radius: 8px; overflow: hidden; display: flex; }
.progress i { display: block; height: 100%; }
.progress .a { background: var(--nod); } .progress .c { background: var(--coral); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; }
@media (max-width: 600px) { .kv { grid-template-columns: 1fr; } }

/* ---------- Charts (inline SVG) ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--line); }
.chart text { fill: var(--muted); font: 11px Inter, sans-serif; }
.chart .grid { stroke: var(--line-2); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.kpi b { overflow-wrap: anywhere; }
.kpi b { display: block; font-family: var(--display); font-size: 30px; letter-spacing: -.02em; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 50px; gap: 10px; align-items: center; font-size: 13px; margin: 6px 0; }
.bar-row .bar { height: 10px; border-radius: 10px; background: var(--sunken); overflow: hidden; }
.bar-row .bar i { display: block; height: 100%; background: var(--violet); border-radius: 10px; }

/* ---------- Tour ---------- */
.tour-spot { position: fixed; z-index: 300; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(18,12,30,.55); pointer-events: none; transition: all .25s ease; }
.tour-pop { position: fixed; z-index: 301; background: var(--surface); color: var(--text); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 16px; display: grid; gap: 8px; }
.tour-pop .tp-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* help */
.help-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 26px; align-items: start; }
.help-nav { position: sticky; top: 80px; display: grid; gap: 2px; }
.help-nav a { padding: 8px 10px; border-radius: 9px; color: var(--muted); font-weight: 600; }
.help-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.help-article { scroll-margin-top: 80px; }
.help-article h2 { margin-bottom: 10px; }
.help-article ol, .help-article ul { padding-inline-start: 20px; display: grid; gap: 6px; }
@media (max-width: 800px) { .help-grid { grid-template-columns: 1fr; } .help-nav { position: static; display: flex; flex-wrap: wrap; } }

/* Logo card gaps match the bar behind them */


/* ---------- Languages and right-to-left ---------- */
.lang-switch { position: relative; display: inline-block; border: 0; min-width: 0; min-height: 0; padding: 0; }
.lang-switch summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--text); background: var(--surface); }
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 60; min-width: 180px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow, 0 10px 30px rgba(30,21,48,.15)); display: grid; gap: 2px; }
.lang-menu a { display: flex; gap: 10px; align-items: center; min-height: 40px; padding: 0 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.lang-menu a:hover { background: var(--surface-2); }
.lang-menu a[aria-current] { background: var(--surface-2); font-weight: 700; }
.lang-menu b { font-size: 11.5px; min-width: 22px; letter-spacing: .05em; }
.menu-langs { display: flex; align-items: center; gap: 4px; padding: 6px 10px; color: var(--muted); }
.menu-langs a { min-width: 36px; min-height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-weight: 700; font-size: 12.5px; color: var(--text); text-decoration: none; border: 1px solid var(--line); }
.menu-langs a[aria-current] { background: var(--text); color: var(--surface); border-color: var(--text); }
.ai-tr { display: inline-flex; gap: 4px; align-items: center; }
.ai-tr select { min-height: 34px; padding: 0 6px; font-size: 13px; width: auto; }

[dir=rtl] body { font-family: Inter, 'Noto Sans Arabic', system-ui, sans-serif; }
[dir=rtl] h1, [dir=rtl] h2, [dir=rtl] h3, [dir=rtl] .brand { letter-spacing: 0; }
[dir=rtl] .ic-arrow, [dir=rtl] .ic-left, [dir=rtl] .ic-right, [dir=rtl] .ic-back { transform: scaleX(-1); }
[dir=rtl] input[type=email], [dir=rtl] input[type=url], [dir=rtl] input[type=password], [dir=rtl] .ltr { direction: ltr; text-align: end; }
[dir=rtl] .fnp-wrap { direction: rtl; }

/* Text people typed keeps its own direction (an English caption inside the Arabic interface reads correctly) */
[dir=rtl] textarea, [dir=rtl] input[type=text], [dir=rtl] input[type=search], [dir=rtl] .fnp-cap, [dir=rtl] .fnp-cm, [dir=rtl] .bub, [dir=rtl] .cv-note, [dir=rtl] .ai-opt, [dir=rtl] .quote, [dir=rtl] .diff, [dir=rtl] .cvd-cm p, [dir=rtl] .cvd-difftext { unicode-bidi: plaintext; }

/* Wordmark and berry mark (1.3.1) */
.wm { font-family: var(--display); font-weight: 800; letter-spacing: -.035em; text-transform: none; }
.wm-mora { color: var(--mora, #13955A); }
[dir=rtl] .wm { letter-spacing: -.035em; }
.brand:hover .logo circle { animation: berry .5s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(var(--i) * 35ms); }
.logo circle { transform-box: fill-box; transform-origin: center; }
@keyframes berry { 45% { transform: translateY(-2.5px) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .brand:hover .logo circle { animation: none; } }
