:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #172b4d;
  --muted: #5e6c84;
  --faint: #8993a4;
  --line: #e3e7ee;
  --accent: #0b5cd5;
  --accent-soft: #e9f2ff;
  --violet: #7c4dff;
  --violet-soft: #f1ecff;
  --brand: linear-gradient(135deg, #7c4dff, #0b5cd5);
  --green: #1f9d55;
  --green-soft: #e3f6ea;
  --amber: #a86f00;
  --amber-soft: #fff4d6;
  --red: #c93a3a;
  --red-soft: #fde8e8;
  --sun: #ffd166;
  --shadow: 0 1px 2px rgba(23, 43, 77, 0.06), 0 8px 24px rgba(23, 43, 77, 0.08);
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1420;
    --card: #182033;
    --ink: #edf1f8;
    --muted: #a3afc4;
    --faint: #7d8aa2;
    --line: #2a3550;
    --accent: #7fb0ff;
    --accent-soft: #1b2b4a;
    --violet: #a98bff;
    --violet-soft: #2a2247;
    --green: #4fd48a;
    --green-soft: #15362a;
    --amber: #f0b552;
    --amber-soft: #3a2c12;
    --red: #ff8077;
    --red-soft: #3d1b1b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
}
h1, h2, h3 { font-family: 'Inter Tight', 'Inter', system-ui, sans-serif; letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
a { color: var(--accent); }
img, video { max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
textarea { resize: vertical; min-height: 120px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; padding: 0; margin: 0; accent-color: var(--accent); flex: none; }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 600px) { .wrap { padding: 0 24px; } }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-family: 'Inter Tight', sans-serif; font-size: 19px; text-decoration: none; color: var(--ink); }
.brand img { width: 32px; height: 32px; border-radius: 9px; display: block; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; flex-wrap: wrap; }
.top .right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.top form { margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 18px; font-weight: 600; text-decoration: none; color: var(--ink); transition: transform 0.08s, background 0.2s, opacity 0.2s; white-space: nowrap; }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--brand); border-color: transparent; color: #fff; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn.ghost { background: transparent; }
.btn[disabled], .btn[aria-disabled=true] { opacity: 0.45; cursor: not-allowed; }
.btn[disabled]:active { transform: none; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font: inherit; cursor: pointer; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--line); color: var(--ink); white-space: nowrap; }
.chip.ok { background: var(--green-soft); color: var(--green); }
.chip.warn { background: var(--amber-soft); color: var(--amber); }
.chip.bad { background: var(--red-soft); color: var(--red); }
.chip.info { background: var(--accent-soft); color: var(--accent); }
.chip.off { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.notice { border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.notice.error { background: var(--red-soft); color: var(--red); }
.notice.ok { background: var(--green-soft); color: var(--green); }
.notice.warn { background: var(--amber-soft); color: var(--amber); }
.notice.info { background: var(--accent-soft); color: var(--ink); }

.net { width: 28px; height: 28px; border-radius: 8px; display: inline-grid; place-items: center; color: #fff; font-size: 11px; font-weight: 800; flex: none; letter-spacing: 0; }
.net.instagram { background: linear-gradient(45deg, #f9a825, #e1306c 55%, #833ab4); }
.net.threads, .net.tiktok { background: #111; }
.net.telegram { background: #229ed9; }
.net.youtube { background: #ff0033; }
.net.sm { width: 20px; height: 20px; border-radius: 6px; font-size: 9px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand); flex: none; display: grid; place-items: center; font-weight: 700; color: #fff; position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---- toast ---- */
.toasts { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; width: min(460px, calc(100% - 32px)); }
.toast { background: var(--ink); color: var(--bg); border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); animation: up 0.25s ease-out; }
.toast.error { background: var(--red); color: #fff; }
.toast span { flex: 1; }
.toast button { background: none; border: 0; color: inherit; font-weight: 700; padding: 0 4px; }
@keyframes up { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- footer ---- */
.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 22px 0 36px; font-size: 13px; color: var(--muted); display: grid; gap: 8px; }
.foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.foot nav a { color: var(--ink); font-weight: 600; text-decoration: none; }
.foot nav a:hover { text-decoration: underline; }
.foot p { margin: 0; }

/* ---- legal pages ---- */
.doc { max-width: 760px; }
.doc h1 { font-size: clamp(28px, 5vw, 36px); margin: 18px 0 8px; }
.doc h2 { font-size: 19px; margin: 28px 0 8px; }
.doc p, .doc li { color: var(--ink); }
.doc ul, .doc ol { padding-left: 22px; display: grid; gap: 4px; }
.doc .meta { color: var(--muted); margin: 0 0 18px; }
.doc table { border-collapse: collapse; width: 100%; font-size: 14px; }
.doc th, .doc td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.doc th { background: var(--card); }
.table-wrap { overflow-x: auto; }

/* ---- landing ---- */
.hero { display: grid; gap: 36px; align-items: center; padding: 28px 0 56px; }
@media (min-width: 940px) { .hero { grid-template-columns: 1fr 1fr; padding-top: 48px; } }
.hero h1 { font-size: clamp(34px, 6vw, 54px); letter-spacing: -0.035em; }
.hero h1 em { font-style: normal; background: var(--brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 18px; color: var(--muted); max-width: 34em; margin: 18px 0 22px; }
.nets-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.nets-row span { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.signin { padding: 18px; display: grid; gap: 10px; max-width: 460px; }
.signin h2 { font-size: 18px; }
.signin form { display: flex; gap: 8px; flex-wrap: wrap; }
.signin input { flex: 1 1 220px; }
.signin .btn { flex: 0 0 auto; }
.signin .alt { display: flex; gap: 8px; flex-wrap: wrap; }
.signin .alt .btn { flex: 1 1 200px; }

.mock { position: relative; display: grid; gap: 14px; }
.mock .win { padding: 0; overflow: hidden; }
.mock .bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.mock .bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.mock .bar span { margin-left: 10px; font-size: 12px; color: var(--faint); background: var(--bg); border-radius: 6px; padding: 2px 10px; }
.mock .body { padding: 16px; display: grid; gap: 12px; }
.mock .head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.mock .head b { font: 700 18px 'Inter Tight', sans-serif; }
.mock .pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; border: 1px solid var(--line); border-radius: 10px; padding: 5px 10px 5px 5px; }
.mock .pill.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.mock .pills { display: flex; gap: 6px; flex-wrap: wrap; }
.mock .txt { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.mock .txt .tag { color: var(--accent); }
.mock .row { display: flex; gap: 10px; align-items: center; }
.mock .thumb { width: 64px; height: 64px; border-radius: 10px; flex: none; background: linear-gradient(160deg, #ffcf86, #e57b5a 60%, #8c4a3c); position: relative; }
.mock .thumb.v::after { content: ''; position: absolute; left: 26px; top: 22px; border-left: 14px solid #fff; border-top: 10px solid transparent; border-bottom: 10px solid transparent; }
.mock .ok { color: var(--green); font-size: 13px; font-weight: 600; }
.mock .go { background: var(--brand); color: #fff; border-radius: 10px; padding: 8px 14px; font-weight: 700; font-size: 14px; }
.mock .q { display: grid; gap: 8px; }
.mock .qi { display: flex; gap: 10px; align-items: center; font-size: 13px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; flex-wrap: wrap; }
.mock .qi .t { flex: 1 1 160px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mock .qi .thumb { width: 34px; height: 34px; border-radius: 8px; }
.mock .qi .thumb.v::after { left: 13px; top: 10px; border-left-width: 9px; border-top-width: 7px; border-bottom-width: 7px; }

.section { padding-bottom: 54px; display: grid; gap: 16px; }
.section > h2 { font-size: clamp(24px, 4vw, 30px); }
.section > p.sub { margin: -6px 0 0; color: var(--muted); max-width: 46em; }
.steps { display: grid; gap: 14px; }
@media (min-width: 800px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps .card { padding: 20px; display: grid; gap: 6px; align-content: start; }
.steps b { font-size: 17px; }
.num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 800; font-size: 14px; }
.grid2 { display: grid; gap: 14px; }
@media (min-width: 700px) { .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid2.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.grid2 .card { padding: 18px; display: grid; gap: 8px; align-content: start; }
.grid2 .card .h { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.grid2 .card ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; display: grid; gap: 3px; }
.free { padding: 24px; display: grid; gap: 10px; background: var(--brand); color: #fff; border: 0; }
.free h2 { font-size: clamp(22px, 4vw, 28px); }
.free p { margin: 0; opacity: 0.92; max-width: 44em; }
.free .btn { justify-self: start; background: #fff; color: #172b4d; border-color: #fff; }

/* ---- app ---- */
.app-grid { display: grid; gap: 26px; padding: 6px 0 20px; }
.app-grid > section { min-width: 0; }
section > h2 { font-size: 21px; margin: 0 0 12px; }
.loading { text-align: center; padding: 22vh 0; color: var(--muted); }
.ios-hint { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.btn.danger-outline { background: transparent; border-color: var(--red); color: var(--red); }
@media (pointer: coarse) { .btn, .btn.small { min-height: 44px; } }

/* avatar with the network badge on its corner */
.face { position: relative; display: inline-flex; flex: none; }
.face .net { position: absolute; right: -4px; bottom: -4px; box-shadow: 0 0 0 2px var(--card); }

/* empty state */
.onboard { padding: 22px; display: grid; gap: 12px; }
.onboard h2 { font-size: 22px; margin: 0; }
.onboard > p { margin: 0; }
.conn-btns { display: grid; gap: 10px; }
@media (min-width: 640px) { .conn-btns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .conn-btns { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.conn-btn { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--ink); text-decoration: none; text-align: left; font: inherit; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.conn-btn:hover:not([disabled]) { border-color: var(--accent); background: var(--accent-soft); }
.conn-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.conn-btn .cb-t { display: grid; min-width: 0; }
.conn-btn small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }

/* account strip and manage panel */
.accounts-sec { display: grid; gap: 12px; }
.strip { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.schip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 10px 4px 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: 14px; font-weight: 600; max-width: 100%; }
.schip .h { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.schip.bad { border-color: var(--red); }
a.chip, button.chip { border: 0; text-decoration: none; cursor: pointer; font: 600 12px/1.6 inherit; font-family: inherit; }
.chip.bad:is(a, button):hover { background: var(--red); color: #fff; }
.manage { padding: 16px; display: grid; gap: 14px; background: var(--bg); }
.manage-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.manage-h h2 { font-size: 18px; margin: 0; }
.accounts { display: grid; gap: 12px; }
@media (min-width: 720px) { .accounts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1060px) { .accounts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.acc { padding: 16px; display: grid; gap: 12px; align-content: start; }
.acc-h { display: flex; gap: 10px; align-items: center; }
.acc-h b { font-size: 16px; display: block; }
.acc-h .muted { font-size: 12.5px; line-height: 1.35; }
.conn { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.conn-top { display: flex; gap: 10px; align-items: center; min-width: 0; flex-wrap: wrap; }
.conn-top .who { min-width: 0; flex: 1; }
.conn-top .who b, .conn-top .who span { display: block; overflow-wrap: anywhere; }
.conn-top .who span { font-size: 13px; color: var(--muted); }
.conn .acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.confirm { display: grid; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--red-soft); color: var(--ink); font-size: 14px; }
.confirm .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.tg-steps { display: grid; gap: 10px; font-size: 14px; padding: 12px; border-radius: 12px; background: var(--accent-soft); }
.tg-steps ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.codebox { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.codebox code { font: 600 15px ui-monospace, Menlo, monospace; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; user-select: all; word-break: break-all; }
.waiting { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* composer: inputs, preview, time, submit. Two columns from 900 px, one column below in that order. */
.composer { padding: 18px; display: grid; gap: 18px; }
.c-inputs, .c-preview { display: grid; gap: 18px; min-width: 0; align-content: start; }
@media (min-width: 900px) {
  .composer { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-rows: auto 1fr auto; grid-template-areas: 'inputs preview' 'side preview' 'status status'; gap: 18px 24px; align-items: start; }
  .c-inputs { grid-area: inputs; }
  .c-preview { grid-area: preview; padding-left: 24px; border-left: 1px solid var(--line); }
  .c-side { grid-area: side; position: sticky; top: calc(16px + env(safe-area-inset-top, 0px)); display: grid; gap: 14px; }
  .c-status { grid-area: status; }
}
@media (max-width: 899px) { .c-side { display: contents; } }
.field { display: grid; gap: 6px; }
.field > .label, .field > label.label, .when-box > .label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.composer textarea { min-height: 140px; font-size: 16px; }
.drop { border: 1.5px dashed var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 10px; }
.drop .pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.drop .pick .btn, .drop .linkish { min-height: 44px; }
.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--brand); transition: width 0.15s; }
.pick:focus-within label.btn { outline: 2px solid var(--violet); outline-offset: 2px; }

/* Post to: account chips */
.targets { display: flex; flex-wrap: wrap; gap: 8px; }
.tchip { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 14px 8px 8px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--bg); cursor: pointer; max-width: 100%; min-width: 0; transition: border-color 0.15s, background 0.15s; user-select: none; }
.tchip .who { display: grid; min-width: 0; line-height: 1.25; }
.tchip .who b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tchip .who small { font-size: 12px; color: var(--muted); }
.tchip .cnt { font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.tchip .cnt:empty { display: none; }
.tchip .cnt.over { color: var(--red); }
.tchip .tick { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line); flex: none; display: grid; place-items: center; background: var(--card); }
.tchip.on, .tchip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.tchip.on .tick, .tchip:has(input:checked) .tick { background: var(--accent); border-color: var(--accent); }
.tchip.on .tick::after, .tchip:has(input:checked) .tick::after { content: ''; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.tchip:focus-within { outline: 2px solid var(--violet); outline-offset: 2px; }
.tchip.dis { cursor: default; border-style: dashed; }
.tchip.dis .face, .tchip.dis .who { opacity: 0.6; }

/* preview cards */
.c-preview > h3 { font-size: 17px; }
.pv-none { margin: 0; }
.pv-cards { display: grid; gap: 14px; }
.pv-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; background: var(--card); overflow: hidden; min-width: 0; }
.pv-card.bad { border-color: color-mix(in srgb, var(--amber) 55%, var(--line)); }
.pv-h { display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-width: 0; }
.pv-h .who { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.pv-h .who b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-h .who span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-h .cnt { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pv-h .cnt.over { background: var(--red-soft); color: var(--red); }
.pv-media { background: #000; display: grid; place-items: center; }
.pv-media img, .pv-media video { display: block; width: 100%; max-height: 360px; object-fit: contain; background: #000; }
.pv-card.instagram .pv-media { aspect-ratio: 4 / 5; max-height: 420px; }
.pv-card.instagram .pv-media img, .pv-card.instagram .pv-media video { height: 100%; max-height: none; }
.pv-card.tiktok .pv-media { aspect-ratio: 9 / 16; max-height: 420px; }
.pv-card.tiktok .pv-media video, .pv-card.tiktok .pv-media img { height: 100%; max-height: 420px; }
/* A Short: vertical video, the title in bold over the description. */
.pv-card.youtube .pv-media { aspect-ratio: 9 / 16; max-height: 420px; }
.pv-card.youtube .pv-media video, .pv-card.youtube .pv-media img { height: 100%; max-height: 420px; }
.pv-text .yt-title { display: block; font-size: 15px; margin-bottom: 4px; }
.pv-card .pv-media:has(.pv-ph) { aspect-ratio: auto; min-height: 96px; }
.pv-ph { color: #c9cfdb; font-size: 13px; padding: 20px; text-align: center; }
.pv-text { padding: 10px 12px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow-y: auto; }
.pv-text .none { color: var(--faint); font-style: italic; }
.pv-text mark.over { background: var(--red-soft); color: var(--red); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--red) 50%, transparent); border-radius: 3px; }
.pv-card.threads .pv-text { order: -1; }
.pv-card.threads .pv-h { order: -2; }
.pv-card.threads .pv-media { margin: 0 12px 12px; border-radius: 10px; overflow: hidden; }
.pv-warn { list-style: none; margin: 0; padding: 0 12px 12px; display: grid; gap: 6px; }
.pv-warn li { background: var(--amber-soft); color: var(--amber); border-radius: 10px; padding: 8px 10px; font-size: 13px; font-weight: 500; }
.pv-card .tt { border: 0; border-top: 1px solid var(--line); border-radius: 0; }

/* TikTok settings */
.tt { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 14px; background: var(--bg); }
.tt h3 { font-size: 17px; display: flex; align-items: center; gap: 8px; }
.tt .creator { display: flex; align-items: center; gap: 10px; }
.tt .creator b { display: block; }
.tt .opt { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; min-height: 32px; }
.tt .opt input { margin-top: 2px; }
.tt .opt.dis { cursor: not-allowed; color: var(--faint); }
.tt .opt .note { display: block; font-size: 12.5px; color: var(--faint); }
.tt .group { display: grid; gap: 10px; }
.tt .sub { display: grid; gap: 10px; padding: 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background 0.2s; flex: none; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }

/* time and submit */
.when-box { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.when-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.when-row input { max-width: 260px; min-height: 44px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.submit-bar { display: grid; gap: 8px; }
.sb-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.sb-row .btn.primary { flex: 1 1 130px; min-height: 48px; padding: 10px 20px; font-size: 16px; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); flex: 0 0 auto; }
.seg label { position: relative; display: flex; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.seg input:checked + span { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(23, 43, 77, 0.18); }
.seg input:focus-visible + span { outline: 2px solid var(--violet); outline-offset: 1px; }
#submit-hint { margin: 0; }
.declaration { font-size: 13px; color: var(--muted); margin: 0; }
@media (max-width: 899px) {
  .submit-bar { position: sticky; bottom: 0; z-index: 5; margin: 0 -18px -18px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--card); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 -6px 18px rgba(23, 43, 77, 0.08); }
  .c-status { order: 1; }
  .toasts { bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 420px) { .seg span { padding: 0 10px; font-size: 13.5px; } .sb-row .btn.primary { font-size: 15px; padding: 10px 14px; } }

/* queue */
.queue { display: grid; gap: 12px; }
.qh { font-size: 15px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 6px 0 0; }
.qh .muted { font-weight: 600; }
.qpost { padding: 14px; display: grid; gap: 10px; }
.qpost.failed { border-left: 4px solid var(--red); }
.qpost .main { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.qpost .qthumb { width: 72px; height: 72px; border-radius: 10px; overflow: hidden; flex: none; background: var(--line); }
.qpost .qthumb img, .qpost .qthumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.qpost .body { min-width: 0; flex: 1; display: grid; gap: 4px; }
.qpost .text { white-space: pre-wrap; word-wrap: break-word; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.qpost .text.none { color: var(--faint); font-style: italic; }
.qpost .time { font-size: 13px; color: var(--muted); }
.qpost .tgts { display: grid; gap: 6px; }
.qpost .tg { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; padding: 6px 8px; border-radius: 10px; background: var(--bg); }
.qpost .tg.failed { background: var(--red-soft); }
.qpost .tg .name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.qpost .tg .open { font-weight: 600; margin-left: auto; }
.qpost .err { font-size: 13px; color: var(--red); flex-basis: 100%; padding-left: 32px; }
.qpost .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.empty { text-align: center; padding: 26px 16px; color: var(--muted); }

/* account settings */
.settings > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 14px 18px; min-height: 48px; cursor: pointer; font-weight: 700; list-style: none; }
.settings > summary::-webkit-details-marker { display: none; }
.settings > summary > span:first-child::before { content: '▸'; display: inline-block; width: 1.2em; color: var(--muted); transition: transform 0.15s; }
.settings[open] > summary > span:first-child::before { transform: rotate(90deg); }
.settings-body { padding: 0 18px 18px; display: grid; gap: 12px; }
.settings .confirm input { max-width: 220px; background: var(--card); }
.doc code { overflow-wrap: anywhere; }

/* AI assistant: beside the queue on wide screens, a tab on phones */
.q-row { display: grid; gap: 26px; min-width: 0; }
.q-row > section { min-width: 0; }
.q-tabs { justify-self: start; }
.q-tabs button { border: 0; background: none; font: inherit; font-weight: 600; padding: 8px 16px; border-radius: 10px; color: var(--muted); cursor: pointer; }
.q-tabs button[aria-selected=true] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
@media (max-width: 959px) {
  .q-row.with-agent[data-tab=queue] > #agent-sec, .q-row.with-agent[data-tab=agent] > #queue-sec { display: none; }
}
@media (min-width: 960px) {
  .q-tabs { display: none; }
  .q-row.with-agent { grid-template-columns: minmax(0, 1fr) 400px; align-items: start; }
  .q-row.with-agent > #agent-sec { position: sticky; top: 12px; }
}
#ai-drafts:empty { display: none; }
#ai-drafts { margin-bottom: 12px; }
.qpost.ai-draft { border-style: dashed; box-shadow: none; background: transparent; }
.agent { padding: 14px; display: grid; gap: 10px; }
.agent-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.agent-h h2 { margin: 0; font-size: 19px; }
.agent-chat { display: grid; gap: 10px; max-height: 60vh; overflow-y: auto; align-content: start; }
.amsg { display: grid; gap: 8px; }
.amsg .bubble { padding: 8px 12px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; max-width: 92%; }
.amsg.me .bubble { background: var(--accent-soft); justify-self: end; }
.amsg.bot .bubble { background: var(--bg); justify-self: start; }
.pcards { display: grid; gap: 8px; }
.pcards > .acts, .pcard .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.pcard { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 6px; background: var(--card); }
.pcard.done { opacity: 0.7; }
.pcard .ph { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.pcard .pnets { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pcard .ptext { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.pcard .pthumb { width: 100%; max-height: 200px; border-radius: 10px; overflow: hidden; background: var(--line); }
.pcard .pthumb img, .pcard .pthumb video { width: 100%; max-height: 200px; object-fit: cover; display: block; }
.pcard .pchange { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.agent-form { display: grid; gap: 8px; }
.agent-form textarea { min-height: 72px; resize: vertical; }
.agent-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.agent-row #agent-send { margin-left: auto; }
.agent-files { display: flex; gap: 6px; flex-wrap: wrap; }
.agent-log ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; max-height: 240px; overflow-y: auto; }
.agent-log .err { color: var(--red); }
.ai-editing { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
