[hidden] { display: none !important; }
:root {
  --bg: #f5f6f8; --card: #fff; --ink: #16181d; --mut: #6b7280; --line: #e5e7eb; --acc: #4f46e5; --acc2: #eef2ff;
  --ok: #16a34a; --warn: #d97706; --bad: #dc2626;
  --telegram: #229ED9; --youtube: #FF0033; --instagram: #E1306C; --linkedin: #0A66C2; --tiktok: #111;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--acc); text-decoration: none; }
.muted { color: var(--mut); } .small { font-size: 12px; } .err { color: var(--bad); }
.btn { border: 1px solid var(--line); background: #fff; padding: 8px 14px; border-radius: 9px; font: inherit; cursor: pointer; }
.btn:hover { border-color: #cfd3da; } .btn.primary { background: var(--acc); color: #fff; border-color: var(--acc); }
.btn.sm { padding: 4px 10px; font-size: 12px; } .btn.danger { color: var(--bad); }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font: inherit; background: #fff; }
textarea { resize: vertical; } input:focus, textarea:focus { outline: 2px solid var(--acc2); border-color: var(--acc); }

/* login */
body.login { display: grid; place-items: center; min-height: 100vh; }
.login-card { background: var(--card); padding: 34px; border-radius: 16px; width: min(360px, 92vw); display: grid; gap: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.06); }
.logo { font-weight: 800; font-size: 18px; letter-spacing: -.2px; }

/* header */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px; padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--line); }
.top nav { display: flex; gap: 4px; } .top nav a { color: var(--mut); padding: 6px 12px; border-radius: 8px; font-weight: 600; }
.top nav a.on { background: var(--acc2); color: var(--acc); } .top .right { margin-left: auto; display: flex; gap: 14px; align-items: center; }
main { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
h2 { margin: 0; font-size: 18px; } h3 { margin: 26px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--mut); }

/* post cards */
.post { display: grid; grid-template-columns: 96px 1fr auto; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.thumb { width: 96px; height: 96px; border-radius: 10px; background: #eceef2 center/cover; display: grid; place-items: center; color: var(--mut); font-size: 22px; position: relative; overflow: hidden; }
.thumb .n { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 6px; }
.post .t { font-weight: 700; } .post .b { color: #374151; white-space: pre-wrap; max-height: 3.9em; overflow: hidden; }
.post .when { font-size: 12px; color: var(--mut); margin-bottom: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); background: #fff; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip.published { border-color: #bbf7d0; background: #f0fdf4; } .chip.failed { border-color: #fecaca; background: #fef2f2; }
.chip.publishing { border-color: #fde68a; background: #fffbeb; } .chip.skipped { opacity: .6; }
.acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .04em; }
.status.draft { background: #f3f4f6; color: var(--mut); } .status.scheduled { background: var(--acc2); color: var(--acc); }
.status.publishing { background: #fffbeb; color: var(--warn); } .status.done { background: #f0fdf4; color: var(--ok); }
.status.partial, .status.failed { background: #fef2f2; color: var(--bad); }
.errline { font-size: 12px; color: var(--bad); margin-top: 6px; word-break: break-word; }
.empty { text-align: center; padding: 60px 20px; color: var(--mut); background: var(--card); border: 1px dashed var(--line); border-radius: 14px; }

/* calendar */
.cal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { font-size: 12px; color: var(--mut); text-align: center; font-weight: 600; }
.cal .day { min-height: 110px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px; cursor: pointer; }
.cal .day.out { opacity: .45; } .cal .day.today { border-color: var(--acc); }
.cal .num { font-size: 12px; font-weight: 700; color: var(--mut); }
.cal .ev { font-size: 11px; padding: 3px 6px; border-radius: 6px; margin-top: 4px; background: var(--acc2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .ev.done { background: #f0fdf4; } .cal .ev.failed, .cal .ev.partial { background: #fef2f2; } .cal .ev.draft { background: #f3f4f6; }

/* accounts */
.accs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.acc { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 10px; align-content: start; }
.acc .hd { display: flex; align-items: center; gap: 10px; } .acc .hd b { font-size: 16px; }
.acc .badge { margin-left: auto; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.badge.on { background: #f0fdf4; color: var(--ok); } .badge.off { background: #f3f4f6; color: var(--mut); }
.pico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; }
.acc details { border-top: 1px solid var(--line); padding-top: 8px; } .acc summary { cursor: pointer; color: var(--mut); font-size: 13px; }
.acc .help { font-size: 12px; color: #4b5563; } .acc .help ol { padding-left: 18px; margin: 6px 0; }
.copy { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: #f3f4f6; padding: 6px 8px; border-radius: 6px; word-break: break-all; }
.row { display: flex; gap: 8px; align-items: center; } .grid2 { display: grid; gap: 8px; }

/* composer */
.overlay { position: fixed; inset: 0; background: rgba(17,19,24,.45); display: grid; place-items: center; z-index: 20; padding: 16px; }
.sheet { background: #fff; border-radius: 16px; width: min(1000px, 100%); max-height: 94vh; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.sheet-head, .sheet-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.sheet-foot { border-top: 1px solid var(--line); border-bottom: 0; justify-content: flex-end; } .sheet-foot .err { margin-right: auto; }
.sheet-body { display: grid; grid-template-columns: 1fr 330px; gap: 22px; padding: 18px 20px; overflow: auto; }
.x { margin-left: auto; border: 0; background: none; font-size: 26px; cursor: pointer; color: var(--mut); }
.lbl { display: block; font-weight: 700; font-size: 13px; margin: 14px 0 6px; } .col > .lbl:first-child { margin-top: 0; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; color: var(--mut); cursor: pointer; }
.drop.hover { border-color: var(--acc); background: var(--acc2); }
.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.file { width: 110px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 11px; position: relative; background: #fff; }
.file .im { height: 80px; background: #eceef2 center/cover; display: grid; place-items: center; color: var(--mut); }
.file .nm { padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file .bar { height: 3px; background: var(--acc); width: 0; transition: width .2s; }
.file .rm { position: absolute; top: 3px; right: 3px; background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: 6px; cursor: pointer; width: 20px; height: 20px; }
.limits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; } .limits span { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: #f3f4f6; }
.limits span.over { background: #fef2f2; color: var(--bad); }
.plats { display: grid; gap: 6px; }
.plat { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.plat.on { border-color: var(--acc); background: var(--acc2); } .plat.dis { opacity: .45; cursor: not-allowed; }
.plat .nm { font-weight: 600; } .plat .why { font-size: 11px; color: var(--warn); margin-left: auto; text-align: right; }
.popt { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-top: 8px; display: grid; gap: 6px; font-size: 13px; }
.popt b { font-size: 12px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.seg button { flex: 1; border: 0; background: #fff; padding: 8px; font: inherit; cursor: pointer; } .seg button.on { background: var(--acc); color: #fff; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #111; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 50; max-width: 90vw; }

@media (max-width: 760px) {
  .sheet-body { grid-template-columns: 1fr; } .post { grid-template-columns: 64px 1fr; } .thumb { width: 64px; height: 64px; }
  .post .acts { grid-column: 1 / -1; flex-direction: row; } .top { gap: 10px; padding: 10px; flex-wrap: wrap; } .cal .day { min-height: 70px; }
}
.btn.dis { opacity: .5; pointer-events: none; }
