:root {
  --bg: #0b0d14; --panel: #12151f; --card: #171b27; --line: #252a3a; --text: #eef0f6; --muted: #8d93a8;
  --accent: #3b5bdb; --accent2: #e5484d; --ok: #30a46c; --warn: #f5a524; --radius: 14px;
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); display: flex; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
h1 { font-size: 34px; margin: 0 0 6px; letter-spacing: -.5px; }
h2 { font-size: 20px; margin: 28px 0 12px; }
.muted { color: var(--muted); }
.side { width: 250px; flex: none; background: var(--panel); border-right: 1px solid var(--line); padding: 20px 16px;
  display: flex; flex-direction: column; gap: 14px; position: sticky; top: 0; height: 100vh; }
.logo { font-size: 22px; display: flex; align-items: center; gap: 10px; }
.logo b { color: #7c93ff; }
.mark { background: var(--accent); width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; }
nav { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
nav a { padding: 11px 12px; border-radius: 10px; color: #c9cddb; }
nav a:hover { background: #1b2030; }
nav a.active { background: #1f2538; color: white; font-weight: 600; }
.mode { margin-top: auto; font-size: 13px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; line-height: 1.6; }
.logout { font-size: 13px; color: var(--muted); }
main { flex: 1; padding: 34px 40px 60px; max-width: 1280px; min-width: 0; }
.btn { border: 1px solid var(--line); background: #1b2030; color: var(--text); border-radius: 10px; padding: 11px 18px;
  font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { filter: brightness(1.15); }
.btn.primary { background: var(--accent); border-color: var(--accent); }
.btn.red { background: var(--accent2); border-color: var(--accent2); }
.btn.ghost { background: transparent; }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.hero { display: grid; grid-template-columns: 1fr 260px; gap: 30px; align-items: center; padding: 34px; }
.hero h1 { font-size: 44px; }
.hero .actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.phone { aspect-ratio: 9/16; background: #000; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); position: relative; }
.phone video, .phone img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.tile { background: linear-gradient(160deg, #1f2640, #151926); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; min-height: 140px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; cursor: pointer; }
.tile b { font-size: 18px; }
.tile:hover { border-color: #3b4670; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.post { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; }
.post:hover { border-color: #3b4670; }
.post .thumb { aspect-ratio: 9/16; background: #05060a center/cover; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; padding: 10px; }
.post .meta { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.post .meta b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: #262c40; color: #c9cddb; text-transform: uppercase; letter-spacing: .4px; width: fit-content; }
.chip.ready { background: #16351f; color: #6fdc9b; } .chip.published { background: #1a2b55; color: #9db2ff; }
.chip.scheduled { background: #3a2c0c; color: #ffc85c; } .chip.failed { background: #3e1517; color: #ff8d8f; }
.chip.generating, .chip.queued, .chip.publishing { background: #2a2140; color: #c3a6ff; }
.chip.test { background: #333; color: #bbb; }
form.create { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
label { font-size: 13px; color: var(--muted); font-weight: 600; }
input, textarea, select { background: #0f121b; border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 11px 12px; font: inherit; width: 100%; }
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid #3b5bdb88; border-color: var(--accent); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; cursor: pointer; color: var(--muted); }
.drop img { max-height: 180px; border-radius: 8px; display: block; margin: 0 auto 8px; }
.checks { display: flex; gap: 16px; }
.checks label { display: flex; gap: 6px; align-items: center; color: var(--text); font-weight: 500; }
.checks input { width: auto; }
.editor { display: grid; grid-template-columns: 340px 1fr; gap: 28px; align-items: start; }
.steps { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.spinner { width: 18px; height: 18px; border: 3px solid #ffffff33; border-top-color: white; border-radius: 50%; animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.err { color: #ff8d8f; }
.note { background: #1a1f30; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.55; }
.note.warn { border-color: #6b4f12; background: #241c0b; }
pre, code { background: #0a0c12; border: 1px solid var(--line); border-radius: 8px; font-family: Consolas, monospace; font-size: 13px; }
pre { padding: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
code { padding: 1px 6px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { color: var(--muted); font-size: 12px; text-align: center; padding: 4px; }
.cal .day { background: var(--card); border: 1px solid var(--line); border-radius: 10px; min-height: 96px; padding: 6px; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.cal .day.other { opacity: .35; } .cal .day.today { border-color: var(--accent); }
.cal .ev { background: #262c40; border-radius: 6px; padding: 3px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal .ev.published { background: #1a2b55; } .cal .ev.scheduled { background: #3a2c0c; }
.toast { position: fixed; bottom: 24px; right: 24px; background: #1f2538; border: 1px solid #3b4670; padding: 12px 18px; border-radius: 12px; opacity: 0; transition: .2s; pointer-events: none; max-width: 420px; }
.toast.show { opacity: 1; }
.menu-btn { display: none; }
.login-page { display: grid; place-items: center; }
.login { width: min(380px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 900px) {
  body { display: block; }
  .side { position: fixed; z-index: 10; left: -270px; transition: .2s; }
  .side.open { left: 0; }
  .menu-btn { display: block; position: fixed; top: 12px; left: 12px; z-index: 11; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 18px; }
  main { padding: 64px 16px 40px; }
  .hero, .editor, form.create { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
  .phone { max-width: 300px; }
  .cal .day { min-height: 60px; }
}
.btn.fb { background: #1877f2; border-color: #1877f2; color: #fff; }
