/* Admin: the pitch board — queue list, presentation editor, replies. */

.btn-ghost {
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
}

.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

/* ---------- queue list ---------- */

.pitch-admin-list { display: flex; flex-direction: column; gap: 10px; }

.pitch-admin-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.pitch-admin-order {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.pitch-admin-num {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.pitch-move {
  width: 28px;
  height: 24px;
  color: var(--text-secondary);
  font-size: .9rem;
  line-height: 1;
  background: var(--bg-input);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.pitch-move:hover:not(:disabled) { background: var(--bg-hover); color: var(--text); }
.pitch-move:disabled { opacity: .35; cursor: default; }

.pitch-admin-main { min-width: 0; }

.pitch-admin-main h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.pitch-admin-summary {
  margin: 4px 0 0;
  font-size: .87rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.pitch-admin-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.pitch-chip {
  padding: 3px 8px;
  font-size: .72rem;
  line-height: 1.4;
  color: var(--text-secondary);
  background: var(--bg-input);
  border-radius: 5px;
}

.pitch-chip.is-yes { color: #15803d; background: rgba(34, 197, 94, .14); }
.pitch-chip.is-no { color: #b91c1c; background: rgba(239, 68, 68, .13); }
.pitch-chip.is-wait { color: var(--accent); background: var(--accent-light); }
.pitch-chip.is-done { color: #fff; background: #15803d; }
.pitch-chip.is-draft { color: var(--text-muted); background: transparent; border: 1px dashed var(--border); }
.pitch-chip.is-mute { color: var(--text-muted); background: transparent; padding-left: 0; }

.pitch-admin-acts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}

/* ---------- replies ---------- */

.pitch-reactions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.pitch-reaction {
  padding: 10px 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
}

.pitch-reaction-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: .74rem;
  color: var(--text-muted);
}

.pitch-reaction-text {
  margin: 6px 0 0;
  font-size: .89rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.pitch-reaction audio {
  display: block;
  width: 100%;
  margin-top: 8px;
}

.history-summary {
  margin: 0 0 16px;
  font-size: .9rem;
  color: var(--text-secondary);
}

/* ---------- editor ---------- */

.pitch-editor-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  background: rgba(0, 0, 0, .5);
}

.pitch-editor-backdrop[hidden] { display: none; }

.pitch-editor {
  width: 100%;
  max-width: 760px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.pitch-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.pitch-editor-head h2 { margin: 0; font-size: 1.05rem; }

.pitch-editor-close {
  width: 34px;
  height: 34px;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.pitch-editor-close:hover { background: var(--bg-hover); color: var(--text); }

.pitch-editor-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}

.pitch-field { display: block; }

.pitch-field > span {
  display: block;
  margin-bottom: 6px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.pitch-field > span em { font-style: normal; font-weight: 400; color: var(--text-muted); }

.pitch-field input[type="text"],
.pitch-field textarea,
.pitch-field select {
  width: 100%;
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
  font-size: .92rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.pitch-field textarea { resize: vertical; line-height: 1.55; }

#pitch-body {
  min-height: 300px;
  font-family: ui-monospace, 'Cascadia Mono', Menlo, Consolas, monospace;
  font-size: .86rem;
  tab-size: 2;
}

.pitch-field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  align-items: end;
}

.pitch-field-check {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.pitch-field-check input { width: 18px; height: 18px; accent-color: var(--accent); }

.pitch-field-check > span {
  margin: 0;
  font-size: .88rem;
  font-weight: 400;
  color: var(--text);
}

.pitch-facts {
  margin: 0;
  padding: 14px 16px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.pitch-facts legend {
  padding: 0 7px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.pitch-facts legend em { font-style: normal; font-weight: 400; color: var(--text-muted); }

.pitch-cover {
  padding: 12px;
  background: var(--bg-input);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.pitch-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.pitch-media-tile {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--bg-card, #111);
  border-radius: var(--radius-sm);
}

.pitch-media-tile img,
.pitch-media-tile video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pitch-media-cover,
.pitch-media-badge {
  position: absolute;
  top: 6px;
  padding: 2px 6px;
  font-size: .68rem;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, .6);
  border-radius: 4px;
}

.pitch-media-cover { left: 6px; background: var(--accent, #7657ff); }
.pitch-media-badge { right: 6px; }

.pitch-media-tools {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  display: flex;
  gap: 4px;
}

.pitch-media-tools button {
  flex: 1;
  height: 28px;
  font-size: .95rem;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, .62);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.pitch-media-tools button:disabled { opacity: .3; cursor: default; }
.pitch-media-tools [data-drop] { flex: 0 0 32px; }

/* display:block above would otherwise beat the hidden attribute */
.pitch-cover [hidden] { display: none; }

.pitch-cover-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.pitch-md-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.pitch-md-tools button {
  padding: 6px 10px;
  color: var(--text-secondary);
  font: inherit;
  font-size: .78rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.pitch-md-tools button:hover { background: var(--bg-hover); color: var(--text); }

.pitch-md-previewbtn { margin-left: auto; }
.pitch-md-previewbtn.is-on { color: #fff; background: var(--accent); border-color: var(--accent); }

.pitch-md-hint {
  margin: 8px 0 0;
  font-size: .78rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.pitch-md-hint code {
  padding: 1px 5px;
  font-size: .9em;
  background: var(--bg-input);
  border-radius: 4px;
}

.pitch-editor-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.pitch-editor-status {
  margin-right: auto;
  font-size: .82rem;
  color: var(--text-muted);
}

/* ---------- markdown preview ----------
   The public page styles this content with its own light palette; here the
   same markup has to sit inside the dark admin, so the rules are repeated
   against the admin's tokens rather than importing the reader's stylesheet. */

.pitch-md-render {
  min-height: 300px;
  padding: 18px;
  font-size: .95rem;
  line-height: 1.62;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-wrap: break-word;
}

.pitch-md-render[hidden] { display: none; }
.pitch-md-render > :first-child { margin-top: 0; }
.pitch-md-render .md-p { margin: 0 0 1em; }

/* Same split as the public page: the serif for headings that belong to the
   text, Onest for the two smallest. */
.pitch-md-render .md-h2,
.pitch-md-render .md-h3 {
  margin: 1.6em 0 .45em;
  font-family: 'Literata', Georgia, 'Times New Roman', serif;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -.012em;
}

.pitch-md-render .md-h4,
.pitch-md-render .md-h5 {
  margin: 1.5em 0 .4em;
  font-weight: 600;
  line-height: 1.3;
}

.pitch-md-render .md-h2 { font-size: 1.26rem; }
.pitch-md-render .md-h3 { font-size: 1.08rem; }
.pitch-md-render .md-h4,
.pitch-md-render .md-h5 { font-size: .98rem; color: var(--text-secondary); }

.pitch-md-render .md-list { margin: 0 0 1em; padding-left: 1.3em; }
.pitch-md-render .md-list li { margin-bottom: .35em; }
.pitch-md-render .md-tasks { padding-left: 0; list-style: none; }

.pitch-md-render .md-task { position: relative; padding-left: 1.7em; }

.pitch-md-render .md-task::before {
  content: '';
  position: absolute;
  top: .3em;
  left: 0;
  width: 1.05em;
  height: 1.05em;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 3px;
}

.pitch-md-render .md-task-done::before { background: #15803d; border-color: #15803d; }

.pitch-md-render .md-task-done::after {
  content: '';
  position: absolute;
  top: .55em;
  left: .28em;
  width: .48em;
  height: .24em;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}

.pitch-md-render .md-quote {
  margin: 0 0 1em;
  padding: 2px 0 2px 14px;
  color: var(--text-secondary);
  border-left: 2px solid var(--accent);
}

.pitch-md-render .md-figure { margin: 1.3em 0; }

.pitch-md-render .md-img,
.pitch-md-render .md-video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

.pitch-md-render .md-caption {
  margin: 7px 0 0;
  font-size: .8rem;
  color: var(--text-muted);
}

.pitch-md-render .md-callout {
  margin: 1.3em 0;
  padding: 13px 14px;
  background: var(--bg-card);
  border-left: 3px solid var(--text-muted);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.pitch-md-render .md-callout > :last-child { margin-bottom: 0; }
.pitch-md-render .md-callout-title { margin: 0 0 .4em; font-weight: 600; }
.pitch-md-render .md-callout-note { border-left-color: var(--accent); }
.pitch-md-render .md-callout-tip { border-left-color: var(--success); }
.pitch-md-render .md-callout-warn { border-left-color: var(--danger); }

.pitch-md-render .md-hr {
  margin: 1.8em 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.pitch-md-render .md-code {
  margin: 0 0 1em;
  padding: 12px 13px;
  overflow-x: auto;
  font-size: .84rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}

.pitch-md-render code {
  padding: .1em .3em;
  font-size: .88em;
  background: var(--bg-card);
  border-radius: 3px;
}

.pitch-md-render .md-code code { padding: 0; background: none; }

.pitch-md-render .md-table-wrap { margin: 0 0 1em; overflow-x: auto; }

.pitch-md-render .md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

.pitch-md-render .md-table th,
.pitch-md-render .md-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.pitch-md-render .md-table th { font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.pitch-md-render .md-table th.md-ta-right,
.pitch-md-render .md-table td.md-ta-right { text-align: right; }
.pitch-md-render .md-table th.md-ta-center,
.pitch-md-render .md-table td.md-ta-center { text-align: center; }
.pitch-md-render a { color: var(--accent); }

/* ---------- narrow screens ---------- */

@media (max-width: 720px) {
  .pitch-admin-row { grid-template-columns: 36px minmax(0, 1fr); }
  .pitch-admin-acts { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .pitch-editor-backdrop { padding: 0; }
  .pitch-editor { max-width: none; min-height: 100%; border: 0; border-radius: 0; }
  .pitch-md-previewbtn { margin-left: 0; }
}

.btn-done-on {
  color: #fff;
  background: #15803d;
  border: 1px solid #15803d;
}

.btn-done-on:hover { background: #166534; border-color: #166534; }
