:root {
  --bg: #f4f5fb; --panel: #ffffff; --panel-2: #f8f9fd; --text: #141625; --muted: #6a7085; --line: #e6e8f0;
  --accent: #5b4cf5; --accent-2: #8b5cf6; --accent-soft: #eeecff; --accent-ink: #ffffff;
  --ok: #138a52; --warn: #b26a00; --err: #cf2e45;
  --ok-bg: #e5f6ed; --warn-bg: #fff3dd; --err-bg: #fde9ec; --info-bg: #eef1ff;
  --side: #12132a; --side-2: #1b1d3a; --side-text: #c9cbe3; --side-muted: #7f83a8;
  --radius: 14px; --shadow: 0 1px 2px rgba(20, 22, 37, .04), 0 6px 20px rgba(20, 22, 37, .05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0d18; --panel: #15172a; --panel-2: #1a1c33; --text: #eceefa; --muted: #9a9ebb; --line: #262945;
    --accent: #7c6dff; --accent-2: #a78bfa; --accent-soft: #23214a;
    --ok: #4cd38b; --warn: #f3ad45; --err: #ff6f82;
    --ok-bg: #10291d; --warn-bg: #2e2312; --err-bg: #331620; --info-bg: #1c1f3d;
    --side: #0a0b16; --side-2: #15172b; --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -.02em; }
h2 { font-size: 16px; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
code { background: var(--panel-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--side) 0%, var(--side-2) 100%); color: var(--side-text);
  padding: 22px 16px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 18px;
  padding: 4px 10px 22px; letter-spacing: -.01em; }
.logo:hover { text-decoration: none; }
.logo .mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 18px rgba(91, 76, 245, .45); }
.logo .mark svg { width: 18px; height: 18px; stroke: #fff; }
.logo .word em { color: #a99cff; font-style: normal; }
.side-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); padding: 12px 12px 6px; }
.side-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--side-text); font-weight: 500; transition: background .15s, color .15s; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.side-link.on { background: linear-gradient(135deg, rgba(124, 109, 255, .28), rgba(167, 139, 250, .14)); color: #fff;
  box-shadow: inset 2px 0 0 #a99cff; }
.side-status { margin: 10px 4px 0; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .06); font-size: 13px; }
.side-status div { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #e05570; flex: none; }
.dot.on { background: #3ed08a; box-shadow: 0 0 0 3px rgba(62, 208, 138, .18); }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, .08); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, #f472b6, var(--accent)); flex: none; }
.side-foot .who { flex: 1; min-width: 0; line-height: 1.3; }
.side-foot .who b { display: block; color: #fff; font-size: 14px; }
.side-foot .who span { color: var(--side-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.icon-btn { background: transparent; border: 0; color: var(--side-muted); cursor: pointer; padding: 8px; border-radius: 8px; }
.icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .08); }

.main { min-width: 0; }
.mobile-bar, .scrim { display: none; }
.content { max-width: 1720px; margin: 0 auto; padding: 28px clamp(16px, 2.6vw, 44px) 64px; }

.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }

/* ---------- surfaces ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.section-title { display: flex; align-items: center; gap: 10px; margin: 6px 0 16px; }
.section-title .num { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 700;
  font-size: 13px; background: var(--accent-soft); color: var(--accent); }
.section-title h2 { margin: 0; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 26px 0 20px; }

.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 22px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; }
.stat .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent); }
.stat .ic.green { background: var(--ok-bg); color: var(--ok); }
.stat .ic.amber { background: var(--warn-bg); color: var(--warn); }
.stat .ic.red { background: var(--err-bg); color: var(--err); }
.stat b { display: block; font-size: 24px; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat span { color: var(--muted); font-size: 13px; }
.stat > div { min-width: 0; }

.connect { position: relative; overflow: hidden; }
.connect .brand-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex: none; }
.connect .brand-ic svg { width: 24px; height: 24px; }
.brand-ic.yt { background: linear-gradient(135deg, #ff3b3b, #d10f2f); }
.brand-ic.fb { background: linear-gradient(135deg, #2f80ff, #1559d6); }
.connect-top { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.connect-top h2 { margin: 0 0 2px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); padding: 9px 16px; border-radius: 10px; font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; transition: transform .1s, box-shadow .15s, filter .15s; }
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink);
  border-color: transparent; box-shadow: 0 6px 16px rgba(91, 76, 245, .3); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.block { width: 100%; justify-content: center; padding: 11px; }
.btn svg.i { width: 16px; height: 16px; }
form.inline { display: inline; }

label { display: block; font-weight: 600; font-size: 14px; margin: 16px 0 7px; }
label .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=date],
input[type=time], input[type=number], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel-2); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--panel); }
textarea { min-height: 78px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.file-drop { display: flex; align-items: center; gap: 12px; border: 1.5px dashed var(--line); border-radius: 12px;
  padding: 14px; background: var(--panel-2); cursor: pointer; transition: border-color .15s; }
.file-drop:hover { border-color: var(--accent); }
.file-drop input { width: 100%; font-size: 13px; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; margin-top: 18px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.choice { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.choice label { margin: 0; border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer;
  display: flex; gap: 12px; align-items: flex-start; font-weight: 500; transition: border-color .15s, background .15s; }
.choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { accent-color: var(--accent); margin-top: 3px; }
.choice b { display: block; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip { border: 1px solid var(--line); background: var(--panel-2); color: var(--text); padding: 5px 12px; border-radius: 99px;
  font-size: 13px; cursor: pointer; font-weight: 500; }
.chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ---------- feedback ---------- */
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 20px; display: flex; gap: 10px; align-items: center; font-weight: 500; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--err-bg); color: var(--err); }
.notice { padding: 14px 16px; border-radius: 12px; background: var(--info-bg); margin-bottom: 18px; display: flex; gap: 10px; align-items: flex-start; }
.notice:empty { display: none; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.err { background: var(--err-bg); color: var(--err); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px;
  font-weight: 600; background: var(--info-bg); color: var(--accent); white-space: nowrap; text-transform: capitalize; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.completed, .pill.scheduled, .pill.ok, .pill.ready { background: var(--ok-bg); color: var(--ok); }
.pill.waiting, .pill.paused, .pill.skipped { background: var(--warn-bg); color: var(--warn); }
.pill.error, .pill.failed { background: var(--err-bg); color: var(--err); }
.pill.running::before { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 8px 0 6px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; transition: width .5s; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; color: var(--muted); }
.step .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); font-size: 12px; flex: none; }
.step.active { color: var(--text); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.step.active .n { background: var(--accent); border-color: var(--accent); color: #fff; }
.step.done { color: var(--ok); }
.step.done .n { background: var(--ok-bg); border-color: transparent; color: var(--ok); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 22px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; background: var(--panel-2); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--panel-2); }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.proj-name { display: flex; gap: 12px; align-items: center; }
.proj-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #2f80ff, var(--accent)); flex: none; text-transform: uppercase; }
.logs { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; max-height: 340px; overflow: auto; padding: 8px 22px 16px; }
.logs div { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.empty { text-align: center; padding: 56px 16px; color: var(--muted); }
.empty .big { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 14px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); }
.empty .big svg { width: 26px; height: 26px; }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-hero { background: radial-gradient(circle at 20% 20%, #3b2fd1 0%, transparent 55%),
  radial-gradient(circle at 80% 80%, #8b5cf6 0%, transparent 50%), #12132a; color: #fff; padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between; }
.auth-hero h1 { font-size: 38px; line-height: 1.15; margin: 0 0 14px; }
.auth-hero p { color: #c9cbe3; max-width: 440px; font-size: 16px; }
.auth-hero ul { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.auth-hero li { display: flex; gap: 10px; align-items: center; color: #e2e3f5; }
.auth-hero li svg { stroke: #a99cff; }
.auth-side { display: grid; place-items: center; padding: 32px 16px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h2 { font-size: 24px; margin-bottom: 4px; display: block; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 40; }
  .mobile-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--side); color: #fff; position: sticky; top: 0; z-index: 30; }
  .mobile-bar .icon-btn { color: #fff; }
  .content { padding: 22px 16px 48px; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { padding: 32px 20px; }
  .auth-hero h1 { font-size: 28px; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .choice { grid-template-columns: 1fr; }
  th, td { padding: 10px 14px; }
  h1 { font-size: 22px; }
}

/* ---------- toggle switch (admin) ---------- */
.toggle { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); padding: 0; }
.toggle span { width: 38px; height: 22px; border-radius: 99px; background: var(--line); position: relative; transition: background .2s; flex: none; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: left .2s; }
.toggle.on { color: var(--ok); }
.toggle.on span { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.toggle.on span::after { left: 19px; }

/* ---------- plans ---------- */
.credit-badge { display: flex; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 18px; box-shadow: var(--shadow); color: var(--accent); }
.credit-badge b { display: block; font-size: 22px; color: var(--text); line-height: 1.1; }
.credit-badge span { color: var(--muted); font-size: 12px; }
.plan-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 22px; }
.plan { position: relative; text-align: left; font: inherit; color: var(--text); cursor: pointer; display: flex; flex-direction: column; gap: 4px;
  background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 22px 20px; box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s; }
.plan:hover { transform: translateY(-2px); border-color: var(--accent); }
.plan.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.plan.popular { background: linear-gradient(160deg, var(--accent-soft), var(--panel) 60%); }
.plan .tag { position: absolute; top: -11px; right: 16px; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.plan-name { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.plan-price { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.plan-videos { font-weight: 600; }
.calc-grid { display: grid; gap: 28px; grid-template-columns: 1.3fr 1fr; }
.summary { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.total { font-size: 38px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin: 4px 0 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.slider-row { display: flex; gap: 14px; align-items: center; margin: 6px 0 10px; }
.slider-row input[type=number] { width: 120px; font-weight: 700; font-size: 18px; text-align: center; }
input[type=range] { flex: 1; -webkit-appearance: none; appearance: none; height: 8px; border-radius: 99px; outline: none;
  background: linear-gradient(90deg, var(--accent) var(--fill, 0%), var(--line) var(--fill, 0%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  background: #fff; border: 4px solid var(--accent); box-shadow: 0 2px 8px rgba(91, 76, 245, .4); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid var(--accent); }
.tiers { display: grid; gap: 8px; margin-top: 18px; }
.tier { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 14px; transition: background .15s, border-color .15s; }
.tier.on { border-color: var(--accent); background: var(--accent-soft); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.pill.no_credits { background: var(--err-bg); color: var(--err); }

/* ---------- live panel ---------- */
.live-item { padding: 16px 22px; border-bottom: 1px solid var(--line); }
.live-item:last-child { border-bottom: 0; }
.live-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.live-msg { font-size: 13px; color: var(--muted); margin-top: 2px; }
.mini { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.mini b { color: var(--text); font-variant-numeric: tabular-nums; }
.next-up { display: flex; gap: 12px; align-items: center; }
@media (max-width: 900px) { .calc-grid { grid-template-columns: 1fr; } }
.side-badge { margin-left: auto; background: rgba(255, 255, 255, .1); color: #fff; font-size: 12px; font-weight: 700;
  padding: 1px 9px; border-radius: 99px; }

/* ---------- v8: review modal, tabs, calendar, sync ---------- */
.pill.review, .pill.watching { background: var(--info-bg); color: var(--accent); }
.pill.duplicate, .pill.excluded { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
tr.clickable { cursor: pointer; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: 12px; cursor: pointer; }
.linkish:hover { text-decoration: underline; }
.chip svg.i { width: 13px; height: 13px; vertical-align: -2px; }

.sync-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 22px; }
.stat-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted);
  padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.tabs button:hover { color: var(--text); background: var(--panel-2); }
.tabs button.on { color: var(--accent); background: var(--accent-soft); }

.modal { position: fixed; inset: 0; z-index: 100; background: rgba(10, 11, 24, .6); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-box { position: relative; background: var(--panel); border-radius: 18px; width: min(980px, 100%); max-height: 92vh;
  overflow: auto; padding: 24px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.modal-x { position: absolute; top: 12px; right: 12px; color: var(--muted); font-size: 16px; }
.modal-x:hover { color: var(--text); background: var(--panel-2); }
.modal-grid { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
.player { background: #000; border-radius: 14px; overflow: hidden; aspect-ratio: 9 / 16; display: grid; place-items: center; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player [id=m-novideo] { color: #aaa; padding: 20px; text-align: center; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }
.modal-actions[hidden] { display: none; }

.cal-head, .cal-row { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-head div { padding: 10px 12px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); background: var(--panel-2); border-bottom: 1px solid var(--line); }
.cal-day { min-height: 112px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-row .cal-day:last-child { border-right: 0; }
.cal-row:last-child .cal-day { border-bottom: 0; }
.cal-day.out { background: var(--panel-2); }
.cal-day.out .cal-num { opacity: .4; }
.cal-day.past .cal-item { opacity: .6; }
.cal-num { font-size: 13px; font-weight: 600; color: var(--muted); }
.cal-day.today .cal-num { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; width: 26px; height: 26px;
  border-radius: 50%; display: grid; place-items: center; }
.cal-item { display: block; font-size: 12px; line-height: 1.35; padding: 4px 7px; border-radius: 7px; background: var(--accent-soft);
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--accent); }
.cal-item:hover { text-decoration: none; filter: brightness(.97); }
.cal-item b { color: var(--accent); font-weight: 700; }

@media (max-width: 760px) {
  .modal-grid { grid-template-columns: 1fr; }
  .player { max-width: 260px; margin: 0 auto; }
  .cal-day { min-height: 70px; padding: 4px; }
  .cal-item { font-size: 10px; padding: 2px 4px; }
  .cal-item b { display: none; }
  .sync-card { flex-direction: column; align-items: flex-start; }
}

/* setup guide */
.side-link.guide-link { background: rgba(255, 255, 255, .07); border: 1px dashed rgba(255, 255, 255, .22); margin: 4px 0 6px; }
.guide-progress { margin-bottom: 18px; }
.gp-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.gp-bar { height: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.gp-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; transition: width .4s; }
.guide { display: grid; grid-template-columns: 270px 1fr; gap: 18px; align-items: start; }
.guide-nav { padding: 10px; position: sticky; top: 18px; }
.gstep { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 10px; color: var(--text); }
.gstep:hover { background: var(--panel-2); text-decoration: none; }
.gstep.on { background: var(--accent-soft); }
.gnum { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  border: 2px solid var(--line); color: var(--muted); background: var(--panel); }
.gnum svg { width: 15px; height: 15px; }
.gstep.on .gnum { border-color: var(--accent); color: var(--accent); }
.gstep.done .gnum { background: var(--ok); border-color: var(--ok); color: #fff; }
.gtxt { display: flex; flex-direction: column; line-height: 1.3; }
.gtxt small { color: var(--muted); font-size: 12px; }
.gstep.done .gtxt small { color: var(--ok); }
.gp-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.gp-head > svg { width: 38px; height: 38px; padding: 8px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex: none; }
.gp-head h2 { margin: 0; }
.gbadge { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; background: var(--ok-bg); color: var(--ok);
  font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 99px; white-space: nowrap; }
.gbadge svg { width: 14px; height: 14px; }
.gsteps { margin: 14px 0 18px; padding-left: 22px; line-height: 1.65; }
.gsteps li { margin-bottom: 8px; padding-left: 4px; }
.gtip { display: flex; gap: 10px; margin-top: 18px; padding: 12px 14px; background: var(--info-bg); border-radius: 10px; font-size: 13.5px; line-height: 1.55; }
.gtip svg { flex: none; width: 18px; height: 18px; color: var(--accent); margin-top: 1px; }
.gnav-btns { display: flex; justify-content: space-between; margin-top: 14px; }
.gnav-btns .btn:disabled { opacity: .45; cursor: default; }
@media (max-width: 900px) {
  .guide { grid-template-columns: 1fr; }
  .guide-nav { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .gstep { flex: none; }
  .gtxt small { display: none; }
}

/* out-of-credits alert: shakes briefly every few seconds to catch the eye */
.credit-alert { align-items: center; border: 1px solid currentColor; animation: credit-shake 5s ease-in-out 1s infinite; }
.credit-alert .ca-text { flex: 1; }
.credit-alert .btn { flex: none; }
@keyframes credit-shake {
  0%, 12%, 100% { transform: translateX(0); }
  2%, 6%, 10% { transform: translateX(-6px); }
  4%, 8% { transform: translateX(6px); }
}
@media (max-width: 640px) { .credit-alert { flex-wrap: wrap; } .credit-alert .btn { width: 100%; justify-content: center; } }
@media (prefers-reduced-motion: reduce) { .credit-alert { animation: none; } }

/* promo banner carousel (dashboard) */
.promo { position: relative; overflow: hidden; border-radius: var(--radius); margin-bottom: 18px; background: var(--panel-2);
  aspect-ratio: 4 / 1; box-shadow: 0 6px 22px rgba(20, 22, 37, .08); }
.promo-track { display: flex; height: 100%; transition: transform .6s ease; }
.promo-slide { flex: 0 0 100%; height: 100%; }
.promo-slide a, .promo-slide img { display: block; width: 100%; height: 100%; }
.promo-slide img { object-fit: cover; }
.promo-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .85); color: #141625; font-size: 22px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .2s; }
.promo:hover .promo-nav, .promo-nav:focus-visible { opacity: 1; }
.promo-nav.prev { left: 12px; } .promo-nav.next { right: 12px; }
.promo-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 6px; }
.promo-dots button { width: 8px; height: 8px; border-radius: 99px; border: 0; padding: 0; background: rgba(255, 255, 255, .6); cursor: pointer; transition: width .3s; }
.promo-dots button.on { width: 22px; background: #fff; }
@media (max-width: 640px) { .promo-nav { display: none; } }
@media (prefers-reduced-motion: reduce) { .promo-track { transition: none; } }
/* admin list */
.promo-admin { display: grid; gap: 10px; margin-top: 16px; }
.promo-row { display: flex; align-items: center; gap: 14px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.promo-row.off { opacity: .55; }
.promo-row img { width: 160px; aspect-ratio: 4 / 1; object-fit: cover; border-radius: 8px; flex: none; background: var(--panel-2); }
.pr-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pr-info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.promo-add { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 12px; align-items: end; margin-top: 18px;
  padding-top: 16px; border-top: 1px solid var(--line); }
@media (max-width: 900px) { .promo-add { grid-template-columns: 1fr; } .promo-row { flex-wrap: wrap; } .promo-row img { width: 100%; } }

/* longer sidebar: scroll inside it on short screens */
.sidebar { overflow-y: auto; scrollbar-width: thin; }
.side-badge.hot { background: #ef4444; color: #fff; }

/* guide: where the module lives in the sidebar + connection checks */
.gwhere { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; }
.gwhere svg { width: 13px; height: 13px; }
.gwhere b { color: var(--accent); }
.gchecks { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 6px; }
.gchecks span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 5px 10px;
  border-radius: 99px; background: var(--err-bg); color: var(--err); }
.gchecks span.ok { background: var(--ok-bg); color: var(--ok); }
.gchecks svg { width: 14px; height: 14px; }
