* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0c1c3d;
  --bg-2: #142a52;
  --cream: #F5F0E8;
  --coral: #E8614A;
  --lime: #C8E946;
  --navy: #0F1B2D;
  --text: #e8eef6;
  --muted: #98a4b8;
  --border: #1f3360;
  --good: #4ade80;
  --warn: #fbbf24;
  --bad: #ef4444;
}
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
#app { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
nav.sidebar { background: var(--navy); padding: 24px 16px; border-right: 1px solid var(--border); }
nav.sidebar h1 { font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 24px; }
nav.sidebar ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
nav.sidebar li { padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--muted); }
nav.sidebar li.active, nav.sidebar li:hover { background: var(--bg-2); color: var(--text); }
nav.sidebar select { background: var(--bg-2); color: var(--text); border: 1px solid var(--border); padding: 6px 10px; border-radius: 6px; font-size: 13px; width: 100%; margin-bottom: 12px; }
main { padding: 32px 40px; overflow: auto; }
h2 { font-size: 24px; font-weight: 800; margin-bottom: 24px; letter-spacing: -0.02em; }
h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.col { flex: 1; min-width: 240px; }
button { background: var(--coral); color: white; border: 0; padding: 10px 18px; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 14px; }
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
button.ghost { background: transparent; color: var(--muted); }
button.small { padding: 6px 12px; font-size: 12px; }
input, select, textarea { background: var(--bg); color: var(--text); border: 1px solid var(--border); padding: 10px 12px; border-radius: 8px; font-size: 14px; font-family: inherit; width: 100%; }
textarea { min-height: 100px; resize: vertical; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.field { margin-bottom: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: 0.08em; }
tr:hover { background: rgba(255,255,255,0.02); }
.tag { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.tag-queued { background: #475569; color: white; }
.tag-running { background: #2563eb; color: white; }
.tag-done, .tag-posted, .tag-published { background: var(--good); color: var(--navy); }
.tag-failed, .tag-rejected, .tag-post_failed { background: var(--bad); color: white; }
.tag-needs_approval, .tag-scheduled, .tag-pending, .tag-wp_draft { background: var(--warn); color: var(--navy); }
.tag-deferred { background: var(--muted); color: var(--navy); }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calendar .cell { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px; min-height: 100px; font-size: 11px; }
.calendar .cell h4 { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.calendar .post-chip { display: block; padding: 3px 6px; border-radius: 4px; background: var(--bg-2); margin-bottom: 4px; }
.login-screen { display: grid; place-items: center; min-height: 100vh; padding: 40px; }
.login-screen .card { width: 100%; max-width: 380px; }
.toast { position: fixed; top: 20px; right: 20px; background: var(--good); color: var(--navy); padding: 12px 18px; border-radius: 8px; font-weight: 700; z-index: 99; }
.toast.error { background: var(--bad); color: white; }
.stat { font-size: 28px; font-weight: 800; color: var(--text); }
.stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.muted { color: var(--muted); font-size: 12px; }
pre { background: var(--navy); padding: 12px; border-radius: 8px; font-size: 12px; overflow: auto; max-height: 400px; }

/* Help chat drawer */
.help-fab {
  position: fixed; bottom: 24px; right: 24px;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--coral); color: white; border: 0;
  font-size: 22px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  z-index: 100;
}
.help-drawer {
  position: fixed; top: 0; right: 0; height: 100vh;
  width: 420px; max-width: 100vw;
  background: var(--bg-2); border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.25s ease-out;
  z-index: 99; box-shadow: -8px 0 24px rgba(0,0,0,0.4);
}
.help-drawer.open { transform: translateX(0); }
.help-drawer header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.help-drawer header h3 { color: var(--text); margin: 0; text-transform: none; letter-spacing: 0; font-size: 16px; }
.help-messages {
  flex: 1; overflow-y: auto; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.help-msg { padding: 12px 14px; border-radius: 10px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; }
.help-msg.user { background: var(--bg); color: var(--text); align-self: flex-end; max-width: 85%; }
.help-msg.assistant { background: rgba(232,97,74,0.08); border: 1px solid rgba(232,97,74,0.25); color: var(--text); align-self: flex-start; max-width: 90%; }
.help-msg.thinking { color: var(--muted); font-style: italic; }
.help-input-row {
  padding: 12px 16px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: flex-end;
}
.help-input-row textarea {
  flex: 1; min-height: 44px; max-height: 140px; resize: none;
  font-size: 14px;
}
.help-suggestions { padding: 0 20px 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.help-suggestion {
  font-size: 11px; padding: 6px 10px; border-radius: 20px;
  background: var(--bg); border: 1px solid var(--border); color: var(--muted);
  cursor: pointer;
}
.help-suggestion:hover { color: var(--text); border-color: var(--coral); }
