/* Campaign Studio (2026-10-22). Uses the panel's own tokens only (light + dark via :root[data-theme]). Every class is cst-*. */
.cst { max-width: 1320px; width: 100%; min-width: 0; margin: 0 auto; color: var(--text-1); }   /* a grid item of #main-content: never wider than its track */
.cst .btn { width: auto; }   /* the panel's .btn-primary is full-width by default (sign-in form) */
.cst-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.cst-h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.cst-sub { color: var(--text-3); font-size: 13px; margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cst-brand { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--primary-lt); color: var(--primary-md); font-weight: 700; font-size: 12px; }
.cst-btn-xl { padding: 12px 20px; font-size: 14px; font-weight: 700; border-radius: var(--r-md); }

/* tabs + filters */
.cst-bar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.cst-tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.cst-tab { border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 9px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.cst-tab:hover { color: var(--text-1); }
.cst-tab.on { background: var(--primary); color: #fff; }
.cst-tab .n { font-size: 11px; opacity: .8; font-weight: 700; }
.cst-search { min-width: 220px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-1); font: inherit; font-size: 13px; }

/* overview cards */
.cst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 16px; }
.cst-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-sm); transition: box-shadow .15s var(--ease), transform .15s var(--ease); cursor: pointer; }
.cst-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.cst-card-top { display: flex; gap: 12px; align-items: flex-start; }
.cst-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.cst-ico.bonus { background: var(--primary-lt); } .cst-ico.spins { background: var(--accent-lt); } .cst-ico.mix { background: var(--orange-lt); }
.cst-ico.cash { background: var(--teal-lt); } .cst-ico.welcome { background: var(--green-lt); }
.cst-card-name { font-weight: 800; font-size: 15px; line-height: 1.25; }
.cst-card-title { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.cst-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.cst-chip { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--bg); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.cst-state { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: capitalize; }
.cst-state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.cst-state.live { background: var(--green-lt); color: var(--green); } .cst-state.scheduled { background: var(--accent-lt); color: var(--accent); }
.cst-state.pending { background: var(--yellow-lt); color: var(--yellow); } .cst-state.draft { background: var(--bg); color: var(--text-3); border: 1px solid var(--border); }
.cst-state.paused { background: var(--orange-lt); color: var(--orange); } .cst-state.ended { background: var(--bg); color: var(--text-4); border: 1px solid var(--border); }
.cst-figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid var(--border-light); padding-top: 12px; }
.cst-fig b { display: block; font-size: 16px; font-weight: 800; } .cst-fig span { font-size: 11px; color: var(--text-3); }
.cst-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cst-next { font-size: 12px; color: var(--text-3); }
.cst-empty { text-align: center; padding: 56px 20px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--r-lg); }
.cst-empty .big { font-size: 40px; } .cst-empty h3 { margin: 10px 0 6px; font-size: 18px; } .cst-empty p { color: var(--text-3); margin: 0 0 16px; }

/* editor */
.cst-ed-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.cst-back { border: 0; background: transparent; color: var(--text-3); font: inherit; font-size: 13px; cursor: pointer; padding: 6px 0; }
.cst-back:hover { color: var(--text-1); }
.cst-name { flex: 1 1 240px; font-size: 22px; font-weight: 800; letter-spacing: -.01em; border: 1px solid transparent; background: transparent; color: var(--text-1); padding: 6px 10px; border-radius: 10px; font-family: inherit; min-width: 0; }
.cst-name:hover { border-color: var(--border); } .cst-name:focus { outline: none; border-color: var(--primary-md); background: var(--surface); }
.cst-ed-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cst-steps { display: flex; gap: 4px; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px; overflow-x: auto; }
.cst-step { flex: 1 1 0; min-width: 120px; border: 0; background: transparent; font: inherit; padding: 9px 12px; border-radius: 10px; cursor: pointer; display: flex; align-items: center; gap: 10px; color: var(--text-3); text-align: left; }
.cst-step .num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--bg); border: 1px solid var(--border); flex-shrink: 0; }
.cst-step .lbl { font-size: 13px; font-weight: 700; }
.cst-step.on { background: var(--primary-lt); color: var(--primary-md); } .cst-step.on .num { background: var(--primary); color: #fff; border-color: var(--primary); }
.cst-step.done .num { background: var(--green-lt); color: var(--green); border-color: transparent; }
.cst-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.cst-pane { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-sm); }
.cst-pane h2 { font-size: 17px; margin: 0 0 4px; font-weight: 800; } .cst-pane .lead { color: var(--text-3); font-size: 13px; margin: 0 0 18px; }
.cst-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; }
.cst-nav { display: flex; justify-content: space-between; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border-light); }

/* type tiles */
.cst-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 12px; }
.cst-tile { border: 1.5px solid var(--border); background: var(--surface); border-radius: var(--r-lg); padding: 18px; text-align: left; cursor: pointer; font: inherit; color: var(--text-1); display: flex; flex-direction: column; gap: 8px; transition: border-color .12s, box-shadow .12s, transform .12s; }
.cst-tile:hover:not([disabled]) { border-color: var(--primary-md); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.cst-tile.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-lt); }
.cst-tile[disabled] { opacity: .55; cursor: not-allowed; }
.cst-tile .t { font-weight: 800; font-size: 15px; } .cst-tile .d { color: var(--text-3); font-size: 12.5px; line-height: 1.45; }
.cst-tile .soon { align-self: flex-start; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; background: var(--yellow-lt); color: var(--yellow); }
.cst-section-title { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin: 26px 0 10px; }
.cst-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 10px; }
.cst-tpl { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--bg); cursor: pointer; text-align: left; font: inherit; color: var(--text-1); }
.cst-tpl:hover { border-color: var(--primary-md); } .cst-tpl .t { font-weight: 700; font-size: 13.5px; } .cst-tpl .d { font-size: 12px; color: var(--text-3); margin-top: 3px; }

/* components + fields */
.cst-comp { border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; background: var(--bg); }
.cst-comp-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.cst-comp-h .t { font-weight: 800; font-size: 14.5px; display: flex; gap: 8px; align-items: center; }
.cst-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: 14px 16px; }
.cst-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cst-f.wide { grid-column: 1 / -1; }
.cst-f label, .cst-lbl { font-size: 12px; font-weight: 700; color: var(--text-2); }
.cst-f .hint { font-size: 11.5px; color: var(--text-3); line-height: 1.4; }
.cst-in { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; }
.cst-in:focus-within { border-color: var(--primary-md); box-shadow: 0 0 0 3px var(--primary-lt); }
.cst-in input, .cst-in select { border: 0; background: transparent; color: var(--text-1); font: inherit; font-size: 14px; padding: 9px 10px; width: 100%; min-width: 0; outline: none; }
.cst-in .ad { padding: 0 10px; color: var(--text-3); font-size: 13px; font-weight: 600; white-space: nowrap; }
.cst-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.cst-pill { border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 12px; border-radius: 999px; cursor: pointer; }
.cst-pill:hover { border-color: var(--primary-md); color: var(--text-1); }
.cst-pill.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.cst-pill[disabled] { opacity: .5; cursor: not-allowed; }
.cst-err { color: var(--red); font-size: 12px; font-weight: 600; min-height: 0; }
.cst-err:empty { display: none; }
.cst-f.bad .cst-in { border-color: var(--red); }
.cst-days { display: flex; gap: 6px; flex-wrap: wrap; }
.cst-day { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-weight: 800; font-size: 12.5px; cursor: pointer; }
.cst-day.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.cst-note { display: block; font-size: 12.5px; color: var(--text-2); background: var(--surface); border: 1px dashed var(--border); border-radius: 12px; padding: 10px 12px; line-height: 1.45; }
.cst-note.warn { border-style: solid; border-color: var(--yellow); background: var(--yellow-lt); }
.cst-x { border: 0; background: transparent; color: var(--text-3); cursor: pointer; font-size: 18px; line-height: 1; padding: 4px; }
.cst-x:hover { color: var(--red); }
.cst-tier { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin-bottom: 10px; }
.cst-games { border: 1px solid var(--border); border-radius: 12px; max-height: 280px; overflow: auto; background: var(--surface); }
.cst-game { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border-light); cursor: pointer; }
.cst-game:last-child { border-bottom: 0; } .cst-game:hover { background: var(--bg); } .cst-game.on { background: var(--primary-lt); }
.cst-game .n { font-weight: 700; font-size: 13.5px; } .cst-game .p { font-size: 11.5px; color: var(--text-3); }
.cst-picked { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--primary-md); background: var(--primary-lt); border-radius: 12px; }

/* summary side */
.cst-sum { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.cst-sum-h { padding: 14px 16px; border-bottom: 1px solid var(--border-light); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cst-sum-h b { font-size: 13px; }
.cst-sum-b { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.cst-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 12.5px; }
.cst-facts dt { color: var(--text-3); font-weight: 600; } .cst-facts dd { margin: 0; color: var(--text-1); font-weight: 600; }
.cst-check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; font-size: 12.5px; line-height: 1.4; }
.cst-check.ok { background: var(--green-lt); color: var(--green); } .cst-check.warn { background: var(--yellow-lt); color: var(--yellow); }
.cst-check.bad { background: var(--red-lt); color: var(--red); } .cst-check.busy { background: var(--bg); color: var(--text-3); }
.cst-check ul { margin: 4px 0 0; padding-left: 16px; }
.cst-ccy { display: inline-flex; gap: 4px; background: var(--bg); border-radius: 9px; padding: 3px; }
.cst-ccy button { border: 0; background: transparent; font: inherit; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 7px; cursor: pointer; color: var(--text-3); }
.cst-ccy button.on { background: var(--surface); color: var(--text-1); box-shadow: var(--shadow-sm); }

/* player preview (the brand's dark card) */
.cst-player { background: radial-gradient(120% 120% at 0% 0%, #2a1050 0%, #120a26 55%, #0a0716 100%); border-radius: 16px; padding: 16px; color: #fff; border: 1px solid rgba(167,139,250,.35); }
.cst-player .art { height: 96px; border-radius: 12px; margin-bottom: 12px; background: linear-gradient(135deg, rgba(236,72,153,.55), rgba(124,58,237,.55) 50%, rgba(34,211,238,.45)); display: grid; place-items: center; font-weight: 900; font-size: 18px; letter-spacing: .04em; text-shadow: 0 2px 12px rgba(0,0,0,.5); text-align: center; padding: 0 10px; }
.cst-player .k { font-size: 10.5px; letter-spacing: .14em; font-weight: 800; color: #c4b5fd; text-transform: uppercase; }
.cst-player .h { font-size: 17px; font-weight: 900; margin: 4px 0; }
.cst-player .s { font-size: 12.5px; color: rgba(255,255,255,.78); }
.cst-player .cta { margin-top: 12px; border-radius: 10px; padding: 10px; text-align: center; font-weight: 800; font-size: 13px; background: linear-gradient(90deg, #ec4899, #8b5cf6); }
.cst-player.mobile { max-width: 300px; margin: 0 auto; }
.cst-player.mobile .h { font-size: 16px; }
.cst-timeline { position: relative; padding-left: 18px; }
.cst-timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.cst-tl { position: relative; padding-bottom: 10px; }
.cst-tl::before { content: ''; position: absolute; left: -16px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px var(--primary-lt); }
.cst-tl .w { font-size: 12px; font-weight: 800; } .cst-tl .i { font-size: 12.5px; color: var(--text-2); }

/* review */
.cst-terms { font-size: 13px; line-height: 1.6; color: var(--text-2); background: var(--bg); border-radius: 12px; padding: 12px 14px; white-space: pre-wrap; }
.cst-text-edit textarea, .cst-text-edit input { width: 100%; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-1); font: inherit; font-size: 13px; padding: 9px 10px; }
.cst-text-edit textarea { min-height: 120px; resize: vertical; }
.cst-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cst-linkbtn { border: 0; background: transparent; color: var(--primary-md); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; padding: 0; }
.cst-linkbtn:hover { text-decoration: underline; }

/* group detail */
.cst-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cst-kpi { background: var(--bg); border-radius: 12px; padding: 12px 14px; }
.cst-kpi b { display: block; font-size: 20px; font-weight: 800; } .cst-kpi span { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.cst-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cst-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.cst-table td { padding: 10px; border-bottom: 1px solid var(--border-light); }
.cst-result { margin-top: 12px; }

@media (max-width: 1100px) { .cst-layout { grid-template-columns: minmax(0, 1fr); } .cst-side { position: static; } }
@media (max-width: 700px) {
  .cst-two { grid-template-columns: 1fr; } .cst-grid { grid-template-columns: 1fr; } .cst-search { min-width: 0; width: 100%; }
  .cst-pane { padding: 16px; } .cst-figs { grid-template-columns: repeat(2, 1fr); } .cst-step { min-width: 100px; }
}

/* phase 2: following days, segments, artwork, deliveries */
.cst-follow { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.cst-segchip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.cst-segchip.include { background: var(--green-lt); color: var(--green); } .cst-segchip.exclude { background: var(--red-lt); color: var(--red); }
.cst-segchip .v { font-weight: 600; opacity: .7; font-size: 11px; } .cst-segchip .cst-x { color: inherit; font-size: 15px; padding: 0 4px; }
.cst-size { font-size: 13px; color: var(--text-2); } .cst-size span { color: var(--text-3); font-size: 12px; }
.cst-seglist { border: 1px solid var(--border); border-radius: 12px; margin-top: 8px; background: var(--surface); }
.cst-segrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border-light); }
.cst-segrow:last-child { border-bottom: 0; } .cst-segrow .n { font-weight: 700; font-size: 13px; } .cst-segrow .p { font-size: 11.5px; color: var(--text-3); }
.cst-art { position: relative; border: 1px dashed var(--border); border-radius: 12px; aspect-ratio: 3 / 2; overflow: hidden; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.cst-art.has { border-style: solid; } .cst-art img { width: 100%; height: 100%; object-fit: cover; }
.cst-art .ph { text-align: center; font-weight: 700; color: var(--text-2); font-size: 13px; } .cst-art .ph span { display: block; font-weight: 500; color: var(--text-3); font-size: 11.5px; margin-top: 4px; }
.cst-upload { position: absolute; bottom: 8px; left: 8px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.cst-upload input { display: none; }
.cst-art .cst-linkbtn { position: absolute; bottom: 12px; right: 10px; background: var(--surface); padding: 3px 8px; border-radius: 6px; }
.cst-check-line { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); margin-top: 10px; }
.cst-player .art.img { padding: 0; height: auto; aspect-ratio: 3 / 2; overflow: hidden; } .cst-player .art.img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cst-days-line { display: flex; gap: 4px; flex-wrap: wrap; }
.cst-dchip { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; font-size: 11.5px; font-weight: 800; }
.cst-dchip.ok { background: var(--green-lt); color: var(--green); } .cst-dchip.sch { background: var(--accent-lt); color: var(--accent); }
.cst-dchip.warn { background: var(--yellow-lt); color: var(--yellow); } .cst-dchip.bad { background: var(--red-lt); color: var(--red); }
.cst-dchip.muted { background: var(--bg); color: var(--text-4); border: 1px solid var(--border); }

.cst-toast { position: fixed; right: 20px; bottom: 20px; z-index: 99999; max-width: min(440px, calc(100vw - 40px)); padding: 12px 16px; border-radius: 12px;
  font: 600 13.5px/1.4 var(--font); color: #fff; box-shadow: var(--shadow-lg); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.cst-toast.ok { background: #15803d; } .cst-toast.bad { background: #b91c1c; } .cst-toast.warn { background: #b45309; }
.cst-toast.out { opacity: 0; transform: translateY(6px); }
