/* Social Planner: the calendar and its queue, the funnel against its plan, the weekly slate and its
   production plan, the post editor's hand-off steps, Performance and the accounts' weekly slots. Cards,
   chips, panels, tabs, tables and modals are app.css's; only the planner's own shapes live here. */
.sp { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.spbody { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; }
.sprange { font-size: 15px; margin-left: 4px; }
.sppad { padding: 14px; }

/* ---- the calendar: queue on the left, the grid beside it ---- */
.spcal { flex: 1; min-height: 0; display: grid; grid-template-columns: 236px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.spqueue { border-right: 1px solid var(--border); background: var(--paper-warm); overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.sphd { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding-bottom: 2px; }
.sphd b { flex: 1; font-weight: 600; }
.spq { flex-direction: row; align-items: flex-start; gap: 9px; padding: 7px; cursor: grab; }
.spq > .col { gap: 5px; min-width: 0; flex: 1; }
.spq .ttl { font-size: 13px; }
.spthumb { flex: none; width: 40px; aspect-ratio: 9 / 16; border-radius: 3px; background: var(--sunken) center / cover no-repeat; display: grid; place-items: center; color: var(--text-3); }
.sphead .spthumb { width: 46px; }
.spgrid { overflow: auto; padding: 14px 18px 18px; min-height: 0; display: flex; flex-direction: column; }

.spweek { display: grid; grid-template-columns: repeat(7, minmax(104px, 1fr)); gap: 8px; align-items: stretch; flex: 1 0 auto; }
.spday { background: var(--sunken); border-radius: 6px; padding: 6px; display: flex; flex-direction: column; gap: 6px; min-height: 260px; min-width: 0; }
.spday.today { box-shadow: inset 0 2px 0 var(--ink); }
.spdayhd { display: flex; align-items: baseline; gap: 6px; padding: 2px 4px 4px; }
.spdayhd b { font: 600 16px/1 var(--font-head); }
.spdayhd .count { margin-left: auto; }
.spslot { justify-content: flex-start; gap: 6px; width: 100%; min-height: 28px; padding: 4px 7px; background: transparent; border: 1px dashed var(--border-strong);
  color: var(--text-2); font-size: 12px; font-weight: 500; }
.spslot:hover { background: var(--panel); color: var(--text); }
.sph { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.spslot .sph { color: var(--text-3); font-weight: 400; }
.spslot.over, .spday.over, .spmday.over { background: var(--panel); box-shadow: 0 0 0 2px var(--accent); }
.sppost { padding: 7px 8px; gap: 5px; }
.sppost .ttl { font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sppost .meta { gap: 5px; flex-wrap: nowrap; }
.sppost.live { background: var(--paper-warm); }
.sppost.clash, .spchip.clash { box-shadow: inset 2px 0 0 var(--alert); }
.spclash { display: flex; align-items: center; gap: 4px; font: 500 11px/1 var(--font-mono); color: var(--alert); }
.spviews { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; font: 500 11px/1 var(--font-mono); color: var(--text-2); }
/* an empty slot in the next 72 hours is an alert; each account's best slot carries a star */
.spslot.soon, .spslot.soon .sph { border-color: var(--alert); color: var(--alert); }
.spstar { display: inline-flex; color: var(--text); }

/* ---- momentum, above the calendar: a meter per account, then the next 72 hours ---- */
.spguard { flex: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; }
.spmeters { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.spmeter { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 12.5px; }
.spmeter .sph { max-width: 140px; }
.spmeter b { font: 500 12px/1 var(--font-mono); }
.spmeter.low b { color: var(--alert); }
.spcells { display: inline-flex; gap: 2px; }
.spcells i { width: 6px; height: 12px; border-radius: 1px; box-shadow: inset 0 0 0 1px var(--border-strong); }
.spcells i.on { background: var(--ink); box-shadow: none; }
.spsoon { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
.spsoonhd { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--alert); }
.spsoonslot { gap: 5px; border-style: dashed; border-color: var(--alert); color: var(--alert); }

.spmonth { flex: none; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.spmhd { background: var(--panel); padding: 8px; }
.spmday { background: var(--panel); min-height: 112px; padding: 4px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.spmday.out { background: var(--paper-warm); }
.spmday.out .spmnum { color: var(--text-3); }
.spmday.today .spmnum { background: var(--ink); color: var(--paper); }
.spmnum { align-self: flex-start; min-height: 22px; min-width: 24px; padding: 2px 6px; font: 600 12px/1 var(--font-mono); color: var(--text); }
.spchip { justify-content: flex-start; gap: 4px; width: 100%; min-height: 22px; padding: 2px 4px; border: 0; background: var(--sunken); font-size: 11.5px; font-weight: 400; }
.spchip .chip { padding: 0; background: none; }
/* a chip clips its own overflow, so in a tight row it would shrink to nothing: icons keep their size */
.spchip .chip, .spstage .chip, .sppost .top1 .chip, .spentry .top1 .chip { flex: none; }
.spchip .spt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---- booking and the post editor ---- */
.spcopy { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: 6px; }
.spcopy input, .spcopy textarea { width: 100%; }
.spfree { gap: 5px; }
.spfree.best { border-color: var(--ink); }
.spsteps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.spstep { display: flex; gap: 10px; align-items: flex-start; }
.spnum { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 600 11px/1 var(--font-mono); background: var(--ink); color: var(--paper); }
.spmetrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.spm { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; border-radius: var(--radius); background: var(--sunken); }
.spm b { font-size: 15px; }

/* ---- Performance ---- */
.spstats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.spbarcell { width: 28%; }
.spbar { display: block; height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.spbar span { display: block; height: 100%; background: var(--text-2); }
.spnote { border-top: 1px solid var(--border); }

/* ---- accounts and their weekly slots ---- */
.spslots { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.spsday { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }
.spsday .chip { gap: 2px; padding-right: 2px; }
.spadd { display: flex; gap: 2px; }
.spadd input { padding: 3px 4px; font-size: 12px; width: 88px; }
.sptarget { gap: 6px; margin-bottom: 12px; }
.sptarget input { width: 64px; }
.sptight { gap: 3px; }
.spacct > .hd { flex-wrap: wrap; }
.spconnect, .spramp { margin-bottom: 12px; }
.spramp { gap: 8px; }

/* ---- direct publishing forms: TikTok's and YouTube's own fields ---- */
.spdirect { flex-wrap: wrap; }
.spform { gap: 10px; color: var(--text); }
.spfield { gap: 10px; }
.spfield .label { min-width: 104px; }
.spform select { max-width: 320px; }
.sptoggle { align-items: flex-start; }
.sptoggle input { margin-top: 2px; }
.spdisclose { padding-left: 23px; }
.sppreview { flex: none; width: 112px; aspect-ratio: 9 / 16; border-radius: var(--radius); background: var(--ink); object-fit: contain; }

/* ---- trial reels: under their feed post in the Posts tab, and side by side in Performance ---- */
.sptrialrow { padding-left: 34px; background: var(--paper-warm); }
.sptrial + .sptrial { border-top: 1px solid var(--border); }
.sptrialhd { padding: 12px 14px 4px; }
tr.splead td { background: var(--paper-warm); }

/* ---- the funnel: a week's mix against its plan, in the guard, under each month week and on the slate ---- */
.spmixes { gap: 6px; }
.spguard .spmixes { padding-top: 8px; border-top: 1px solid var(--border); }
.spmix { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 12.5px; min-width: 0; }
.spmix .sph { width: 170px; font-weight: 500; }
.spstage { display: inline-flex; align-items: center; gap: 5px; font: 500 12px/1 var(--font-mono); color: var(--text-2); }
.spstage .chip { padding: 2px 3px; }
.spstage.short { color: var(--alert); }
.spmweek { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 24px; padding: 6px 8px; background: var(--paper-warm); }
.spmweek .spmix { gap: 4px 10px; font-size: 11.5px; }
.spmweek .spmix .sph { width: auto; max-width: 150px; }

/* ---- the weekly slate: one card per piece, the production plan under it ---- */
.spslate { width: 100%; min-width: 0; }
.spslate .pagehd .titles { flex: 1 1 420px; }
.spslatewk { overflow-x: auto; min-width: 0; }
.spentry { padding: 7px 8px; gap: 5px; cursor: pointer; }
.spentry .ttl { font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.spentry .meta { gap: 6px; flex-wrap: wrap; }
.spentry .meta .small { display: inline-flex; align-items: center; gap: 3px; }
.spentry.booked { background: var(--paper-warm); }
.spentry.picked, .spentry.over { box-shadow: 0 0 0 2px var(--accent); }
.spnotes .col span { color: var(--text-2); }
.spprodfmts { gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.spprodfmt { gap: 8px; }
.spprodfmt input { width: 64px; }
.spprodfmt select { width: auto; }
.spprodday { gap: 6px; }
.spprodrow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 6px 0 6px 2px; font-size: 13px; }
.sptask { flex: 1 1 320px; min-width: 0; }
.spwho { gap: 5px; color: var(--text-2); }

@media (max-width: 820px) {
  .spcal { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .spmix .sph { width: calc(100% - 28px); }   /* the logo and its handle on one line, the stages under them */
  .spqueue { border-right: 0; border-bottom: 1px solid var(--border); flex-direction: row; overflow-x: auto; }
  .spq { min-width: 220px; }
  .spweek { grid-template-columns: repeat(7, 200px); }
  .spstats, .spmetrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spslots { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .spslots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
