/* Marketing studio (module 8). Every class is prefixed mk-. Tokens only. */
.mk .tabs a { display: inline-block; }

/* campaign cards */
.mk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 16px; }
.mk-card { padding: 16px 18px; display: grid; gap: 12px; cursor: pointer; align-content: start; transition: border-color .12s, box-shadow .12s; }
.mk-card:hover { border-color: var(--brand); box-shadow: var(--shadow-2); }
.mk-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.mk-cname { font: 700 21px/1.1 var(--f-head); color: var(--ink); }
.mk-goal { margin: -4px 0 0; }
.mk-spend { display: grid; gap: 5px; }
.mk-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface-2); overflow: hidden; }
.mk-sc { padding: 8px 4px 7px; text-align: center; border-left: 1px solid var(--line-2); min-width: 0; }
.mk-sc:first-child { border-left: 0; }
.mk-sl { font: 600 10.5px var(--f-num); color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.mk-sv { font-weight: 700; font-size: 15px; margin-top: 2px; }
.mk-sp { font-size: 10.5px; color: var(--brand); min-height: 14px; }
.mk-card-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line-2); padding-top: 10px; }
.mk-card-foot svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }

/* campaign detail */
.mk-hero { padding: 16px 20px; }
.mk-hero-g { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px 24px; }
.mk-hero .eyebrow { margin-bottom: 3px; letter-spacing: .1em; text-transform: uppercase; }
.mk-fun th, .mk-fun td { white-space: nowrap; }
.mk-vbar { position: relative; height: 18px; min-width: 120px; }
.mk-vbar i, .mk-vbar b { position: absolute; left: 0; border-radius: 999px; }
.mk-vbar i { top: 0; height: 9px; background: var(--ink); opacity: .78; }
.mk-vbar b { top: 10px; height: 8px; background: var(--c2); }
.mk-crmcount { font-family: var(--f-num); }

/* step tracker */
.mk-steps { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 8px 10px; overflow-x: auto; box-shadow: var(--shadow-1); scrollbar-width: none; }
.mk-steps::-webkit-scrollbar { display: none; }
.mk-step { flex: 1 0 84px; position: relative; display: grid; justify-items: center; gap: 6px; border: 0; background: none; cursor: pointer; padding: 0 4px 4px; color: var(--ink-2); font: 600 13px var(--f-ui); }
.mk-step::before { content: ""; position: absolute; top: 15px; left: -50%; right: 50%; height: 2px; background: var(--line); }
.mk-step:first-child::before { display: none; }
.mk-step.done::before, .mk-step.ready::before { background: var(--brand); }
.mk-bub { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line); font: 700 13px var(--f-num); color: var(--ink-3); }
.mk-bub svg { width: 16px; height: 16px; }
.mk-step.done .mk-bub { background: var(--brand); border-color: var(--brand); color: #fff; }
.mk-step.ready .mk-bub { border-color: var(--brand); color: var(--brand); }
.mk-step.changes .mk-bub { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.mk-step.sel { color: var(--ink); }
.mk-step.sel .mk-bub { box-shadow: 0 0 0 4px var(--brand-soft); }
.mk-step.sel .mk-sl2 { color: var(--brand); border-bottom: 2px solid var(--brand); }
.mk-sl2 { padding-bottom: 2px; text-align: center; line-height: 1.2; }
.mk-step:hover .mk-sl2 { color: var(--ink); }

.mk-split { grid-template-columns: minmax(0, 1fr) 400px; }
.mk-side { position: sticky; top: calc(var(--top-h) + 12px); }
@media (max-width: 1280px) { .mk-split { grid-template-columns: minmax(0, 1fr); } .mk-side { position: static; } }

/* notices */
.mk-note { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--r-sm); padding: 10px 12px; border: 1px solid var(--line); background: var(--surface-2); }
.mk-note svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.mk-note.bad { background: var(--bad-soft); border-color: #e7b9b2; color: #6e231a; }
.mk-note.bad svg { color: var(--bad); }
.mk-note.warn { background: var(--warn-soft); border-color: #e5cf9d; color: #5e3d00; }
.mk-note.warn a { color: inherit; text-decoration: underline; }
.mk-banner { align-items: center; }

/* AI writer */
.mk-vars { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.mk-var { border: 1px solid #d9c9ef; background: linear-gradient(180deg, #faf6ff, #fff); border-radius: var(--r-sm); padding: 12px; display: grid; gap: 8px; align-content: start; }
.mk-var.picked { border-color: var(--brand); background: var(--brand-tint); }
.mk-var p { white-space: normal; max-height: 150px; overflow: hidden; color: var(--ink-2); }
.mk-copy { min-height: 190px; font-size: 15px; line-height: 1.5; }
.mk-over { color: var(--bad); font-weight: 700; }
.mk-fold { color: var(--ink-3); }
.mk-tag { color: var(--brand); font-weight: 600; }

/* LinkedIn preview */
.mk-li { border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; font-size: 14px; }
.mk-li-h { display: flex; gap: 10px; padding: 12px 14px 6px; align-items: flex-start; }
.mk-li-av { width: 48px; height: 48px; border-radius: 4px; background: var(--band); display: grid; place-items: center; flex: none; padding: 7px; }
.mk-li-av img { width: 100%; height: auto; filter: brightness(0) invert(1); }
.mk-li-who { display: grid; min-width: 0; line-height: 1.3; }
.mk-li-who span { font-size: 12px; color: var(--ink-3); display: flex; gap: 4px; align-items: center; }
.mk-li-who span svg { width: 12px; height: 12px; }
.mk-li-t { padding: 4px 14px 10px; line-height: 1.45; word-break: break-word; }
.mk-more { border: 0; background: none; padding: 0; color: var(--ink-3); font-weight: 600; cursor: pointer; }
.mk-more:hover { color: var(--brand); text-decoration: underline; }
.mk-li-media { position: relative; background: linear-gradient(135deg, var(--band), var(--band-2) 60%, #214a52); width: 100%; display: grid; place-items: center; max-height: 340px; margin: 0 auto; color: #fff; }
.mk-li-play { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--band); display: grid; place-items: center; }
.mk-li-play svg { width: 22px; height: 22px; margin-left: 3px; }
.mk-li-dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.7); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 4px; }
.mk-li-cap { position: absolute; left: 10px; right: 10px; bottom: 8px; font-size: 12px; text-align: center; color: #fff; display: none; }
.mk-li-slide { display: grid; gap: 12px; justify-items: center; padding: 24px; text-align: center; font: 700 22px/1.15 var(--f-head); }
.mk-li-react { display: flex; justify-content: space-between; padding: 8px 14px; font-size: 12.5px; color: var(--ink-3); border-bottom: 1px solid var(--line-2); }
.mk-li-acts { display: flex; justify-content: space-around; padding: 4px 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.mk-li-acts span { display: inline-flex; gap: 6px; align-items: center; padding: 8px 6px; }
.mk-li-acts svg { width: 16px; height: 16px; }
.mk-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line); display: inline-block; }
.mk-dot.ok { background: var(--ok); }
.mk-dot.bad { background: var(--bad); }

/* script scenes */
.mk-scene, .mk-scene-head { display: grid; grid-template-columns: 28px minmax(130px, .8fr) minmax(140px, 1fr) minmax(200px, 1.6fr) 104px; gap: 10px; align-items: start; }
.mk-scene-head { font: 700 11px var(--f-num); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 0 0 2px; }
.mk-scene { padding: 10px 0; border-top: 1px solid var(--line-2); }
.mk-sno { width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; margin-top: 8px; }
.li .mk-sno { margin-top: 2px; flex: none; }
.mk-vo { min-height: 64px; }
.mk-sact { display: flex; gap: 2px; padding-top: 5px; }
.mk-flip { transform: rotate(180deg); }
@media (max-width: 900px) {
  .mk-scene-head { display: none; }
  .mk-scene { grid-template-columns: 28px minmax(0, 1fr); }
  .mk-scene > .field, .mk-scene > .mk-sact { grid-column: 2; }
}

/* progress */
.mk-prog { display: grid; gap: 6px; border: 1px dashed var(--ctl-line); border-radius: var(--r-sm); padding: 10px 12px; background: var(--surface-2); }
.mk-range { width: 100%; accent-color: var(--brand); height: 28px; }

/* audio waveform and playback */
.mk-aud { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; background: var(--surface-2); }
.mk-wave { position: relative; flex: 1; height: 56px; min-width: 0; }
.mk-wl { position: absolute; inset: 0; display: flex; align-items: center; gap: 2px; }
.mk-wl i { flex: 1; min-width: 1px; background: #b7c7ca; border-radius: 2px; }
.mk-wl.on { clip-path: inset(0 calc(100% - var(--p, 0%)) 0 0); }
.mk-wl.on i { background: var(--brand); }
.mk-head { position: absolute; top: -3px; bottom: -3px; left: var(--p, 0%); width: 2px; background: var(--ink); border-radius: 2px; }
.mk-play .i-pause { display: none; }
[data-playing] .mk-play .i-pause { display: inline-flex; }
[data-playing] .mk-play .i-play { display: none; }
.mk-t { white-space: nowrap; color: var(--ink-2); }
.mk-aud .mk-scrub { position: absolute; }

/* video preview */
.mk-vp { display: grid; gap: 8px; max-width: 640px; margin: 0 auto; width: 100%; }
.mk-frame { position: relative; border-radius: var(--r-sm); overflow: hidden; background: linear-gradient(160deg, var(--band), var(--band-2)); max-height: 400px; margin: 0 auto; width: 100%; display: grid; grid-template-rows: auto 1fr; }
.mk-fbar { display: flex; align-items: center; gap: 5px; padding: 8px 10px; background: rgba(255,255,255,.08); }
.mk-fbar i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.3); }
.mk-scr { margin-left: 8px; font: 600 12px var(--f-num); color: var(--band-ink); }
.mk-fbody { padding: 14px 16px; display: grid; gap: 9px; align-content: start; }
.mk-sk { height: 10px; border-radius: 5px; background: rgba(255,255,255,.14); }
.w40 { width: 40%; } .w60 { width: 60%; } .w75 { width: 75%; } .w90 { width: 90%; }
.mk-cap { position: absolute; left: 10px; right: 10px; bottom: 28px; background: rgba(0,0,0,.66); color: #fff; font-size: 13px; text-align: center; border-radius: 6px; padding: 4px 8px; }
.mk-cap:empty { display: none; }
.mk-scn { position: absolute; left: 10px; bottom: 6px; font: 600 10.5px var(--f-num); color: var(--band-muted); }
.mk-ctl { display: flex; gap: 10px; align-items: center; }
.mk-scrub { flex: 1; accent-color: var(--brand); min-width: 0; height: 24px; }
.mk-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.mk-sb { display: grid; gap: 6px; }
.mk-sb-f { background: linear-gradient(160deg, var(--band), var(--band-2)); color: #fff; border-radius: var(--r-sm); aspect-ratio: 16 / 9; padding: 8px 10px; display: grid; align-content: space-between; }
.mk-sb-f .mono { color: var(--band-eyebrow); }

/* review */
.mk-tline { position: relative; height: 22px; margin: 0 auto; width: 100%; max-width: 640px; background: var(--surface-3); border-radius: 999px; }
.mk-pin { position: absolute; top: 3px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; border: 2px solid #fff; background: var(--warn); cursor: pointer; padding: 0; box-shadow: var(--shadow-1); }
.mk-pin.res { background: var(--ok); }
.mk-res { opacity: .6; }
.mk-apr { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; display: grid; gap: 8px; border-left-width: 4px; }
.mk-apr.ok { border-left-color: var(--ok); }
.mk-apr.bad { border-left-color: var(--bad); background: var(--bad-soft); }
.mk-apr-h { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.mk-chk { display: grid; gap: 6px; }
.mk-chk > div { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.mk-chk svg { width: 16px; height: 16px; }
.mk-chk .ok svg { color: var(--ok); }
.mk-chk .no svg { color: var(--bad); }

/* calendar */
.mk-month { font: 700 24px var(--f-head); min-width: 170px; text-align: center; }
.mk-legend { display: inline-flex; gap: 6px 12px; flex-wrap: wrap; color: var(--ink-2); }
.mk-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mk-lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.mk-cal { overflow: hidden; }
.mk-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface-2); border-bottom: 1px solid var(--line); font: 700 11.5px var(--f-num); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.mk-dow div { padding: 8px 10px; }
.mk-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mk-day { border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; background: var(--surface); transition: background .1s; }
.mk-day:nth-child(7n) { border-right: 0; }
.mk-day.off { background: var(--surface-2); }
.mk-day.past:not(.off) { background: #fafcfc; }
.mk-day.today { background: var(--brand-tint); box-shadow: inset 0 0 0 2px var(--brand); }
.mk-day.mk-drop { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); }
.mk-dn { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.mk-day.today .mk-dn { color: var(--brand); font-weight: 800; }
.mk-chip { display: flex; align-items: center; gap: 5px; width: 100%; border: 0; border-left: 3px solid var(--ink-3); border-radius: 5px; padding: 4px 6px; background: var(--surface-3); color: var(--ink); font: 600 12px/1.2 var(--f-ui); text-align: left; cursor: pointer; min-width: 0; }
.mk-chip[data-drag] { cursor: grab; touch-action: none; }
.mk-chip:hover { filter: brightness(.96); }
.mk-ci svg { width: 12px; height: 12px; flex: none; display: block; }
.mk-ct { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-cm { font-size: 10px; color: var(--ink-3); flex: none; }
.s-Idea { border-left-color: var(--ink-3); background: var(--surface-3); }
.s-Drafting { border-left-color: var(--c2); background: var(--brand-soft); }
.s-Inreview { border-left-color: #c28a1a; background: var(--warn-soft); }
.s-Approved { border-left-color: var(--ok); background: var(--ok-soft); }
.s-Scheduled { border-left-color: var(--quar); background: var(--quar-soft); }
.s-Published { border-left-color: var(--brand); background: var(--brand); color: #fff; }
.s-Published .mk-cm { color: var(--band-muted); }
.mk-lg.s-Idea { background: var(--ink-3); } .mk-lg.s-Drafting { background: var(--c2); } .mk-lg.s-Inreview { background: #c28a1a; } .mk-lg.s-Approved { background: var(--ok); } .mk-lg.s-Scheduled { background: var(--quar); } .mk-lg.s-Published { background: var(--brand); }
.mk-lifted { opacity: .35; }
.mk-ghost { position: fixed; z-index: 99; pointer-events: none; box-shadow: var(--shadow-2); width: auto; cursor: grabbing; transform: rotate(-1.5deg); }
.mk-dragging, .mk-dragging * { cursor: grabbing !important; user-select: none; }
.mk-wl-d { width: 92px; flex: none; font-size: 13px; }

/* analytics */
.mk-funnel { display: grid; gap: 12px; }
.mk-fr { display: grid; grid-template-columns: 96px minmax(0, 1fr) 110px; gap: 10px; align-items: center; }
.mk-fr > span:last-child { text-align: right; }
.mk-fbar2 { height: 22px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.mk-fbar2 i { display: block; height: 100%; background: linear-gradient(90deg, var(--c1), var(--c2)); border-radius: 6px; }
.mk-fbar2.won i { background: var(--ok); }

@media (max-width: 1024px) { .mk-split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .mk-cards { grid-template-columns: minmax(0, 1fr); }
  .mk-cname { font-size: 20px; }
  .mk-sv { font-size: 13.5px; }
  .mk-aud { flex-wrap: wrap; }
  .mk-fr { grid-template-columns: 78px minmax(0, 1fr) 84px; gap: 6px; }
  .mk-month { min-width: 0; flex: 1; font-size: 21px; }
  .mk-legend { display: none; }
  .mk-wl-d { width: 74px; }
  .mk-li-who span { font-size: 11.5px; }
  .kpis[style] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .mk .kpi .v { font-size: 22px; }
}
