/* Social — same visual system as Planner (sf-callsheet): dark-only, system font,
   panel surfaces, 12px cards, pill chips. Tokens copied verbatim from app.css there. */
:root {
  --bg: #0d0f12;
  --panel: #14171c;
  --panel2: #1a1e25;
  --border: #262b33;
  --text: #e8eaed;
  --muted: #8b929e;
  --accent: #6a8ff5;
  --ok: #48a179;
  --bad: #e8646a;
  --warn: #f1a55b;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
}
button { font: inherit; color: inherit; background: var(--panel2); border: 1px solid var(--border); border-radius: 7px; padding: 5px 11px; cursor: pointer; }
button:hover { border-color: #3a4250; }
button:disabled { opacity: .45; cursor: default; }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- chrome ---- */
header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 22px;
  background: rgba(13, 15, 18, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
/* the app switcher doubles as the wordmark: the active app names the product */
.appswitch { display: flex; }
.apppick { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; border: 1px solid transparent; background: transparent; padding: 5px 8px 5px 10px; border-radius: 9px; }
.apppick:hover { background: var(--panel2); border-color: var(--border); }
.apppick .appname { font-weight: 700; letter-spacing: .2px; color: var(--text); }
.apppick .appswap { display: inline-flex; color: var(--muted); }
.apppick:hover .appswap { color: var(--accent); }
.apppick .appswap svg { width: 15px; height: 15px; display: block; }
#btnPerf svg { width: 14px; height: 14px; display: block; }
.viewtoggle { display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--border); border-radius: 9px; padding: 2px; }
header nav + nav { margin-left: 2px; } /* Insights sits as its own pill group */
.viewtoggle button { border: none; background: transparent; color: var(--muted); border-radius: 7px; padding: 5px 13px; display: flex; align-items: center; gap: 7px; }
.viewtoggle button.active { background: var(--panel2); color: var(--text); }
.tabbadge { min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #0d0f12; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.tabbadge.warn { background: var(--warn); } /* empty slots read as a gap to fill, not a queue */
.tabbadge.ok { background: var(--ok); color: #08130d; }
.spacer { flex: 1; }
.synced { color: var(--muted); font-size: 12px; white-space: nowrap; }
.iconbtn { padding: 5px 9px; border-radius: 8px; }
#userchip { display: flex; align-items: center; gap: 7px; padding: 3px 10px 3px 4px; border-radius: 999px; }
#userchip img { width: 24px; height: 24px; border-radius: 50%; }

main { padding: 20px 22px 80px; max-width: 1500px; margin: 0 auto; }

/* ---- shared bits ---- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; color: var(--muted); background: var(--panel); white-space: nowrap; }
.chip .cdot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.plat { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0 5px; border-radius: 999px; font-size: 11px; font-weight: 600; border: 1px solid var(--border); background: var(--panel2); }
.plat svg { width: 14px; height: 14px; display: block; }
.plat:not(:has(svg)) { width: auto; } /* unknown platform falls back to its name */
.plat.ig { color: #ec6fa8; } .plat.tt { color: #7fd8de; } .plat.yt { color: #f07d7d; }
.plat.li { color: #7ab2e8; } .plat.x { color: var(--text); } .plat.tr { color: var(--warn); }
.emptymsg { border: 1px dashed var(--border); border-radius: 12px; padding: 40px 20px; text-align: center; color: var(--muted); }
.bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.bar input[type=search] { flex: 1; min-width: 170px; }
.bar .count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.fbtn { white-space: nowrap; }
.fbtn.on { border-color: var(--accent); color: var(--accent); background: rgba(106,143,245,.08); }
.checkmenu { min-width: 190px; max-height: 340px; display: flex; flex-direction: column; }
.ckhead { display: flex; gap: 4px; padding-bottom: 5px; margin-bottom: 3px; border-bottom: 1px solid var(--border); }
.ckbtn { flex: 1; font-size: 11px; padding: 3px 8px; border-radius: 7px; color: var(--muted); }
.ckbtn:hover { color: var(--accent); border-color: var(--accent); }
.ckbody { overflow: auto; }
.checkrow { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.checkrow:hover { background: var(--panel); }
.checkrow input { accent-color: var(--accent); margin: 0; }
.seg { display: inline-flex; gap: 2px; background: var(--panel); border: 1px solid var(--border); border-radius: 9px; padding: 2px; }
.seg button { border: none; background: transparent; color: var(--muted); border-radius: 7px; padding: 4px 11px; font-size: 13px; white-space: nowrap; }
.seg button.active { background: var(--panel2); color: var(--text); }

#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--panel2); border: 1px solid var(--border); border-left: 3px solid var(--ok); border-radius: 9px; padding: 9px 14px; max-width: 340px; box-shadow: 0 8px 30px rgba(0,0,0,.5); animation: pop .18s ease; }
.toast.err { border-left-color: var(--bad); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

.ovl { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--panel2); border: 1px solid var(--border); border-radius: 14px; width: min(520px, 94vw); max-height: 90vh; overflow: auto; padding: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.modal.wide { width: min(1120px, 94vw); }
.modal h3 { margin: 0 0 4px; font-size: 16px; }
.modal .sub { color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.mbtns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ---- sign-in ---- */
.signin { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 16px; }
.signin .logo { font-size: 22px; font-weight: 700; display: flex; gap: 10px; align-items: center; }
.signinbtn { border-color: var(--accent); color: var(--accent); background: rgba(106,143,245,.08); padding: 9px 22px; border-radius: 9px; font-weight: 600; }
.signin .note { color: var(--muted); font-size: 12px; }

/* ---- captioner ---- */
.capwrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.captop { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; min-height: 28px; }
.stack { position: relative; width: min(430px, 94vw); }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; box-shadow: 0 14px 44px rgba(0,0,0,.45);
  touch-action: pan-y;
  display: flex; flex-direction: column;
}
.card.peek { position: absolute; inset: 0; transform: scale(.955) translateY(12px); opacity: .55; pointer-events: none; z-index: 0; }
.card.top { position: relative; z-index: 1; transition: transform .16s ease; }
.card.top.dragging { transition: none; }
.card.swipe-right { animation: swr .32s ease forwards; }
.card.swipe-left { animation: swl .32s ease forwards; }
@keyframes swr { to { transform: translateX(130%) rotate(10deg); opacity: 0; } }
@keyframes swl { to { transform: translateX(-130%) rotate(-10deg); opacity: 0; } }
/* A true 9:16 box that fills the card width. The old `max-height:56vh` clamped height
   without re-deriving width, so `object-fit:contain` pillarboxed the video and the wrapper
   (which applySize()/the drag-clamp measure) was ~68px wider than the real video — the title
   overlay came out oversized and sitting on the black bars. width:100% + aspect-ratio keeps
   the element box exactly 9:16, so .vidwrap == the rendered video and the overlay maths is right. */
.card video, .novideo { display: block; width: 100%; height: auto; aspect-ratio: 9/16; object-fit: cover; background: #000; }
.novideo { display: flex; align-items: center; justify-content: center; color: var(--muted); background: #101317; }
.cbody { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 9px; }
/* desktop: video beside the fields so the whole card fits without scrolling */
@media (min-width: 920px) {
  .stack { width: min(820px, 94vw); }
  .card { flex-direction: row; }
  .card video, .novideo { width: auto; height: min(66vh, 640px); max-height: none; aspect-ratio: 9/16; object-fit: cover; flex: 0 0 auto; }
  .novideo { width: 240px; }
  .card .vidwrap { flex: 0 0 auto; }
  .cbody { flex: 1; min-width: 0; overflow-y: auto; }
}


/* ---- on-screen title (IG text tool) ---- */
.vidwrap { position: relative; }
.vidwrap.editing video { filter: brightness(.5); }
.aabtn { position: absolute; top: 10px; right: 10px; z-index: 5; width: 34px; height: 34px; padding: 0; border-radius: 50%; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.4); color: #fff; font-weight: 700; font-size: 14px; backdrop-filter: blur(4px); }
.vidwrap.editing .aabtn { display: none; }
.igdone { display: none; position: absolute; top: 10px; right: 10px; z-index: 7; background: rgba(0,0,0,.45); color: #fff; border: 1px solid rgba(255,255,255,.4); font-weight: 700; border-radius: 999px; padding: 6px 14px; backdrop-filter: blur(4px); }
.vidwrap.editing .igdone { display: block; }
/* width is set in JS (92% of the video, IG's text box) — see applySize().
   pointer-events:none on the box means only the text intercepts touches, so the invisible
   92%-wide band never swallows a page scroll and a drag can't start from empty space. */
.titleov { position: absolute; z-index: 4; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
.vidwrap.editing .titleov { z-index: 6; }
.tovtext { display: inline; box-decoration-break: clone; -webkit-box-decoration-break: clone; padding: .12em .38em; border-radius: .32em; line-height: 1.34; white-space: pre-wrap; overflow-wrap: break-word; outline: none; caret-color: #fff; pointer-events: auto; touch-action: none; cursor: grab; user-select: none; }
.tovtext:active { cursor: grabbing; }
.vidwrap.editing .tovtext { cursor: text; user-select: text; }
.igtools { display: none; }
.vidwrap.editing .igtools { display: block; }
.igsize { position: absolute; left: 6px; top: 50%; width: 44px; height: 170px; transform: translateY(-50%); z-index: 6; }
/* touch-action:none: the ancestor .card is pan-y, which would otherwise hand the slider's
   only gesture axis to the page scroller and make the size control undraggable by finger */
.igsize input { position: absolute; width: 170px; height: 40px; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-90deg); margin: 0; accent-color: #fff; touch-action: none; }
.igpanel { position: absolute; left: 0; right: 0; bottom: 10px; z-index: 6; display: flex; flex-direction: column; gap: 9px; align-items: center; }
.igdots { display: flex; gap: 8px; align-items: center; }
.igA { width: 26px; height: 26px; padding: 0; border-radius: 7px; border: 1.5px solid #fff; background: transparent; color: #fff; font-weight: 800; font-size: 13px; margin-right: 2px; }
.igA.solid { background: #fff; color: #000; }
.igA.faded { background: rgba(255,255,255,.55); color: #000; }
/* the painted dot stays 18px (background-clip:content-box) but padding grows the hit area
   to ~40px so it's tappable in a row of nine on a phone */
.igdot { width: 18px; height: 18px; box-sizing: content-box; padding: 11px; margin: -11px; border-radius: 50%; border: 2px solid #fff; background-clip: content-box; box-shadow: 0 0 5px rgba(0,0,0,.45); transition: transform .1s; }
.igdot.sel { transform: scale(1.25); }
.igdots { flex-wrap: wrap; justify-content: center; }
/* touch-action:pan-x lets the font strip scroll horizontally despite the ancestor's pan-y */
.igfonts { display: flex; gap: 6px; overflow-x: auto; max-width: 92%; padding: 2px; touch-action: pan-x; -webkit-overflow-scrolling: touch; }
.igfont { border-radius: 999px; padding: 4px 12px; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.35); color: #fff; font-size: 12px; white-space: nowrap; backdrop-filter: blur(4px); }
.igfont.sel { background: #fff; color: #000; border-color: #fff; }
.cname { font-weight: 650; line-height: 1.3; }
.chip.noplat { border-style: dashed; color: var(--warn); }
.crow { display: flex; gap: 6px; flex-wrap: wrap; }
.cfield label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; text-transform: uppercase; letter-spacing: .4px; }
.cfhead2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cfhright { display: inline-flex; align-items: center; gap: 9px; }
.copyfrom { font-size: 10.5px; padding: 2px 9px; border-radius: 999px; color: var(--muted); background: transparent; }
.copyfrom:hover { color: var(--accent); border-color: var(--accent); }
/* the caption soaks up the spare height so Skip/Submit sit level with the video bottom */
.cfield.grow { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.cfield.grow .cfwrap { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.cfield.grow textarea { flex: 1; resize: none; min-height: 74px; }
/* suggest sits at the end of the box itself */
.cfwrap { position: relative; }
.cfwrap input { width: 100%; padding-right: 98px; }
.cfwrap textarea { width: 100%; padding-bottom: 34px; }
.cfwrap .sparkle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.cfwrap:has(textarea) .sparkle { top: auto; bottom: 8px; transform: none; }
/* AI suggest — a hue of its own, a resting twinkle, a spin+glow while it thinks */
.sparkle { display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 3px 9px 3px 7px; font-size: 11px; font-weight: 650; line-height: 1; color: #d8ccff; border: 1px solid #4a3f7a; border-radius: 999px; background: linear-gradient(135deg, #2b2450, #211b3d); transition: filter .15s, box-shadow .15s, transform .05s; }
.sparkle svg { width: 13px; height: 13px; display: block; animation: sparktwinkle 3.4s ease-in-out infinite; }
.sparkle:hover { filter: brightness(1.28); box-shadow: 0 0 0 3px rgba(124, 92, 255, .16); }
.sparkle:active { filter: brightness(.85); } /* no transform: it's absolutely positioned inside .cfwrap */
.sparkle.loading { pointer-events: none; color: #b7a6ff; animation: sparkglow 1.1s ease-in-out infinite; }
.sparkle.loading svg { animation: sparkspin .8s linear infinite; }
@keyframes sparktwinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .6; transform: scale(.86) rotate(9deg); } }
@keyframes sparkspin { to { transform: rotate(360deg); } }
@keyframes sparkglow { 0%, 100% { box-shadow: 0 0 0 0 rgba(124, 92, 255, 0); } 50% { box-shadow: 0 0 11px 2px rgba(124, 92, 255, .55); } }
/* a recommendation, not a limit — the count colours but never blocks */
.charcount { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.charcount b { font-weight: 700; }
.charcount.ok b { color: #7dd8a2; }
.charcount.warn b { color: var(--warn); }
.charcount.over b { color: #f0888d; }
.charcount .hint { opacity: .75; }
.cfield input, .cfield textarea { width: 100%; }
.cfield textarea { min-height: 74px; resize: vertical; }
.savestate { font-size: 11px; color: var(--muted); min-height: 14px; text-align: right; }
.cbtns { display: flex; gap: 9px; }
.cbtns .skip { flex: 1; color: var(--muted); }
.cbtns .submit { flex: 2; border-color: var(--ok); color: #7dd8a2; background: #1f2a22; font-weight: 650; }
.scriptline {
  font-size: 12px; color: var(--muted); white-space: pre-wrap; cursor: zoom-in;
  max-height: 160px; overflow: auto; line-height: 1.5;
  border-left: 2px solid var(--border); padding-left: 9px;
}
.scriptline:hover { border-left-color: var(--accent); }
.scriptline.expanded { max-height: none; cursor: zoom-out; }
.scripttoggle { align-self: flex-start; font-size: 11px; padding: 3px 10px; border-radius: 999px; color: var(--muted); background: transparent; }
.scripttoggle:hover { color: var(--accent); border-color: var(--accent); }

/* ---- ready grid ---- */
/* min(Npx, 100%) floors the track at the container so a wide card can't overflow a narrow phone */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.vgrid.sm { grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: 10px; }
.vgrid.lg { grid-template-columns: repeat(auto-fill, minmax(min(400px, 100%), 1fr)); gap: 18px; }
.vgrid.sm .vtitle { font-size: 12px; }
.vgrid.sm .vcap, .vgrid.sm .chip { display: none; } /* at this scale the thumbnail is the content */
.vgrid.sm .vbody { padding: 8px 9px 9px; gap: 6px; }
.vgrid.sm .schedbtn { font-size: 11px; padding: 3px 6px; }
.vgrid.lg .vtitle { font-size: 15px; }
.vgrid.lg .vcap { -webkit-line-clamp: 3; }
.vcard { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.vcard:hover { border-color: #3a4250; }
.vtile { position: relative; width: 100%; aspect-ratio: 9/12; background: #101317; border: none; border-radius: 0; padding: 0; cursor: pointer; overflow: hidden; }
.vtile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vtile .playov { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; color: rgba(255,255,255,.85); text-shadow: 0 2px 12px rgba(0,0,0,.7); pointer-events: none; }
.vbody { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.vtitle { font-weight: 650; line-height: 1.3; }
.vcap { color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vfoot { margin-top: auto; display: flex; gap: 8px; align-items: center; }
.schedbtn { border-color: var(--accent); color: var(--accent); background: rgba(106,143,245,.08); font-weight: 600; }
.vfoot .schedbtn, .slots .schedbtn { flex: 1; }

/* ---- slot picker ---- */
.slotdays { display: flex; flex-direction: column; gap: 6px; }
.slotday { display: grid; grid-template-columns: 118px 1fr; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.slotday:last-child { border-bottom: none; }
.slotday .dlabel { font-size: 12.5px; color: var(--muted); }
.slotday .dlabel b { color: var(--text); display: block; }
.slots { display: flex; gap: 7px; }
.slotbtn { flex: 1; font-size: 12.5px; padding: 5px 4px; }
.slotbtn.free:hover { border-color: var(--accent); color: var(--accent); }
.slotbtn.taken { opacity: .4; cursor: default; text-decoration: line-through; }
/* date + time share the top row; "Custom time" is a full-width button below (never cut off) */
.customrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.customrow input { flex: 1 1 40%; min-width: 0; color-scheme: dark; }
.customrow .schedbtn { flex-basis: 100%; }

/* ---- calendar ---- */
.calbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.calnav { display: contents; } /* desktop: week-nav items are direct flex children (mobile regroups) */
.calbar .wklabel { font-weight: 650; min-width: 170px; text-align: center; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); flex-basis: 100%; flex-wrap: wrap; }
.legend .key { display: inline-flex; align-items: center; gap: 5px; }
.legend .sw { width: 9px; height: 9px; border-radius: 3px; }
.rulesbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; font-size: 12px; }
.rulesbar b { font-size: 12px; }
.ruleref { color: var(--muted); }
.ruleref::before { content: '•'; margin-right: 8px; color: var(--border); }
.rulescore { margin-left: auto; font-weight: 650; color: var(--warn); }
.rulescore.ok { color: #7dd8a2; }
.rulebreach { color: #f0888d; font-weight: 600; }
.rulesbar .rulescore + button, .rulesbar .rulebreach + button { margin-left: 0; }
.rulesbar button { font-size: 12px; padding: 3px 10px; }
.fillbtn { margin-left: auto; }
.rulescore ~ .fillbtn { margin-left: 0; }
.rulerow { display: flex; gap: 6px; align-items: center; }
.rulerow select { flex: 0 0 130px; }
.rulerow .rulen { width: 54px; }
.rulerow .fbtn { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* plan review */
.planlist { display: flex; flex-direction: column; margin: 12px 0; max-height: 52vh; overflow: auto; }
.planrow { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-top: 1px solid var(--border); }
.planrow:first-child { border-top: none; }
.pwhen { flex: 0 0 118px; font-size: 12px; color: var(--muted); }
.pwhen b { display: block; color: var(--text); font-size: 12.5px; }
.pmid { flex: 1; min-width: 0; }
.pmid .ptitle { font-size: 13px; font-weight: 600; }
.pmid .psub { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.pwhy { font-size: 11px; color: var(--accent); }
.pdrop { border: none; background: transparent; color: var(--muted); padding: 2px 6px; }
.pdrop:hover { color: var(--bad); background: var(--panel); }
.mbtns .count { margin-right: auto; }
.rules { display: flex; gap: 5px; flex-wrap: wrap; padding: 0 2px 2px; }
.rulechip { font-size: 10px; padding: 1px 7px; border-radius: 999px; border: 1px dashed rgba(241,165,91,.5); color: var(--warn); white-space: nowrap; }
.rulechip.met { border-style: solid; border-color: rgba(72,161,121,.4); color: #7dd8a2; background: rgba(72,161,121,.07); }
.rulechip.missed { border-color: rgba(232,100,106,.4); color: #f0888d; }
.calgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: start; }
@media (max-width: 1100px) { .calgrid { grid-template-columns: repeat(2, 1fr); } }
.daycol { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 9px; display: flex; flex-direction: column; gap: 8px; min-height: 130px; }
.daycol.today { border-color: var(--accent); }
.daycol.past { opacity: .55; }
.dayhead { display: flex; align-items: baseline; gap: 7px; padding: 1px 3px; }
.dayhead b { font-size: 13px; }
.dayhead span { color: var(--muted); font-size: 11.5px; }
.dayhead .n { margin-left: auto; color: var(--muted); font-size: 11px; }
.pcard { border: 1px solid var(--border); border-radius: 9px; background: var(--panel2); padding: 8px 9px; display: flex; flex-direction: column; gap: 5px; cursor: pointer; position: relative; }
.pcard:hover { border-color: #3a4250; }
.pcard .ptime { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.pcard .ptitle { font-size: 12.5px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .prow { display: flex; gap: 4px; flex-wrap: wrap; }
.pcard.unsched { border-style: dashed; border-color: rgba(241,165,91,.55); opacity: .8; }
/* the lifecycle reads as it progresses: grey planned → blue scheduled → green live */
.badge { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; letter-spacing: .3px; white-space: nowrap; }
.badge.planned { background: var(--panel2); color: var(--muted); border: 1px solid var(--border); }
.badge.scheduled { background: rgba(106,143,245,.16); color: var(--accent); }
.badge.posted { background: rgba(72,161,121,.16); color: #7dd8a2; }
.badge.unplanned { background: rgba(241,165,91,.14); color: var(--warn); }
.ptime .overdue { color: var(--bad); font-weight: 650; }
/* day columns are ~130px, so the question takes its own line and the buttons split the row */
.postask { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11px; color: var(--muted); border-top: 1px dashed var(--border); padding-top: 6px; }
.postask .q { flex: 1 0 100%; }
.postask button { font-size: 11px; padding: 2px 10px; border-radius: 999px; flex: 1; white-space: nowrap; }
.postask.compact { flex-wrap: nowrap; }
.postask.compact .q, .postask.compact button { flex: none; }
.postask .yesbtn:hover { border-color: var(--ok); color: #7dd8a2; }
.schedbtn2 { border-color: rgba(106,143,245,.5); color: var(--accent); }
.schedbtn2:hover { background: rgba(106,143,245,.1); border-color: var(--accent); }
.iconseg { font-size: 13px; padding: 4px 9px; line-height: 1.2; }
.linkout { margin-left: auto; font-size: 12px; padding: 0 4px; }
.addlink { font-size: 11px; padding: 3px 9px; border-radius: 999px; border-style: dashed; color: var(--warn); border-color: rgba(241,165,91,.5); background: transparent; text-align: center; }
.addlink:hover { border-color: var(--warn); background: rgba(241,165,91,.08); }
.missing { border: 1px dashed var(--border); border-radius: 9px; padding: 6px 9px; color: var(--muted); font-size: 11.5px; background: transparent; text-align: left; }
.missing:hover { border-color: var(--accent); color: var(--accent); }

/* calendar list view */
.callist { display: flex; flex-direction: column; gap: 10px; }
.lday { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.lday.today { border-color: var(--accent); }
.lday.past { opacity: .55; }
.ldayhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 4px; }
.ldayhead b { font-size: 13.5px; }
.ldate { color: var(--muted); font-size: 12px; }
.ldayhead .n { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.ldayhead .rules { padding: 0; }
.lrow { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-top: 1px solid var(--border); cursor: pointer; border-radius: 7px; }
.lrow:hover { background: var(--panel2); }
.lrow.unsched .ltitle { color: var(--muted); }
.ltime { width: 48px; flex: none; color: var(--muted); font-size: 12px; }
.ltime.overdue { color: var(--bad); font-weight: 650; }
.lrow .badge { flex: none; }
.ltitle { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .crow { flex: none; }
.postask.compact { border-top: none; padding-top: 0; flex: none; }
.postask.compact .q { flex: none; }
.lmissing { display: flex; gap: 8px; padding: 8px 4px 2px; border-top: 1px solid var(--border); }
.lmissing .missing { flex: none; padding: 4px 12px; }

/* menu (⋯) */
.menu { position: fixed; z-index: 80; background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 5px; box-shadow: 0 12px 40px rgba(0,0,0,.55); display: flex; flex-direction: column; min-width: 160px; }
.menu button { border: none; background: transparent; text-align: left; padding: 7px 11px; border-radius: 7px; }
.menu button:hover { background: var(--panel); }
.menu button.danger { color: var(--bad); }

/* ---- post modal: everything needed to put this on a platform ---- */
.postmodal { width: min(880px, 94vw); }
.pmhead { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.pmhead h3 { margin: 0; }
.pmwhen { color: var(--muted); font-size: 12.5px; flex: 1; }
.pmcols { display: flex; gap: 18px; align-items: flex-start; }
@media (max-width: 760px) { .pmcols { flex-direction: column; } .pmvideo { width: 100%; } }
.pmvideo { flex: 0 0 240px; display: flex; flex-direction: column; gap: 8px; }
.pmvideo video { width: 100%; aspect-ratio: 9/16; max-height: 58vh; border-radius: 10px; background: #000; object-fit: cover; }
.liveframe { width: 100%; height: 540px; max-height: 62vh; border: 1px solid var(--border); border-radius: 10px; background: #000; }
.pmvideo .novideo { aspect-ratio: 9/16; border-radius: 10px; font-size: 12px; text-align: center; padding: 0 14px; }
.dlbtn { display: block; text-align: center; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--ok); color: #7dd8a2; background: rgba(72,161,121,.1); font-weight: 650; font-size: 13px; }
.dlbtn:hover { text-decoration: none; background: rgba(72,161,121,.18); }
.shadelink { text-align: center; font-size: 12px; color: var(--muted); }
.pmfields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.pmplats { display: flex; align-items: center; gap: 8px; }
.pmlabel { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.copyfield { border: 1px solid var(--border); border-radius: 9px; background: var(--panel); padding: 8px 10px; }
.copyfield.missing { border-style: dashed; border-color: rgba(241,165,91,.5); }
.cfhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.cfhead label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.cfwarn { font-size: 11px; color: var(--warn); }
.copybtn { font-size: 11px; padding: 2px 10px; border-radius: 999px; }
.copybtn:hover { border-color: var(--accent); color: var(--accent); }
.copybtn.copied { border-color: var(--ok); color: #7dd8a2; background: rgba(72,161,121,.1); }
.cfval { font-size: 13px; line-height: 1.45; white-space: pre-wrap; max-height: 132px; overflow: auto; user-select: text; }
.copyfield.missing .cfval { color: var(--muted); }
.pmstats.none { color: var(--muted); font-size: 12px; border: 1px dashed var(--border); border-radius: 10px; padding: 14px; }
.pmstitle { display: flex; align-items: baseline; justify-content: space-between; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px; }
.pmssync { text-transform: none; letter-spacing: 0; }
.pmsgrid { display: flex; flex-direction: column; gap: 8px; }
.pmscard { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.pmshead { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pmsname { font-size: 12.5px; font-weight: 600; }
.pmsdur { font-size: 11px; color: var(--muted); }
.pmsopen { margin-left: auto; font-size: 12px; }
.xavg { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--panel2); color: var(--muted); border: 1px solid var(--border); }
.xavg.hot { color: #7dd8a2; border-color: rgba(72,161,121,.5); background: rgba(72,161,121,.1); }
.xavg.cold { color: #f0888d; border-color: rgba(232,100,106,.4); background: rgba(232,100,106,.08); }
.pmscells { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pmscell b { display: block; font-size: 15px; }
.pmscell span { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.pmstotal { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.pmstotal b { font-size: 15px; color: var(--text); }
.lvert { flex: none; }
.pmore { border: none; background: transparent; color: var(--muted); padding: 0 4px; border-radius: 6px; line-height: 1; }
.pmore:hover { background: var(--panel); color: var(--text); }
.ptime .linkout + .pmore { margin-left: 0; }
.ptime .pmore:only-of-type, .ptime .linkout { margin-left: auto; }

/* ---- performance ---- */
.statrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.stat .sval { font-size: 22px; font-weight: 700; line-height: 1.2; }
.stat .slabel { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 3px; }
.stat .ssub { font-size: 11px; color: var(--accent); margin-top: 2px; }
.rollups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 14px; margin-bottom: 18px; }
.rollup { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px 14px; }
.rhead { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; font-size: 13px; }
.rhead span { color: var(--muted); font-size: 11px; }
.rempty { color: var(--muted); font-size: 12px; padding: 6px 0; }
.rrow { display: grid; grid-template-columns: 110px 1fr 46px 62px; align-items: center; gap: 8px; padding: 3px 0; font-size: 12px; }
.rkey { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rtrack { background: var(--panel2); border-radius: 999px; height: 8px; overflow: hidden; }
.rbar { height: 100%; background: linear-gradient(90deg, rgba(106,143,245,.55), var(--accent)); border-radius: 999px; }
.rval { text-align: right; font-weight: 650; }
.rsub { text-align: right; color: var(--muted); font-size: 11px; }
.perflist { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.prow { display: flex; align-items: center; gap: 14px; padding: 9px 0; border-top: 1px solid var(--border); }
.prow:first-of-type { border-top: none; }
.pmain { flex: 1; min-width: 0; }
.pmain .ptitle { font-size: 13px; font-weight: 600; }
.psub { display: flex; gap: 10px; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.pmetrics { display: flex; gap: 16px; }
.pcell { text-align: right; min-width: 52px; }
.pcell b { display: block; font-size: 13px; }
.pcell span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.plinks { display: flex; gap: 5px; }
.plinks a:hover { text-decoration: none; }
/* per-post drill-down */
.prow.click { cursor: pointer; border-radius: 8px; padding-left: 6px; padding-right: 6px; margin: 0 -6px; }
.prow.click:hover, .prow.click:focus-visible { background: var(--panel2); outline: none; }
.pplats { display: flex; gap: 6px; flex-wrap: wrap; }
.pchip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel2); font-size: 12px; }
.pchip svg { width: 12px; height: 12px; display: block; }
.pchip b { font-weight: 650; }
.perflist .rhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pmright { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.platcard { border: 1px solid var(--border); border-radius: 10px; background: var(--panel2); padding: 10px 12px; }
.platcard .pchead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.platcard .pchead a { margin-left: auto; font-size: 12px; }
.platcard .pchead svg { width: 15px; height: 15px; display: block; }
.avgchip { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.avgchip.up { color: #7dd8a2; background: rgba(72,161,121,.14); }
.avgchip.down { color: var(--muted); background: var(--panel); }
.pcgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; margin-top: 9px; }
.pmcap { font-size: 12px; color: var(--muted); white-space: pre-wrap; border-left: 2px solid var(--border); padding-left: 9px; max-height: 120px; overflow: auto; }
/* performance "every post" as an Inspiration-style grid */
.perfhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 20px 0 12px; }
.perfhead b { font-size: 15px; }
.perfcard .vtitle { -webkit-line-clamp: 2; }
.perfcard .psub { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; color: var(--muted); }
.perfmetrics { display: flex; gap: 14px; margin-top: 8px; }
.perfmetrics .pcell { text-align: left; min-width: 0; }
.perfmetrics .pcell b { font-size: 14px; }
/* calendar ticket hover-preview (desktop only) */
.pthumb { position: relative; border-radius: 8px; overflow: hidden; margin-bottom: 7px; background: #000; }
.pthumb video { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.pthumb .pplay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; color: rgba(255,255,255,.85); text-shadow: 0 1px 6px rgba(0,0,0,.6); pointer-events: none; transition: opacity .15s; }
.pcard:hover .pthumb .pplay { opacity: 0; }
@media (max-width: 919px) { .pthumb { display: none; } } /* no hover on touch; the card tap opens the full preview */
@media (min-width: 920px) { .calbar .modeseg { margin-left: auto; } } /* grid/list toggle right-aligned on the row */
.autoverified { background: rgba(72,161,121,.06); border: 1px solid rgba(72,161,121,.35); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; font-size: 12px; }
.autoverified b { color: #7dd8a2; display: block; margin-bottom: 6px; font-size: 12px; }
.autoverified.reclaimed { background: rgba(241,165,91,.06); border-color: rgba(241,165,91,.35); }
.autoverified.reclaimed b { color: var(--warn); }
.avrow { display: flex; gap: 10px; align-items: center; padding: 2px 0; color: var(--muted); }
.avrow span:first-child { flex: 1; color: var(--text); }
.avwhen { font-size: 11px; }
.acclist { display: flex; flex-direction: column; gap: 7px; margin: 10px 0; }
.accrow { display: flex; gap: 7px; }
.accrow input { flex: 1; }
@media (max-width: 720px) { .prow { flex-wrap: wrap; } .pmetrics { gap: 12px; } }

/* video lightbox */
.vpop { display: flex; flex-direction: column; gap: 12px; background: var(--panel2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; width: min(430px, 94vw); max-height: 92vh; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.vpop video { width: 100%; max-height: 62vh; border-radius: 9px; background: #000; }
.vpop .vtitle { font-size: 15px; }
.vpop .vcap { -webkit-line-clamp: 6; }

/* ---- phone (below the desktop side-by-side layout) — LAST in the file so these win the
   cascade over the base control sizes they override (same specificity → source order) ---- */
@media (max-width: 919px) {
  main { padding: 16px; }
  /* the header couldn't fit on a phone. Drop everything non-essential — the app switcher +
     wordmark, the Performance tab, the status text and the account name — leaving just the
     three primary tabs (which take the row) and Refresh, on ONE row. */
  header { gap: 8px; padding: 8px 12px; flex-wrap: nowrap; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .appswitch { display: none; }
  nav.viewtoggle[aria-label="Insights"] { display: none; } /* Performance */
  .spacer { display: none; }
  .synced { display: none; }
  #userchip { display: none; }
  .viewtoggle { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .viewtoggle::-webkit-scrollbar { display: none; }
  .viewtoggle { gap: 0; }
  .viewtoggle button { padding: 12px 7px; font-size: 14px; white-space: nowrap; flex: 0 0 auto; } /* ~44px tap target */
  .viewtoggle button .tabbadge { min-width: 17px; height: 17px; }
  .tablong { display: none; }                      /* "Ready to post" → "Ready" so all 3 tabs fit */
  /* refresh moves to a floating footer button so the nav owns the whole row and the
     Captioner badge isn't clipped (the 60s poll auto-refreshes anyway) */
  #btnRefresh { position: fixed; bottom: 16px; right: 16px; width: 46px; height: 46px; border-radius: 50%; z-index: 55; background: var(--panel2); border-color: var(--border); box-shadow: 0 4px 18px rgba(0,0,0,.55); font-size: 18px; }
  main { padding-bottom: 78px; }                   /* clear the floating refresh at the end of scroll */

  /* calendar bar: week picker on its own full-width row; board + grid/list pack tight-left
     on the next row; the status filter scrolls sideways so "In Asana" never wraps. */
  .calbar { gap: 8px; justify-content: flex-start; }
  .calnav { display: flex; align-items: center; gap: 8px; flex-basis: 100%; }
  .calnav .wklabel { flex: 1; min-width: 0; }
  .calbar .filterseg { flex-basis: 100%; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
  .calbar .filterseg::-webkit-scrollbar { display: none; }

  /* multiselect dropdowns (Content / Vertical / Platform): bigger tap rows + checkboxes */
  .checkmenu { min-width: 240px; max-height: 60vh; }
  .checkrow { padding: 11px 12px; font-size: 15px; gap: 12px; }
  .checkrow input { width: 20px; height: 20px; }
  .ckbtn { font-size: 13px; padding: 8px 10px; }

  /* ready filter bar: the 3 selects share one row, search goes full-width below,
     and the card-size toggle is dropped (irrelevant on a one-column phone) */
  .bar { gap: 8px; }
  .bar .seg { display: none; }
  .bar .fbtn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .bar input[type=search] { flex-basis: 100%; min-width: 0; order: 9; }
  .bar .count { order: 10; }

  /* iOS Safari zooms the whole page when a focused input is <16px, and never zooms back */
  input, select, textarea { font-size: 16px; }
  .cfield input { min-height: 46px; }              /* room for the in-field Suggest pill */
  .cfwrap .sparkle { min-height: 34px; }

  /* real hit areas on the primary one-handed captioning flow */
  .copyfrom, .scripttoggle { min-height: 40px; }
  .cbtns button { padding-block: 13px; }
  .aabtn { width: 44px; height: 44px; }
  .igdone { padding: 11px 16px; }
  .igfont { padding: 10px 14px; }
  .igA { width: 40px; height: 40px; }

  /* the caption can't flex in an auto-height column, so give it a real size + a manual handle */
  .cfield.grow textarea { min-height: 150px; resize: vertical; }
}
@media (max-width: 700px) {
  .calgrid { grid-template-columns: 1fr; }         /* phones: one day per row (2-col is too cramped) */
  .daycol { min-width: 0; }
}
