/* Marketing (marketing.js, 27 Oct 2026). Same cards, type and tokens as Keystone; phone first. No :has() and no runtime
   custom properties (see the 22 Oct perf rules in app.css). */
.mk { display: flex; flex-direction: column; gap: 12px; }
.mk .card h3 small { font-weight: 400; color: var(--muted); }
.mk-i { width: 22px; height: 22px; flex: none; color: var(--accent); margin-top: 3px; }
.mk-mut { font-size: 12.5px; color: var(--muted); }
.mk-fine { font-size: 11.5px; margin: 8px 0 0; }
.mk-warn { display: block; font-size: 12.5px; color: #c2410c; margin-top: 3px; }
.mk-note { font-size: 13px; background: var(--accent-soft); color: var(--ink); border-radius: 10px; padding: 8px 10px; margin: 8px 0 0; }
.mk-sub { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mk-title { display: flex; gap: 10px; align-items: flex-start; }
.mk-title h3 { margin: 0; font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 24px; line-height: 1.1; }
.mk-title p { margin: 3px 0 0; }
.mk-meter { margin-top: 12px; }
.mk-meter-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; flex-wrap: wrap; }
.mk-bar { height: 8px; border-radius: 99px; background: var(--notice); overflow: hidden; margin-top: 6px; }
.mk-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.mk-bar.high i { background: #e8a33d; } .mk-bar.full i { background: #c2410c; }
.mk-kpis { margin: 0; }
.mk-kpis .kpi { text-align: left; cursor: pointer; }
.mk-kpis .kpi.warn .kv { color: #c2410c; }
.mk-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.mk-tabs::-webkit-scrollbar { display: none; }
.mk-tabs button { flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.mk-tabs button.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.mk-lower { display: flex; flex-direction: column; gap: 12px; }

/* pills */
.mk-pill { display: inline-flex; align-items: center; flex: none; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; letter-spacing: 0; text-transform: none; }
.mk-pill.ok { background: #dcf3e8; color: #13744a; } .mk-pill.warn { background: #fdecd6; color: #a14b00; } .mk-pill.bad { background: #fde3dc; color: #b42318; } .mk-pill.mute { background: var(--notice); color: var(--muted); }

/* rows */
.mk-list { list-style: none; margin: 0; padding: 0; }
.mk-list > li + li { border-top: 1px solid var(--rule); }
.mk-row { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 10px 2px; font: inherit; color: inherit; }
.mk-row.on { background: var(--bg); border-radius: 10px; }
.mk-th { width: 48px; height: 60px; flex: none; border-radius: 6px; object-fit: cover; background: var(--notice); border: 1px solid var(--rule); }
.mk-vid { display: flex; align-items: center; justify-content: center; color: var(--accent); background: var(--accent-soft); }
.mk-vid svg { width: 20px; height: 20px; }
.mk-rb { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mk-rt { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }

/* the open post */
.mk-sheet-li { padding: 4px 0 14px; }
.mk-sheet { background: var(--bg); border: 1px solid var(--rule); border-radius: 14px; padding: 12px; }
.mk-sheet-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 760px) { .mk-sheet-grid { grid-template-columns: minmax(240px, 340px) 1fr; } }
/* 10 Nov 2026 (Lisa B: 'it does nothing when i hit it'): a Story video drew at its full 1080 px and covered the Approve
   button beside it; every picture/video in a sheet stays inside its own column, Stories at 9:16 */
.mk-big { min-width: 0; }
.mk-big video { display: block; width: 100%; max-width: 300px; max-height: 70vh; aspect-ratio: 9 / 16; object-fit: contain; background: #000; border-radius: 10px; margin: 0 auto; }
.mk-big img.mk-story { aspect-ratio: 9 / 16; max-width: 300px; object-fit: contain; }
.mk-big img { display: block; width: 100%; max-width: 360px; aspect-ratio: 4 / 5; height: auto; border-radius: 10px; border: 1px solid var(--rule); background: var(--surface); margin: 0 auto; }
.mk-script textarea { width: 100%; }
.mk-side { min-width: 0; }
.mk-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mk-ref, .mk-link { color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.mk-fld { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.mk textarea, .mk input[type="text"], .mk input:not([type]), .mk input[type="datetime-local"], .mk input[inputmode] { font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 9px 11px; width: 100%; box-sizing: border-box; }
.mk textarea { line-height: 1.45; resize: vertical; }
.mk textarea[readonly], .mk input[readonly] { background: var(--notice); }
.mk-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.mk-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 14px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 14px; }
.mk-btn.ghost { background: var(--surface); color: var(--accent); border: 1px solid var(--rule); }
.mk-btn[disabled] { opacity: .45; }
.mk-plats { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 10px 0 0; font-size: 12.5px; }
.mk-checks ul, .mk-hist, .mk-under { list-style: none; margin: 0; padding: 0; }
.mk-checks li { display: flex; gap: 8px; font-size: 13px; padding: 6px 0; border-top: 1px solid var(--rule); }
.mk-checks li:first-child { border-top: 0; }
.mk-ck { width: 20px; height: 20px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: #dcf3e8; color: #13744a; }
.mk-checks li.mk-l-block .mk-ck { background: #fde3dc; color: #b42318; } .mk-checks li.mk-l-warn .mk-ck { background: #fdecd6; color: #a14b00; }
.mk-rule { font-size: 11.5px; color: var(--muted); }
.mk-hist li { font-size: 12.5px; padding: 4px 0; }
.mk-under li { font-size: 14px; padding: 3px 0; }
.mk-under li::before { content: "• "; color: var(--accent); }
.mk-pre { white-space: pre-wrap; font-size: 13.5px; background: var(--bg); border: 1px solid var(--rule); border-radius: 10px; padding: 9px 11px; margin: 0; }

/* calendar */
.mk-cal section + section { margin-top: 10px; }
.mk-cal h4 { margin: 4px 0 2px; font-size: 13px; font-weight: 600; color: var(--ink); }
.mk-cal section.past { opacity: .7; }

/* brand + settings */
.mk-chk { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; padding: 4px 0; }
.mk-chk input { width: 20px; height: 20px; flex: none; margin: 0; }
.mk-evs { display: flex; flex-direction: column; }
.mk-conn { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; padding: 6px 0; }
.mk-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rule); flex: none; margin-top: 5px; } .mk-dot.ok { background: #19a463; }
.mk-cols { display: flex; gap: 12px; flex-wrap: wrap; }
.mk-col { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.mk-col input { width: 44px; height: 44px; padding: 0; border: 1px solid var(--rule); border-radius: 10px; background: none; }
.mk-inl { display: flex; gap: 8px; } .mk-inl input { max-width: 120px; }

/* spend */
.mk-days { display: flex; align-items: flex-end; gap: 3px; height: 90px; }
.mk-day { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.mk-day i { display: block; width: 100%; max-width: 22px; background: var(--accent); border-radius: 4px 4px 1px 1px; }
.mk-day span { font-size: 10px; color: var(--muted); }
.mk-t { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 4px; }
.mk-t th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11.5px; padding: 0 6px 4px 0; }
.mk-t td { border-top: 1px solid var(--rule); padding: 6px 6px 6px 0; overflow-wrap: anywhere; }
.mk-t td:last-child, .mk-t th:last-child { text-align: right; padding-right: 0; }
@media (max-width: 480px) { .mk-t th:nth-child(3), .mk-t td:nth-child(3), .mk-t th:nth-child(4), .mk-t td:nth-child(4) { display: none; } }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mk-pill.ok { background: #12352a; color: #6fd3a5; }
  :root:not([data-theme="light"]) .mk-pill.warn { background: #3a2a14; color: #f2b366; }
  :root:not([data-theme="light"]) .mk-pill.bad { background: #3d1a16; color: #ff9b8a; }
  :root:not([data-theme="light"]) .mk-warn, :root:not([data-theme="light"]) .mk-kpis .kpi.warn .kv { color: #ff9b6a; }
  :root:not([data-theme="light"]) .mk-ck { background: #12352a; color: #6fd3a5; }
  :root:not([data-theme="light"]) .mk-checks li.mk-l-block .mk-ck { background: #3d1a16; color: #ff9b8a; }
  :root:not([data-theme="light"]) .mk-checks li.mk-l-warn .mk-ck { background: #3a2a14; color: #f2b366; }
}
:root[data-theme="dark"] .mk-pill.ok { background: #12352a; color: #6fd3a5; }
:root[data-theme="dark"] .mk-pill.warn { background: #3a2a14; color: #f2b366; }
:root[data-theme="dark"] .mk-pill.bad { background: #3d1a16; color: #ff9b8a; }
:root[data-theme="dark"] .mk-warn { color: #ff9b6a; }
/* 28 Oct 2026 UX pass: tabs match Keystone's chips; easier taps on phones */
.mk-tabs button { min-height: 40px; }
.mk-tabs button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.mk-chk { padding: 8px 0; }
.mk-ref { min-height: 32px; display: inline-flex; align-items: center; }

/* ───── Social media manager (28 Oct 2026): media library, caption per platform, platform chips. Phone first. ───── */
.mk select { font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 9px 11px; width: 100%; box-sizing: border-box; min-height: 42px; }
.mk-sm { min-height: 34px; padding: 0 10px; font-size: 13px; }
.mk-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mk-chip { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; padding: 4px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.mk-chip b { font-weight: 700; color: var(--ink); }
.mk-chip.ok { background: #dcf3e8; color: #13744a; } .mk-chip.warn { background: #fdecd6; color: #a14b00; } .mk-chip.bad { background: #fde3dc; color: #b42318; } .mk-chip.mute { background: var(--notice); color: var(--muted); }
.mk-honest { list-style: none; margin: 8px 0 0; padding: 8px 10px; font-size: 12.5px; background: #fdecd6; color: #6b3500; border-radius: 10px; }
.mk-honest li + li { margin-top: 4px; }
.mk-captabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-top: 12px; -webkit-overflow-scrolling: touch; }
.mk-captabs::-webkit-scrollbar { display: none; }
.mk-captabs button { flex: none; min-height: 36px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); font-size: 13px; color: var(--muted); }
.mk-captabs button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.mk-captabs button.over { border-color: #c2410c; }
.mk-count { font-variant-numeric: tabular-nums; } .mk-count.over { color: #c2410c; font-weight: 600; }
.mk-media img { display: block; width: 100%; max-width: 360px; height: auto; max-height: 460px; object-fit: contain; border-radius: 10px; border: 1px solid var(--rule); background: #000; margin: 0 auto; }
.mk-media video { display: block; width: 100%; max-width: 360px; max-height: 560px; border-radius: 10px; border: 1px solid var(--rule); background: #000; margin: 0 auto; }
.mk-media p { text-align: center; margin: 6px 0 0; }
.mk-poster { display: flex; align-items: center; justify-content: center; aspect-ratio: 9 / 16; max-width: 180px; margin: 0 auto; border-radius: 10px; background: var(--notice); color: var(--muted); font-size: 13px; }
.mk-thv { position: relative; display: inline-flex; flex: none; }
.mk-thv i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-style: normal; font-size: 14px; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); pointer-events: none; }
.mk-file { position: relative; overflow: hidden; cursor: pointer; margin-top: 10px; }
.mk-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.mk-uplist { list-style: none; margin: 10px 0 0; padding: 0; }
.mk-uplist li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 6px 0; border-top: 1px solid var(--rule); font-size: 13px; }
.mk-uplist li .mk-bar { grid-column: 1 / -1; margin-top: 2px; }
.mk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mk-md { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mk-md .mk-thv { display: block; }
.mk-mdi { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--rule); background: var(--notice); }
.mk-md figcaption { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mk-md input { font-size: 13px !important; padding: 6px 8px !important; }
.mk-md .mk-acts { margin-top: 0; }
.mk-pgrid { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
.mk-conn .mk-cb { flex: 1; min-width: 0; }
.mk-tog { display: flex; gap: 6px; align-items: center; font-size: 13px; flex: none; }
.mk-tog input { width: 20px; height: 20px; margin: 0; }
.mk-dot.warn { background: #e8a33d; }
.mk-newgrid { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mk-chip.ok { background: #12352a; color: #6fd3a5; }
  :root:not([data-theme="light"]) .mk-chip.warn, :root:not([data-theme="light"]) .mk-honest { background: #3a2a14; color: #f2b366; }
  :root:not([data-theme="light"]) .mk-chip.bad { background: #3d1a16; color: #ff9b8a; }
}
:root[data-theme="dark"] .mk-chip.ok { background: #12352a; color: #6fd3a5; }
:root[data-theme="dark"] .mk-chip.warn, :root[data-theme="dark"] .mk-honest { background: #3a2a14; color: #f2b366; }
:root[data-theme="dark"] .mk-chip.bad { background: #3d1a16; color: #ff9b8a; }

.mk-plist { list-style: none; margin: 0; padding: 0; }
.mk-plist li { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--rule); font-size: 13.5px; }
.mk-plist li:first-child { border-top: 0; }

/* ───── Desktop (28 Oct 2026): side-by-side panels instead of one long column. Below 1024px is untouched. ───── */
@media (min-width: 1024px) {
  .mk { gap: 16px; }
  .mk-top { display: flex; align-items: center; gap: 28px; }
  .mk-top .mk-title { flex: 1; min-width: 0; }
  .mk-top .mk-meter { flex: 0 0 min(380px, 40%); margin-top: 0; }
  .mk-lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-auto-flow: row dense; align-items: start; gap: 16px; }
  .mk-lower > .card { min-width: 0; }
  /* queue: what needs you on the left (posts open in place), scheduled and posted on the right */
  .mk-lower.mk-l-queue { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
  .mk-lower.mk-l-queue > .card:first-child { grid-column: 1; grid-row: span 2; }
  .mk-lower.mk-l-queue > .card:not(:first-child) { grid-column: 2; }
  /* calendar and spend are one card each: use the whole width */
  .mk-lower.mk-l-calendar, .mk-lower.mk-l-spend { grid-template-columns: minmax(0, 1fr); }
  .mk-cal { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px 22px; align-items: start; }
  .mk-cal section + section { margin-top: 0; }
  .mk-cal h4 { padding-bottom: 4px; border-bottom: 1px solid var(--rule); }
  .mk-sheet-grid { grid-template-columns: minmax(220px, 300px) 1fr; }
  .mk-l-calendar .mk-sheet-grid { grid-template-columns: 1fr; }
  .mk-days { height: 120px; }
  /* mouse: hover, pointer, focus rings, no oversized touch padding */
  .mk-tabs button { min-height: 36px; }
  .mk-tabs button:not(.on):hover { color: var(--ink); border-color: var(--muted); }
  .mk-row { cursor: pointer; border-radius: 10px; padding: 9px 8px; }
  .mk-row:hover { background: var(--bg); }
  .mk-row:hover .mk-rt { color: var(--accent); }
  .mk-kpis .kpi:hover { border-color: var(--accent); }
  .mk-btn:hover:not([disabled]) { filter: brightness(1.08); }
  .mk-btn.ghost:hover:not([disabled]) { filter: none; border-color: var(--accent); }
  .mk-btn { min-height: 36px; }
  .mk-chk { padding: 5px 0; cursor: pointer; }
  .mk-ref:hover, .mk-link:hover { text-decoration-thickness: 2px; }
  .mk button:focus-visible, .mk a:focus-visible, .mk input:focus-visible, .mk textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
}
@media (min-width: 1024px) {
  /* Social media manager: media grid, profile form in two columns, new-post form in a row */
  .mk-lower.mk-l-media { grid-template-columns: minmax(0, 1fr); }
  .mk-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
  .mk-pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-newgrid { grid-template-columns: minmax(160px, 1fr) minmax(0, 2fr) minmax(0, 1.4fr); align-items: end; }
  .mk-lower.mk-l-queue > .card.mk-new:first-child { grid-column: 1 / -1; grid-row: auto; }
  .mk-lower.mk-l-queue > .mk-new + .card { grid-column: 1; grid-row: span 2; }
  .mk-lower.mk-l-brand > .mk-prof { grid-row: span 3; }
  .mk-captabs button:not(.on):hover, .mk-chip a:hover { color: var(--ink); }
  .mk-md .mk-mdi:hover { border-color: var(--accent); }
  .mk-file:hover { filter: brightness(1.08); }
  .mk select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
}
@media (min-width: 1440px) {
  .mk-lower { gap: 20px; }
  .mk-lower.mk-l-brand { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
