/* =====================================================================================
   Podcast dashboard — design system 
   Identity: deep burgundy + a quiet gold for marks; Heebo for everything
   (one typeface). Class names are a contract with
   app.js / publish.js / charts.js — never rename, only restyle.
   ===================================================================================== */

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --font-ui: "Heebo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: var(--font-ui);   /* owner (2026-11-09): one typeface everywhere, like the menu */
  --page: #f2f0f3; --surface: #ffffff; --surface-2: #f6f3f6;
  --ink: #1f1a24; --ink-2: #534a58; --muted: #857b8a;
  --grid: #e9e4ea; --axis: #c9c1cc; --border: rgba(31,26,36,0.10);
  --accent: #8c2039; --accent-soft: #f6e3e8; --accent-deep: #5a1427; --on-accent: #ffffff;
  --gold: #c59a2f; --gold-soft: #f7efd9;
  --good: #1f7a3a; --bad: #c43d3d; --warn: #a86a00; --critical: #c43d3d;
  --nav-bg: #2a0c18; --nav-ink: #f6e9ee; --nav-muted: #b596a2; --nav-hover: rgba(255,255,255,.06); --nav-active: rgba(255,255,255,.11);
  --nav-w: 248px; --radius: 14px; --radius-s: 9px;
  --shadow: 0 1px 2px rgba(31,26,36,.04), 0 10px 28px -16px rgba(31,26,36,.16);
  --hero-a: #3b0f1f; --hero-b: #8c2039;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #15111a; --surface: #1f1924; --surface-2: #2a2230;
    --ink: #f2ecef; --ink-2: #c7bcc9; --muted: #8f8494;
    --grid: #2f2735; --axis: #4a4050; --border: rgba(255,255,255,0.09);
    --accent: #d85c7c; --accent-soft: #46202d; --accent-deep: #f0a3b6; --on-accent: #1a0a10;
    --gold: #dcb554; --gold-soft: #3a3020;
    --good: #4cc26f; --bad: #ef7373; --warn: #f0b545; --critical: #ef7373;
    --nav-bg: #120810; --nav-ink: #f6e9ee; --nav-muted: #a88a96;
    --shadow: none;
    --hero-a: #2a0b16; --hero-b: #6d1a30;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #15111a; --surface: #1f1924; --surface-2: #2a2230;
  --ink: #f2ecef; --ink-2: #c7bcc9; --muted: #8f8494;
  --grid: #2f2735; --axis: #4a4050; --border: rgba(255,255,255,0.09);
  --accent: #d85c7c; --accent-soft: #46202d; --accent-deep: #f0a3b6; --on-accent: #1a0a10;
  --gold: #dcb554; --gold-soft: #3a3020;
  --good: #4cc26f; --bad: #ef7373; --warn: #f0b545; --critical: #ef7373;
  --nav-bg: #120810; --nav-ink: #f6e9ee; --nav-muted: #a88a96;
  --shadow: none;
  --hero-a: #2a0b16; --hero-b: #6d1a30;
}

/* platform icons: a tinted mask of the SVG, so one file serves every color and both themes */
.picon { --icon: none; display: inline-block; width: 15px; height: 15px; flex: none; vertical-align: -2px; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; border-radius: 0 !important; box-shadow: none !important; }
nav .dot.picon { width: 17px; height: 17px; }
nav .dot.picon[data-id="threads"], nav .dot.picon[data-id="tiktok"] { background: var(--nav-ink) !important; }
.pill .picon { width: 13px; height: 13px; }
.chip .picon { width: 12px; height: 12px; background: currentColor !important; }
.plan-item .dot.picon { width: 12px; height: 12px; }

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font-ui); background: var(--page); color: var(--ink); font-size: 15px; line-height: 1.55; direction: rtl; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; }
h1 { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1.15; letter-spacing: -0.005em; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.005em; }
h3 { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
b { font-weight: 600; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: 100vh; }
nav.side { background: var(--nav-bg); color: var(--nav-ink); padding: 22px 14px 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
nav .brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 22px; color: var(--nav-ink); font-family: var(--font-display); font-size: 19px; font-weight: 700; line-height: 1.1; }
nav .brand .logo { width: 34px; height: 34px; border-radius: 50%; flex: none; border: 2px solid var(--gold); position: relative; }
nav .brand .logo::after { content: ""; position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); top: 4px; right: 50%; transform: translateX(50%); }
nav .brand small { display: block; font-family: var(--font-ui); font-size: 12px; color: var(--nav-muted); font-weight: 400; margin-top: 3px; }
nav .items { display: contents; }
nav a.item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-s); color: var(--nav-ink); font-weight: 400; position: relative; opacity: .86; }
nav a.item:hover { background: var(--nav-hover); text-decoration: none; opacity: 1; }
nav a.item.active { background: var(--nav-active); opacity: 1; font-weight: 500; }
nav a.item.active::before { content: ""; position: absolute; inset-inline-start: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--gold); }
nav .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; box-shadow: 0 0 0 1.5px rgba(255,255,255,.5); }
nav .group { margin: 16px 0 4px; padding: 0 12px; font-size: 11.5px; color: var(--nav-muted); letter-spacing: .04em; }
nav .status-pill { margin-right: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--axis); }
nav .status-pill.ok { background: var(--good); } nav .status-pill.err { background: var(--critical); } nav .status-pill.manual { background: var(--warn); }
nav #nav-user { margin-top: auto; padding: 16px 12px 0 !important; color: var(--nav-muted) !important; border-top: 1px solid rgba(255,255,255,.08); }
nav #nav-user a { color: var(--nav-ink); }
nav .theme { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.07); margin: 0 12px 10px; }
nav .theme button { border: 0; background: transparent; color: var(--nav-muted); font-size: 12px; padding: 4px 10px; border-radius: 999px; cursor: pointer; }
nav .theme button.active { background: var(--gold); color: #2a0c18; font-weight: 600; }
main { padding: 28px 32px 72px; min-width: 0; max-width: 1480px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.topbar .sub { color: var(--muted); font-size: 13.5px; margin-top: 6px; max-width: 72ch; }
/* the date bar always sits on its own row under the title: a longer subtitle ("היום, … בעיכוב") used to push it down only sometimes (owner 2026-11-17) */
.topbar > #filters { flex-basis: 100%; }
.topbar > #filters:empty { display: none; }
#page { animation: page-in .28s ease-out both; }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* filter row: one row, above everything it scopes */
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 13px; border-radius: 999px; cursor: pointer; color: var(--ink-2); font-weight: 400; }
.seg button:hover { color: var(--ink); }
.seg button.active { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }
.filters input[type=date], .pubbar select, .plantools select, .whenrow input[type=datetime-local], select.small, input[type=text], input[type=password] { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-s); padding: 7px 10px; color: var(--ink); }
.btn { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-s); padding: 7px 14px; cursor: pointer; font-weight: 500; color: var(--ink); transition: background .12s, border-color .12s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.primary:hover { background: var(--accent-deep); color: var(--on-accent); }
:root[data-theme="dark"] .btn.primary:hover, :root:not([data-theme="light"]) .btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.armed { background: var(--warn); color: #1a1200; border-color: transparent; }

/* ---------- cards & grids ---------- */
.grid { display: grid; gap: 16px; }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); min-width: 0; }
.card header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card header .tools { display: flex; gap: 2px; background: var(--surface-2); border-radius: 999px; padding: 2px; }
.card header .tools button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.card header .tools button:hover, .card header .tools button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.section { margin: 34px 0 14px; display: flex; align-items: baseline; gap: 12px; }
.section h2 { font-family: var(--font-display); font-weight: 600; font-size: 20px; }
.section:first-child { margin-top: 4px; }
.loading main > * { opacity: .55; transition: opacity .2s; }

/* stat tile */
.tile .label { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.tile .swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.tile .value { font-family: var(--font-display); font-size: 30px; font-weight: 600; margin-top: 6px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .delta { font-size: 13px; margin-top: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tile .delta.up { color: var(--good); } .tile .delta.down { color: var(--bad); } .tile .delta.flat { color: var(--muted); }
.tile .spark { position: relative; height: 38px; margin-top: 12px; }
.tile .spark canvas { display: block; width: 100% !important; height: 38px !important; }
.tile .asof { font-size: 11.5px; color: var(--muted); margin-top: 8px; }

/* the one bold element: the overview hero band */
.card.hero { display: flex; align-items: flex-end; gap: 48px; flex-wrap: wrap; background: linear-gradient(120deg, var(--hero-a), var(--hero-b)); color: #fff; border-color: transparent; padding: 28px 30px 26px; position: relative; overflow: hidden; }
.card.hero::before { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.12); left: -70px; top: -110px; pointer-events: none; }
.card.hero::after { content: ""; position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); left: 60px; top: 24px; pointer-events: none; }
.hero .big { font-family: var(--font-display); font-size: 54px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.hero .cap { color: rgba(255,255,255,.72); font-size: 14px; margin-bottom: 8px; }
.hero .delta { margin-top: 10px; font-size: 13.5px; display: flex; gap: 6px; align-items: center; }
.hero .delta.up { color: #a7e8b9; } .hero .delta.down { color: #ffb3b3; } .hero .delta.flat { color: rgba(255,255,255,.7); }
.hero .muted { color: rgba(255,255,255,.7); }

/* charts */
.chart-box { position: relative; height: 280px; }
.chart-box.tall { height: 340px; } .chart-box.short { height: 220px; }
.chart-box canvas { width: 100% !important; height: 100% !important; }
.chart-table { display: none; max-height: 320px; overflow: auto; }
.card.table-mode .chart-box { display: none; } .card.table-mode .chart-table { display: block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin: 0 0 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; } .legend i.rect { height: 10px; width: 10px; border-radius: 3px; }

/* ranked bars (html) */
.ranked { display: grid; gap: 9px; }
.ranked .row { display: grid; grid-template-columns: minmax(80px, 150px) 1fr 110px; align-items: center; gap: 10px; font-size: 13px; }
.ranked .row .name { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranked .row .bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; display: flex; justify-content: flex-start; }
.ranked .row .bar i { display: block; height: 100%; border-radius: 4px 0 0 4px; margin-right: auto; background: var(--accent); }
.ranked .row .val { text-align: left; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; direction: ltr; }

/* tables */
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; vertical-align: middle; }
table.data th { color: var(--muted); font-weight: 500; font-size: 12.5px; position: sticky; top: 0; background: var(--surface); cursor: pointer; border-bottom-color: var(--axis); }
table.data th.sorted { color: var(--accent-deep); font-weight: 600; }
table.data td.n { font-variant-numeric: tabular-nums; text-align: right; direction: ltr; }   /* same edge as the (RTL) header above it; right-aligned digits also line up ones under ones (2026-11-10) */
table.data td.title { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
/* long free text (episode names, file lists, activity details): wraps inside the card instead of pushing the table past it */
table.data td.wrap { white-space: normal; overflow-wrap: anywhere; min-width: 160px; line-height: 1.45; }
/* safety net: a table that is still wider than its card scrolls inside the card, never over its edge */
.card:has(table.data) { overflow-x: auto; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; background: var(--surface-2); color: var(--ink-2); }
.pill i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.thumb { display: inline-block; width: 48px; height: 30px; object-fit: cover; border-radius: 5px; background: var(--surface-2); vertical-align: middle; margin-left: 10px; }
.segbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; background: transparent; min-width: 120px; }
.segbar i { display: block; height: 100%; }

/* status */
.status-card .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--grid); font-size: 13.5px; }
.status-card .row:last-child { border: 0; }
.badge { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.ok { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.badge.err { background: color-mix(in srgb, var(--critical) 14%, transparent); color: var(--critical); }
.badge.off { background: var(--surface-2); color: var(--muted); }
.badge.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.notice { background: color-mix(in srgb, var(--warn) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); border-radius: var(--radius-s); padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }
.steps { padding-right: 20px; } .steps li { margin: 6px 0; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; font-size: 13px; direction: ltr; unicode-bidi: embed; }
details summary { cursor: pointer; }

/* red alert bar (manual imports not updated today, monitor errors) */
#alerts { position: sticky; top: 0; z-index: 20; display: grid; gap: 4px; margin: -28px -32px 22px; }
#alerts:empty { display: none; }
.alert-bar { background: var(--critical); color: #fff; padding: 10px 32px; font-weight: 500; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.alert-bar a { color: #fff; text-decoration: underline; text-underline-offset: 3px; font-weight: 500; margin-right: auto; }

/* ---------- publishing ---------- */
.pubbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.pubgroup { margin-bottom: 16px; padding: 14px 18px; overflow-x: auto; }
table.pub td.chips { white-space: normal; min-width: 260px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; margin: 2px 0 2px 4px; border-radius: 999px; font-size: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); text-decoration: none; }
.chip:hover { text-decoration: none; }
.chip.ok { background: color-mix(in srgb, var(--good) 13%, transparent); color: var(--good); border-color: transparent; }
.chip.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); border-color: transparent; }
.chip.err { background: color-mix(in srgb, var(--critical) 13%, transparent); color: var(--critical); border-color: transparent; }
.chip.prop { border-style: dashed; background: transparent; }
.chip .when { font-size: 11px; opacity: .85; margin-inline-start: 2px; white-space: nowrap; }
.pubsearch { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-s); padding: 7px 10px; color: var(--ink); min-width: 220px; }
.chip i.manual { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); display: inline-block; }
tr.has-problems td.title a { color: var(--critical); }
/* asset window: a drawer that opens from the side opposite the nav, full height */
.pubmodal { position: fixed; inset: 0; background: rgba(20,10,16,.45); z-index: 50; display: flex; align-items: stretch; justify-content: flex-end; backdrop-filter: blur(2px); }
.pubbox { background: var(--surface); border-inline-end: 1px solid var(--border); width: min(960px, 100%); padding: 22px 26px 40px; overflow-y: auto; animation: drawer-in .22s ease-out both; box-shadow: 12px 0 40px -20px rgba(0,0,0,.4); }
@keyframes drawer-in { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
.pubhead { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.pubhead h2 { margin: 0 0 4px; font-family: var(--font-display); font-weight: 700; font-size: 22px; }
.findings { margin: 10px 0; padding-right: 18px; font-size: 13px; } .findings li.error { color: var(--critical); } .findings li.warn { color: var(--warn); }
.pubsec { border-top: 1px solid var(--grid); margin-top: 18px; padding-top: 16px; } .pubsec h3 { margin: 0 0 10px; font-size: 16px; color: var(--ink); }
.pubsechead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.netchecks { display: flex; gap: 14px 22px; flex-wrap: wrap; margin-bottom: 10px; } .netcheck { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.netcheck .netwhen { margin-inline-start: 8px; padding: 4px 8px; font-size: 13px; }
.whenrow { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.copyblk { border: 1px solid var(--border); border-radius: var(--radius-s); margin: 8px 0; overflow: hidden; }
.copyhead { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; background: var(--surface-2); }
.copyblk pre { margin: 0; padding: 12px; white-space: pre-wrap; word-wrap: break-word; font: inherit; font-size: 14px; max-height: 260px; overflow-y: auto; }

/* ---------- scheduling calendar (advisor) ---------- */
.plancard { margin-bottom: 16px; }
.plantools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.plan { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.plan-day { background: var(--page); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 8px; min-height: 120px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.plan-day.today { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.plan-day.shabbat { background: repeating-linear-gradient(135deg, var(--page) 0 8px, color-mix(in srgb, var(--accent-soft) 55%, var(--page)) 8px 16px); }
.plan-dayhead { display: flex; flex-direction: column; gap: 2px; padding-bottom: 5px; border-bottom: 1px solid var(--grid); font-size: 13px; }
.plan-blocked { font-size: 12px; color: var(--ink-2); background: color-mix(in srgb, var(--warn) 14%, transparent); border-radius: 6px; padding: 4px 6px; }
.plan-note { font-size: 12px; color: var(--muted); }
.plan-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 7px 9px; font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.plan-item.proposal { border-style: dashed; }
.plan-item.published { opacity: .8; }
.plan-item.failed { border-color: color-mix(in srgb, var(--critical) 50%, transparent); }
.plan-itemtop { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.plan-item .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.plan-item .time { font-variant-numeric: tabular-nums; font-weight: 600; direction: ltr; }
.plan-item .net { color: var(--ink-2); }
.plan-item .plan-name { color: var(--ink); font-weight: 500; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.plan-acts { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.plan-acts .btn { padding: 3px 9px; font-size: 12px; }
.plan-why { margin: 4px 0 0; padding-right: 16px; color: var(--ink-2); font-size: 12px; } .plan-why li { margin: 2px 0; }
@media (max-width: 1100px) { .plan { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .plan { grid-template-columns: 1fr; } }

/* ---------- login ---------- */
body.login { display: grid; place-items: center; background: var(--page); }
.login-box { width: min(400px, calc(100% - 32px)); text-align: center; padding: 32px 28px; }
.login-box .brand { display: flex; align-items: center; justify-content: center; gap: 12px; font-family: var(--font-display); font-size: 24px; margin-bottom: 6px; }
.login-box .brand .logo { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--gold); position: relative; display: inline-block; }
.login-box .brand .logo::after { content: ""; position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); top: 4px; right: 50%; transform: translateX(50%); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  /* phone: brand + theme on one row, the menu as one horizontally scrolling row below */
  nav.side { position: sticky; top: 0; z-index: 30; height: auto; padding: 10px 16px 8px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 10px; overflow: visible; }
  nav .brand { padding: 0; font-size: 18px; }
  nav .brand .logo { width: 28px; height: 28px; } nav .brand .logo::after { width: 8px; height: 8px; top: 3px; }
  nav .brand small { display: none; }
  nav .theme { margin: 0; grid-column: 2; grid-row: 1; }
  nav .items { display: flex; grid-column: 1 / -1; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
  nav .items::-webkit-scrollbar { display: none; }
  nav .group { display: none; }
  nav #nav-platforms { display: contents; }
  nav a.item { padding: 6px 11px; font-size: 13px; white-space: nowrap; flex: none; }
  nav a.item.active::before { display: none; }
  nav a.item.active { background: var(--nav-active); }
  nav #nav-user { display: none !important; }
  main { padding: 16px 16px 48px; }
  .topbar { margin-bottom: 16px; align-items: flex-start; }
  h1 { font-size: 26px; }
  #alerts { margin: -16px -16px 16px; } .alert-bar { padding: 8px 16px; font-size: 13px; gap: 6px 12px; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .grid.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { padding: 16px; }
  .card.hero { gap: 24px; padding: 22px 20px; }
  .hero .big { font-size: 44px; }
  .card:has(> table.data), .card:has(> .chart-table) { overflow-x: auto; }
  .pubbox { padding: 18px 16px 40px; }
}

/* ---------- manual imports page ---------- */
.dropzone { border: 1.5px dashed var(--axis); border-radius: var(--radius); padding: 26px 18px; text-align: center; display: flex; flex-direction: column; gap: 6px; align-items: center; cursor: pointer; background: var(--surface-2); transition: border-color .12s, background .12s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.droplist { display: grid; gap: 8px; margin-top: 10px; }
.dropfile { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-s); background: var(--surface); }
.dropfile > :nth-child(2) { grid-column: 1; }
.dropfile > .btn { grid-column: 2; grid-row: 1 / span 2; }
.dropfile.bad { border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field input { width: 100%; }
input[type=date], input[type=number], input[type=text] { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-s); padding: 7px 10px; color: var(--ink); }
.checklist { display: flex; flex-wrap: wrap; gap: 4px; }
.checklist .chip { margin: 0; }
.netedit { display: inline-flex; align-items: center; gap: 6px; margin-inline-start: 6px; }

/* floating explanation: one bubble for the whole app (fixed, so scrolling tables do not clip it); see tip() in app.js */
.tipbox { position: fixed; top: 0; left: 0; z-index: 1000; max-width: min(340px, calc(100vw - 16px)); padding: 10px 12px; border-radius: var(--radius-s); background: var(--ink); color: var(--page); font-size: 12.5px; font-weight: 400; line-height: 1.55; white-space: pre-line; text-align: right; direction: rtl; box-shadow: 0 10px 28px -10px rgba(0,0,0,.4); pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .12s; }
.tipbox.on { opacity: 1; visibility: visible; }
[data-tip] { cursor: help; }
[data-tip]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.tipi { display: inline-grid; place-items: center; width: 15px; height: 15px; margin-inline-start: 5px; border: 1px solid currentColor; border-radius: 50%; font-size: 10px; font-weight: 700; font-style: normal; line-height: 1; vertical-align: 1px; opacity: .7; }
.tipi:hover, .tipi:focus { opacity: 1; }

.plantools .pubsearch { min-width: 200px; }
.plan-matches { margin: 4px 0 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-s); background: var(--surface); }
.plan-matches ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.plan-matches button.chip { cursor: pointer; font: inherit; font-size: 12px; }

/* comments inbox (#/comments) */
.navcount { margin-inline-start: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: #2a0c18; font-size: 11.5px; font-weight: 700; text-align: center; line-height: 19px; }
.navcount:empty { display: none; }
.cmt-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cmt-bar .grow { flex: 1 1 200px; min-width: 0; }
.cmt-info { margin-top: 10px; }
.cmt-notes { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.cmt-notes:not(:empty) { margin-top: 10px; }
.cmt-note { white-space: normal; font-weight: 500; border-radius: var(--radius-s); padding: 5px 10px; line-height: 1.5; }
.cmt-post { margin-top: 16px; padding: 16px 20px 8px; }
.cmt-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; min-width: 0; }
.cmt-thumb { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: var(--surface-2); flex: none; display: block; }
.cmt-headtext { min-width: 0; }
.cmt-head .ttl { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 3px; color: var(--ink); }
.cmt-thread { border-top: 1px solid var(--grid); padding: 12px 0 2px; }
.cmt { padding: 0 0 10px; }
.cmt.reply { margin-inline-start: 18px; padding-inline-start: 12px; border-inline-start: 2px solid var(--grid); }
.cmt.ours { border-inline-start-color: var(--gold); }
.cmt-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.cmt-meta b { color: var(--ink); font-weight: 600; }
.cmt-text { margin: 4px 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; max-width: 80ch; text-align: right; }   /* dir=auto orders an English comment left to right; it still hugs the page's right edge */
.cmt-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.cmt-actions .btn { padding: 4px 11px; font-size: 13px; }
.cmt-foot { margin: 18px 2px 0; max-width: 80ch; }
.cmt-replybox { margin: 8px 0 4px; display: grid; gap: 6px; max-width: 80ch; }
.cmt-replybox textarea { width: 100%; min-height: 78px; box-sizing: border-box; border: 1px solid var(--border); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); padding: 8px 10px; font: inherit; line-height: 1.5; resize: vertical; }
.cmt-replybox textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.cmt-replyrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cmt-replyrow .btn { padding: 5px 14px; font-size: 13px; }
.cmt-count { margin-inline-start: auto; white-space: nowrap; }
.cmt-bulk { padding: 3px 10px; font-size: 12.5px; }
