/* Saqrion Marketing v1.11 — "Enterprise" design system.
   Dense, bordered panels on a cool grey page; dark side menu; teal primary action; IBM Plex Sans.
   All colours are tokens; [data-theme="dark"] swaps the surfaces. Text pairs are checked for >= 4.5:1. */

:root {
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 6px; --rl: 8px;

  /* surfaces and text */
  --bg: #F3F5F8; --surface: #FFFFFF; --surface-2: #F7F9FB; --sunk: #EEF1F5; --hover: #F1F4F7;
  --line: #DDE2E9; --line-2: #E7EBF0; --field: #CBD3DD;
  --fg: #17212F; --fg-2: #3B4757; --muted: #5B6878;
  --accent: #0B6574; --accent-hover: #084F5B; --accent-soft: #E3F1F3; --accent-fg: #FFFFFF;
  --link: #0B6574; --link-hover: #084F5B; --focus: #0B6574;
  --brand: #D93A48;
  --seg-on: #17212F; --seg-on-fg: #FFFFFF;
  --today: #F7FBFC;

  /* status (bg / text / dot) */
  --ok-bg: #E3F4EA; --ok-fg: #14653A; --ok-dot: #2E9E5B;
  --sch-bg: #E3F1F3; --sch-fg: #0B6574; --sch-dot: #0B7285;
  --wait-bg: #FDF1DC; --wait-fg: #7A4A00; --wait-dot: #D68A00;
  --draft-bg: #EDF0F4; --draft-fg: #4A5666; --draft-dot: #8A97A8;
  --err-bg: #FBE5E7; --err-fg: #9B1C2C; --err-dot: #C8323F;
  --info-bg: #EDE7F6; --info-fg: #4B2A85;

  /* names kept for older inline styles */
  --good: var(--ok-fg); --good-soft: var(--ok-bg); --warn: var(--wait-fg); --warn-soft: var(--wait-bg);
  --crit: var(--err-fg); --crit-soft: var(--err-bg); --err: var(--err-fg); --data: var(--accent); --data-soft: var(--accent-soft);
  --press: inset 0 0 0 1px var(--accent);

  /* side menu (dark in both themes) */
  --side: #101B2B; --side-fg: #C9D2DE; --side-group: #7D8BA0; --side-sub: #8A97A8; --side-hover: #17263A;
  --side-on: #1E3550; --side-bar: #4FB3BF; --side-badge: #24344B; --side-badge-fg: #E4EAF2;

  /* platform tags */
  --fb: #1458C8; --ig: #B5175A; --li: #0A66C2;

  /* chart series: colour follows the platform (FB, IG, LinkedIn page, LinkedIn profile); >= 3:1 on the panel */
  --s1: #0B6574; --s2: #DB7438; --s3: #808DA0; --s4: #6B4FA0; --chart-alt: #4A5666;

  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0F1724; --surface: #152033; --surface-2: #18253A; --sunk: #111B2C; --hover: #1B2940;
  --line: #24344B; --line-2: #1F2E44; --field: #33465F;
  --fg: #E4EAF2; --fg-2: #C9D2DE; --muted: #9AA7B8;
  --accent: #0B6574; --accent-hover: #0E7A8C; --accent-soft: #12343B; --accent-fg: #FFFFFF;
  --link: #5CC2CE; --link-hover: #8AD6DF; --focus: #5CC2CE;
  --seg-on: #E4EAF2; --seg-on-fg: #0F1724;
  --today: #13263A;
  --ok-bg: #123A27; --ok-fg: #7FDCA4; --ok-dot: #3CB371;
  --sch-bg: #12343B; --sch-fg: #7FD0D9; --sch-dot: #3FA7B4;
  --wait-bg: #3D2E0F; --wait-fg: #F2C062; --wait-dot: #E0A21F;
  --draft-bg: #1F2B3D; --draft-fg: #B4C0CF; --draft-dot: #8A97A8;
  --err-bg: #3D1820; --err-fg: #F4A3AC; --err-dot: #E05563;
  --info-bg: #2A2142; --info-fg: #C9B6F0;
  --side: #0A111C; --side-hover: #142236; --side-on: #1A2F49;
  --s1: #3FA7B4; --s2: #F08D52; --s3: #9AA7B8; --s4: #9C84D0; --chart-alt: #9AA7B8;
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 13.5px/1.5 var(--font); }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
h1 { font-size: 22px; line-height: 1.25; font-weight: 600; margin: 2px 0 0; text-wrap: balance; }
h2 { font-size: 14px; font-weight: 600; margin: 0 0 10px; color: var(--fg); }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 6px; }
p { margin: 0 0 10px; }
ul, ol { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.inline { display: inline; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
main:focus { outline: none; }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--surface); color: var(--fg); padding: 8px 12px; border-radius: var(--r); border: 1px solid var(--line); }
.skip:focus { top: 8px; }
.sfhide { display: none !important; }
code { background: var(--sunk); padding: 1px 6px; border-radius: 4px; font: 12.5px var(--mono); }
img, video { max-width: 100%; }

/* ---------- app frame ---------- */
.app { display: flex; min-height: 100vh; background: linear-gradient(to right, var(--side) 216px, transparent 216px); }
.sidenav { flex: 0 0 216px; width: 216px; background: var(--side); color: var(--side-fg); padding: 14px 10px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; z-index: 50; }
.sidenav :focus-visible { outline-color: var(--side-bar); }
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 10px; color: #fff; }
.logo:hover { text-decoration: none; color: #fff; }
.lm { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff; display: inline-grid; place-items: center;
  font-weight: 700; font-size: 15px; flex: 0 0 auto; }
.logo b { display: block; font-size: 16px; color: #fff; line-height: 1.2; }
.logo b + span { display: block; font-size: 11px; color: var(--side-sub); }
.ng { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--side-group); padding: 12px 10px 4px; }
.nl { display: flex; flex-direction: column; gap: 1px; }
.sidenav .nl a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 10px; min-height: 30px;
  border-radius: 6px; color: var(--side-fg); font-size: 13px; }
.sidenav .nl a:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.sidenav .nl a.on { background: var(--side-on); color: #fff; box-shadow: inset 3px 0 0 var(--side-bar); font-weight: 500; }
.nb { font-size: 11px; font-weight: 600; background: var(--side-badge); color: var(--side-badge-fg); border-radius: 4px; padding: 1px 6px; line-height: 1.5; }
.sidenav .nl a.on .nb { background: #2B4566; }
.navfoot { margin-top: auto; padding: 14px 6px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.navfoot .ver { font-size: 11px; color: var(--side-sub); }
.cos { display: inline-flex; border: 1px solid #2B3B52; border-radius: 6px; overflow: hidden; }
.cos button { border: 0; background: transparent; color: var(--side-fg); font: inherit; font-size: 12px; padding: 4px 10px; cursor: pointer; }
.cos button + button { border-left: 1px solid #2B3B52; }
.cos button[aria-pressed="true"] { background: var(--side-on); color: #fff; font-weight: 600; }
.navscrim { display: none; }

.appmain { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; justify-content: space-between; padding: 9px 20px;
  background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.tb-l, .tb-r { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.tb-l { flex: 1 1 auto; }
.iconbtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r); border: 1px solid var(--field);
  background: var(--surface); color: var(--fg); cursor: pointer; padding: 0; flex: 0 0 auto; }
.iconbtn:hover { background: var(--hover); }
.navtoggle { display: none; }
.wl { font-size: 12px; color: var(--muted); font-weight: 400; }
.wsname { display: inline-flex; gap: 6px; align-items: baseline; }
.wsname b { font-size: 13px; }

/* drop-down menus built on <details> */
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
details.menu > summary::-webkit-details-marker { display: none; }
.wsmenu > summary b { font-size: 13px; font-weight: 600; padding: 5px 8px; border: 1px solid var(--field); border-radius: var(--r);
  background: var(--surface); max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wsmenu > summary svg { margin-left: -26px; margin-right: 8px; pointer-events: none; color: var(--muted); }
.wsmenu > summary b { padding-right: 28px; }
.menupop { position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--rl); padding: 6px; z-index: 60; box-shadow: 0 8px 24px -12px rgba(16, 27, 43, .35); display: flex; flex-direction: column; }
.menupop.right { left: auto; right: 0; }
.menupop a { padding: 7px 10px; border-radius: var(--r); color: var(--fg); font-size: 13px; }
.menupop a:hover { background: var(--hover); text-decoration: none; color: var(--fg); }
.menupop a.on { background: var(--accent-soft); color: var(--sch-fg); font-weight: 600; }
.menupop a.all { border-top: 1px solid var(--line-2); margin-top: 4px; padding-top: 9px; border-radius: 0 0 var(--r) var(--r); }
.menupop .who { padding: 6px 10px 8px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }
.menupop .who b { color: var(--fg); font-size: 13px; }
.av { width: 32px; height: 32px; border-radius: 50%; background: var(--sunk); color: var(--fg); display: inline-grid; place-items: center;
  font-weight: 700; font-size: 12px; border: 1px solid var(--line); }
.usermenu > summary { border-radius: 50%; }

.tsearch { flex: 0 1 320px; min-width: 160px; }
.tsearch input[type=search] { width: 100%; }

main { padding: 16px 20px 32px; min-width: 0; width: 100%; max-width: 1560px; }
.crumb { font-size: 12px; color: var(--muted); }
.crumb a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line); }
.crumb a:hover { color: var(--fg); }
.head { display: flex; justify-content: space-between; align-items: center; gap: 10px 12px; margin: 0 0 14px; flex-wrap: wrap; }
.head > div:first-child { min-width: 0; }
.head .muted { margin-top: 2px; max-width: 80ch; }

/* ---------- panels ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--rl); padding: 14px 16px; margin-bottom: 14px; min-width: 0; }
.card > h2:first-child, .card > .ch:first-child { margin-top: 0; }
.grid { display: grid; gap: 14px; }
.grid > .card { margin-bottom: 0; }
.grid + .card, .grid + .grid, .grid + p, .grid + form, .dash + .card { margin-top: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ch { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; margin-bottom: 10px; flex-wrap: wrap; }
.ch h2 { margin: 0; }
.empty { text-align: center; color: var(--muted); padding: 24px 12px; }
.card.empty { padding: 28px 16px; }
.item { border-top: 1px solid var(--line-2); padding: 12px 0; }
.item:first-child { border-top: 0; padding-top: 0; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 8px 0; border-top: 1px solid var(--line-2); }
.list li:first-child { border-top: 0; padding-top: 0; }
.eyebrow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.panelhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); }
.panelhead h2 { margin: 0; }
.card.flush { padding: 0; }
.card.flush > .tablewrap { margin: 0; padding: 0; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 600; line-height: 1.3;
  padding: 7px 13px; border-radius: var(--r); border: 1px solid var(--accent); background: var(--accent); color: var(--accent-fg);
  cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-fg); text-decoration: none; }
.btn.ghost, .btn.danger { background: var(--surface); color: var(--fg); border-color: var(--field); }
.btn.ghost:hover, .btn.danger:hover { background: var(--hover); color: var(--fg); border-color: var(--field); }
.btn.danger, .btn.ghost.danger { color: var(--err-fg); }
.btn.danger:hover { background: var(--err-bg); color: var(--err-fg); }
.btn.gold, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.gold:hover, .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn.big { padding: 11px 22px; font-size: 15px; }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: default; }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }

/* ---------- forms ---------- */
label { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin: 12px 0 5px; }
label .hint, .hint { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=datetime-local], input[type=time], input[type=file],
input[type=number], input[type=search], input[type=date], input[type=tel], select, textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--field); border-radius: var(--r); font: inherit; font-size: 13.5px;
  color: var(--fg); background: var(--surface); min-height: 34px; }
input[type=file] { padding: 5px 8px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
input[type=color] { width: 52px; height: 34px; padding: 2px; border: 1px solid var(--field); border-radius: var(--r); background: var(--surface); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 15px; height: 15px; }
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
textarea.post { min-height: 260px; font-size: 14px; }
::placeholder { color: var(--muted); opacity: .85; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--fg); margin: 10px 0; flex-wrap: wrap; font-weight: 400; }
.check input { width: auto; }
.days, .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.days label, .chips label { display: flex; gap: 6px; align-items: center; margin: 0; padding: 4px 10px; border-radius: var(--r); font-size: 12.5px;
  color: var(--fg); background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.days label:has(input:checked), .chips label:has(input:checked) { background: var(--accent-soft); color: var(--sch-fg); border-color: var(--accent); font-weight: 600; }
.counter { font-size: 12px; color: var(--muted); text-align: right; margin-top: 4px; font-variant-numeric: tabular-nums; }
.counter.over { color: var(--err-fg); font-weight: 600; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input[type=date] { width: auto; }
.filters input[type=search] { width: auto; flex: 1 1 200px; min-width: 160px; }
.card.filters { padding: 8px 10px; }

/* ---------- messages ---------- */
.flash { padding: 9px 14px; border-radius: var(--r); margin: 8px 0 12px; border: 1px solid transparent; border-left-width: 3px; font-size: 13px; }
.flash.ok { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-dot); }
.flash.err { background: var(--err-bg); color: var(--err-fg); border-color: var(--err-dot); }
.flash a { color: inherit; text-decoration: underline; }
.callout { border-radius: var(--r); padding: 10px 14px; background: var(--wait-bg); color: var(--wait-fg); margin-bottom: 14px; font-size: 13px;
  border-left: 3px solid var(--wait-dot); }
.callout a { color: inherit; text-decoration: underline; }
.callout ul { margin: 6px 0 0; padding-left: 18px; }
.callout.ok { background: var(--ok-bg); color: var(--ok-fg); border-left-color: var(--ok-dot); }
.callout.big { font-size: 14px; padding: 12px 16px; margin: 12px 0; }
.reviewnote { border-radius: var(--r); padding: 12px 16px; margin-bottom: 14px; background: var(--wait-bg); color: var(--fg); border-left: 3px solid var(--wait-dot); }
.reviewnote > b { color: var(--wait-fg); }
.reviewnote p { margin: 6px 0 0; white-space: pre-wrap; }
.allgood { display: flex; gap: 10px; align-items: center; color: var(--ok-fg); background: var(--ok-bg); padding: 10px 12px; border-radius: var(--r); }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 12px; border-top: 1px solid var(--line-2); vertical-align: top; }
tr:first-child > td { border-top: 0; }
th + th, td + td { padding-left: 8px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.tablewrap table { min-width: 560px; }
.tablewrap table.wide { min-width: 900px; }
.tablewrap table.compact { min-width: 0; }
td.nowrap { white-space: nowrap; }
.card > .tablewrap:first-child, .card > table:first-child { margin-top: -4px; }

/* ---------- pills and tags ---------- */
.pill { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11.5px; font-weight: 600; line-height: 1.45; white-space: nowrap;
  background: var(--draft-bg); color: var(--draft-fg); }
.pill.pending, .pill.pending_approval, .pill.warm, .pill.negotiation { background: var(--wait-bg); color: var(--wait-fg); }
.pill.approved, .pill.publishing, .pill.sending, .pill.contacted, .pill.sent, .pill.question, .pill.proposal { background: var(--sch-bg); color: var(--sch-fg); }
.pill.published, .pill.subscribed, .pill.qualified, .pill.won, .pill.replied, .pill.buying, .pill.praise { background: var(--ok-bg); color: var(--ok-fg); }
.pill.failed, .pill.rejected, .pill.bounced, .pill.hot, .pill.complaint { background: var(--err-bg); color: var(--err-fg); }
.pill.draft, .pill.new, .pill.drafted, .pill.cold, .pill.skipped, .pill.lost, .pill.spam, .pill.other, .pill.unsubscribed, .pill.cancelled, .pill.queued { background: var(--draft-bg); color: var(--draft-fg); }
.pill.co { background: var(--sunk); color: var(--fg); margin: 0 4px 4px 0; font-weight: 500; }
.pill.co.all { background: var(--accent-soft); color: var(--sch-fg); }
a.pill:hover { text-decoration: none; filter: brightness(.97); }
.pf { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 3px; color: #fff; background: var(--draft-fg); white-space: nowrap; }
.pf.facebook { background: var(--fb); } .pf.instagram { background: var(--ig); } .pf.linkedin, .pf.linkedin_org { background: var(--li); }
.tag { display: inline-block; padding: 0 7px; margin: 1px 3px 1px 0; border-radius: 4px; font-size: 11.5px; background: var(--sunk); color: var(--fg-2); white-space: nowrap; border: 1px solid var(--line-2); }
.badge { min-width: 18px; padding: 0 6px; border-radius: 4px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--draft-dot); flex: 0 0 auto; }
.st-pending { --st: var(--wait-dot); } .st-approved, .st-publishing { --st: var(--sch-dot); } .st-published { --st: var(--ok-dot); }
.st-failed, .st-rejected { --st: var(--err-dot); } .st-draft { --st: var(--draft-dot); }
.dot[class*="st-"] { background: var(--st); }

/* ---------- segmented controls ---------- */
.seg { display: inline-flex; border: 1px solid var(--field); border-radius: var(--r); overflow: hidden; max-width: 100%; overflow-x: auto; background: var(--surface); }
.seg a, .seg button { padding: 5px 12px; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--fg); background: var(--surface); border: 0; cursor: pointer; white-space: nowrap; }
.seg > * + * { border-left: 1px solid var(--field) !important; }
.seg a:hover, .seg button:hover { background: var(--hover); text-decoration: none; color: var(--fg); }
.seg a.on, .seg button[aria-pressed="true"], .seg a[aria-current="page"] { background: var(--seg-on); color: var(--seg-on-fg); font-weight: 600; }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpis.k6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--rl); padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kpi .kl { font-size: 12px; color: var(--muted); }
.kpi .kv { font-size: 24px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi .kd { font-size: 12px; color: var(--muted); }
.dl { font-weight: 600; } .dl.up { color: var(--ok-fg); } .dl.down { color: var(--err-fg); } .dl.flat { color: var(--muted); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--rl); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 22px; font-weight: 600; } .stat span { color: var(--muted); font-size: 12px; }

/* summary bar (posts) */
.sumbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--rl); margin-bottom: 14px; }
.sumbar > div { padding: 10px 14px; min-width: 0; }
.sumbar > div + div { border-left: 1px solid var(--line-2); }
.sumbar .kl { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sumbar .kv { font-size: 20px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ---------- dashboard ---------- */
.sechead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 0 8px; flex-wrap: wrap; }
.sechead h2 { margin: 0; font-size: 14px; }
.sechead h2 .muted { font-weight: 400; font-size: 12.5px; }
.kpis.roi-tiles .kv, .kpis.roi-kpis .kv { font-size: 21px; }
.pill.open { background: var(--sch-bg); color: var(--sch-fg); }
.segs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.segs a { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); color: var(--fg); min-width: 0; }
.segs a:hover { background: var(--hover); text-decoration: none; }
.segs a.on { box-shadow: var(--press); }
.segs .sl { min-width: 0; overflow-wrap: anywhere; }
.segs .sl code { display: block; font-size: 11px; color: var(--muted); background: none; padding: 0; }
.segs b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.trig { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; padding: 12px 0; border-top: 1px solid var(--line-2); align-items: start; }
.trig:first-of-type { border-top: 0; padding-top: 4px; }
.trig .check { margin: 0; }
.trig p { margin: 2px 0 0 26px; }
.biz { font-variant-numeric: tabular-nums; }
.dash { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dash .card { margin: 0; }
.dash .span2 { grid-column: span 2; }
.dash .full { grid-column: 1 / -1; }
.dash + .dash { margin-top: 14px; }
.wq { display: flex; flex-direction: column; margin: 0 -16px -14px; }
.wq a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line-2); color: var(--fg); }
.wq a:hover { background: var(--hover); text-decoration: none; color: var(--fg); }
.wq .wt { display: flex; flex-direction: column; min-width: 0; }
.wq .wt b { font-weight: 500; }
.wq .wt span { font-size: 12px; color: var(--muted); }
.wq .wc { min-width: 26px; text-align: center; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: var(--draft-bg); color: var(--draft-fg); }
.wq .wc.wait { background: var(--wait-bg); color: var(--wait-fg); } .wq .wc.sch { background: var(--sch-bg); color: var(--sch-fg); }
.wq .wc.ok { background: var(--ok-bg); color: var(--ok-fg); } .wq .wc.info { background: var(--info-bg); color: var(--info-fg); }
.wq .wc.err { background: var(--err-bg); color: var(--err-fg); } .wq .wc.zero { background: transparent; color: var(--muted); font-weight: 500; }
.checklist { padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.checklist li { list-style: none; display: flex; gap: 8px; align-items: center; }
.checklist .done { color: var(--ok-fg); font-weight: 700; }
.checklist .todo { color: var(--wait-fg); font-weight: 700; }
.needs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.needs li { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line-2); }

/* charts (inline SVG) */
.viz { margin: 0; position: relative; }
.viz svg { width: 100%; height: auto; display: block; overflow: visible; }
.viz .grid { stroke: var(--line); stroke-width: 1; }
.viz .grid.base { stroke: var(--field); }
.viz .tick { fill: var(--muted); font: 11px var(--font); }
.viz .bar { fill: var(--s1); }
.viz.alt .bar { fill: var(--chart-alt); }
.viz .hit { fill: transparent; }
.viz .mk { cursor: default; outline: none; }
.viz .mk.on .hit, .viz .mk:focus .hit { fill: var(--accent-soft); }
.viz .mk:focus-visible .hit { stroke: var(--focus); stroke-width: 2; }
.viz .overlay { position: absolute; inset: 0 0 24px 40px; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 13px; padding: 0 24px; }
.viz.isempty .grid { opacity: .5; }
.s1 { --c: var(--s1); } .s2 { --c: var(--s2); } .s3 { --c: var(--s3); } .s4 { --c: var(--s4); }
.viz .ln { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz .dot { fill: var(--c); stroke: var(--surface); stroke-width: 2; width: auto; height: auto; border-radius: 0; display: inline; }
.viz .dlabel { fill: var(--fg); font: 600 11px var(--font); }
.vtip { position: absolute; transform: translate(-50%, -100%); background: var(--fg); color: var(--bg); padding: 5px 9px; border-radius: var(--r);
  font-size: 12px; pointer-events: none; white-space: nowrap; z-index: 70; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--c); margin-right: 6px; vertical-align: -1px; flex: 0 0 auto; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--fg-2); margin-top: 6px; }
.legend.col { flex-direction: column; list-style: none; padding: 0; margin: 0; gap: 8px; }
.legend.col li { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; font-size: 13px; }
.legend.col b { font-weight: 600; font-variant-numeric: tabular-nums; }
.donut { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.donut svg { width: 160px; height: 160px; }
.donut .arc { fill: var(--c); stroke: var(--surface); stroke-width: 2; }
.donut .dn { fill: var(--fg); font: 600 28px var(--font); }
.donut .tick { fill: var(--muted); font: 12px var(--font); }
.donut .legend.col { width: 100%; }
.hb { display: flex; flex-direction: column; gap: 9px; }
.hr { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.hl { color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl .sw { margin-right: 6px; }
.ht { height: 8px; background: var(--sunk); border-radius: 2px; overflow: hidden; }
.ht i { display: block; height: 100%; background: var(--s1); border-radius: 2px; min-width: 2px; }
.ht i.s1, .ht i.s2, .ht i.s3, .ht i.s4 { background: var(--c); }
.ht i[style="width:0%"], .ht i[style="width:0.0%"] { display: none; }
.hv { font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; }

/* ---------- content calendar ---------- */
.filterbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--rl); padding: 8px 10px; margin-bottom: 14px; }
.filterbar .fgrp { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.filterbar .flabel { font-size: 12px; color: var(--muted); margin: 0 2px 0 6px; }
.filterbar .vsep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.filterbar .range { font-weight: 600; padding: 0 6px; white-space: nowrap; }
.filterbar select { width: auto; min-height: 30px; padding: 4px 8px; font-size: 12.5px; }
.navbtn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r); border: 1px solid var(--field); background: var(--surface); color: var(--fg); font-size: 16px; }
.navbtn:hover { background: var(--hover); text-decoration: none; color: var(--fg); }
.chip { font-size: 12px; padding: 4px 8px; border-radius: 4px; border: 1px solid var(--line); color: var(--fg); background: var(--surface); white-space: nowrap; }
.chip:hover { background: var(--hover); text-decoration: none; color: var(--fg); }
.chip.on { background: var(--accent-soft); color: var(--sch-fg); border-color: transparent; font-weight: 600; }
.bulkline { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--wait-bg); color: var(--fg);
  border: 1px solid var(--line); border-left: 3px solid var(--wait-dot); border-radius: var(--rl); padding: 8px 12px; margin-bottom: 14px; font-size: 13px; }
.plannote { background: var(--surface); border: 1px solid var(--line); border-radius: var(--rl); padding: 9px 14px; margin-bottom: 14px; font-size: 13px; color: var(--fg-2); }

.calwrap { display: flex; gap: 14px; align-items: flex-start; }
.calbox { flex: 1 1 auto; min-width: 0; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--rl); }
.calgrid { min-width: 760px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cday { min-height: 520px; border-right: 1px solid var(--line-2); min-width: 0; }
.cday:last-child { border-right: 0; }
.cday.today { background: var(--today); }
.cdh { display: flex; justify-content: space-between; padding: 8px 10px; font-size: 12px; border-bottom: 1px solid var(--line-2); color: var(--muted); margin: 0; font-weight: 400; }
.cdh b { font-weight: 600; color: var(--fg); }
.cday.today .cdh { color: var(--sch-fg); box-shadow: inset 0 2px 0 var(--accent); }
.cday.today .cdh b { color: var(--sch-fg); }
.ccards { display: flex; flex-direction: column; gap: 6px; padding: 6px; container-type: inline-size; }
.cempty { display: none; font-size: 12px; color: var(--muted); padding: 2px 4px; }

.pcard { position: relative; display: block; padding: 7px 8px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--st, var(--draft-dot)); color: var(--fg); }
.pcard:hover { border-color: var(--field); border-left-color: var(--st, var(--draft-dot)); background: var(--surface-2); }
.pcard.sel { background: var(--accent-soft); border-color: var(--accent); border-left-color: var(--st, var(--draft-dot)); }
.pcard .pct { display: flex; gap: 5px; align-items: center; min-width: 0; }
.pcard .tm { font-size: 11.5px; color: var(--muted); }
.pcard .dot { margin-left: auto; background: var(--st, var(--draft-dot)); }
.pcard .pick { position: relative; z-index: 2; margin: 0; width: 14px; height: 14px; }
.pcard .pcb { display: flex; gap: 6px; margin-top: 5px; align-items: flex-start; }
.pcard .th { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 4px; object-fit: cover; background: var(--sunk); display: block; }
.pcard .th.vid { display: grid; place-items: center; background: #1B2A3F; color: #fff; }
.pcard a.pcl { font-size: 12px; font-weight: 500; line-height: 1.3; color: var(--fg); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow-wrap: break-word; min-width: 0; }
.pcard a.pcl::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.pcard a.pcl:hover { text-decoration: none; }
.pcard a.pcl:focus-visible { outline: none; }
.pcard:has(a.pcl:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }
@container (max-width: 132px) {
  .pcard .pcb { flex-direction: column; }
  .pcard .th { width: 100%; flex-basis: auto; height: 46px; }
}
.pcard .stx { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* month view */
.mgrid { min-width: 760px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mgrid .mh { padding: 7px 10px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line-2); }
.mcell { min-height: 112px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 4px 5px 6px; min-width: 0; }
.mcell:nth-child(7n) { border-right: 0; }
.mcell.out { background: var(--surface-2); }
.mcell.out .mn { color: var(--muted); opacity: .8; }
.mcell.today { background: var(--today); box-shadow: inset 0 2px 0 var(--accent); }
.mn { font-size: 12px; font-weight: 600; padding: 2px 4px 4px; display: block; }
.mcell .pcard { padding: 3px 6px; margin-bottom: 4px; }
.mcell .pcard a.pcl { -webkit-line-clamp: 1; font-size: 11.5px; }
.mcell .pcard .pcb { margin-top: 2px; }
.mrow-label { display: none; }

/* list view */
.plist td { vertical-align: middle; }
.plist .pth { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; display: block; background: var(--sunk); }
.plist tr.pcard { display: table-row; border: 0; padding: 0; background: none; }
.plist tr.pcard > td:first-child { box-shadow: inset 3px 0 0 var(--st, var(--draft-dot)); }
.plist tr.pcard.sel { background: var(--accent-soft); }
.plist a.pcl { position: static; display: inline; -webkit-line-clamp: unset; font-size: 13px; font-weight: 500; }
.plist a.pcl::after { display: none; }

/* preview panel */
.pvpanel { display: none; }
.js .pvpanel { display: flex; flex-direction: column; flex: 0 0 410px; width: 410px; min-width: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--rl); position: sticky; top: 66px; max-height: calc(100vh - 80px); overflow: hidden; }
.pvscroll { overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.pvempty { padding: 28px 18px; color: var(--muted); text-align: center; font-size: 13px; }
.pvempty b { display: block; color: var(--fg); font-size: 14px; margin-bottom: 4px; }
.pvh { padding: 11px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pvh .pvt { min-width: 0; }
.pvh .pvt span { font-size: 11px; color: var(--muted); display: block; }
.pvh .pvt h2 { font-weight: 600; font-size: 14px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pvh .pill { flex: 0 0 auto; }
.pvclose { width: 30px; height: 30px; }
.pvtabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 8px; overflow-x: auto; }
.pvtabs button { font: inherit; font-size: 12.5px; font-weight: 500; padding: 9px 8px; border: 0; background: transparent; cursor: pointer; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.pvtabs button:hover { color: var(--fg); }
.pvtabs button[aria-selected="true"] { color: var(--sch-fg); border-bottom-color: var(--accent); font-weight: 600; }
.pvstage { padding: 14px; background: var(--bg); }
.pvbody { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); }
.pvd { margin: 0; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 6px 10px; font-size: 13px; }
.pvd dt { color: var(--muted); }
.pvd dd { margin: 0; overflow-wrap: anywhere; }
.trail { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; color: var(--fg-2); font-size: 12.5px; }
.trail .terr { color: var(--err-fg); }
.pvacts { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.pvacts form { margin: 0; }
.pvacts details { width: 100%; }
.pvacts details > summary { display: inline-flex; }
.pvacts details[open] { order: 10; }
.pvacts .resched { margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.pvacts .resched label { margin-top: 0; }
.pvacts .actrow { display: flex; gap: 8px; flex-wrap: wrap; }
.pvloading { padding: 30px; text-align: center; color: var(--muted); }

/* platform mock-ups */
.mock { background: var(--surface); border: 1px solid var(--line); border-radius: var(--rl); overflow: hidden; color: var(--fg); }
.mock .mh { display: flex; gap: 10px; align-items: center; padding: 10px 12px; }
.mock .mav { width: 34px; height: 34px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 700; flex: 0 0 auto; font-size: 14px; }
.mock.li .mav { border-radius: 6px; }
.mock .mname { font-weight: 600; font-size: 13px; line-height: 1.25; }
.mock .mwhen { font-size: 11.5px; color: var(--muted); }
.mock .mfollow { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--sch-fg); }
.mock .cap { padding: 0 12px 10px; font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.mock.ig .cap { padding: 10px 12px; }
.mock .media img, .mock .media video { width: 100%; display: block; max-height: 440px; object-fit: cover; background: #0F1724; }
.mock.ig .media img, .mock.ig .media video { aspect-ratio: 1 / 1; max-height: none; }
.mock .nomedia { aspect-ratio: 1 / 1; display: grid; place-items: center; text-align: center; padding: 20px; background: var(--sunk); color: var(--muted); font-size: 12.5px; }
.mock .lnk { display: block; padding: 8px 12px; background: var(--sunk); border-top: 1px solid var(--line-2); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.mock .mstats { display: flex; justify-content: space-between; gap: 8px; padding: 7px 12px; font-size: 12px; color: var(--muted); }
.mock .macts { display: flex; justify-content: space-around; padding: 9px 4px; font-size: 12.5px; font-weight: 600; color: var(--draft-fg); border-top: 1px solid var(--line-2); }
.mock.ig .macts { justify-content: flex-start; gap: 16px; padding: 9px 12px 0; border-top: 0; }
.mock.ig .macts span:last-child { margin-left: auto; }
.mock.ig .mstats { padding-top: 4px; padding-bottom: 0; justify-content: flex-start; color: var(--fg); font-weight: 600; }
.pvnote { font-size: 12px; color: var(--muted); margin: 8px 2px 0; }

/* post editor */
.editgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 430px); gap: 14px; align-items: start; }
.editgrid > .card, .editgrid > div > .card:last-child { margin-bottom: 0; }
.editgrid .pvside { position: sticky; top: 66px; }
.editgrid .pvside .pvpanel, .pvpanel.static { display: flex; flex-direction: column; position: static; max-height: none; width: auto; flex: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--rl); overflow: hidden; margin-bottom: 14px; }

/* ---------- media ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.mitem { background: var(--surface); border: 1px solid var(--line); border-radius: var(--rl); overflow: hidden; }
.mitem img, .mitem video { width: 100%; height: 150px; object-fit: cover; background: var(--sunk); display: block; }
.mitem .b { padding: 10px 12px; }
.mitem textarea { min-height: 60px; font-size: 13px; margin-top: 6px; }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 320px; overflow: auto;
  border: 1px solid var(--line); border-radius: var(--r); padding: 8px; background: var(--surface-2); }
.picker label { margin: 0; cursor: pointer; }
.picker input { position: absolute; opacity: 0; pointer-events: none; }
.picker input + div { border-radius: var(--r); padding: 2px; border: 2px solid transparent; background: var(--surface); }
.picker input:checked + div { border-color: var(--accent); }
.picker input:focus-visible + div { outline: 2px solid var(--focus); outline-offset: 2px; }
.picker img, .picker video { width: 100%; height: 72px; object-fit: cover; border-radius: 4px; display: block; }
.picker .none { height: 72px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.picker.wide img, .picker.wide .none { height: 64px; }
.preview { white-space: pre-wrap; border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r); padding: 12px; font-size: 13.5px; overflow-wrap: anywhere; }
.quote { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 9px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.kit li { margin-bottom: 6px; }
pre.code { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px; overflow: auto; font: 12px/1.5 var(--mono); white-space: pre-wrap; word-break: break-all; margin: 0 0 10px; }

/* ---------- leads, users, chat ---------- */
details.inline-edit { position: relative; display: inline-block; vertical-align: middle; }
details.inline-edit summary { list-style: none; cursor: pointer; display: inline-flex; }
details.inline-edit summary::-webkit-details-marker { display: none; }
details.inline-edit[open] .edit-user { position: absolute; right: 0; z-index: 20; width: min(460px, 86vw); margin-top: 6px; }
details.inline-edit[open] .edit-user.card { display: block; text-align: left; padding: 14px 16px; box-shadow: 0 10px 28px -14px rgba(16, 27, 43, .45); }
.edit-user.card input, .edit-user.card select { width: 100%; min-width: 0; }
.cobox { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 4px 12px 10px; }
.cobox .check { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; text-align: left; margin: 8px 0 0; }
.cobox .check input { width: auto; flex: 0 0 auto; }
.colist { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 12px; }
.cobox.isall .colist { opacity: .45; pointer-events: none; }
.chat { max-width: 920px; }
.chat .thread { display: flex; flex-direction: column; gap: 12px; max-height: 62vh; overflow-y: auto; padding: 4px 2px 10px; }
.chat .msg { max-width: 82%; padding: 9px 13px; border-radius: var(--rl); border: 1px solid var(--line-2); }
.chat .msg.me { align-self: flex-end; background: var(--accent-soft); border-color: transparent; }
.chat .msg.bot { align-self: flex-start; background: var(--surface-2); }
.chat .who { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.chat .who span { font-weight: 400; margin-left: 6px; }
.chat .txt { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.chat .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chat .hello p { margin: 0 0 10px; }
.chat .ex { display: flex; flex-wrap: wrap; gap: 8px; }
.chat .btn[data-ex], .chat .acts .btn { white-space: normal; text-align: left; font-weight: 500; }
.chat .ex.more { margin-top: 12px; align-items: center; }
.chat .ask { border-top: 1px solid var(--line-2); margin-top: 12px; padding-top: 2px; }
.chat .ask textarea { min-height: 80px; margin-bottom: 10px; }
.chat-note { max-width: 920px; }

/* ---------- customers, campaigns ---------- */
.bulkbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.bulkbar input[type=text] { width: 160px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.secret { display: block; padding: 10px 12px; word-break: break-all; font-size: 13px; margin-top: 6px; }
.mapgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.editor .side-preview { position: sticky; top: 66px; }
.mailframe { width: 100%; height: 860px; border: 1px solid var(--line); border-radius: var(--r); background: #EEF1F5; display: block; }
.bannerimg { width: 100%; border-radius: var(--r); display: block; aspect-ratio: 2 / 1; object-fit: cover; background: var(--sunk); }
.statusbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.mailstage { background: var(--sunk); border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px; }
.mailstage .mailframe { width: 100%; max-width: 100%; height: 900px; margin: 0 auto; transition: width .2s ease; }
.mailstage.mobile .mailframe { width: 375px; }
.summary { margin: 4px 0 0; }
.summary > div { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; padding: 7px 0; border-top: 1px solid var(--line-2); }
.summary > div:first-child { border-top: 0; }
.summary dt { color: var(--muted); font-size: 13px; }
.summary dd { margin: 0; overflow-wrap: anywhere; }
.summary dd.strong { font-weight: 600; }
.decide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; margin-bottom: 14px; }
.decide .card { margin-bottom: 0; }
.apptitle { margin: 4px 0 0; font-size: 22px; line-height: 1.25; }

/* ---------- public approval pages (always light, no side menu) ---------- */
.auth { max-width: 420px; margin: 8vh auto 40px; padding: 0 16px; }
.authbrand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 18px; }
.authbrand .lm { width: 36px; height: 36px; font-size: 17px; }
.authbrand b { display: block; font-size: 18px; line-height: 1.2; }
.authbrand b + span { display: block; font-size: 12px; color: var(--muted); }
.auth .card { padding: 18px 20px; }
.auth.wide { max-width: 760px; }
.auth.xwide { max-width: 1040px; margin-top: 4vh; }
.appost { border-top: 1px solid var(--line-2); padding: 14px 0; }
.appost:first-of-type { border-top: 0; }
.appost .mock { margin-top: 10px; max-width: 520px; }

/* ---------- v1.12.1 sign-in, setup and password pages: animated story panel + form card ----------
   Story side is always dark; the form side follows the chosen theme. Animations only move transform and opacity
   (no layout shift) and stop for prefers-reduced-motion. */
.authx { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(400px, 1fr); background: var(--bg); }
.authx-side { background: #0B1422; color: #E6ECF3; padding: 44px 56px; display: flex; flex-direction: column; justify-content: space-between;
  gap: 24px; position: relative; overflow: hidden; min-width: 0; isolation: isolate; }
.ax-orb { position: absolute; border-radius: 50%; pointer-events: none; z-index: -1; }
.ax-orb.o1 { width: 520px; height: 520px; background: #0B6574; opacity: .35; filter: blur(80px); left: -120px; top: -120px; }
.ax-orb.o2 { width: 440px; height: 440px; background: #D93A48; opacity: .18; filter: blur(90px); right: -80px; bottom: -60px; }
.authx-brand { display: flex; align-items: center; gap: 12px; color: #fff; position: relative; }
.ax-mark { width: 44px; height: 44px; border-radius: 12px; background: var(--brand); display: grid; place-items: center; flex: 0 0 auto; }
.ax-mark svg { width: 26px; height: 26px; transform-origin: 20px 20px; }
.authx-brand b { display: block; font-size: 24px; font-weight: 700; line-height: 1; color: #fff; }
.authx-brand .authx-sub2 { display: block; font-size: 12px; color: #8FA3B8; letter-spacing: .04em; margin-top: 3px; }
.ax-stage { position: relative; height: 430px; max-width: 580px; width: 100%; }
.ax-c { position: absolute; border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); background: #fff; color: #17212F; }
.ax-c1 { left: 0; top: 30px; width: 250px; overflow: hidden; }
.ax-c1 .hd { display: flex; gap: 8px; align-items: center; padding: 10px; }
.ax-c1 .av { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); flex: 0 0 auto; }
.ax-c1 .nm { font-size: 12px; font-weight: 600; line-height: 1.3; } .ax-c1 .tm { font-size: 10px; color: #5B6878; }
.ax-c1 .tag { margin-left: auto; font-size: 10px; font-weight: 700; color: #fff; background: var(--fb); border-radius: 3px; padding: 1px 5px; }
.ax-c1 .img { height: 110px; background: #1B2A3F; display: flex; align-items: flex-end; gap: 4px; padding: 10px; }
.ax-c1 .img span { flex: 1; background: #4FB3BF; border-radius: 2px; } .ax-c1 .img span.hi { background: var(--brand); }
.ax-c1 .cap { padding: 8px 10px; font-size: 11px; color: #3B4757; }
.ax-c2 { left: 280px; top: 0; width: 220px; padding: 14px; }
.ax-c2 .k { font-size: 11px; color: #5B6878; } .ax-c2 .v { font-size: 26px; font-weight: 700; margin: 2px 0 6px; line-height: 1.2; }
.ax-c2 .s { font-size: 11px; color: #14653A; } .ax-c2 svg { display: block; width: 190px; height: 70px; }
.ax-c3 { left: 110px; top: 250px; width: 260px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ax-c3 .t { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; }
.ax-c3 .dot { width: 10px; height: 10px; border-radius: 50%; background: #4FB3BF; flex: 0 0 auto; }
.ax-c3 .b1 { font-size: 12px; background: #F3F5F8; border-radius: 10px; padding: 8px; }
.ax-c3 .b2 { font-size: 12px; background: #E3F1F3; color: #0B6574; border-radius: 10px; padding: 8px; align-self: flex-end; }
.ax-c4 { left: 420px; top: 230px; width: 150px; padding: 12px; background: #13223A; border: 1px solid #24344B; color: #E6ECF3; }
.ax-c4 .k { font-size: 11px; color: #8FA3B8; } .ax-c4 .v { font-size: 30px; font-weight: 700; line-height: 1.25; } .ax-c4 .s { font-size: 11px; color: #7FD3DC; }
.authx-story { position: relative; max-width: 600px; }
.authx-lead { margin: 0; font-size: 44px; line-height: 1.08; font-weight: 700; letter-spacing: -.02em; color: #fff; text-wrap: balance; }
.ax-tick { margin-top: 16px; height: 26px; overflow: hidden; font-size: 17px; color: #B4C4D6; }
.ax-tick div div { height: 26px; line-height: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax-chips { display: flex; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; flex-wrap: wrap; }
.ax-chips li { font-size: 12px; padding: 5px 10px; border-radius: 999px; border: 1px solid #2A3D57; color: #C9D2DE; }
.authx-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px 24px; min-width: 0; }
.authx-main:focus { outline: none; }
.authx-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 30px;
  box-shadow: 0 30px 70px rgba(16, 27, 43, .12); margin: auto 0 0; }
:root[data-theme="dark"] .authx-card { box-shadow: 0 30px 70px rgba(0, 0, 0, .35); }
.authx-card h1 { font-size: 24px; font-weight: 700; margin: 0; }
.authx-sub { margin: 4px 0 14px; font-size: 14px; }
.authx-card label { font-size: 13px; font-weight: 500; color: var(--fg); margin-top: 14px; }
.authx-card input[type=text], .authx-card input[type=email], .authx-card input[type=password] { min-height: 44px; font-size: 14.5px; padding: 10px 12px;
  border-radius: 10px; transition: box-shadow .2s, border-color .2s; }
.authx-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(11, 101, 116, .15); }
.authx-submit { width: 100%; margin-top: 20px; border-radius: 10px; min-height: 46px; font-size: 15px; font-weight: 600; border: 0;
  background: linear-gradient(90deg, #0B6574 0%, #0B6574 40%, #13899A 50%, #0B6574 60%, #0B6574 100%); background-size: 200% 100%; }
.authx-submit:hover { filter: brightness(1.08); }
.ax-safe { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin: 14px 0 0; }
.ax-safe svg { flex: 0 0 auto; }
.ax-links { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; margin: 14px 0 0; }
.authx-foot { margin: auto 0 0; padding-top: 24px; font-size: 12px; color: var(--muted); text-align: center; }
.demo-logins { margin: 18px 0 0; border: 1px dashed var(--field); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.demo-logins h2 { font-size: 13px; margin: 0 0 2px; }
.demo-logins p { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.demo-logins ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.demo-logins li { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; align-items: baseline; }
.demo-logins button { font: inherit; font-weight: 600; color: var(--link); background: none; border: 0; padding: 2px 0; cursor: pointer; text-align: left; }
.demo-logins button:hover { text-decoration: underline; }
.demo-logins li span { color: var(--muted); font-size: 12px; text-align: right; }
.demo-logins code { font-family: var(--mono); font-size: 12px; background: var(--sunk); padding: 1px 5px; border-radius: 4px; }
.pwfield { position: relative; }
.authx-card .pwfield input { padding-right: 46px; }
.pwtoggle { position: absolute; top: 3px; right: 3px; bottom: 3px; width: 38px; display: grid; place-items: center; padding: 0; border: 0;
  border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.pwtoggle:hover { color: var(--fg); background: var(--hover); }
.pwtoggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.pwtoggle .i-hide, .pwtoggle[aria-pressed="true"] .i-show { display: none; }
.pwtoggle[aria-pressed="true"] .i-hide { display: block; }
.capbox { margin-top: 2px; }
.caprow { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.caprow img { display: block; width: 160px; height: 56px; border-radius: 8px; flex: 0 0 auto; }
.capnew { width: 40px; height: 40px; border-radius: 10px; }
.capq { font-size: 16px; font-weight: 600; color: var(--fg); margin: 0 0 8px; padding: 9px 12px; background: var(--sunk); border: 1px solid var(--line-2);
  border-radius: var(--r); font-variant-numeric: tabular-nums; }
.caphelp { margin: 6px 0 0; }
.cf-turnstile { margin-top: 16px; min-height: 65px; }
/* demo ribbon (sign-in pages and inside the app) */
.demo-ribbon { background: #FDF1DC; color: #7A4A00; border-bottom: 1px solid #F0D6A8; font-size: 12.5px; text-align: center; padding: 5px 12px;
  line-height: 1.4; }
.demo-ribbon b { font-weight: 600; }
:root[data-theme="dark"] .demo-ribbon { background: #3D2E0F; color: #F2C062; border-color: #5A4418; }
.authx-wrap .demo-ribbon { position: relative; z-index: 2; }

/* motion (transform / opacity only) */
@keyframes ax-drift1 { 0%, 100% { transform: translate(0, 0) rotate(-6deg); } 50% { transform: translate(18px, -22px) rotate(-3deg); } }
@keyframes ax-drift2 { 0%, 100% { transform: translate(0, 0) rotate(5deg); } 50% { transform: translate(-20px, 16px) rotate(8deg); } }
@keyframes ax-drift3 { 0%, 100% { transform: translate(0, 0) rotate(-2deg); } 50% { transform: translate(14px, 20px) rotate(1deg); } }
@keyframes ax-orb1 { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(60px, -40px) scale(1.15); } }
@keyframes ax-orb2 { 0%, 100% { transform: translate(0, 0) scale(1.1); } 50% { transform: translate(-50px, 50px) scale(.95); } }
@keyframes ax-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes ax-slidein { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes ax-draw { from { stroke-dashoffset: 600; } to { stroke-dashoffset: 0; } }
@keyframes ax-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(79, 179, 191, .55); } 70% { box-shadow: 0 0 0 14px rgba(79, 179, 191, 0); } }
@keyframes ax-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes ax-ticker { 0%, 25% { transform: translateY(0); } 33%, 58% { transform: translateY(-26px); } 66%, 91% { transform: translateY(-52px); } 100% { transform: translateY(0); } }
@keyframes ax-wing { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-8deg); } }
@keyframes ax-popin { 0% { opacity: 0; transform: scale(.6); } 70% { transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: no-preference) {
  .ax-c1 { animation: ax-drift1 9s ease-in-out infinite; }
  .ax-c2, .ax-c4 { animation: ax-drift2 11s ease-in-out infinite; }
  .ax-c3 { animation: ax-drift3 10s ease-in-out infinite; }
  .ax-orb.o1 { animation: ax-orb1 16s ease-in-out infinite; }
  .ax-orb.o2 { animation: ax-orb2 19s ease-in-out infinite; }
  .ax-r1 { animation: ax-rise .8s .1s both cubic-bezier(.2, .7, .2, 1); }
  .ax-r2 { animation: ax-rise .8s .25s both cubic-bezier(.2, .7, .2, 1); }
  .ax-r3 { animation: ax-rise .8s .4s both cubic-bezier(.2, .7, .2, 1); }
  .ax-r4 { animation: ax-rise .8s .55s both cubic-bezier(.2, .7, .2, 1); }
  .authx-card { animation: ax-slidein .9s .3s both cubic-bezier(.2, .7, .2, 1); }
  .ax-line { stroke-dasharray: 600; animation: ax-draw 2.4s .6s both ease-out; }
  .ax-c3 .dot { animation: ax-pulse 2.2s infinite; }
  .authx-submit { animation: ax-shimmer 3.5s linear infinite; }
  .ax-tick > div { animation: ax-ticker 7.5s ease-in-out infinite; }
  .ax-mark { animation: ax-popin .7s both; }
  .ax-mark svg { animation: ax-wing 3s ease-in-out infinite; }
}
@media (max-width: 1180px) {
  .ax-stage { transform: scale(.82); transform-origin: left top; height: 352px; margin-bottom: -10px; }
  .authx-lead { font-size: 36px; }
}
@media (max-width: 899px) {
  .authx { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .authx-side { padding: 18px 16px 20px; gap: 12px; justify-content: flex-start; }
  .ax-orb.o1 { width: 300px; height: 300px; left: -100px; top: -140px; }
  .ax-orb.o2 { display: none; }
  .ax-mark { width: 36px; height: 36px; border-radius: 10px; } .ax-mark svg { width: 22px; height: 22px; }
  .authx-brand b { font-size: 20px; }
  .ax-stage { display: none; }
  .authx-lead { font-size: 20px; line-height: 1.2; }
  .ax-tick { font-size: 14px; margin-top: 8px; height: 22px; } .ax-tick div div { height: 22px; line-height: 22px; }
  .ax-chips { display: none; }
  .authx-main { justify-content: flex-start; padding: 20px 16px 16px; }
  .authx-card { margin: 0; padding: 22px 18px 20px; }
  .authx-foot { padding-top: 20px; }
}
@media (max-width: 899px) and (prefers-reduced-motion: no-preference) {
  @keyframes ax-ticker-s { 0%, 25% { transform: translateY(0); } 33%, 58% { transform: translateY(-22px); } 66%, 91% { transform: translateY(-44px); } 100% { transform: translateY(0); } }
  .ax-tick > div { animation-name: ax-ticker-s; }
}

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kpis.k6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor { grid-template-columns: minmax(0, 1fr); } .editor .side-preview { position: static; }
  .mapgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* below 1360px the preview opens as a drawer over the calendar */
@media (max-width: 1359px) {
  body.pv-open { overflow: hidden; }
  .js .calwrap .pvpanel { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); max-height: none; border-radius: 0; z-index: 80;
    border-width: 0 0 0 1px; box-shadow: -12px 0 32px -16px rgba(16, 27, 43, .5); }
  .js .calwrap .pvpanel:not(.open) { display: none; }
  .pvscrim { position: fixed; inset: 0; background: rgba(10, 17, 28, .45); z-index: 79; }
  .editgrid { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); }
}
@media (min-width: 1360px) { .pvscrim { display: none !important; } }
@media (max-width: 899px) {
  .sidenav { position: fixed; left: 0; top: 0; bottom: 0; height: auto; width: 260px; transform: translateX(-100%); visibility: hidden; transition: transform .18s ease, visibility .18s; }
  body.nav-open .sidenav { transform: none; visibility: visible; }
  body.nav-open .navscrim { display: block; position: fixed; inset: 0; background: rgba(10, 17, 28, .5); z-index: 45; }
  .navtoggle { display: inline-grid; }
  .topbar { padding: 8px 16px; }
  main { padding: 14px 16px 28px; }
  .tsearch { order: 5; flex: 1 1 100%; }
  .js .calwrap .pvpanel { width: 100%; border: 0; }
  .editgrid { grid-template-columns: minmax(0, 1fr); } .editgrid .pvside { position: static; }
  .dash { grid-template-columns: minmax(0, 1fr); } .dash .span2 { grid-column: auto; }
  .g2, .g3, .decide { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) { .app { background: none; } }
@media (max-width: 700px) {
  .kpis, .kpis.k6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi .kv { font-size: 20px; }
  .sumbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sumbar > div { border-left: 0 !important; border-top: 1px solid var(--line-2); }
  .sumbar > div:nth-child(-n+2) { border-top: 0; }
  .sumbar > div:nth-child(2n) { border-left: 1px solid var(--line-2) !important; }
  .sumbar > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .g4, .mapgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calbox { overflow: visible; }
  .calgrid { min-width: 0; grid-template-columns: minmax(0, 1fr); }
  .cday { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line-2); }
  .cday:last-child { border-bottom: 0; }
  .cempty { display: block; }
  .mgrid { min-width: 0; grid-template-columns: minmax(0, 1fr); }
  .mgrid .mh { display: none; }
  .mcell { min-height: 0; border-right: 0; }
  .mcell:not(.has) { display: none; }
  .mrow-label { display: inline; }
  .hr { grid-template-columns: minmax(70px, 40%) 1fr auto; }
  .head > .row, .head > form.row { width: 100%; }
  .head h1 { font-size: 20px; }
  .summary > div { grid-template-columns: 1fr; gap: 2px; }
  .mailstage { padding: 6px; } .mailstage .mailframe { height: 760px; } .mailstage.mobile .mailframe { width: 100%; }
  .chat .msg { max-width: 100%; }
  .wsmenu > summary .wl, .wsname .wl { display: none; }
  .tb-r .btn.ghost { padding: 6px 10px; }
  .filterbar .vsep { display: none; }
  .filterbar { justify-content: flex-start; }
}
@media (max-width: 420px) { .g4, .mapgrid { grid-template-columns: minmax(0, 1fr); } .wsmenu > summary b { max-width: 150px; } }

@media print {
  .sidenav, .topbar, .noprint, .head .row, .flash, .navscrim { display: none !important; }
  body, .card, .kpi { background: #fff !important; color: #111 !important; }
  .app { display: block; background: none; } main { padding: 0 !important; } .dash { grid-template-columns: 1fr 1fr; }
}
