:root {
  --ink: #15131f;
  --ink-2: #4a4760;
  --muted: #8a87a0;
  --line: #e8e6f0;
  --bg: #f6f5fa;
  --card: #ffffff;
  --accent: #6d4aff;
  --accent-2: #ff5c8a;
  --accent-soft: #efebff;
  --grad: linear-gradient(135deg, #6d4aff 0%, #b14dff 55%, #ff5c8a 100%);
  --ok: #16a34a;
  --ok-soft: #e7f7ec;
  --warn: #d97706;
  --warn-soft: #fdf3e2;
  --err: #e11d48;
  --err-soft: #fdeaef;
  --draft: #8a87a0;
  --draft-soft: #f0eff5;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(21, 19, 31, .04), 0 6px 24px rgba(21, 19, 31, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---- logo ---- */
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.logo.big { font-size: 28px; justify-content: center; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: url(/favicon.svg) center/cover; flex: none; }
.logo.big .logo-mark { width: 38px; height: 38px; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--card); font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: transform .08s, box-shadow .15s, background .15s;
}
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--grad); color: #fff; border: none; }
.btn.dark { background: var(--ink); color: #fff; border: none; }
.btn.danger { color: var(--err); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; pointer-events: none; }
.link { background: none; border: none; color: var(--muted); cursor: pointer; padding: 0; font-weight: 600; }
.link:hover { color: var(--ink); }

/* ---- login ---- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background:
  radial-gradient(600px 400px at 20% 10%, #e9e2ff 0%, transparent 60%),
  radial-gradient(600px 400px at 90% 90%, #ffe0ea 0%, transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow); display: grid; gap: 14px; text-align: center; }
.login-card p { margin: -6px 0 6px; }
label { display: grid; gap: 6px; text-align: left; font-weight: 600; font-size: 13px; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], textarea, select {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 10px 12px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 120px; }
.form-error { color: var(--err); font-weight: 600; min-height: 1em; }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 16px; border-right: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; gap: 22px; }
.sidebar nav { display: grid; gap: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-weight: 600; color: var(--ink-2); }
.sidebar nav a:hover { background: var(--bg); }
.sidebar nav a.active { background: var(--accent-soft); color: var(--accent); }
.side-foot { margin-top: auto; display: grid; gap: 12px; }
.soon { font-size: 12px; color: var(--muted); padding: 10px 12px; border-radius: 10px; background: var(--bg); }
main { padding: 28px 32px 60px; min-width: 0; }
.tabbar { display: none; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---- icons (CSS-only) ---- */
.ico { width: 18px; height: 18px; display: inline-block; background: currentColor; -webkit-mask: var(--m) center/contain no-repeat; mask: var(--m) center/contain no-repeat; flex: none; }
.ico-cal { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E"); }
.ico-list { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M9 6h11M9 12h11M9 18h11M4 6h.01M4 12h.01M4 18h.01'/%3E%3C/svg%3E"); }
.ico-user { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c1.5-4 4.5-6 8-6s6.5 2 8 6'/%3E%3C/svg%3E"); }

/* ---- calendar ---- */
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav .month { font-weight: 800; font-size: 16px; min-width: 150px; text-align: center; }
.cal { overflow: hidden; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: 10px 12px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
.cal-day { min-height: 118px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; transition: background .15s; }
.cal-day:nth-child(7n) { border-right: none; }
.cal-day:hover { background: #fbfaff; }
.cal-day.other { background: #fcfcfe; color: var(--muted); }
.cal-day .num { font-weight: 700; font-size: 13px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .num { background: var(--ink); color: #fff; }
.chip { display: flex; align-items: center; gap: 6px; padding: 3px 6px 3px 3px; border-radius: 8px; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent); overflow: hidden; }
.chip img, .chip video { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; flex: none; background: #ddd; }
.chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.published { background: var(--ok-soft); color: var(--ok); }
.chip.failed { background: var(--err-soft); color: var(--err); }
.chip.draft { background: var(--draft-soft); color: var(--draft); }
.chip.publishing { background: var(--warn-soft); color: var(--warn); }
.more { font-size: 12px; color: var(--muted); font-weight: 600; padding-left: 4px; }

/* ---- queue ---- */
.tabs { display: flex; gap: 4px; background: var(--card); padding: 4px; border-radius: 12px; box-shadow: var(--shadow); width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs button { border: none; background: none; padding: 8px 14px; border-radius: 9px; font-weight: 700; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.tabs button.active { background: var(--ink); color: #fff; }
.tabs .count { opacity: .6; margin-left: 4px; }
.day-group { margin-top: 22px; }
.day-group h3 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 8px; }
.row { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 12px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); margin-bottom: 8px; cursor: pointer; transition: transform .1s; }
.row:hover { transform: translateY(-1px); }
.thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--bg); display: block; }
.row .meta { min-width: 0; }
.row .top { display: flex; align-items: center; gap: 8px; font-weight: 700; flex-wrap: wrap; }
.row .cap { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.row .err { color: var(--err); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .when { text-align: right; font-weight: 700; white-space: nowrap; }
.badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--bg); color: var(--ink-2); }
.status { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; display: inline-block; }
.status.scheduled { background: var(--accent-soft); color: var(--accent); }
.status.published { background: var(--ok-soft); color: var(--ok); }
.status.failed { background: var(--err-soft); color: var(--err); }
.status.draft { background: var(--draft-soft); color: var(--draft); }
.status.publishing { background: var(--warn-soft); color: var(--warn); }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }

/* ---- composer ---- */
.composer { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.panel { padding: 20px; display: grid; gap: 18px; }
.field-title { font-weight: 700; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; display: flex; justify-content: space-between; gap: 8px; }
.field-title .counter { color: var(--muted); font-weight: 600; }
.field-title .counter.over { color: var(--err); }
.acc-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.acc-pill { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-weight: 700; }
.acc-pill img, .avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--grad); flex: none; }
.acc-pill.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; background: var(--bg); padding: 4px; border-radius: 12px; }
.seg button { border: none; background: none; padding: 9px 6px; border-radius: 9px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.drop.over, .drop:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.drop b { color: var(--ink); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 12px; }
.tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--bg); }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .n { position: absolute; top: 6px; left: 6px; background: rgba(21,19,31,.75); color: #fff; font-size: 11px; font-weight: 800; border-radius: 6px; padding: 1px 6px; }
.tile .x { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; border: none; background: rgba(21,19,31,.75); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; }
.tile .mv { position: absolute; bottom: 6px; left: 6px; right: 6px; display: flex; justify-content: space-between; opacity: 0; transition: opacity .15s; }
.tile:hover .mv { opacity: 1; }
.tile .mv button { width: 24px; height: 24px; border-radius: 6px; border: none; background: rgba(255,255,255,.9); cursor: pointer; font-weight: 800; }
.tile .prog { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--grad); transition: width .2s; }
.tile.loading::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.5); }
.warn-box { background: var(--warn-soft); color: #92400e; border-radius: 10px; padding: 10px 12px; font-size: 13px; font-weight: 600; }
.err-box { background: var(--err-soft); color: var(--err); border-radius: 10px; padding: 10px 12px; font-size: 13px; font-weight: 600; }
.ok-box { background: var(--ok-soft); color: var(--ok); border-radius: 10px; padding: 10px 12px; font-size: 13px; font-weight: 600; }
.when-row { display: grid; grid-template-columns: 1fr 140px; gap: 10px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.quick button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 11px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.quick button:hover { border-color: var(--accent); color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions .spacer { flex: 1; }
.log { font-size: 12px; display: grid; gap: 4px; max-height: 220px; overflow: auto; }
.log div { display: grid; grid-template-columns: 110px 1fr; gap: 8px; color: var(--ink-2); }
.log .e { color: var(--err); }

/* ---- phone preview ---- */
.preview { position: sticky; top: 24px; }
.phone { background: #fff; border-radius: 32px; padding: 12px; box-shadow: var(--shadow), 0 0 0 8px #15131f; margin: 8px; }
.phone-top { display: flex; align-items: center; gap: 8px; padding: 6px 4px 10px; font-weight: 700; font-size: 13px; }
.phone-media { position: relative; background: var(--bg); border-radius: 6px; overflow: hidden; aspect-ratio: 4/5; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.phone-media.tall { aspect-ratio: 9/16; }
.phone-media img, .phone-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.dots { display: flex; justify-content: center; gap: 4px; padding: 8px 0 2px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--accent); }
.phone-icons { display: flex; gap: 14px; padding: 8px 4px; font-size: 18px; }
.phone-cap { font-size: 13px; padding: 0 4px 6px; white-space: pre-wrap; word-break: break-word; max-height: 140px; overflow: hidden; }
.phone-cap b { margin-right: 4px; }
.phone-cap .tag { color: #00376b; }

/* ---- accounts ---- */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.acc-card { padding: 18px; display: grid; gap: 12px; }
.acc-card .head { display: flex; gap: 12px; align-items: center; }
.acc-card .avatar { width: 48px; height: 48px; }
.acc-card .u { font-weight: 800; font-size: 16px; }
.kv { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.kv b { color: var(--ink); }
.bar { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--grad); }
.setup { padding: 22px; display: grid; gap: 10px; max-width: 760px; }
.setup ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-2); }
.setup code { background: var(--bg); padding: 2px 6px; border-radius: 6px; font-size: 12px; word-break: break-all; }

/* ---- toasts ---- */
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 50; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); max-width: 360px; animation: pop .2s ease-out; }
.toast.err { background: var(--err); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* ---- mobile ---- */
@media (max-width: 960px) {
  .composer { grid-template-columns: 1fr; }
  .preview { position: static; max-width: 340px; margin: 0 auto; width: 100%; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  main { padding: 18px 16px 96px; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); z-index: 20; }
  .tabbar a { display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px; }
  .tabbar a.active { color: var(--accent); }
  .tabbar .tab-new { order: 0; font-size: 22px; color: #fff; background: var(--grad); border-radius: 14px; margin: 0 10px; align-content: center; }
  .page-head h1 { font-size: 22px; }
  .cal-day { min-height: 64px; padding: 4px; }
  .cal-head div { padding: 8px 4px; text-align: center; }
  .chip span { display: none; }
  .chip { padding: 2px; width: fit-content; }
  .row { grid-template-columns: 48px 1fr; }
  .row .when { grid-column: 2; text-align: left; font-size: 12px; color: var(--muted); }
  .thumb { width: 48px; height: 48px; }
  .when-row { grid-template-columns: 1fr 1fr; }
  .seg button { font-size: 12px; }
  #toasts { left: 16px; bottom: 84px; }
}

/* ---- bulk ---- */
.ico-stack { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3 2 8l10 5 10-5-10-5Z'/%3E%3Cpath d='m2 13 10 5 10-5M2 17.5l10 5 10-5'/%3E%3C/svg%3E"); }
.bulk { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 24px; align-items: start; }
.bulk-settings { position: sticky; top: 24px; }
.seg.seg3 { grid-template-columns: repeat(3, 1fr); }
.seg.seg2 { grid-template-columns: repeat(2, 1fr); }
.bulk .when-row { grid-template-columns: 1fr 1fr; }
.bulk-list { display: grid; gap: 8px; margin-top: 14px; }
.brow { display: grid; grid-template-columns: 28px 64px minmax(0, 1fr) 200px; gap: 12px; align-items: start; padding: 10px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.bnum { font-weight: 800; color: var(--muted); text-align: center; padding-top: 4px; font-size: 13px; }
.bthumb { width: 64px; height: 88px; border-radius: 10px; overflow: hidden; background: var(--bg); }
.bthumb img, .bthumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.bvid { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); }
.bmain { display: grid; gap: 6px; min-width: 0; }
.bname { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.bname b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.bmain textarea { min-height: 52px; font-size: 13px; padding: 8px 10px; }
.bside { display: grid; gap: 6px; justify-items: end; }
.bside input { font-size: 13px; padding: 8px; }
.bprog { display: inline-block; width: 120px; height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; vertical-align: middle; }
.bprog i { display: block; height: 100%; background: var(--grad); transition: width .2s; }
.ok-dot { color: var(--ok); font-weight: 700; font-size: 12px; }
.err-dot { color: var(--err); font-weight: 700; font-size: 12px; }
@media (max-width: 1100px) {
  .bulk { grid-template-columns: 1fr; }
  .bulk-settings { position: static; }
}
@media (max-width: 760px) {
  .tabbar { grid-template-columns: repeat(5, 1fr); }
  .tabbar .tab-new { margin: 0 4px; }
  .brow { grid-template-columns: 56px minmax(0, 1fr); }
  .bnum { display: none; }
  .bthumb { width: 56px; height: 76px; }
  .bside { grid-column: 1 / -1; grid-template-columns: 1fr auto; align-items: center; }
}

/* ---- trial reels ---- */
.trial { display: grid; gap: 10px; padding: 12px; border-radius: 12px; background: var(--bg); }
.trial-opts { display: grid; gap: 10px; }
.trial-opts .seg { background: #fff; }
.trial-opts .seg button.on { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.trial-hint { font-size: 12px; }
.trial-badge { background: var(--warn-soft); color: #92400e; }

/* ---- stats ---- */
.ico-chart { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 20V10M10 20V4M16 20v-7M22 20H2'/%3E%3C/svg%3E"); }
.stats-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seg.period { width: 270px; }
.stats-meta { font-size: 12px; margin: -8px 0 16px; }
.h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.stat { padding: 16px; display: grid; gap: 4px; align-content: start; }
.tile-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.tile-value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.tile-value .muted { font-size: 20px; }
.tile-note { font-size: 12px; color: var(--muted); }
.delta { font-size: 12px; font-weight: 700; color: var(--muted); }
.delta.up { color: var(--ok); }
.delta.down { color: var(--err); }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.chart-card { padding: 16px 16px 8px; }
.chart-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.chart { position: relative; min-height: 190px; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .bar { fill: var(--accent); }
.chart rect.hl { fill: transparent; }
.chart rect.hl.on { fill: var(--accent-soft); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--accent); opacity: .1; }
.chart .dot { fill: transparent; }
.chart .dot.on { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.chart .end { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.chart .end-label { fill: var(--ink); font-size: 12px; font-weight: 700; font-family: inherit; }
.chart-tip { position: absolute; top: -6px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 12px; white-space: nowrap; pointer-events: none; z-index: 2; }
.chart-tip span { opacity: .75; }
.chart-empty { height: 190px; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 13px; padding: 0 20px; }
.table-wrap { overflow-x: auto; }
.mtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.mtable th { text-align: right; font-size: 12px; color: var(--muted); font-weight: 700; padding: 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none; }
.mtable th:first-child { text-align: left; cursor: default; }
.mtable th.on { color: var(--ink); }
.mtable td { padding: 10px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mtable td:first-child { text-align: left; white-space: normal; min-width: 260px; }
.mtable tr:last-child td { border-bottom: none; }
.mcell { display: flex; gap: 10px; align-items: center; }
.mcell img, .mthumb { width: 40px; height: 52px; border-radius: 8px; object-fit: cover; background: var(--bg); flex: none; display: grid; place-items: center; font-weight: 800; color: var(--muted); font-size: 13px; }
.mcell > span { display: grid; gap: 3px; min-width: 0; }
.mcell .badge { width: fit-content; }
.mcap { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink-2); max-width: 340px; }
.pstats { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
@media (max-width: 900px) { .charts { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .tabbar { grid-template-columns: repeat(6, 1fr); }
  .tabbar a { font-size: 10px; }
  .seg.period { width: 100%; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-value { font-size: 22px; }
}

/* ---- calendar views & account filter ---- */
.acc-filter { margin: -6px 0 16px; }
.acc-filter .acc-pill:first-child { padding-left: 12px; }
.cal-nav { flex-wrap: wrap; }
.seg.cal-views { width: 240px; margin-right: 6px; }
.cal-day .num { border: none; background: none; cursor: pointer; padding: 0; font: inherit; font-weight: 700; color: inherit; }
.cal-day .num:hover { background: var(--accent-soft); color: var(--accent); }
.cal-day.today .num:hover { background: var(--ink); color: #fff; }
button.more { border: none; background: none; text-align: left; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; color: var(--accent); padding: 2px 4px; border-radius: 6px; }
button.more:hover { background: var(--accent-soft); }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: start; }
.wcol { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); min-height: 160px; display: flex; flex-direction: column; }
.wcol.past { opacity: .75; }
.whead { display: flex; align-items: baseline; gap: 6px; padding: 10px 12px; border: none; border-bottom: 1px solid var(--line); background: none; cursor: pointer; font: inherit; color: var(--ink-2); text-transform: capitalize; border-radius: var(--radius) var(--radius) 0 0; }
.whead:hover { background: var(--bg); }
.whead b { font-size: 18px; color: var(--ink); }
.wcol.today .whead b { background: var(--ink); color: #fff; border-radius: 50%; width: 28px; height: 28px; display: inline-grid; place-items: center; font-size: 14px; }
.wcount { margin-left: auto; font-size: 11px; font-weight: 800; background: var(--accent-soft); color: var(--accent); border-radius: 99px; padding: 1px 7px; }
.wlist { display: grid; gap: 6px; padding: 8px; }
.wcard { display: flex; gap: 8px; padding: 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); transition: border-color .15s; }
.wcard:hover { border-color: var(--ink-2); }
.wtime { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.wtime b { color: var(--ink); }
.wmark { font-size: 11px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: baseline; gap: 3px; }
.wmark i { font-style: normal; }
.wmark.published { color: var(--ok); }
.wmark.failed { color: var(--err); }
.wthumb { width: 32px; height: 44px; border-radius: 6px; object-fit: cover; background: var(--line); flex: none; display: block; }
.winfo { display: grid; font-size: 12px; min-width: 0; line-height: 1.3; }
.winfo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.winfo .wtype { color: var(--muted); }
.wadd { text-align: center; color: var(--muted); font-weight: 700; padding: 4px; border-radius: 8px; border: 1px dashed var(--line); }
.wadd:hover { color: var(--accent); border-color: var(--accent); }
.day-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; font-weight: 700; }
.day-summary .btn { margin-left: auto; }
@media (max-width: 1100px) { .week { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .week { grid-template-columns: 1fr; }
  .wcol { min-height: 0; }
  .seg.cal-views { width: 100%; margin: 0; }
  .acc-filter { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .acc-filter .acc-pill { flex: none; }
}

/* ---- threads ---- */
.ptag { font-size: 10px; font-weight: 800; letter-spacing: .02em; color: var(--ink-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; margin-left: 6px; vertical-align: 1px; }
.acc-pill.on .ptag { color: var(--accent); border-color: currentColor; }
.seg.seg5 { grid-template-columns: repeat(5, 1fr); }
.seg button:disabled { opacity: .35; cursor: not-allowed; }
.thread-text { font-size: 15px; max-height: none; padding: 4px 4px 10px; }

/* ---- media library ---- */
.ico-media { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='3'/%3E%3Ccircle cx='9' cy='10' r='2'/%3E%3Cpath d='m21 16-5-5-9 9'/%3E%3C/svg%3E"); }
.lib-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 18px 0 10px; }
.lib-bar input[type=text] { width: 240px; }
.lib-bar select { width: auto; }
.seg.lib-kind { width: 230px; }
.lib-actions { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; min-height: 32px; }
.lib-actions .spacer { flex: 1; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.lib-card { overflow: hidden; display: flex; flex-direction: column; border: 2px solid transparent; }
.lib-card.sel { border-color: var(--accent); }
.lib-prev { position: relative; aspect-ratio: 4 / 5; background: var(--bg); }
.lib-prev img, .lib-prev video { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-missing { height: 100%; display: grid; place-items: center; color: var(--err); font-size: 12px; font-weight: 700; }
.lib-kind-tag { position: absolute; left: 8px; bottom: 8px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(21, 19, 31, .7); border-radius: 6px; padding: 2px 7px; }
.lib-pick { position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }
.lib-info { padding: 10px 12px 12px; display: grid; gap: 4px; font-size: 12px; }
.lib-name { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-meta { color: var(--ink-2); }
.lib-meta b { color: var(--ink); }
.lib-usage { font-weight: 700; color: var(--muted); }
.lib-usage.pending { color: var(--accent); }
.lib-usage.published { color: var(--ok); }
.lib-use { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-use:hover { color: var(--accent); }
.lib-note { color: var(--muted); }
.lib-del { color: var(--err); justify-self: start; margin-top: 2px; font-size: 12px; }
.lib-del:hover { color: var(--err); text-decoration: underline; }
@media (max-width: 760px) {
  .lib-bar input[type=text], .seg.lib-kind, .lib-bar select { width: 100%; }
  .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- youtube ---- */
.ico-yt { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='20' height='14' rx='4'/%3E%3Cpath d='m10 9 5 3-5 3z'/%3E%3C/svg%3E"); }
.yt-form { max-width: 860px; }
.yt-row { display: flex; gap: 10px; }
.yt-row input { flex: 1; }
.yt-card { display: flex; gap: 16px; align-items: flex-start; padding-top: 6px; }
.yt-card img { width: 240px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: var(--bg); flex: none; }
.yt-title { font-weight: 800; font-size: 16px; line-height: 1.3; margin-bottom: 4px; }
.yt-meta .quick button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.yt-job { grid-template-columns: 96px 1fr auto; cursor: default; }
.yt-job:hover { transform: none; }
.yt-job .thumb { width: 96px; height: 54px; }
.yt-job .top { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yt-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.yt-prog { display: inline-block; width: 160px; height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; vertical-align: middle; }
.yt-prog i { display: block; height: 100%; background: var(--grad); transition: width .3s; }
@media (max-width: 760px) {
  .yt-row { flex-direction: column; }
  .yt-card { flex-direction: column; }
  .yt-card img { width: 100%; }
  .yt-job { grid-template-columns: 72px 1fr; }
  .yt-job .thumb { width: 72px; height: 40px; }
  .yt-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---- meta block banner ---- */
.block-banner { margin-bottom: 18px; line-height: 1.5; font-weight: 500; }
.block-banner b { font-weight: 800; }
