:root {
  --bg: #faf8f5; --card: #ffffff; --ink: #1d1a17; --muted: #6b645c; --line: #e6e0d8;
  --accent: #e1306c; --accent-2: #f77737; --ok: #1a7f4b; --warn: #a15c00;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141210; --card: #1e1b18; --ink: #f3eee8; --muted: #a39b91; --line: #34302b; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; letter-spacing: .2px; }
.logo { background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 1.3em; margin-right: 4px; }
.who { font-size: 14px; color: var(--muted); }
.who button { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; margin-left: 8px; }
.wrap { max-width: 860px; margin: 0 auto; padding: 20px 16px 60px; }
.steps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 4px 0 20px; flex-wrap: wrap; }
.steps li { flex: 1; min-width: 120px; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; color: var(--muted); background: var(--card); }
.steps li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--ink); font-size: 12px; font-weight: 600; }
.steps li.active { color: var(--ink); border-color: var(--accent); }
.steps li.active span, .steps li.done span { background: var(--accent); color: #fff; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
h1 { margin: 0 0 6px; font-size: 24px; }
h2 { margin: 28px 0 10px; font-size: 18px; }
h3 { margin: 0 0 6px; font-size: 16px; }
.muted { color: var(--muted); margin-top: 0; }
.fine { color: var(--muted); font-size: 13px; margin-top: 18px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.btn { appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 10px 16px; border-radius: 10px; font: inherit; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border: none; font-weight: 600; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
input, textarea, select { font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.banner { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; background: #fff4e5; color: var(--warn); border: 1px solid #f3d3a3; }
.banner.ok { background: #e8f6ee; color: var(--ok); border-color: #b9e2c9; }
@media (prefers-color-scheme: dark) { .banner { background: #2b2113; border-color: #5a4220; } .banner.ok { background: #12281c; border-color: #1f5a3a; } }
.profile { display: flex; gap: 16px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; margin: 14px 0; flex-wrap: wrap; }
.profile .stat { text-align: center; min-width: 70px; }
.profile .stat b { display: block; font-size: 18px; }
.competitor { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.competitor .head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.competitor .head input { flex: 1; }
.competitor textarea { width: 100%; }
.remove { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 20px; }
.loading { text-align: center; padding: 50px 10px; }
.spinner { width: 38px; height: 38px; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%; margin: 0 auto 14px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .cols { grid-template-columns: 1fr; } }
.box { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.box ul { margin: 6px 0 0; padding-left: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.chip { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 13px; }
.phase { border-left: 4px solid var(--accent); }
.idea { background: var(--bg); border-radius: 10px; padding: 10px 12px; margin-top: 8px; font-size: 14px; }
.idea b { color: var(--accent); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }
.demo-flag { display: inline-block; background: #ffe9a8; color: #5c4500; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; margin-bottom: 10px; }
@media print { .top, .steps, .row, .banner { display: none !important; } .card { border: none; } }

/* ---------- calendar ---------- */
.steps li { cursor: pointer; }
.cal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; flex-wrap: wrap; }
.cal-nav b { min-width: 150px; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { font-size: 12px; color: var(--muted); text-align: center; padding: 4px 0; }
.cal .day { min-height: 92px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--bg); display: flex; flex-direction: column; gap: 4px; }
.cal .day.out { background: transparent; border-style: dashed; opacity: .5; }
.cal .day.today { border-color: var(--accent); }
.cal .day .n { font-size: 12px; color: var(--muted); }
.chip-post { display: block; width: 100%; text-align: left; border: 0; border-left: 4px solid var(--muted); border-radius: 6px; padding: 4px 6px; font: inherit; font-size: 12px; line-height: 1.25; cursor: pointer; background: var(--card); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-post:hover { outline: 2px solid var(--accent); }
.chip-post.st-draft { border-left-color: #9a928a; }
.chip-post.st-scheduled { border-left-color: #2f6fed; }
.chip-post.st-publishing { border-left-color: #e29a00; }
.chip-post.st-published { border-left-color: var(--ok); }
.chip-post.st-failed { border-left-color: #d1293d; }
.chip-post .nomedia { color: var(--warn); font-weight: 700; }
@media (max-width: 700px) {
  .cal { grid-template-columns: 1fr; }
  .cal .dow, .cal .day.empty { display: none; }
  .cal .day { min-height: 0; }
  .chip-post { white-space: normal; }
}
.badge { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--line); }
.badge.scheduled { background: #dbe7ff; color: #1b4bb5; }
.badge.published { background: #d6f0e0; color: var(--ok); }
.badge.failed { background: #fbd9de; color: #a3162a; }
.badge.publishing { background: #ffe9a8; color: #5c4500; }
dialog { border: 1px solid var(--line); border-radius: 16px; padding: 0; width: min(680px, 94vw); max-height: 92vh; background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(0, 0, 0, .5); }
.ed { padding: 20px; }
.ed-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.brief { background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: 14px; color: var(--muted); }
.mrow { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.mrow input { flex: 1; min-width: 0; }
.mrow .thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; background: var(--line); }
.ed-actions { margin-top: 18px; }
.note { padding: 10px 12px; border-radius: 10px; margin: 8px 0; font-size: 14px; background: var(--bg); border: 1px solid var(--line); }
.cta-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px; border: 1px solid var(--accent); border-radius: 12px; margin: 14px 0; }

/* ---------- v2: shell, auth, landing, settings ---------- */
.top { gap: 12px; flex-wrap: wrap; }
.top .right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.top select { padding: 6px 10px; max-width: 220px; }
.brand a { color: inherit; text-decoration: none; }
a { color: var(--accent); }
.linkbtn { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }
.small { font-size: 14px; }
.split { display: flex; justify-content: space-between; align-items: baseline; width: 100%; }
.inline { margin: 0 0 0 6px; display: inline; }
.filebtn { font-weight: 400; cursor: pointer; }
.push { margin-left: auto; }
.auth { max-width: 420px; margin: 40px auto; }
.auth form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.auth .alt { margin-top: 16px; font-size: 14px; color: var(--muted); }
.err { color: #b3202f; font-size: 14px; min-height: 1.2em; }
.hero { text-align: center; padding: 56px 8px 24px; }
.hero h1 { font-size: clamp(30px, 6vw, 48px); line-height: 1.1; margin-bottom: 14px; }
.hero p { max-width: 620px; margin: 0 auto 22px; color: var(--muted); font-size: 18px; }
.hero .row { justify-content: center; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 30px 0; }
.features .card { padding: 18px; }
.features h3 { margin-bottom: 4px; }
.tabs { display: flex; gap: 6px; margin: 4px 0 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs a { padding: 10px 16px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; font-weight: 600; margin-bottom: -1px; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--accent); }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.meter { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 6px 0 14px; }
.meter > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.meter.full > i { background: #d1293d; }
.acct { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-bottom: 1px solid var(--line); }
.acct:last-child { border-bottom: 0; }
.acct .sub { color: var(--muted); font-size: 13px; }
.danger { color: #b3202f; border-color: #e7b3ba; }
.sect { margin-bottom: 18px; }
.sect h2 { margin-top: 0; }
.banner.warn { background: #fff4e5; color: var(--warn); }
.banner .linkbtn { margin-left: 8px; }
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 10px 40px; }
.footer a { color: var(--muted); margin: 0 8px; }
.legal h1 { margin-top: 10px; }
.legal h2 { font-size: 18px; margin: 24px 0 6px; }
.legal li { margin: 4px 0; }
.legal .note { background: #fff4e5; color: var(--warn); border: 1px solid #f3d3a3; padding: 10px 14px; border-radius: 10px; }
.busy { opacity: .6; pointer-events: none; }
.progress { text-align: center; padding: 40px 10px; }

/* auto-reply (Messages tab) */
.rule { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.rule code, .card p code, .tbl code { background: var(--line); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
label.check.big { font-size: 17px; margin-top: 8px; }
label.check input { width: auto; }
.fine.inline { display: inline; margin: 0 0 0 6px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
