/* Posting Dashboard — minimal, readable, dependency-free. */
:root {
  --bg: #14110d;
  --panel: #201d18;
  --line: #4a4032;
  --ink: #f7f1e6;
  --muted: #c5bcad;
  --gold: #d9aa59;
  --danger: #d96a5f;
  --ok: #7fb069;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1.25rem;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { font-weight: 700; color: var(--gold); }
.topbar nav { display: flex; gap: 1rem; align-items: center; }
.topbar a, .linklike {
  color: var(--ink); text-decoration: none; background: none; border: 0;
  font-size: 0.95rem; cursor: pointer; padding: 0;
}
.topbar a:hover, .linklike:hover { color: var(--gold); }
.inline-form { display: inline; margin: 0; }
.wrap { max-width: 860px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.wrap.narrow { max-width: 520px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
h1 { font-size: 1.6rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.15rem; margin: 0 0 0.75rem; color: var(--gold); }
h3 { font-size: 1rem; margin: 1rem 0 0.5rem; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.warn {
  background: #3a2c14; border: 1px solid var(--gold);
  padding: 0.6rem 0.8rem; border-radius: 6px;
}
label { display: block; margin-bottom: 0.9rem; font-weight: 600; }
input[type="text"], input[type="url"], input[type="password"],
input[type="datetime-local"], textarea, select {
  display: block; width: 100%; margin-top: 0.3rem;
  background: #121210; color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 0.6rem 0.7rem; font: inherit;
}
textarea { resize: vertical; }
button, .button {
  display: inline-block;
  background: #2b2620; color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 0.6rem 1rem; font: inherit; cursor: pointer;
  text-decoration: none; margin-right: 0.5rem;
}
button:hover, .button:hover { border-color: var(--gold); }
button.primary, .button.primary { background: var(--gold); color: #14110d; font-weight: 700; border-color: var(--gold); }
button.danger { border-color: var(--danger); color: var(--danger); }
.row { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.row.space-between { justify-content: space-between; align-items: center; }
.row label { margin-bottom: 0; flex: 1; min-width: 200px; }
.toggle { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.toggle input { width: 1.1rem; height: 1.1rem; }
.tabs { display: flex; gap: 0.25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.tab {
  background: none; border: 0; border-bottom: 3px solid transparent;
  border-radius: 0; color: var(--muted); margin: 0; padding: 0.6rem 1rem;
}
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.tabpanel { display: none; }
.tabpanel.active { display: block; }
.counter { color: var(--muted); font-size: 0.9rem; margin: -0.4rem 0 0.8rem; }
.counter.over { color: var(--danger); font-weight: 700; }
/* phone preview */
.phone {
  width: 300px; border: 2px solid var(--line); border-radius: 26px;
  padding: 0.6rem; background: #0c0b09; margin-top: 0.5rem;
}
.phone-screen {
  background: #171512; border-radius: 18px; padding: 0.8rem;
  min-height: 220px; font-size: 0.9rem;
}
.preview-head { color: var(--gold); font-weight: 700; font-size: 0.8rem; margin-bottom: 0.5rem; }
.preview-text { white-space: pre-wrap; word-break: break-word; }
.preview-media { color: var(--muted); font-size: 0.8rem; margin-top: 0.5rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.5rem; border-bottom: 1px solid var(--line); }
.pill {
  display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px;
  font-size: 0.8rem; border: 1px solid var(--line);
}
.pill.active { color: var(--ok); border-color: var(--ok); }
.pill.needs_reauth, .pill.revoked { color: var(--danger); border-color: var(--danger); }
.job { border: 1px solid var(--line); border-radius: 6px; padding: 0.6rem 0.8rem; margin: 0.5rem 0; }
.job .st { font-weight: 700; }
.job .st.done { color: var(--ok); }
.job .st.failed { color: var(--danger); }
.job .st.cancelled { color: var(--muted); }
.violation { color: var(--danger); margin: 0.3rem 0; }
.violation .fix { color: var(--muted); display: block; font-size: 0.9rem; }
@media (max-width: 600px) {
  .row label { min-width: 100%; }
  .phone { width: 100%; max-width: 300px; }
}

/* ---- media editor (composer) ---- */
.editor-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8, 7, 5, 0.88);
  display: flex; align-items: center; justify-content: center;
  padding: 0.75rem;
}
.editor-panel {
  background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px;
  width: 100%; max-width: 720px; max-height: 94vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.editor-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--line);
}
.editor-head h2 { margin: 0; }
.editor-close { margin: 0; min-width: 44px; min-height: 44px; }
.editor-body { padding: 1rem; overflow-y: auto; }
.editor-foot {
  display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap;
  padding: 0.75rem 1rem; border-top: 1px solid var(--line);
}
.editor-toolbar {
  display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap;
  margin-bottom: 0.9rem;
}
.editor-toolbar label {
  display: flex; align-items: center; gap: 0.4rem;
  margin: 0; font-weight: 600; font-size: 0.9rem;
}
.editor-toolbar select { width: auto; margin: 0; }
.editor-toolbar input[type="range"] { width: 110px; accent-color: var(--gold); }
.editor-toolbar button { min-width: 44px; min-height: 44px; margin: 0; }
.editor-stage {
  position: relative; display: flex; justify-content: center;
  background: #0c0b09; border-radius: 8px; padding: 0.5rem;
  min-height: 200px;
}
.editor-media {
  max-width: 100%; max-height: 52vh; display: block; border-radius: 4px;
  touch-action: none;
}
.cropbox-stage {
  position: absolute; touch-action: none;
}
.cropbox {
  position: absolute; border: 2px solid var(--gold);
  touch-action: none; cursor: move;
}
.cropbox-shade { position: absolute; inset: 0; pointer-events: none; }
.cropbox-handle {
  position: absolute; background: var(--gold); border-radius: 50%;
  border: 2px solid #14110d; touch-action: none;
}
.cropbox-handle.nw { left: -23px; top: -23px; cursor: nwse-resize; }
.cropbox-handle.ne { right: -23px; top: -23px; cursor: nesw-resize; }
.cropbox-handle.sw { left: -23px; bottom: -23px; cursor: nesw-resize; }
.cropbox-handle.se { right: -23px; bottom: -23px; cursor: nwse-resize; }
.trim-box {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  margin-top: 1rem;
}
.trim-time { font-variant-numeric: tabular-nums; min-width: 3.2em; }
.trim-slider {
  position: relative; flex: 1; min-width: 180px; height: 44px;
  background: #121210; border: 1px solid var(--line); border-radius: 6px;
  touch-action: none;
}
.trim-sel {
  position: absolute; top: 0; bottom: 0;
  background: rgba(217, 170, 89, 0.35);
  border-left: 2px solid var(--gold); border-right: 2px solid var(--gold);
  pointer-events: none;
}
.trim-handle {
  position: absolute; top: 0; bottom: 0; width: 44px;
  background: var(--gold); border-radius: 4px; opacity: 0.9;
  touch-action: none; cursor: ew-resize;
}
.trim-handle::after {
  content: "⋮⋮"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #14110d; font-weight: 700;
}
.big-spend { font-size: 1.6rem; font-weight: 700; margin: 0.3rem 0; }
