/* WINGEATS Command: one dark system, measured off the brand (red #E8202A off the wordmark,
   the site's #172123 panels). Desktop first, a full phone layout below 900 px. */
:root {
  --red: #E8202A; --red-2: #ff4a52; --gold: #d8a13a; --ok: #2e9b5b; --ok-2: #79d39f; --warn: #c9762b; --bad: #ff6b6b; --info: #6ea8ff;
  --ink: #0f0d0c; --bg: #14110f; --panel: #1b1715; --panel-2: #23201d; --line: #302a26; --line-2: #3d3631;
  --text: #f6f2ee; --muted: #a79b92; --dim: #7a706a;
  --fb: #4c8dff; --ig: #d63c8c; --yt: #b8821f; --tt: #22a39f; --gb: #4ade80;
  --side: 236px; --tap: 44px; --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--text); font: 15px/1.45 var(--font); }
a { color: var(--gold); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button[disabled] { opacity: .5; pointer-events: none; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 16px; } h3 { font-size: 14px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
/* sidebar */
.side { background: var(--bg); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 12px; }
.brand img { height: 26px; }
.brand-sub { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; flex-direction: column; padding: 6px 10px; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.nav a .ico { width: 20px; text-align: center; font-size: 16px; }
.nav a:hover { background: var(--panel); color: var(--text); }
.nav a.on { background: var(--red); color: #fff; }
.nav a .badge { margin-left: auto; background: var(--gold); color: #1a1208; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 7px; }
.nav a.on .badge { background: #fff; color: var(--red); }
.side-foot { margin-top: auto; padding: 12px 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.pill { display: inline-block; font-size: 12px; padding: 4px 9px; border-radius: 999px; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: #123a24; color: var(--ok-2); } .pill.bad { background: #4a1a1a; color: #ff9b9b; } .pill.warn { background: #4a3a12; color: var(--gold); }
/* main */
.main { display: flex; flex-direction: column; min-width: 0; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 22px; background: rgba(15,13,12,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 18px; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: 6px; }
.clock { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.iconbtn { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; min-width: 40px; min-height: 40px; }
.view { padding: 18px 22px 90px; max-width: 1480px; width: 100%; }
.bottom { display: none; }
/* building blocks */
.grid { display: grid; gap: 14px; align-items: start; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.card h2 { margin-bottom: 8px; }
.card .sub { color: var(--muted); font-size: 13px; }
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi .label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.kpi .value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.kpi .delta { font-size: 12.5px; color: var(--muted); }
.kpi .delta.up { color: var(--ok-2); } .kpi .delta.down { color: var(--bad); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }
.btn { min-height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.btn:hover { border-color: var(--dim); }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: #ff8b8b; border-color: #5a2a2a; }
.btn.small, .ghost.small { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.ghost { background: none; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { min-height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); font-size: 12.5px; font-weight: 600; }
.chip.on { background: var(--text); color: var(--ink); border-color: var(--text); }
.chip.fb.on { background: var(--fb); border-color: var(--fb); color: #fff; } .chip.ig.on { background: var(--ig); border-color: var(--ig); color: #fff; } .chip.yt.on { background: var(--yt); border-color: var(--yt); color: #fff; }
input[type=text], input[type=search], input[type=date], input[type=datetime-local], input[type=number], select, textarea {
  min-height: 38px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); }
textarea { width: 100%; min-height: 120px; resize: vertical; }
input::placeholder { color: var(--dim); }
.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; background: var(--line); color: var(--muted); white-space: nowrap; }
.tag.DRAFT { background: #4a3a12; color: var(--gold); } .tag.QUEUE { background: #123a24; color: var(--ok-2); } .tag.PUBLISHED { background: #1f2f4a; color: #9cc3ff; } .tag.ERROR { background: #4a1a1a; color: #ff9b9b; }
.tag.video { background: #1f2f4a; color: #9cc3ff; } .tag.story { background: #3a2a4a; color: #d7b3ff; } .tag.carousel { background: #2b3a1f; color: #bde79c; } .tag.image { background: #2a2f33; color: #cfd8dc; } .tag.cut { background: #1f2f4a; color: #9cc3ff; }
.tag.facebook { background: #1c2b4a; color: #8fb6ff; } .tag.instagram { background: #4a1f3a; color: #ff9bd0; } .tag.youtube { background: #4a1a1a; color: #ff9b9b; } .tag.tiktok { background: #163a3a; color: #7ff3ee; } .tag.google { background: #163a24; color: #86efac; }
.tag.owner, .tag.negative { background: #4a1a1a; color: #ff9b9b; } .tag.question { background: #4a3a12; color: var(--gold); } .tag.positive { background: #123a24; color: var(--ok-2); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.dot.facebook { background: var(--fb); } .dot.instagram { background: var(--ig); } .dot.youtube { background: var(--yt); } .dot.tiktok { background: var(--tt); }
.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .k { color: var(--muted); }
.table.tight td { padding: 6px 8px; }
.table td.hide-sm, .table th.hide-sm { }
/* A thumbnail column in a stacked row keeps its image at a sane size. */
.table td img.cover { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; display: block; }
.msg, .empty { text-align: center; color: var(--muted); padding: 40px 16px; font-size: 15px; }
.msg.err { color: #ff8b8b; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 60; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 16px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: min(560px, 92vw); }
.toast.err { border-color: #7a2d2d; color: #ff9b9b; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.overlay[hidden] { display: none; }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; width: min(720px, 100%); max-height: 92vh; overflow: auto; padding: 18px; }
.modal h2 { margin-bottom: 10px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.field label { font-size: 12px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.field input, .field select, .field textarea { width: 100%; }
.alerts { display: flex; flex-direction: column; gap: 6px; }
.alert { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: 13.5px; }
.alert.error { border-color: #5a2a2a; } .alert.warn { border-color: #5a4a20; }
.alert .lvl { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.alert.error .lvl { color: var(--bad); } .alert.warn .lvl { color: var(--gold); } .alert.ok .lvl { color: var(--ok-2); }
/* sign in */
.signin { background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; padding: 26px; width: min(420px, 100%); }
.signin img { height: 30px; margin-bottom: 14px; }
.signin p { color: var(--muted); font-size: 13.5px; margin: 6px 0 14px; }
/* posts */
.toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.toolbar .line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.seg button { min-height: 36px; padding: 0 12px; background: var(--panel); border: 0; color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
.seg button.on { background: var(--text); color: var(--ink); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: center; padding: 4px 0; }
.cal .cell { min-height: 96px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.cal .cell.out { opacity: .45; } .cal .cell.today { border-color: var(--gold); } .cal .cell.sel { outline: 2px solid var(--red); }
.cal .cell .d { font-size: 12.5px; font-weight: 700; color: var(--muted); display: flex; justify-content: space-between; }
.cal .cell .d .n { color: var(--text); font-weight: 600; }
.cal .cell .ln { font-size: 11.5px; display: flex; align-items: center; gap: 5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .cell .ln b { color: var(--text); font-weight: 600; }
.cal .cell .ln .t { color: var(--dim); }
.dayhead { display: flex; align-items: center; gap: 10px; margin: 18px 0 8px; }
.dayhead h2 { font-size: 15px; }
.dayhead .n { color: var(--muted); font-size: 13px; }
.post { display: grid; grid-template-columns: 24px 96px 1fr auto; gap: 12px; align-items: start; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 8px; }
.post.sel { border-color: var(--red); }
.post > * { min-width: 0; }
.post .perf { flex-wrap: wrap; }
.post.older { opacity: .55; }
.post .thumb { width: 96px; height: 96px; border-radius: 8px; background: var(--panel-2); object-fit: cover; display: block; }
.post .thumb.none { display: flex; align-items: center; justify-content: center; color: var(--dim); font-size: 11px; }
.post .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; font-size: 13px; }
.post .meta .chan { font-weight: 700; }
.post .meta .when { color: var(--muted); }
.post .cap { font-size: 14px; white-space: pre-wrap; color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.post .cap.open { display: block; }
.post .item { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.post .perf { display: flex; gap: 12px; font-size: 12.5px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.post .perf b { color: var(--text); }
.post .acts { display: flex; flex-direction: column; gap: 6px; }
.post input[type=checkbox] { width: 18px; height: 18px; margin-top: 4px; accent-color: var(--red); }
.bulk { position: sticky; bottom: 12px; z-index: 15; display: flex; gap: 8px; align-items: center; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; box-shadow: 0 10px 30px rgba(0,0,0,.5); margin-top: 12px; }
.picker { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0; }
.picker img, .picker video { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; flex: none; background: #000; cursor: pointer; }
.picker .sel { border-color: var(--gold); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 64px; }
.bars i { flex: 1; background: var(--red); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.bars i.alt { background: var(--gold); }
.list-kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 13.5px; }
.list-kv .k { color: var(--muted); }
.reply .q { font-size: 14.5px; white-space: pre-wrap; padding: 10px 12px; border-left: 3px solid var(--line-2); background: var(--panel-2); border-radius: 0 10px 10px 0; margin: 6px 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
/* TikTok pack: the clip beside its caption; stacked on a phone. */
.clip { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.clip video { width: 150px; aspect-ratio: 9 / 16; border-radius: 10px; background: #000; display: block; }
.clip .cap { font-size: 13.5px; white-space: pre-wrap; background: var(--panel-2); border-radius: 10px; padding: 8px 10px; margin: 6px 0 8px; }
.clip-body { min-width: 0; }
@media (max-width: 600px) { .clip { grid-template-columns: 1fr; } .clip video { width: min(100%, 300px); margin: 0 auto; } }
.link { color: var(--gold); text-decoration: none; }
.hint { color: var(--muted); font-size: 13px; }
@media (max-width: 1100px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 84vw; max-width: 320px; z-index: 40; transform: translateX(-105%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.6); }
  .iconbtn { display: inline-flex; align-items: center; justify-content: center; }
  .top { padding: 10px 14px; }
  .top h1 { font-size: 16px; }
  .clock { display: none; }
  .view { padding: 12px 14px 96px; overflow-x: hidden; }
  .main { overflow-x: hidden; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr 1fr; }
  .kpi .value { font-size: 22px; }
  .bottom { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(15,13,12,.96); border-top: 1px solid var(--line); padding: 6px 4px max(6px, env(safe-area-inset-bottom)); }
  .bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; color: var(--muted); text-decoration: none; font-size: 10.5px; font-weight: 600; min-height: var(--tap); }
  .bottom a .ico { font-size: 18px; }
  .bottom a.on { color: var(--red-2); }
  .cal .cell { min-height: 64px; padding: 4px 5px; }
  .cal .cell .ln { display: none; } .cal .cell .ln.first { display: flex; }
  .post { grid-template-columns: 22px 64px 1fr; }
  .post .thumb { width: 64px; height: 64px; }
  .post .acts { grid-column: 1 / -1; flex-direction: row; }
  .post .acts .btn { flex: 1; }
  .table { font-size: 13px; }
  .card { overflow: hidden; }
  .bulk { bottom: 70px; }
  /* Stacked tables: one block per row, label on the left, value on the right. */
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; }
  .table.stack tr { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 0 0 8px; background: var(--panel-2); }
  .table.stack td { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0; text-align: left; }
  .table.stack td.num { text-align: right; }
  .table.stack td::before { content: attr(data-label); color: var(--muted); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; flex: none; min-width: 72px; padding-top: 2px; }
  .table.stack td[data-label=""]::before { display: none; }
  .table.stack td.empty { display: block; }
  .table.stack td:empty { display: none; }
  .table.stack td .row { justify-content: flex-end; }
  .hide-sm { display: none !important; }
  /* Page actions move under the title on a phone. */
  .top { flex-wrap: wrap; }
  .top-actions { order: 3; width: 100%; margin: 6px 0 0; }
  .top-actions:empty { display: none; }
  .dayhead { flex-wrap: wrap; }
  .cal .cell { min-height: 58px; }
  .cal .cell .d { flex-direction: column; gap: 0; }
  .cal .cell .d span:last-child { font-size: 10px; font-weight: 500; }
}
@media (max-width: 600px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } .cols-4 { grid-template-columns: 1fr 1fr; } .kpi .value { font-size: 20px; } .card { padding: 12px; } }
