/* Components for the Be Online Marketing section: account frame, AI team, pipeline,
   channel cards, capability matrix, policy table, Creative Studio, Publishing Centre, reports. */

/* ---------- Be Online account frame ---------- */
.brand { padding: 4px 6px 12px; display: grid; gap: 6px; }
.brand img { height: 30px; width: auto; max-width: 100%; display: block; }
.brand .prod { font-size: 11px; color: var(--on-night-2); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
.acct { display: grid; gap: 1px; }
.acct a { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; color: var(--on-night-2); text-decoration: none; font-size: 13px; }
.acct a svg { width: 16px; height: 16px; opacity: 0.7; }
.acct a:hover { background: rgb(255 255 255 / 0.05); color: var(--on-night); }
.nav .sect { display: flex; align-items: center; gap: 8px; padding: 10px 10px 6px; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.nav .sect i { width: 8px; height: 8px; border-radius: 50%; background: #f0703a; }
.nav .sect small { margin-left: auto; font-family: var(--font-body); font-weight: 700; font-size: 10.5px; color: #0c3a22; background: var(--lime); border-radius: 999px; padding: 1px 7px; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }
.crumbs b { color: var(--ink-2); font-weight: 600; }
.promise { font-family: var(--font-display); font-weight: 600; color: var(--green); font-size: 14px; }
:root[data-theme="dark"] .promise { color: var(--mk); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .promise { color: var(--mk); } }

/* week strip */
.wk { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; padding: 14px; }
.wk-day { display: grid; gap: 8px; align-content: start; min-width: 0; }
.wk-h { font-size: 11.5px; font-weight: 600; color: var(--ink-3); padding: 2px 4px; display: flex; justify-content: space-between; }
.wk-h.today { color: var(--ink); }
.wk-h.today span:first-child { background: var(--human); color: var(--human-ink); border-radius: 5px; padding: 0 6px; }
.wcard { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 6px; display: grid; gap: 5px; text-align: left; cursor: pointer; width: 100%; min-width: 0; }
.wcard:hover { border-color: var(--ink-3); }
.wcard .art { width: 100%; aspect-ratio: 4 / 3; height: auto; }
.wcard .wt { font-size: 11.5px; font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wcard .wm { display: flex; align-items: center; justify-content: space-between; gap: 4px; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); }
.wcard .net { width: 18px; height: 18px; font-size: 8.5px; border-radius: 5px; }
.wcard .chip { font-size: 10.5px; padding: 1px 6px; justify-self: start; }
.wk-empty { border: 1px dashed var(--line); border-radius: 10px; min-height: 60px; display: grid; place-items: center; font-size: 11px; color: var(--ink-3); }

/* AI team */
.orch { display: flex; gap: 12px; align-items: center; padding: 12px 16px; background: var(--night); color: var(--on-night); border-radius: var(--r) var(--r) 0 0; flex-wrap: wrap; }
.orch b { font-family: var(--font-display); color: #fff; font-size: 14.5px; }
.orch span { font-size: 12.5px; color: var(--on-night-2); }
.orch .chip { background: rgb(255 255 255 / 0.1); color: var(--on-night); }
.agents { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.agent { padding: 14px 16px; display: grid; gap: 6px; border-top: 1px solid var(--line-2); min-width: 0; align-content: start; }
.agent:nth-child(-n+3) { border-top: 0; }
.agent:not(:nth-child(3n+1)) { border-left: 1px solid var(--line-2); }
.agent .an { font-family: var(--font-display); font-weight: 650; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.agent .an svg { width: 16px; height: 16px; color: var(--ai); }
.agent .ad { font-size: 12px; color: var(--ink-3); }
.agent .now { font-size: 12.5px; color: var(--ink-2); display: flex; gap: 7px; align-items: flex-start; }
.agent .now i { width: 7px; height: 7px; border-radius: 50%; background: var(--ai); margin-top: 6px; flex: none; box-shadow: 0 0 0 3px var(--ai-tint); }
.agent .perm-l { font-size: 11.5px; color: var(--ink-3); display: grid; gap: 2px; }
.agent .perm-l b { font-weight: 600; color: var(--ink-2); }
.policy-bar { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line-2); background: var(--surface-2); font-size: 12.5px; color: var(--ink-2); flex-wrap: wrap; border-radius: 0 0 var(--r) var(--r); }
.policy-bar svg { width: 16px; height: 16px; color: var(--green); flex: none; }

/* pipeline */
.pipe { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); padding: 14px 10px; }
.pst { display: grid; justify-items: center; text-align: center; gap: 4px; position: relative; padding: 4px; min-width: 0; }
.pst + .pst::before { content: ""; position: absolute; left: -12%; top: 23px; width: 24%; height: 2px; background: var(--line); }
.pst .pc { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 600; font-size: 13px; background: var(--line-2); color: var(--ink-2); position: relative; }
.pst.ai .pc { background: var(--ai-tint); color: var(--ai); }
.pst.you .pc { background: var(--human); color: var(--human-ink); }
.pst.done .pc { background: var(--ok-tint); color: var(--ok); }
.pst .pl { font-size: 11.5px; color: var(--ink-3); font-weight: 600; line-height: 1.25; }

/* channel cards */
.chcards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.chc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 6px; min-width: 0; align-content: start; }
.chc .ch-top { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.chc .ch-v { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.chc .ch-row { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); gap: 6px; }
.chc .ch-row b { color: var(--ink-2); font-family: var(--font-mono); font-weight: 600; }
.chc.off { border-style: dashed; background: var(--surface-2); }

/* capability matrix */
.cap { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.cap.yes { background: var(--ok-tint); color: var(--ok); }
.cap.limited { background: var(--warn-tint); color: var(--warn); }
.cap.perm { background: var(--ai-tint); color: var(--ai); }
.cap.no { background: var(--line-2); color: var(--ink-3); }
.cap.cost { background: var(--mk-tint); color: var(--mk); }
.capt td, .capt th { padding: 8px 10px; }
.capt td:first-child, .capt th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }

/* policy */
.pol select { width: auto; min-width: 220px; padding: 7px 10px; }
.lockcell { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.lockcell svg { width: 14px; height: 14px; color: var(--ink-3); }
.mode .tagline { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.mode[aria-pressed="true"] .tagline { color: var(--mk); }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line-2); }
.field-row:first-child { border-top: 0; }
.field-row b { font-size: 13.5px; font-weight: 600; display: block; }
.field-row span { font-size: 12.5px; color: var(--ink-3); }
.field-row select, .field-row input { width: auto; min-width: 150px; }

/* Creative Studio */
.brief { display: grid; gap: 12px; }
.brief textarea { min-height: 84px; font-size: 14.5px; border-color: var(--ai-line); }
.opts-row { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-end; }
.opts-row .grp { display: grid; gap: 6px; }
.opts-row .grp > span { font-size: 11px; color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.toggle-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px 4px 5px; background: var(--surface); font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--ink); }
.toggle-chip[aria-pressed="true"] { border-color: var(--green); background: var(--mk-tint); }
.toggle-chip[aria-pressed="false"] { opacity: 0.55; }
.toggle-chip:disabled { cursor: not-allowed; opacity: 0.4; }
.prog { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.prog div { border-radius: 8px; padding: 8px 10px; background: var(--line-2); font-size: 12px; color: var(--ink-3); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.prog div.done { background: var(--ok-tint); color: var(--ok); }
.prog div.run { background: var(--ai-tint); color: var(--ai); }
.prog svg { width: 14px; height: 14px; flex: none; }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.scene { display: grid; gap: 6px; min-width: 0; align-content: start; }
.scene .art { width: 100%; aspect-ratio: 9 / 16; height: auto; }
.scene .st { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.scene p { font-size: 12.5px; color: var(--ink-2); }
.versions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ver { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; font-size: 12.5px; min-width: 0; align-content: start; }
.ver b { font-size: 13px; display: flex; gap: 7px; align-items: center; }
.ver.off { border-style: dashed; color: var(--ink-3); }
.tpl { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.tpl button { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 8px; display: grid; gap: 6px; font-size: 12px; font-weight: 600; text-align: left; cursor: pointer; min-width: 0; color: var(--ink); }
.tpl button:hover { border-color: var(--ai-line); }
.tpl .art { width: 100%; aspect-ratio: 1; height: auto; }
.lib { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.lib .art { width: 100%; aspect-ratio: 1; height: auto; }

/* Publishing Centre */
.stat-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.sbtn { display: inline-flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; background: var(--surface); font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.sbtn b { font-family: var(--font-mono); }
.sbtn[aria-pressed="true"] { border-color: var(--human); background: var(--human); color: var(--human-ink); }
.js { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.js i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.js.awaiting { background: var(--ai-tint); color: var(--ai); }
.js.scheduled { background: var(--line-2); color: var(--ink-2); }
.js.queued { background: var(--mk-tint); color: var(--mk); }
.js.publishing { background: var(--warn-tint); color: var(--warn); }
.js.published { background: var(--ok-tint); color: var(--ok); }
.js.failed, .js.reconnect, .js.held { background: var(--bad-tint); color: var(--bad); }

/* reports */
.senti { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 2px; }
.senti i { display: block; height: 100%; }
.legend-dots { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.legend-dots span { display: inline-flex; align-items: center; gap: 6px; }
.chart .l2 { fill: none; stroke: var(--ch-2); stroke-width: 2; }
.chart .l3 { fill: none; stroke: var(--ch-3); stroke-width: 2; stroke-dasharray: 5 4; }
tr.you td { background: var(--mk-tint); font-weight: 600; }
.spark { width: 100%; max-width: 110px; height: 34px; display: block; }
.spark path { fill: none; stroke: var(--ch-1); stroke-width: 2; }

/* side panels */
.assist { display: grid; gap: 10px; }
.assist .sugg { display: grid; gap: 6px; }
.assist .sugg button { text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: 9px; padding: 8px 10px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); }
.assist .sugg button:hover { border-color: var(--ai-line); background: var(--ai-tint); }
.ask { display: flex; gap: 6px; }
.ask input { flex: 1; min-width: 0; }
.meter { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--lime)); border-radius: 999px; }
.mini-q { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line-2); }
.mini-q:first-child { border-top: 0; }
.mini-q .ttl { font-size: 13px; font-weight: 600; line-height: 1.3; cursor: pointer; }
.mini-q .sub { font-size: 11.5px; color: var(--ink-3); }
.qa-btns { display: flex; gap: 5px; }
.qa-btns button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.qa-btns button svg { width: 15px; height: 15px; }
.qa-btns .y { color: var(--ok); }
.qa-btns .n { color: var(--bad); }
.lifecycle { display: flex; gap: 4px; flex-wrap: wrap; }
.lifecycle span { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--line-2); color: var(--ink-3); }
.lifecycle span.done { background: var(--ok-tint); color: var(--ok); }
.lifecycle span.now { background: var(--ai); color: #fff; }
.cls { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 5px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.cls.bad { background: var(--bad-tint); color: var(--bad); }
.cls.lead { background: var(--mk-tint); color: var(--mk); }
.cal-d.drop { background: var(--mk-tint); outline: 2px dashed var(--lime); outline-offset: -3px; }
.ev[draggable="true"] { cursor: grab; }
.cdot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.wkcal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; padding: 12px; }

@media (max-width: 1100px) {
  .chcards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .agents { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agent:nth-child(n) { border-left: 0; border-top: 1px solid var(--line-2); }
  .agent:nth-child(even) { border-left: 1px solid var(--line-2); }
  .agent:nth-child(-n+2) { border-top: 0; }
  .pipe { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 14px; }
  .pst:nth-child(5)::before { display: none; }
  .tpl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lib { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .versions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .wk, .wkcal { grid-template-columns: repeat(7, minmax(128px, 1fr)); overflow-x: auto; }
  .chcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agents { grid-template-columns: minmax(0, 1fr); }
  .agent:nth-child(n) { border-left: 0; border-top: 1px solid var(--line-2); }
  .agent:first-child { border-top: 0; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .versions { grid-template-columns: minmax(0, 1fr); }
  .lib { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pol select { min-width: 0; width: 100%; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .field-row select, .field-row input { width: 100%; }
  .pipe { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* grid children must be allowed to shrink so wide tables scroll inside their card */
.view > *, .grid > *, .stack > * { min-width: 0; }
.ev > span { min-width: 0; overflow: hidden; }
.ev .et { display: block; }
