/* Palm Sphere Desk. Tokens come from tokens.css (shared with the mini app); the names below map the console's
   older names onto them so every page takes Palm Sphere's look, light and dark, from one file. */
:root {
  --plaster: var(--paper); --rule: var(--line); --ink-2: var(--muted);
  --ink-3: color-mix(in oklch, var(--muted) 70%, var(--paper));
  --pool: var(--info); --pool-tint: var(--info-bg);
  --mustard: var(--sun); --mustard-tint: var(--warn-bg);
  --coral: var(--fix); --coral-tint: var(--fix-bg);
  --display: var(--f-display); --text: var(--f-body);
  --r-sm: 14px; --r-md: var(--r);
  --tint: color-mix(in oklch, var(--sunk) 60%, var(--surface));
  --rail-w: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 var(--f-body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--pool); }
:focus-visible { outline: 2px solid var(--pool); outline-offset: 2px; }
.boot { padding: 48px; color: var(--ink-2); }

/* Shell: a light rail like the mini app's surfaces; the current page in Palm blue, counts in sun yellow */
.shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }
.rail { background: var(--surface); border-right: 1px solid var(--line); padding: 22px 14px 18px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-family: var(--f-display); font-weight: 600; font-size: 24px; line-height: 1; color: var(--ink); text-decoration: none; padding: 0 10px; }
.brand small { display: block; font: 500 13px/1.2 var(--f-body); color: var(--muted); margin-top: 6px; }
.nav { display: flex; flex-direction: column; gap: 14px; }
.navgroup { display: flex; flex-direction: column; gap: 2px; }
.navlabel { margin: 0 0 4px; padding: 0 12px; font-size: 12px; font-weight: 500; color: var(--muted); }
.nav a { color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 12px; font-size: 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.nav a:hover { background: var(--sunk); }
.nav a[aria-current="page"] { background: color-mix(in oklch, var(--palm) 13%, var(--surface)); color: var(--palm); font-weight: 600; }
.nav .count { background: var(--sun); color: var(--on-sun); border-radius: 999px; font-size: 12px; min-width: 22px; text-align: center; padding: 1px 7px; font-weight: 600; font-variant-numeric: tabular-nums; }
.nav .count.urgent { background: #B42318; color: #EBE5CD; }
.rail-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.rail-foot .who { color: var(--ink); font-weight: 500; }
.rail-foot a, .rail-foot button { background: none; border: 0; color: var(--muted); padding: 0; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-size: 13px; }
.seg { display: flex; gap: 4px; }
.seg button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 4px 11px; font-size: 13px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--palm); color: var(--on-palm); border-color: var(--palm); font-weight: 600; }

/* Top bar: search, view as, language. Solid, never translucent (Palm Sphere .dock rule). */
.work { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 15; background: var(--paper); border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; padding: 12px 36px; }
.search { position: relative; flex: 1; max-width: 560px; }
.search input { border: 1px solid var(--line); border-radius: 999px; background: var(--surface); padding: 9px 16px; width: 100%; min-height: 40px; }
.results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-deep); padding: 6px; z-index: 25; max-height: 60vh; overflow: auto; }
.results button { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.results button span { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.results button:hover, .results button[aria-selected="true"] { background: var(--sunk); }
.results p { margin: 0; padding: 8px 10px; color: var(--muted); font-size: 14px; }
.viewas { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-left: auto; }
.viewas select { width: auto; min-height: 36px; padding: 5px 10px; border-radius: 999px; }
.lang { margin-left: 0; }
.search ~ .lang { margin-left: auto; }
.viewas ~ .lang { margin-left: 0; }

/* Importance, same four levels as the marketing LINE cards */
.lv { display: inline-block; border-radius: 999px; padding: 3px 12px; font: 600 13px/1.4 var(--f-body); letter-spacing: 0; vertical-align: middle; }
.lv-urgent { background: #B42318; color: #EBE5CD; }
.lv-decision { background: #F8F050; color: #252525; }
.lv-ready { background: #252525; color: #F8F050; }
.lv-daily { background: #EBE5CD; color: #252525; }
/* For you */
.fy-count { margin: 0; font-family: var(--f-display); font-size: 22px; color: var(--muted); }
.fy-group h2 { margin: 26px 0 10px; }
.fy { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.fy-row { display: flex; gap: 16px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.fy-row:last-child { border-bottom: 0; }
.fy-main { flex: 1; min-width: 0; }
.fy-title { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.fy-meta { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.fy-act { display: flex; gap: 8px; flex: none; }
.fy-act a.btn { text-decoration: none; }
.fy-empty p { margin: 0; color: var(--muted); }

main { padding: 28px 36px 64px; max-width: 1280px; width: 100%; min-width: 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
h1 { font-family: var(--f-display); font-weight: 500; font-size: 36px; line-height: 1.1; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
h2 { font-family: var(--f-display); font-weight: 500; font-size: 25px; letter-spacing: -0.01em; margin: 32px 0 12px; text-wrap: balance; }
h3 { font-family: var(--f-display); font-weight: 600; font-size: 20px; margin: 0 0 8px; }
.lede { color: var(--ink-2); margin: 6px 0 0; max-width: 70ch; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }

/* Controls */
.btn { border: 1px solid var(--palm); background: var(--palm); color: var(--on-palm); border-radius: 999px; min-height: 42px; padding: 8px 18px; cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--palm); filter: none; }
.btn.warn { background: var(--coral); border-color: var(--coral); }
.btn.good { background: var(--ok); border-color: var(--ok); }
.btn:disabled { opacity: .45; cursor: default; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field > span { font-size: 13px; color: var(--ink-2); font-weight: 500; }
input:not([type]), input[type=search], input[type=text], input[type=email], input[type=number], input[type=date], input[type=url], select, textarea {
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 9px 12px; width: 100%; min-height: 42px;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks label { display: flex; gap: 6px; align-items: center; font-size: 14px; }

/* Panels and tables */
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 20px; }
table { border-collapse: collapse; width: 100%; background: var(--surface); }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; font-size: 14px; }
th { font-weight: 600; color: var(--ink-2); font-size: 13px; background: var(--sunk); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tablewrap { border: 1px solid var(--rule); border-radius: var(--r-md); overflow: auto; }
.tablewrap table tr:last-child td { border-bottom: 0; }
.good { color: var(--ok); } .near { color: var(--warn); } .bad { color: var(--coral); font-weight: 600; }
.tag { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 500; background: var(--sunk); color: var(--ink-2); white-space: nowrap; }
.tag.live { background: var(--ok-bg); color: var(--ok); }
.tag.draft, .tag.planned { background: var(--sunk); }
.tag.paused { background: var(--mustard-tint); color: var(--warn); }
.tag.parked { background: var(--sunk); color: var(--ink-3); }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--surface); }
.kpi { padding: 14px 16px; border-right: 1px solid var(--rule); }
.kpi:last-child { border-right: 0; }
.kpi b { display: block; font-family: var(--display); font-size: 26px; font-weight: 500; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 13px; color: var(--ink-2); }
.kpi em { font-style: normal; font-size: 12px; display: block; }

/* Issues */
.issues { display: flex; flex-direction: column; gap: 10px; }
.issue { background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--ink-3); border-radius: var(--r-sm); padding: 12px 16px; display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; }
.issue.high { border-left-color: var(--coral); }
.issue.medium { border-left-color: var(--mustard); }
.issue h4 { margin: 0; font-size: 15px; font-weight: 600; }
.issue p { margin: 0; font-size: 14px; color: var(--ink-2); grid-column: 1; }
.issue p.fix { color: var(--ink); }
.issue .where { grid-row: 1; grid-column: 2; font-size: 13px; color: var(--ink-2); text-align: right; }

/* Calendar */
.cal-head { display: flex; align-items: center; gap: 12px; }
.cal-head h1 { min-width: 260px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink-2); margin: 4px 0 14px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); background: var(--surface); }
.cal .dow { font-size: 12px; color: var(--ink-2); padding: 6px 8px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--sunk); }
.day { min-height: 128px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 6px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.day.out { background: var(--tint); }
.day.out .dnum { color: var(--ink-3); }
.day.today .dnum { background: var(--palm); color: var(--on-palm); border-radius: 10px; padding: 0 7px; }
.dnum { font-family: var(--display); font-size: 14px; align-self: flex-start; }
.day .add { position: absolute; top: 4px; right: 4px; border: 0; background: none; color: var(--ink-3); font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 6px; opacity: 0; }
.day:hover .add, .day .add:focus-visible { opacity: 1; }
.chip { text-align: left; border: 0; border-left: 3px solid var(--ink-3); background: var(--sunk); border-radius: 3px; padding: 4px 6px; font-size: 12px; line-height: 1.3; cursor: pointer; width: 100%; }
.chip .t { display: flex; gap: 5px; align-items: flex-start; font-weight: 600; }
.chip svg { flex: none; margin-top: 1px; }
.chip .shoot { display: block; color: var(--warn); margin-top: 2px; font-weight: 400; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.chip.media_needed, .chip.brief { background: var(--mustard-tint); border-left-color: var(--mustard); }
.chip.media_in, .chip.draft { background: var(--sunk); border-left-color: var(--ink-2); }
.chip.pending_approval { background: var(--pool-tint); border-left-color: var(--pool); }
.chip.approved, .chip.scheduled { background: var(--ok-bg); border-left-color: var(--ok); }
.chip.published { background: var(--tint); border-left-color: var(--rule); color: var(--ink-2); }
.chip.rejected { background: var(--coral-tint); border-left-color: var(--coral); }
.chip.late { box-shadow: inset 0 0 0 1px var(--coral); }

/* Shoot list */
.tasks { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.task { background: var(--surface); border: 1px solid var(--rule); border-top: 4px solid var(--mustard); border-radius: var(--r-md); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.task .kind { display: flex; gap: 8px; align-items: center; font-family: var(--display); font-size: 18px; }
.task .meta { font-size: 13px; color: var(--ink-2); }
.task pre, .brief { white-space: pre-wrap; font: 14px/1.5 var(--text); margin: 0; color: var(--ink); }
.shots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.shots label { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.shots input { margin-top: 3px; }
.late-note { color: var(--coral); font-weight: 600; }

/* Drawer */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-deep); overflow: auto; padding: 24px 28px 48px; z-index: 20; }
.drawer .close { position: absolute; top: 14px; right: 16px; border: 0; background: none; font-size: 24px; cursor: pointer; color: var(--ink-2); }
.voice { font-size: 13px; margin-top: 4px; }
.voice.ok { color: var(--ok); } .voice.bad { color: var(--coral); }
.assets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.assets a { display: block; aspect-ratio: 1; background: var(--sunk); border-radius: var(--r-sm); overflow: hidden; font-size: 12px; color: var(--ink-2); text-decoration: none; }
.assets img, .assets video { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Plan */
.plan { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.plan .panel ul { margin: 6px 0 0; padding-left: 18px; }
.adcopy { white-space: pre-wrap; background: var(--sunk); border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 10px 12px; font-size: 14px; margin: 6px 0; }
.link { font-size: 12px; word-break: break-all; color: var(--ink-2); }
.warnbox { background: var(--mustard-tint); border-radius: var(--r-sm); padding: 10px 14px; font-size: 14px; margin: 12px 0; }
.errbox { background: var(--coral-tint); border-radius: var(--r-sm); padding: 10px 14px; font-size: 14px; margin: 12px 0; }

/* Charts */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding: 8px 0 0; border-bottom: 1px solid var(--rule); }
.bars div { flex: 1; background: var(--pool); border-radius: 2px 2px 0 0; min-height: 2px; position: relative; }
.bars div span { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--ink-2); }
.bar-labels { display: flex; gap: 6px; font-size: 11px; color: var(--ink-2); margin-top: 4px; }
.bar-labels span { flex: 1; text-align: center; }

/* Sign in */
.signin { max-width: 420px; margin: 12vh auto; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 32px; }
.signin h1 { font-size: 28px; margin-bottom: 4px; }
.signin { max-width: 520px; }
.signin h3 { font-size: 18px; margin: 18px 0 8px; }
.signin .or { font-size: 18px; color: var(--muted); margin: 22px 0 0; }
.qrbox { display: grid; grid-template-columns: 168px 1fr; gap: 18px; align-items: center; margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); }
.qrbox h2 { margin: 0 0 6px; font-size: 21px; }
.qrbox ol { margin: 0 0 6px; padding-left: 18px; }
.qr { width: 168px; aspect-ratio: 1; background: #fff; border-radius: 12px; padding: 6px; }
.qr svg { width: 100%; height: 100%; display: block; }
.qr svg rect[fill="white"], .qr svg rect[fill="#ffffff"] { fill: #fff; }
.qr svg path, .qr svg rect:not([fill="white"]) { fill: #252525; }
@media (max-width: 560px) { .qrbox { display: none; } .signin .or { display: none; } }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 20px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; }
.toast.show { opacity: 1; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  /* phone: one compact bar that stays on top; the menu is a single swipeable row */
  .rail { position: sticky; top: 0; z-index: 20; height: auto; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 10px 12px 8px; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .brand { grid-row: 1; grid-column: 1; font-size: 20px; align-self: center; padding: 0; }
  .brand small { display: none; }
  .rail-foot { grid-row: 1; grid-column: 2; margin: 0; padding: 0; border: 0; align-self: center; flex-direction: row; }
  .rail-foot .who, .rail-foot a { display: none; }
  .nav { grid-row: 2; grid-column: 1 / -1; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px; min-width: 0; gap: 2px; }
  .navgroup { flex-direction: row; gap: 2px; }
  .navlabel { display: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; flex: 0 0 auto; padding: 7px 11px; gap: 6px; }
  .topbar { position: static; padding: 10px 16px; flex-wrap: wrap; }
  .search { flex: 1 1 100%; max-width: none; }
  .viewas span { display: none; }
  .fy-row { flex-wrap: wrap; }
  .fy-act { width: 100%; }
  .fy-act .btn { flex: 1; }
  main { min-width: 0; }
  html, body { overflow-x: hidden; }
  main { padding: 20px 16px 48px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi { border-bottom: 1px solid var(--rule); }
  .grid2, .grid3, .plan { grid-template-columns: 1fr; }
  .cal { display: block; border: 0; }
  .cal .dow, .day.out:not(.has) { display: none; }
  .day { min-height: 0; border: 1px solid var(--rule); margin-bottom: -1px; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
.head .row select { width: auto; min-width: 220px; }
.chip.in_qc { background: var(--pool-tint); border-left-color: var(--pool); border-left-style: dashed; }
.chip.qc_failed { background: var(--coral-tint); border-left-color: var(--coral); }
.decision h2 { font-size: 22px; }
.decision ul { margin: 6px 0 0; padding-left: 18px; }
.btn.good, .btn.warn { color: var(--paper); }
/* ad studio */
.sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.setcard { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; }
.setcard:hover, .setcard:focus-visible { border-color: var(--ink); }
.setcard .thumbs { display: flex; gap: 8px; align-items: flex-end; height: 150px; }
.setcard .thumbs canvas { height: 100%; width: auto; max-width: 40%; background: #EBE5CD; border-radius: 3px; }
.setmeta { display: flex; flex-direction: column; gap: 4px; }
.drawer.wide { width: min(1120px, 100vw); }
.studio { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 24px; align-items: start; }
.previews { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.previews figure { margin: 0; width: 220px; }
.previews canvas { width: 100%; display: block; background: #EBE5CD; box-shadow: 0 1px 4px rgba(20,40,59,.15); }
.previews figcaption { margin-top: 6px; color: var(--ink-2); }
.pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pick button { padding: 0; border: 2px solid transparent; border-radius: 4px; background: none; cursor: pointer; aspect-ratio: 4/3; overflow: hidden; }
.pick button[aria-pressed="true"] { border-color: var(--palm); }
.pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.lib figure { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); overflow: hidden; }
.lib img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.lib figcaption { padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.focal { position: relative; cursor: crosshair; margin-bottom: 6px; }
.focal img { width: 100%; display: block; }
.focal .dot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; border: 2px solid #fff; background: var(--palm); box-shadow: 0 0 0 1px rgba(0,0,0,.3); pointer-events: none; }
.reviewbar { display: none; }
@media (max-width: 860px) {
  .studio { grid-template-columns: 1fr; } .previews figure { width: 46%; }
  /* phone review: see the ads first, Approve / Reject stay at the bottom of the screen */
  .studio.review .previews { order: -1; }
  .reviewbar { display: flex; gap: 10px; position: sticky; bottom: -48px; margin: 16px -28px -48px; padding: 12px 28px 16px; background: var(--surface); border-top: 1px solid var(--rule); z-index: 2; }
  .reviewbar .btn { flex: 1; }
}
.mchip { text-align: left; border: 0; border-radius: 3px; padding: 2px 6px; font-size: 11px; line-height: 1.3; cursor: pointer; width: 100%; font-weight: 600; }
.mchip.sell { background: var(--palm); color: var(--on-palm); }
.mchip.connect { background: var(--sun); color: var(--on-sun); }
.mchip.respect { background: var(--brass-soft); color: var(--ink); }
.mchip.quiet { background: var(--ink); color: var(--paper); }
.warn { color: var(--warn); }
.scenes { list-style: decimal; padding-left: 22px; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.scenes li { display: flex; gap: 6px; align-items: center; }
.scenes img { width: 54px; height: 40px; object-fit: cover; border-radius: 3px; flex: none; }
.scenes input { flex: 1; min-width: 0; }
.scenes .btn { padding: 4px 9px; }
.previews figure.vid { width: 300px; }
[hidden] { display: none !important; }
.pick button { position: relative; }
.clipmark { position: absolute; left: 4px; bottom: 4px; background: rgba(37,37,37,.75); color: #fff; font-size: 11px; padding: 1px 5px; border-radius: 3px; }
.scenes li { position: relative; }
.clipmark.sm { left: 26px; bottom: auto; top: 12px; font-size: 9px; padding: 0 3px; }
.lib video { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: var(--ink); }
.pick { max-height: 300px; overflow: auto; }
.strip { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; background: var(--tint); border-radius: var(--r-sm); font-size: 12.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.chip-t { display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
.strip select { font-size: 12.5px; padding: 4px 6px; }
.strip input[type="text"] { font-size: 12.5px; padding: 6px 8px; width: 100%; box-sizing: border-box; }
.strip input[hidden] { display: none; }
.strip .seg button { font-size: 12px; padding: 3px 9px; }
.strip .seg button { border-color: var(--rule); color: var(--ink); }
.strip .seg button[aria-pressed="true"] { background: var(--palm); color: var(--on-palm); border-color: var(--palm); }

/* ad set comments (owner, 2 Nov 2026) */
.thread h3 { margin: 4px 0 8px; font-size: 18px; }
.notes { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.note { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.note p { margin: 0; } .note p + p { margin-top: 2px; white-space: pre-wrap; }
.note.by-owner, .note.by-marketing { border-left-color: var(--palm); }
.note.by-brand { border-left-color: var(--warn); }
.note.by-designer { border-left-color: var(--ok); }
.field.comment { margin: 16px 0 8px; }

/* suggested budget split */
.split { margin-bottom: 16px; }
.splitsum { text-align: right; display: flex; flex-direction: column; }
.splitsum b { font-family: var(--f-display); font-size: 32px; font-weight: 500; line-height: 1; }
.splitsum span { font-size: 13px; color: var(--muted); }
.splitset summary { cursor: pointer; }
.splitset input, .splitset select { min-width: 110px; }
.split td.num { white-space: nowrap; }

/* screening (Meta chats and lead forms) */
.tabs { margin: 4px 0 16px; }
tr.tap { cursor: pointer; }
tr.tap:hover td { background: var(--surface-2, rgba(0,0,0,.03)); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 12px 0 18px; }
.facts dt { color: var(--muted, #6b6b6b); font-size: 13px; }
.facts dd { margin: 0; }

/* Email studio */
.es-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 620px); gap: 24px; align-items: start; }
.es-preview { position: sticky; top: 16px; }
.es-preview iframe { width: 100%; height: calc(100vh - 140px); min-height: 520px; border: 1px solid var(--rule); border-radius: var(--r-md); background: #F5F6FA; }
.es-count { background: var(--sunk); border-radius: 12px; padding: 10px 12px; }
@media (max-width: 1100px) { .es-grid { grid-template-columns: 1fr; } .es-preview { position: static; } .es-preview iframe { height: 640px; } }

/* Channels (command centre, 4 Nov 2026) */
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.ch.off { opacity: .72; }
.ch.err { border-color: var(--coral); }
.ch-k { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); margin-top: 12px; }
.ch-k .kpi b { font-size: 20px; }
.sw { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.sw input { opacity: 0; width: 0; height: 0; }
.sw i { position: absolute; inset: 0; border-radius: 999px; background: var(--rule); transition: background .15s; }
.sw i::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; border-radius: 50%; background: var(--surface); transition: transform .15s; }
.sw input:checked + i { background: var(--ok); }
.sw input:checked + i::before { transform: translateX(18px); }
.sw input:disabled + i { opacity: .45; cursor: not-allowed; }
.sw input:focus-visible + i { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (max-width: 720px) { .ch-grid { grid-template-columns: 1fr; } }

/* Pipeline (owner, 8 Nov 2026): leads by stage and channel, efficiency, one channel's leads */
.pp-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; flex: none; }
h1 .pp-sw { width: 16px; height: 16px; border-radius: 4px; vertical-align: 2px; }
.pp-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--rule); margin: 4px 0 16px; }
.pp-tabs a { color: var(--ink-2); text-decoration: none; padding: 10px 0; font-weight: 500; }
.pp-tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom: 2px solid var(--palm); margin-bottom: -1px; }
.pp-chips { flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 20px; }
.pp-chips > span { margin-right: 6px; }
.pp-chips button { min-height: 36px; display: inline-flex; align-items: center; }
.pp-chips button .pp-sw { margin-right: 6px; }
.pp-kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.pp-bars { display: flex; flex-direction: column; gap: 12px; }
.pp-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 44px; gap: 16px; align-items: center; }
.pp-label { font-size: 14px; font-weight: 500; }
.pp-row.lost .pp-label, .pp-row.lost .pp-n { color: var(--coral); }
.pp-track { display: flex; height: 22px; background: var(--sunk); border-radius: 6px; overflow: hidden; margin-bottom: 3px; }
.pp-track span { display: block; height: 100%; }
.pp-track span + span { border-left: 2px solid var(--surface); }
.pp-n { font-family: var(--f-display); font-weight: 500; font-size: 20px; text-align: right; font-variant-numeric: lining-nums tabular-nums; }
.pp-rule { border: 0; border-top: 1px solid var(--rule); margin: 2px 0; width: 100%; }
tr.pp-few td, tr.pp-few th { color: var(--ink-2); }
tr.pp-dim { opacity: .5; }
tr.pp-sel td, tr.pp-sel th { background: color-mix(in oklch, var(--palm) 8%, var(--surface)); }
.pp-t tbody th { background: var(--surface); font-weight: 500; text-align: left; white-space: nowrap; }
.pp-t tbody th .small { white-space: normal; }
.pp-t tbody tr.pp-total td, .pp-t tbody tr.pp-total th { background: var(--sunk); font-weight: 600; }
.pp-t tbody tr.pp-sel th, .pp-t tbody tr.pp-sel td { background: color-mix(in srgb, var(--palm) 8%, var(--surface)); }
.pp-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.pp-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: var(--r-sm); }
.pp-card a { font-weight: 600; font-size: 14px; }
.pp-target-set { margin: -4px 0 16px; }
.pp-target-set form { gap: 10px; }
.pp-baht { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 0 8px; min-height: 40px; }
.pp-baht input { width: 96px; border: 0; background: transparent; font-weight: 600; font-variant-numeric: tabular-nums; padding: 6px 2px; }
.pp-rate { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 8px; white-space: nowrap; }
.pp-rate.pp-up { background: var(--ok-bg); }
.pp-rate.pp-down { background: var(--fix-bg); }
.pp-rate.pp-few { color: var(--ink-2); }
.pp-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 24px; align-items: start; }
.pp-plot { position: relative; height: 280px; margin: 8px 8px 30px 8px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pp-target { position: absolute; top: 0; bottom: 0; border-left: 1.5px dashed var(--ink-2); }
.pp-target span { position: absolute; bottom: -24px; transform: translateX(-50%); font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.pp-q { position: absolute; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.pp-q.tl { left: 8px; top: 6px; color: var(--ok); } .pp-q.tr { right: 8px; top: 6px; color: var(--warn); }
.pp-q.bl { left: 8px; bottom: 8px; } .pp-q.br { right: 8px; bottom: 8px; color: var(--coral); }
.pp-pt { position: absolute; transform: translate(-9px, 50%); display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pp-pt i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--ink); }
.pp-pt.pp-dim { opacity: .3; }
.pp-pt.flip { flex-direction: row-reverse; transform: translate(calc(-100% + 9px), 50%); }
.pp-heads { display: flex; flex-direction: column; gap: 18px; }
.pp-head { display: flex; flex-direction: column; gap: 6px; }
.pp-budget { position: relative; height: 10px; border-radius: 5px; background: var(--sunk); }
.pp-budget span { position: absolute; left: 0; top: 0; height: 100%; border-radius: 5px; background: color-mix(in srgb, var(--palm) 30%, var(--surface)); }
.pp-budget span.spent { background: var(--palm); }
.pp-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 14px; align-items: end; }
.pp-cols > div { display: flex; flex-direction: column; gap: 4px; }
.pp-cols b { font-family: var(--f-display); font-weight: 500; font-size: 22px; font-variant-numeric: lining-nums tabular-nums; }
.pp-col { height: 110px; display: flex; align-items: flex-end; background: var(--sunk); border-radius: 8px; overflow: hidden; }
.pp-col span { display: block; width: 100%; }
.pp-line { margin: 16px 0 0; gap: 12px; flex-wrap: wrap; }
@media (max-width: 720px) { .pp-row { grid-template-columns: 90px minmax(0, 1fr) 36px; gap: 10px; } .pp-two { grid-template-columns: 1fr; } .pp-q { display: none; } }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pp-t td.bad { color: var(--coral); } .pp-t td.good { color: var(--ok); font-weight: 600; }
