/* Pitch dashboard — left nav + main area layout */

body.pitch-page {
  padding-bottom: 0;
  overflow: hidden;
  height: 100vh;
}

.header-brand .brand-service {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 200ms ease;
  margin-left: 0.5rem;
}

.header-brand:hover .brand-service {
  opacity: 1;
}

.header-meta {
  margin-left: auto;
  font-size: 0.7rem;
  font-family: var(--mono);
  color: var(--text-muted);
  text-align: right;
}

.header-meta .scan-info {
  opacity: 0.8;
}

/* Layout */
.app-layout {
  display: flex;
  height: calc(100vh - 49px);
}

/* Left nav */
.left-nav {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.nav-item {
  display: block;
  padding: 0.75rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 150ms ease;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--p5d-dim);
  color: var(--p5d);
  border-left-color: var(--p5d);
  font-weight: 600;
}

.nav-item .nav-icon {
  margin-right: 0.5rem;
}

.nav-section {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 1.25rem 1.25rem 0.35rem;
}

/* Main area */
.main-area {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2rem;
  background: var(--bg);
}

/* Page header */
.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.page-header .data-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--mono);
  margin-top: 0.15rem;
}

/* Area cards (dashboard view) */
.area-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 720px;
}

.area-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 150ms ease;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.area-card:hover {
  border-color: var(--p5d);
  box-shadow: var(--shadow-md);
}

.area-card .area-icon { font-size: 1.5rem; flex-shrink: 0; }

.area-card .area-info { flex: 1; }

.area-card .area-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.area-card .area-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.area-card .area-metrics {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
}

.area-metric { text-align: center; }

.area-metric .val {
  font-size: 1.3rem;
  font-weight: 700;
  font-family: var(--mono);
}

.area-metric .val.green { color: var(--p5d); }
.area-metric .val.red { color: var(--red); }
.area-metric .val.amber { color: var(--amber); }

.area-metric .lbl {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.area-card .enter-arrow {
  color: var(--text-muted);
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* KPI strip (on detail pages) */
.kpi-strip {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.kpi-card .number {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--mono);
  line-height: 1.1;
}

.kpi-card .number.green { color: var(--p5d); }
.kpi-card .number.red { color: var(--red); }
.kpi-card .number.amber { color: var(--amber); }

.kpi-card .label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Section headings inside pages */
.section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.5rem 0 0.75rem;
}

/* Bar chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
  margin-bottom: 0.25rem;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.bar {
  width: 100%;
  background: var(--p5d);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  opacity: 0.8;
}

.bar-val {
  font-size: 0.6rem;
  font-family: var(--mono);
  color: var(--text-muted);
  margin-bottom: 2px;
}

.bar-lbl {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Thread cards */
.thread-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}

.thread-card .sub {
  font-size: 0.7rem;
  font-family: var(--mono);
  color: var(--p5d);
  margin-bottom: 0.15rem;
}

.thread-card .title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.thread-card .meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.thread-card .no-reply { color: var(--red); font-weight: 600; }

/* Expand button */
.expand-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-family: var(--sans);
  color: var(--text-muted);
  cursor: pointer;
}

.expand-btn:hover { border-color: var(--p5d); color: var(--p5d); }

/* Thread comments */
.thread-comments {
  border-top: 1px solid var(--border-light);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}

.thread-comment {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.8rem;
}

.thread-comment:last-child { border-bottom: none; }

.cm-author {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--p5d);
}

.cm-body { color: var(--text-secondary); }

.cm-p5d {
  background: var(--p5d-dim);
  border-left: 3px solid var(--p5d);
  padding-left: 0.5rem;
  margin: 0.15rem 0;
}

/* Reply cards */
.reply-card {
  background: var(--red-dim);
  border: 1px solid rgba(220,38,38,0.12);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
}

.reply-card .reply-author {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--red);
  margin-bottom: 0.15rem;
}

.reply-card .reply-text {
  color: var(--text-secondary);
  font-style: italic;
}

.reply-card .reply-verdict {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Compact box */
.compact-box {
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0.75rem 0;
}

/* Subreddit table */
.sub-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin: 0.75rem 0;
}

.sub-table th {
  text-align: left;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.4rem 0.5rem;
  border-bottom: 2px solid var(--border);
}

.sub-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border-light);
}

.sub-table .num { font-family: var(--mono); text-align: right; }
.sub-table .green { color: var(--p5d); font-weight: 600; }
.sub-table .red { color: var(--red); font-weight: 600; }
.sub-table .amber { color: var(--amber); font-weight: 600; }
.sub-table .dim { color: var(--text-muted); }

.sub-table .status { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; }

/* H bar chart */
.h-bar-chart { margin: 0.75rem 0; }

.h-bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.35rem;
  gap: 0.5rem;
}

.h-bar-name {
  font-size: 0.75rem;
  font-family: var(--mono);
  width: 180px;
  flex-shrink: 0;
  text-align: right;
}

.h-bar-track {
  flex: 1;
  height: 20px;
  background: rgba(26,156,66,0.06);
  border-radius: 3px;
  overflow: hidden;
}

.h-bar-fill {
  height: 100%;
  background: var(--p5d);
  border-radius: 3px;
  min-width: 2px;
  opacity: 0.7;
}

.h-bar-count {
  font-size: 0.7rem;
  font-family: var(--mono);
  color: var(--text-muted);
  width: 30px;
}

.h-bar-meta {
  font-size: 0.65rem;
  color: var(--text-dim, var(--text-muted));
  width: 50px;
  text-align: right;
}

/* Gap chart */
.gap-row {
  display: grid;
  grid-template-columns: 120px 1fr 45px 1fr 45px 70px;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
}

.gap-row.header {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.gap-topic { font-weight: 600; }

.gap-bar { height: 16px; border-radius: 3px; }
.gap-bar.reddit { background: var(--p5d); opacity: 0.7; }
.gap-bar.ig { background: var(--homestyler); opacity: 0.6; }

.gap-pct { font-family: var(--mono); font-size: 0.7rem; color: var(--text-muted); }

.gap-ratio { font-family: var(--mono); font-size: 0.7rem; font-weight: 700; }
.gap-ratio.under { color: var(--red); }
.gap-ratio.over { color: var(--homestyler); }
.gap-ratio.ok { color: var(--text-muted); }

/* Sentiment bar */
.sentiment-bar {
  display: flex;
  height: 24px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 0.5rem 0 0.35rem;
}

.sentiment-bar .seg { transition: width 0.6s ease; }
.sentiment-bar .seg.neutral { background: var(--text-muted); opacity: 0.25; }
.sentiment-bar .seg.positive { background: var(--p5d); opacity: 0.5; }
.sentiment-bar .seg.negative { background: var(--red); opacity: 0.5; }

.sentiment-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.sentiment-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.25rem;
  vertical-align: middle;
}

/* IG cards */
.ig-row { display: flex; gap: 0.75rem; margin: 0.75rem 0; }

.ig-card {
  flex: 1;
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  text-align: center;
}

.ig-card.best { border-color: var(--p5d); background: var(--p5d-dim); }
.ig-card .handle { font-family: var(--mono); font-size: 0.7rem; color: var(--p5d); }
.ig-card .followers { font-size: 1.1rem; font-weight: 700; font-family: var(--mono); }
.ig-card .eng { font-size: 0.7rem; color: var(--text-muted); }

/* Blocker card */
.blocker-card {
  background: var(--red-dim);
  border: 1px solid rgba(220,38,38,0.1);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
}

.blocker-card .btext { color: var(--text-secondary); font-style: italic; }
.blocker-card .bmeta { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.15rem; }

/* Source note */
.source-note {
  font-size: 0.65rem;
  font-family: var(--mono);
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Foldable sections */
.foldable {
  margin: 1rem 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.foldable-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-alt);
  cursor: pointer;
}

.foldable-body {
  padding: 0.75rem 1rem;
}

/* Card link */
.card-link {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--p5d);
  text-decoration: none;
  margin-top: 0.25rem;
}

.card-link:hover {
  text-decoration: underline;
}

/* Rich area cards (dashboard) */
.area-card-rich {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 150ms ease;
}

.area-card-rich:hover {
  border-color: var(--p5d);
  box-shadow: var(--shadow-md);
}

.area-card-rich .card-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.area-card-rich .card-top .area-icon { font-size: 1.3rem; }

.area-card-rich .card-top .area-title {
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
}

.area-card-rich .card-top .enter-arrow {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.area-card-rich .card-body {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.area-card-rich .card-body strong { color: var(--text); }

.area-card-rich .card-insight {
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--p5d-dark);
}

/* Mini sparkline (inline bar chart on dashboard cards) */
.mini-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 32px;
  margin: 0.5rem 0;
}

.mini-bars .mbar {
  flex: 1;
  background: var(--p5d);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  opacity: 0.6;
}

/* Mini h-bars (dashboard subreddit preview) */
.mini-hbars { margin: 0.5rem 0; }

.mini-hbar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.2rem;
  font-size: 0.7rem;
}

.mini-hbar .mh-name {
  width: 130px;
  font-family: var(--mono);
  font-size: 0.65rem;
  text-align: right;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-hbar .mh-track {
  flex: 1;
  height: 12px;
  background: rgba(26,156,66,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.mini-hbar .mh-fill {
  height: 100%;
  border-radius: 2px;
  min-width: 2px;
}

.mini-hbar .mh-tag {
  font-size: 0.6rem;
  font-family: var(--mono);
  width: 20px;
  flex-shrink: 0;
}

/* Callout box (strategy connection, what's missing) */
.callout {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 3px solid var(--p5d);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.callout.amber { border-left-color: var(--amber); }
.callout.red { border-left-color: var(--red); }

.callout .callout-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
}

.callout ul {
  margin: 0.35rem 0 0 1.25rem;
  padding: 0;
}

.callout li { margin-bottom: 0.15rem; }

/* Strategy arrow */
.strategy-arrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  font-size: 0.8rem;
}

.strategy-arrow .sa-dir {
  font-weight: 700;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--p5d);
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 700px) {
  .left-nav { width: 56px; }
  .nav-item { padding: 0.6rem; font-size: 0; }
  .nav-item .nav-icon { font-size: 1.2rem; margin: 0; }
  .nav-section { display: none; }
  .kpi-strip { flex-wrap: wrap; }
  .gap-row { grid-template-columns: 1fr; }
  .ig-row { flex-direction: column; }
  .mini-hbar .mh-name { width: 90px; }
}
