:root {
  --bg: #0f1115; --panel: #171a21; --panel2: #1e222b; --line: #2a2f3a; --text: #e8eaf0; --muted: #9aa3b2;
  --accent: #ff3d3d; --accent2: #ffd34d; --ok: #3ecf8e; --warn: #f5a524; --err: #ff5d5d; --r: 12px;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f5f6f8; --panel: #fff; --panel2: #f0f2f5; --line: #dde1e7; --text: #15181e; --muted: #5d6675; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
#app { display: flex; min-height: 100vh; }
#nav { width: 220px; flex: none; background: var(--panel); border-right: 1px solid var(--line); padding: 16px 10px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
#nav .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; padding: 4px 10px 16px; }
#nav .brand img { width: 30px; }
#nav a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); }
#nav a i { font-style: normal; width: 22px; text-align: center; }
#nav a.on, #nav a:hover { background: var(--panel2); color: var(--text); }
main { flex: 1; min-width: 0; padding: 24px clamp(16px, 3vw, 36px) 100px; max-width: 1200px; }
@media (max-width: 760px) {
  #nav { position: fixed; bottom: 0; top: auto; left: 0; right: 0; width: 100%; height: auto; flex-direction: row; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); z-index: 10; }
  #nav .brand, #nav .desk { display: none; }
  #nav a { flex-direction: column; gap: 0; font-size: 11px; padding: 6px 4px; }
  #nav a i { font-size: 20px; }
  main { padding-top: 16px; }
}
h1 { font-size: 24px; margin: 0 0 4px; } h2 { font-size: 18px; margin: 24px 0 10px; } h3 { font-size: 16px; margin: 16px 0 8px; }
.sub { color: var(--muted); margin: 0 0 18px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.card.link { cursor: pointer; transition: border-color .15s; text-decoration: none; display: block; }
.card.link:hover { border-color: var(--accent); }
.stat b { display: block; font-size: 26px; } .stat span { color: var(--muted); font-size: 13px; }
.btn { appearance: none; border: 1px solid var(--line); background: var(--panel2); color: var(--text); padding: 9px 14px; border-radius: 10px; font: inherit; cursor: pointer; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.danger { color: var(--err); }
.btn:disabled { opacity: .5; cursor: wait; }
input, textarea, select { width: 100%; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font: inherit; }
textarea { min-height: 90px; resize: vertical; }
textarea.big { min-height: 420px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
label { display: block; margin: 10px 0 4px; color: var(--muted); font-size: 13px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 12px 0 16px; scrollbar-width: none; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--text); border-color: var(--accent); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }
.pill.idea { color: var(--muted); } .pill.scripted { color: #7aa7ff; } .pill.optimized { color: var(--accent2); } .pill.ready { color: var(--ok); } .pill.published { background: var(--ok); color: #062; border-color: var(--ok); }
.pill.free { color: var(--ok); } .pill.paid { color: var(--warn); } .pill.err { color: var(--err); }
.list .item { display: flex; gap: 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.list .item:last-child { border: 0; }
.list .item .grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted { color: var(--muted); font-size: 13px; }
.md { line-height: 1.65; overflow-wrap: anywhere; }
.md table { border-collapse: collapse; width: 100%; font-size: 13px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.md th { background: var(--panel2); }
.md pre { background: var(--panel2); padding: 12px; border-radius: 8px; overflow-x: auto; }
.md code { background: var(--panel2); padding: 1px 5px; border-radius: 4px; font-size: 90%; }
.md blockquote { border-left: 3px solid var(--accent); margin: 0; padding-left: 12px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.loading { color: var(--muted); padding: 40px; text-align: center; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--muted); border-top-color: transparent; border-radius: 50%; animation: s 1s linear infinite; }
@keyframes s { to { transform: rotate(360deg); } }
#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; max-width: 90vw; white-space: pre-wrap; }
#toast.show { opacity: 1; } #toast.err { border-color: var(--err); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text); margin: 0; font-size: 14px; }
.switch input { width: auto; }
.chip { display: inline-flex; gap: 6px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 13px; margin: 2px; }
.chip button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 2px; font: inherit; }
.thumb { width: 96px; border-radius: 6px; flex: none; }
.two { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; } @media (max-width: 760px) { .two { grid-template-columns: 1fr; } }
details summary { cursor: pointer; }

.bar { height: 10px; background: var(--panel2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.post { display: flex; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.post:last-child { border: 0; }
.post .pico { font-size: 22px; width: 30px; text-align: center; flex: none; }
.post .ptext { white-space: pre-wrap; max-height: 4.8em; overflow: hidden; color: var(--muted); font-size: 13px; }
.post input[type=datetime-local] { width: auto; padding: 4px 8px; font-size: 13px; }
.pill.draft { color: var(--muted); } .pill.scheduled { color: #7aa7ff; } .pill.due { color: var(--warn); border-color: var(--warn); } .pill.sent, .pill.posted { color: var(--ok); } .pill.failed { color: var(--err); }
.pill.lead { color: var(--muted); } .pill.pitched { color: #7aa7ff; } .pill.negotiating { color: var(--warn); } .pill.won, .pill.paid { color: var(--ok); } .pill.lost { color: var(--err); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; } .filters select { width: auto; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); } .kv:last-child { border: 0; }

.pill.review { color: var(--warn); border-color: var(--warn); } .pill.approved { color: var(--accent2); } .pill.rejected { color: var(--err); }
#nav i { position: relative; }
.badge { position: absolute; top: -6px; right: -10px; background: var(--err); color: #fff; font: 700 10px/16px system-ui; min-width: 16px; padding: 0 4px; border-radius: 8px; text-align: center; font-style: normal; }
.kidsCard { border-color: #ffb347; background: linear-gradient(135deg, rgba(255,179,71,.08), transparent); }
label.item.switch { display: flex; gap: 10px; cursor: pointer; }

.btn.disabled { opacity: .5; pointer-events: none; }
