:root {
  --bg: #0d0f14;
  --bg-2: #12151c;
  --panel: #161a23;
  --panel-2: #1c212c;
  --line: #262c39;
  --line-2: #323a4a;
  --text: #e8ebf2;
  --muted: #8a93a6;
  --dim: #5f687b;
  --accent: #6d5efc;
  --accent-2: #8b7fff;
  --accent-soft: rgba(109, 94, 252, .14);
  --ok: #2fbf71;
  --warn: #f0a429;
  --err: #f0524f;
  --info: #3ea6ff;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent-2); text-decoration: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 15px; }
h3 { font-size: 14px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
[hidden] { display: none !important; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--bg-2); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 6px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), #b05cff); display: grid; place-items: center; }
.brand-mark svg { width: 22px; height: 22px; stroke: #fff; stroke-width: 2.6; }
.brand-name { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 11.5px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--panel); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--text); }
.nav a.active svg { color: var(--accent-2); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.foot-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.meter { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 7px; }
.meter > div { height: 100%; background: linear-gradient(90deg, var(--accent), #b05cff); }
.main { min-width: 0; }
.view { padding: 26px 32px 60px; max-width: 1320px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 5px 0 0; color: var(--muted); }
.sim-banner { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 9px 32px; background: rgba(240, 164, 41, .1); border-bottom: 1px solid rgba(240, 164, 41, .25); color: #f6c46f; font-size: 13px; }
.sim-banner a { color: #f6c46f; font-weight: 600; white-space: nowrap; }

/* ---------- primitives ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); gap: 10px; }
.grid { display: grid; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s; }
.btn:hover { background: #242a37; border-color: #3d4659; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-danger { color: #ff8a87; }
.btn-danger:hover { background: rgba(240, 82, 79, .12); border-color: rgba(240, 82, 79, .4); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); border-color: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn svg { width: 16px; height: 16px; }
.icon-btn { width: 32px; padding: 0; }

label.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12.5px; color: var(--muted); font-weight: 550; display: flex; justify-content: space-between; gap: 8px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 9px; color: var(--text); font: inherit; padding: 9px 11px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
input[type=datetime-local] { color-scheme: dark; }
select { appearance: none; background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a93a6' stroke-width='2.5'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
.hint { font-size: 12px; color: var(--dim); line-height: 1.45; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.s-scheduled, .s-pending { color: var(--info); background: rgba(62, 166, 255, .1); border-color: rgba(62, 166, 255, .25); }
.s-processing { color: var(--warn); background: rgba(240, 164, 41, .1); border-color: rgba(240, 164, 41, .25); }
.s-posted, .s-success { color: var(--ok); background: rgba(47, 191, 113, .1); border-color: rgba(47, 191, 113, .25); }
.s-partial { color: #c3d94a; background: rgba(195, 217, 74, .1); border-color: rgba(195, 217, 74, .25); }
.s-failed, .s-error { color: var(--err); background: rgba(240, 82, 79, .1); border-color: rgba(240, 82, 79, .25); }
.s-draft, .s-cancelled, .s-info { color: var(--muted); }
.s-warn { color: var(--warn); background: rgba(240, 164, 41, .1); border-color: rgba(240, 164, 41, .25); }
.s-processing .dot { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* platform icon */
.pf { width: 26px; height: 26px; border-radius: 7px; display: inline-grid; place-items: center; font-size: 10.5px; font-weight: 800; color: #fff; flex-shrink: 0; letter-spacing: -.02em; }
.pf-xs { width: 16px; height: 16px; border-radius: 5px; font-size: 8px; }
.pf-sm { width: 20px; height: 20px; border-radius: 6px; font-size: 9px; }
.pf-lg { width: 40px; height: 40px; border-radius: 11px; font-size: 14px; }
.pf svg { width: 60%; height: 60%; fill: currentColor; stroke: none; }
.pf-youtube { background: #ff0033; }
.pf-tiktok { background: #000; box-shadow: inset 0 0 0 1px #333; }
.pf-instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285AEB 90%); }
.pf-facebook { background: #1877f2; }
.pf-threads { background: #000; box-shadow: inset 0 0 0 1px #333; }
.pf-x { background: #000; box-shadow: inset 0 0 0 1px #333; }
.pf-stack { display: inline-flex; }
.pf-stack .pf { margin-left: -5px; box-shadow: 0 0 0 2px var(--panel); }
.pf-stack .pf:first-child { margin-left: 0; }

/* ---------- dashboard ---------- */
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 16px 18px; }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 550; display: flex; align-items: center; gap: 7px; }
.stat-value { font-size: 28px; font-weight: 700; margin-top: 8px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; color: var(--dim); margin-top: 2px; }
.dash-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); margin-top: 16px; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding: 16px 18px 0; }
.chart .bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .bar { width: 100%; max-width: 26px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); min-height: 3px; position: relative; }
.chart .bar.zero { background: var(--line); }
.chart .bar:hover::after { content: attr(data-v); position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--text); background: var(--panel-2); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-2); }
.chart-x { display: flex; gap: 6px; padding: 6px 18px 14px; }
.chart-x span { flex: 1; text-align: center; font-size: 10.5px; color: var(--dim); }
.acc-mini { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 14px 18px 18px; }
.acc-mini a { display: flex; align-items: center; gap: 9px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); min-width: 0; }
.acc-mini a:hover { border-color: var(--line-2); background: var(--panel-2); }
.acc-mini .nm { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--panel-2); }
.thumb { width: 46px; height: 46px; border-radius: 8px; background: var(--bg-2) center/cover no-repeat; flex-shrink: 0; border: 1px solid var(--line); display: grid; place-items: center; color: var(--dim); position: relative; overflow: hidden; }
.thumb svg { width: 18px; height: 18px; }
.thumb .vid-ico { position: absolute; right: 3px; bottom: 3px; background: rgba(0, 0, 0, .65); border-radius: 4px; padding: 1px 3px; color: #fff; display: flex; }
.thumb .vid-ico svg { width: 10px; height: 10px; fill: #fff; stroke: none; }
.li-main { flex: 1; min-width: 0; }
.li-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sub { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 8px; }
.empty { padding: 34px 18px; text-align: center; color: var(--muted); }
.empty svg { width: 34px; height: 34px; color: var(--dim); margin-bottom: 8px; }
.log-line { display: flex; gap: 10px; padding: 9px 18px; border-bottom: 1px solid var(--line); font-size: 12.5px; align-items: flex-start; }
.log-line:last-child { border-bottom: 0; }
.log-line .t { color: var(--dim); white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 92px; }
.log-line .m { flex: 1; word-break: break-word; line-height: 1.45; }

/* ---------- library ---------- */
.dropzone { border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 26px; text-align: center; color: var(--muted); transition: border-color .15s, background .15s; cursor: pointer; }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.dropzone svg { width: 30px; height: 30px; color: var(--accent-2); margin-bottom: 6px; }
.dropzone b { color: var(--text); }
.uploads { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.upload-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.upload-row .meter { flex: 1; margin: 0; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.media-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s; position: relative; }
.media-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.media-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.media-card .preview { aspect-ratio: 1 / 1; background: var(--bg-2) center/cover no-repeat; display: grid; place-items: center; color: var(--dim); position: relative; }
.media-card .preview video { width: 100%; height: 100%; object-fit: cover; }
.media-card .dur { position: absolute; right: 7px; bottom: 7px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 5px; display: flex; align-items: center; gap: 4px; }
.media-card .dur svg { width: 9px; height: 9px; fill: #fff; stroke: none; }
.media-card .used { position: absolute; left: 7px; top: 7px; }
.media-card .meta { padding: 9px 11px; }
.media-card .nm { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card .check { position: absolute; right: 8px; top: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); display: none; place-items: center; }
.media-card.selected .check { display: grid; }
.media-card .check svg { width: 13px; height: 13px; stroke: #fff; stroke-width: 3; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 550; padding: 5px 12px; border-radius: 7px; cursor: pointer; }
.seg button.on { background: var(--panel-2); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }

/* ---------- composer ---------- */
.compose { grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); align-items: start; }
.picked-media { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.picked-media .thumb { width: 72px; height: 72px; }
.pf-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pf-opt { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--bg-2); user-select: none; position: relative; transition: border-color .15s, background .15s; }
.pf-opt:hover { border-color: var(--line-2); }
.pf-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.pf-opt.disabled { opacity: .45; cursor: not-allowed; }
.pf-opt .nm { font-weight: 600; font-size: 13px; }
.pf-opt .st { font-size: 11px; color: var(--dim); }
.pf-opt input { display: none; }
.counter-row { display: flex; flex-wrap: wrap; gap: 6px; }
.counter { font-size: 11.5px; padding: 2px 8px; border-radius: 99px; background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); display: inline-flex; gap: 5px; align-items: center; }
.counter.over { color: var(--err); border-color: rgba(240, 82, 79, .4); }
.issues { border: 1px solid rgba(240, 164, 41, .3); background: rgba(240, 164, 41, .07); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: #f6c46f; }
.issues ul { margin: 4px 0 0; padding-left: 18px; }
.when-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.when-opt { padding: 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; text-align: center; font-weight: 600; font-size: 13px; background: var(--bg-2); }
.when-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.quick-times { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 4px 10px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--line-2); }
details.adv summary { cursor: pointer; color: var(--muted); font-weight: 550; font-size: 13px; list-style: none; display: flex; align-items: center; gap: 6px; }
details.adv summary::before { content: '▸'; transition: transform .15s; }
details.adv[open] summary::before { transform: rotate(90deg); }
.preview-card { position: sticky; top: 20px; }
.phone { background: #000; border-radius: 22px; padding: 12px; border: 1px solid var(--line-2); }
.phone-media { aspect-ratio: 9 / 14; max-height: 52vh; margin: 0 auto; border-radius: 12px; background: #111 center/cover no-repeat; display: grid; place-items: center; color: var(--dim); overflow: hidden; }
.phone-media video, .phone-media img { width: 100%; height: 100%; object-fit: cover; }
.phone-cap { color: #ddd; font-size: 12.5px; line-height: 1.45; padding: 10px 4px 2px; white-space: pre-wrap; word-break: break-word; max-height: 140px; overflow: hidden; }
.preview-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.preview-tabs button { border: 1px solid var(--line); background: var(--bg-2); border-radius: 8px; padding: 4px; cursor: pointer; opacity: .55; }
.preview-tabs button.on { opacity: 1; border-color: var(--accent); }

/* ---------- calendar ---------- */
.cal-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.cal-head div { padding: 10px; font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cell { min-width: 0; min-height: 116px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell:hover { background: rgba(255, 255, 255, .015); }
.cal-cell.other { background: rgba(0, 0, 0, .18); }
.cal-cell.other .cal-day { color: var(--dim); }
.cal-day { font-size: 12px; font-weight: 600; color: var(--muted); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-cell.today .cal-day { background: var(--accent); color: #fff; }
.cal-ev { display: flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 3px 5px; border-radius: 6px; background: var(--panel-2); border-left: 3px solid var(--info); overflow: hidden; cursor: pointer; }
.cal-ev:hover { background: #262d3b; }
.cal-ev .tm { color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-ev .tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.cal-ev.st-posted { border-left-color: var(--ok); }
.cal-ev.st-failed { border-left-color: var(--err); }
.cal-ev.st-partial { border-left-color: #c3d94a; }
.cal-ev.st-processing { border-left-color: var(--warn); }
.cal-ev.st-draft, .cal-ev.st-cancelled { border-left-color: var(--dim); opacity: .7; }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 4px; }

/* ---------- table ---------- */
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--panel-2); }

/* ---------- accounts ---------- */
.acc-grid { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.acc-card .acc-top { display: flex; gap: 12px; align-items: center; padding: 16px 18px; }
.acc-card .acc-body { padding: 0 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.acc-user { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--panel-2) center/cover; flex-shrink: 0; }
.copy-box { display: flex; gap: 6px; align-items: center; }
.copy-box code { flex: 1; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.acc-note { font-size: 12px; color: var(--muted); line-height: 1.5; background: var(--bg-2); border-radius: 9px; padding: 9px 11px; border: 1px solid var(--line); }

/* ---------- settings ---------- */
.set-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.toggle { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: var(--line-2); border-radius: 99px; cursor: pointer; transition: background .15s; }
.toggle span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::before { transform: translateX(18px); }
.set-row { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
ol.steps { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.7; font-size: 13px; }
ol.steps code, .acc-note code, .hint code { background: var(--bg-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; font-size: 11.5px; color: var(--text); }

/* ---------- modal & toasts ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(4, 6, 10, .72); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 24px; animation: fade .15s; }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; width: min(760px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; box-shadow: var(--shadow); animation: pop .18s; }
.modal-wide { width: min(1080px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); gap: 10px; }
.modal-body { padding: 18px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.media-view { max-width: 100%; max-height: 60vh; border-radius: 10px; display: block; margin: 0 auto; background: #000; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); padding: 11px 14px; border-radius: 10px; box-shadow: var(--shadow); max-width: 380px; font-size: 13px; animation: pop .2s; }
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
.target-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.target-row:last-child { border-bottom: 0; }
.target-err { font-size: 12px; color: #ff8a87; margin-top: 3px; word-break: break-word; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.spin { width: 16px; height: 16px; border: 2px solid var(--line-2); border-top-color: var(--accent-2); border-radius: 50%; animation: rot .7s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .compose, .set-grid { grid-template-columns: 1fr; }
  .preview-card { position: static; }
}
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .view { padding: 18px; }
  .pf-picker, .when-opts { grid-template-columns: repeat(2, 1fr); }
  .acc-grid { grid-template-columns: 1fr; }
}

/* ================= multi-profil & multi-akun ================= */
.profile-switch { display: flex; flex-direction: column; gap: 5px; }
.ps-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); font-weight: 600; padding-left: 4px; }
.ps-box { position: relative; display: flex; align-items: center; }
.ps-box .pdot { position: absolute; left: 11px; pointer-events: none; }
.ps-box .pdot.img { width: 20px; height: 20px; left: 7px; }
.ps-box select { padding-left: 34px; font-weight: 600; background-color: var(--panel); }
.pdot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; background: var(--dim); }
.pchip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 2px 8px 2px 7px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* avatar akun + badge platform */
.acc-ava { position: relative; width: 30px; height: 30px; flex-shrink: 0; }
.acc-ava .av { width: 100%; height: 100%; border-radius: 50%; background: var(--panel-2) center/cover; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; }
.acc-ava .pf { position: absolute; right: -4px; bottom: -4px; width: 16px; height: 16px; border-radius: 5px; box-shadow: 0 0 0 2px var(--panel); }
.acc-ava.sm { width: 22px; height: 22px; }
.acc-ava.sm .av { font-size: 9.5px; }
.acc-ava.sm .pf { width: 12px; height: 12px; border-radius: 4px; right: -3px; bottom: -3px; }
.acc-ava.lg { width: 40px; height: 40px; }
.acc-ava.lg .pf { width: 20px; height: 20px; }
.ava-stack { display: inline-flex; }
.ava-stack .acc-ava { margin-left: -4px; }
.ava-stack .acc-ava:first-child { margin-left: 0; }
.ava-stack .acc-ava .av { box-shadow: 0 0 0 2px var(--panel); }

/* pemilih akun di composer */
.acc-group { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.acc-group + .acc-group { margin-top: 10px; }
.acc-group-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.acc-group-head b { font-size: 13px; }
.acc-group-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; padding: 10px; }
.acc-opt { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--panel); user-select: none; min-width: 0; transition: border-color .15s, background .15s; }
.acc-opt:hover { border-color: var(--line-2); }
.acc-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.acc-opt.disabled { opacity: .4; cursor: not-allowed; }
.acc-opt .nm { font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-opt .st { font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-opt .tick { margin-left: auto; width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--line-2); display: grid; place-items: center; flex-shrink: 0; }
.acc-opt.on .tick { background: var(--accent); border-color: var(--accent); }
.acc-opt .tick svg { width: 12px; height: 12px; stroke: #fff; stroke-width: 3; opacity: 0; }
.acc-opt.on .tick svg { opacity: 1; }

/* halaman profil & akun */
.prof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 16px; }
.prof-card { overflow: hidden; }
.prof-ava { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: 16px; color: #fff; background-color: var(--pc, var(--accent)); background-size: cover; background-position: center; flex-shrink: 0; }
.prof-ava.xs { width: 20px; height: 20px; font-size: 9px; }
.prof-ava.sm { width: 32px; height: 32px; font-size: 13px; }
.prof-ava.xl { width: 84px; height: 84px; font-size: 30px; box-shadow: 0 0 0 4px var(--panel); }
.prof-cover { position: relative; height: 120px; background: linear-gradient(135deg, var(--pc, var(--accent)), color-mix(in srgb, var(--pc, var(--accent)) 35%, #0d0f14)); background-size: cover; background-position: center; }
.prof-cover-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.prof-cover-actions .btn { background: rgba(13, 15, 20, .72); border-color: rgba(255, 255, 255, .12); backdrop-filter: blur(6px); }
.prof-id { display: flex; align-items: flex-start; gap: 14px; padding: 0 18px; margin-top: -42px; position: relative; }
.prof-names { min-width: 0; padding-top: 48px; }
.prof-names h2 { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prof-user { color: var(--muted); font-weight: 550; }
.prof-body { padding: 12px 18px 16px; }
.prof-bio { white-space: pre-wrap; line-height: 1.5; word-break: break-word; }
.prof-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; }
.kit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.kit-btn { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }
.kit-btn:hover { border-color: var(--accent); }
.kit-btn svg { width: 13px; height: 13px; }

/* dialog ubah profil */
.pe-cover { position: relative; height: 150px; border-radius: 12px; cursor: pointer; background: linear-gradient(135deg, var(--pc, var(--accent)), color-mix(in srgb, var(--pc, var(--accent)) 35%, #0d0f14)); background-size: cover; background-position: center; margin-bottom: 46px; }
.pe-cover-btn { position: absolute; top: 10px; right: 10px; background: rgba(13, 15, 20, .72); border-color: rgba(255, 255, 255, .12); pointer-events: none; }
.pe-ava { position: absolute; left: 18px; bottom: -42px; width: 96px; height: 96px; border-radius: 50%; background-color: var(--pc, var(--accent)); background-size: cover; background-position: center; box-shadow: 0 0 0 4px var(--panel); cursor: pointer; display: grid; place-items: center; }
.pe-ava::before { content: attr(data-initial); font-size: 34px; font-weight: 800; color: #fff; grid-area: 1 / 1; }
.pe-ava-cam { grid-area: 1 / 1; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(13, 15, 20, .65); opacity: 0; transition: opacity .15s; }
.pe-ava:hover .pe-ava-cam, .pe-cover:hover .pe-cover-btn { opacity: 1; }
.pe-ava-cam svg { width: 17px; height: 17px; }
.pe-img-info { display: flex; justify-content: space-between; gap: 12px; padding-left: 128px; margin-top: -38px; min-height: 34px; margin-bottom: 10px; }
.pe-img-info > span:last-child { text-align: right; }
.pe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.input-prefix { display: flex; align-items: center; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 9px; }
.input-prefix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-prefix > span { padding-left: 11px; color: var(--muted); }
.input-prefix input { border: 0; background: transparent; padding-left: 3px; box-shadow: none !important; }
.danger-box { border: 1px solid rgba(240, 82, 79, .4); background: rgba(240, 82, 79, .08); border-radius: 10px; padding: 12px 14px; line-height: 1.55; }
.danger-box ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
@media (max-width: 640px) { .pe-grid { grid-template-columns: 1fr; } .pe-img-info { padding-left: 0; margin-top: 0; flex-direction: column; } }
.acc-row { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--line); }
.acc-row .info { flex: 1; min-width: 0; }
.acc-row .info b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-row select { height: 30px; padding: 4px 28px 4px 8px; font-size: 12px; margin-top: 6px; max-width: 260px; }
.connect-bar { padding: 12px 18px 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.connect-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 5px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.connect-btn:hover { border-color: var(--accent); }
.connect-btn.off { opacity: .45; }
.connect-btn .pf { width: 20px; height: 20px; border-radius: 6px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; }
.swatch.on { border-color: #fff; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.prof-mini { padding: 12px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.prof-mini:last-child { border-bottom: 0; }
.cal-ev .pdot { width: 7px; height: 7px; }
@media (max-width: 820px) { .prof-grid { grid-template-columns: 1fr; } }

/* halaman masuk & keamanan */
.auth-body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(900px 500px at 50% -10%, rgba(109, 94, 252, .18), transparent), var(--bg); }
.auth-wrap { width: min(400px, calc(100% - 32px)); padding: 32px 0; }
.auth-brand { justify-content: center; margin-bottom: 18px; }
.auth-card { padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.auth-card h1 { font-size: 21px; }
.auth-card p { margin: -6px 0 2px; font-size: 13px; line-height: 1.5; }
.auth-error { background: rgba(240, 82, 79, .1); border: 1px solid rgba(240, 82, 79, .4); color: #ff9a97; border-radius: 9px; padding: 9px 12px; font-size: 13px; }
.auth-foot { text-align: center; margin-top: 14px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-2); font: inherit; font-size: 12px; cursor: pointer; }
.user-box { display: flex; align-items: center; gap: 9px; }
.user-box .uava { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line-2); font-weight: 700; font-size: 12px; flex-shrink: 0; }
.user-box b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sess-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.sess-row:last-child { border-bottom: 0; }
