/* ──────────────────────────────────────────────
   Steam Radar — Indie Game Opportunity Finder
   Dark gaming theme + teal accent
   ────────────────────────────────────────────── */

:root {
  --bg: #1a1d23;
  --bg-raised: #22262e;
  --bg-card: #2a2f38;
  --bg-card-hover: #323842;
  --bg-overlay: #181b20;

  --text: #e8eaed;
  --text-secondary: #9aa0a6;
  --text-tertiary: #6b7280;

  --accent: #4ecdc4;
  --accent-active: #3ab5ad;
  --accent-muted: #2a3f3d;

  --success: #5db872;
  --success-bg: #1e3a2a;
  --warning: #e8a55a;
  --warning-bg: #3a2e1e;
  --danger: #e05555;
  --danger-bg: #3a1e1e;
  --info: #5b8fb9;

  --border: #333842;
  --border-active: #4a5060;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 9999px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 180ms;

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ────────────────────────────────── */

.app-header {
  background: var(--bg-overlay);
  border-bottom: 1px solid var(--border);
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  position: relative;
}

.lang-selector {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-raised);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
  transition: border-color var(--duration);
}

.lang-selector:hover,
.lang-selector:focus {
  border-color: var(--accent);
  color: var(--text);
}

.app-header h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.app-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 540px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

/* ── Tag Selector ─────────────────────────── */

.tag-selector {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.tag-input-area {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  min-height: 44px;
  cursor: text;
  transition: border-color var(--duration), box-shadow var(--duration);
}

.tag-input-area:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.15);
}

.selected-tags { display: contents; }

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-muted);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

.pill-remove {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity var(--duration);
}
.pill-remove:hover { opacity: 1; }

.tag-input-area input {
  flex: 1;
  min-width: 120px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text);
  outline: none;
  padding: 2px 0;
}
.tag-input-area input::placeholder { color: var(--text-tertiary); }

.tag-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
}
.tag-dropdown.active { display: block; }

.dropdown-item {
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  transition: background var(--duration);
}
.dropdown-item:hover,
.dropdown-item.highlighted {
  background: var(--bg-card-hover);
}
.dropdown-item strong { color: var(--accent); font-weight: 600; }

.tag-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.tag-hint {
  flex: 1;
  font-size: 0.78rem;
  color: var(--text-tertiary);
}
.tag-hint.ready { color: var(--success); }

.tag-actions button {
  padding: 10px 20px;
  border-radius: var(--radius);
  border: none;
  font-size: 14px;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
  height: 40px;
}

.btn-search { background: var(--accent); color: #1a1d23; font-weight: 600; }
.btn-search:hover:not(:disabled) { background: var(--accent-active); }
.btn-search:active:not(:disabled) { transform: scale(0.97); }
.btn-search:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-inspire {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border) !important;
}
.btn-inspire:hover {
  color: var(--text);
  border-color: var(--border-active) !important;
  background: var(--bg-raised);
}

.hot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0.75rem;
  justify-content: center;
}

.hot-tag-btn {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
}
.hot-tag-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-muted);
}

/* ── Main Content ──────────────────────────── */

.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ── Progress ──────────────────────────────── */

.progress-bar {
  display: none;
  margin-bottom: 1.5rem;
  padding: 0.85rem 1.15rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.progress-bar.active { display: block; }

.progress-track {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s var(--ease-out);
}

.progress-text { font-size: 0.82rem; color: var(--text-secondary); }

/* ── Section Title ─────────────────────────── */

.section-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
}

.chart-tips {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  line-height: 1.6;
  padding: 0.6rem 0.85rem;
  background: var(--bg-raised);
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
}

/* ── Score Badges ─────────────────────────── */

.score-high   { background: var(--success-bg); color: var(--success); }
.score-medium { background: var(--warning-bg); color: var(--warning); }
.score-low    { background: var(--danger-bg); color: var(--danger); }
.score-unknown { background: var(--bg-card); color: var(--text-tertiary); }

/* ── Tag Detail ───────────────────────────── */

.category-detail {
  display: none;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  margin-bottom: 2rem;
  overflow: hidden;
  animation: slideUp 0.25s var(--ease-out);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.category-detail.active { display: block; }

.detail-header {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-header h2 { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em; }

.btn-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--duration);
}
.btn-close:hover { color: var(--text); border-color: var(--border-active); }

.detail-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
}

/* ── Detail Cards (chart & ranking) ────────── */

.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  min-width: 0;
}

/* ── Chart Container ───────────────────────── */

.chart-container { position: relative; height: 380px; }

/* ── Game List ─────────────────────────────── */

.app-list {
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-active) transparent;
}

.app-list::-webkit-scrollbar { width: 4px; }
.app-list::-webkit-scrollbar-track { background: transparent; }
.app-list::-webkit-scrollbar-thumb { background: var(--border-active); border-radius: 2px; }

.app-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.7rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--duration);
}
.app-item:hover { background: var(--bg-card); }

.app-item .rank {
  width: 24px; height: 24px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; font-family: var(--font-mono);
  flex-shrink: 0;
}

.rank-1 { background: var(--warning-bg); color: var(--warning); }
.rank-2 { background: var(--bg-card); color: var(--text-secondary); }
.rank-3 { background: #2e2518; color: #d4804a; }
.rank-other { background: var(--bg-card); color: var(--text-tertiary); }

.app-item .app-info { flex: 1; min-width: 0; }
.app-item .app-name {
  font-size: 0.82rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-item .app-meta {
  font-size: 0.72rem; color: var(--text-tertiary);
  margin-top: 0.05rem; font-family: var(--font-mono);
}
.app-item .app-score {
  font-size: 0.75rem; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  flex-shrink: 0; font-family: var(--font-mono);
}

/* ── Game Detail ──────────────────────────── */

.app-detail {
  display: none;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  margin-bottom: 2rem;
  overflow: hidden;
  animation: slideUp 0.25s var(--ease-out);
}
.app-detail.active { display: block; }

.app-detail-header {
  padding: 1.75rem 1.5rem;
  display: flex; gap: 1.25rem;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
}

.app-detail-icon {
  width: 64px; height: 64px;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--bg-card);
  object-fit: cover;
}

.app-detail-info { flex: 1; }
.app-detail-info h3 { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.01em; }
.app-detail-info .developer { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.1rem; }

.app-detail-stats { display: flex; gap: 1.5rem; margin-top: 0.75rem; flex-wrap: wrap; }
.stat-item { text-align: center; }
.stat-value {
  font-size: 1.05rem; font-weight: 600;
  color: var(--accent); font-family: var(--font-mono);
}
.stat-label {
  font-size: 0.68rem; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.05rem;
}

.app-detail-body { padding: 1.5rem; }

/* ── Score Breakdown ───────────────────────── */

.score-breakdown {
  padding: 1.15rem 1.35rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
}

.score-breakdown-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 0.85rem;
}
.score-breakdown-header .total-label { font-size: 0.82rem; font-weight: 600; }
.score-breakdown-header .total-score { font-size: 1.6rem; font-weight: 700; color: var(--accent); }
.score-breakdown-header .total-max { font-size: 0.82rem; color: var(--text-tertiary); }

.score-dim {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.4rem 0;
}
.score-dim + .score-dim { border-top: 1px solid var(--border); }
.score-dim .dim-label { width: 56px; font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); flex-shrink: 0; }
.score-dim .dim-bar-track { flex: 1; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.score-dim .dim-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s var(--ease-out); }

.dim-bar-fill.demand { background: var(--info); }
.dim-bar-fill.competition { background: var(--accent); }
.dim-bar-fill.saturation { background: var(--success); }
.dim-bar-fill.pain { background: var(--danger); }
.dim-bar-fill.revenue { background: var(--warning); }

.score-dim .dim-value { width: 36px; text-align: right; font-size: 0.75rem; font-weight: 600; font-family: var(--font-mono); }
.score-dim .dim-hint { width: 100px; font-size: 0.7rem; color: var(--text-tertiary); text-align: right; flex-shrink: 0; }

/* ── Radar Chart ───────────────────────────── */

.radar-chart-container { max-width: 260px; margin: 0 auto 1rem; }

/* ── Report ────────────────────────────────── */

.report-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 0.85rem; margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.report-label { font-size: 0.92rem; font-weight: 600; color: var(--text-secondary); }
.report-date { font-size: 0.72rem; color: var(--text-tertiary); font-family: var(--font-mono); }

.report-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
.report-row .analysis-card { margin-bottom: 0; }

/* ── Verdict Banner ────────────────────────── */

.verdict-banner {
  padding: 1rem 1.25rem; border-radius: var(--radius-lg);
  margin-bottom: 1.25rem; display: flex; align-items: center; gap: 1rem;
}
.verdict-badge { font-size: 1.5rem; font-weight: 700; flex-shrink: 0; }
.verdict-reason { font-size: 0.88rem; line-height: 1.5; }
.verdict-reason strong { display: block; margin-bottom: 0.15rem; }

/* ── Analysis Card ─────────────────────────── */

.analysis-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em;
  margin-bottom: 0.75rem; color: var(--text);
}

/* ── Revenue Section ───────────────────────── */

.revenue-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.75rem; }
.revenue-item { padding: 0.65rem 0.85rem; background: var(--bg-raised); border-radius: var(--radius); }
.revenue-item .revenue-label { font-size: 0.72rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.04em; }
.revenue-item .revenue-value { font-family: var(--font-mono); font-size: 1rem; font-weight: 600; color: var(--text); margin-top: 0.1rem; }
.revenue-item .revenue-value.highlight { color: var(--success); }
.recommendation { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; padding: 0.6rem 0.85rem; background: var(--bg-raised); border-radius: var(--radius); }

/* ── MVP Section ───────────────────────────── */

.mvp-group { margin-bottom: 0.65rem; }
.mvp-group:last-child { margin-bottom: 0; }
.mvp-group-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-tertiary); margin-bottom: 0.3rem; }
.mvp-feature-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.mvp-tag { display: inline-block; padding: 3px 10px; border-radius: var(--radius-sm); font-size: 0.78rem; font-weight: 500; }
.mvp-tag.must { background: var(--success-bg); color: var(--success); }
.mvp-tag.baseline { background: var(--bg-raised); color: var(--text-secondary); border: 1px solid var(--border); }
.mvp-tag.nice { background: var(--warning-bg); color: var(--warning); }

/* ── Feature Gap Section ───────────────────── */

.feature-gap-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.feature-gap-group-label {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; margin-bottom: 0.4rem; padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}
.feature-gap-group-label.complaints { color: var(--danger); }
.feature-gap-group-label.requests { color: var(--success); }
.feature-gap-list { list-style: none; padding: 0; }
.feature-gap-item { display: flex; align-items: baseline; gap: 0.65rem; padding: 0.45rem 0; border-bottom: 1px solid var(--border); }
.feature-gap-item:last-child { border-bottom: none; }
.feature-gap-item .gap-rank { width: 22px; font-size: 0.75rem; font-weight: 700; color: var(--text-tertiary); font-family: var(--font-mono); flex-shrink: 0; }
.feature-gap-item .gap-text { flex: 1; font-size: 0.85rem; color: var(--text); text-transform: capitalize; }
.feature-gap-item .gap-count { font-size: 0.72rem; color: var(--text-tertiary); font-family: var(--font-mono); flex-shrink: 0; }

/* ── Sentiment ─────────────────────────────── */

.sentiment-summary { font-size: 0.85rem; color: var(--text); margin-bottom: 0.35rem; }
.sentiment-summary .trend-icon { margin-right: 0.3rem; }
.sentiment-desc { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }

/* ── Risk & Strategy ───────────────────────── */

.risk-section, .strategy-section { margin-bottom: 0.85rem; }
.risk-group-label, .strategy-group-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-tertiary); margin-bottom: 0.4rem; }
.risk-list, .strategy-list { list-style: none; padding: 0; }
.risk-item { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.35rem 0; font-size: 0.82rem; line-height: 1.5; }
.risk-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; margin-top: 0.45rem; }
.risk-dot.high { background: var(--danger); }
.risk-dot.medium { background: var(--warning); }
.risk-dot.low { background: var(--text-tertiary); }
.risk-text { color: var(--text-secondary); }
.strategy-item { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.strategy-item:last-child { border-bottom: none; }
.strategy-tag { display: inline-block; padding: 1px 8px; border-radius: var(--radius-pill); font-size: 0.72rem; font-weight: 600; margin-right: 0.3rem; }
.strategy-tag.high { background: var(--success-bg); color: var(--success); }
.strategy-tag.medium { background: var(--warning-bg); color: var(--warning); }
.strategy-desc { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; margin-top: 0.2rem; }

/* ── Insight Box ───────────────────────────── */

.insight-box { background: var(--bg-card); border-radius: var(--radius-lg); padding: 1.35rem; margin-bottom: 1.25rem; }
.insight-box h4 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.85rem; }
.insight-item { padding: 0.65rem 0; }
.insight-item + .insight-item { border-top: 1px solid var(--border); }
.insight-item .insight-label { display: inline-block; font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 7px; border-radius: var(--radius-pill); margin-bottom: 0.3rem; }
.insight-label.market { background: var(--success-bg); color: var(--success); }
.insight-label.quality { background: var(--danger-bg); color: var(--danger); }
.insight-label.pricing { background: #1e2e3a; color: var(--info); }
.insight-label.competition { background: var(--bg-card); color: var(--text-secondary); }
.insight-item .insight-title { font-size: 0.88rem; font-weight: 600; color: var(--text); line-height: 1.5; margin-bottom: 0.15rem; }
.insight-item .insight-detail { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.65; }

/* ── Reviews ───────────────────────────────── */

.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.btn-translate-all {
  font-size: 0.78rem; font-weight: 500; color: var(--accent);
  background: none; border: 1px solid var(--accent-muted);
  border-radius: var(--radius); padding: 4px 12px; cursor: pointer;
  font-family: var(--font-body); transition: all var(--duration);
}
.btn-translate-all:hover { background: var(--accent-muted); border-color: var(--accent); }

.review-keywords { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.85rem; }
.keyword-tag { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 2px 10px; font-size: 0.75rem; color: var(--text-secondary); }

.review-item { padding: 0.65rem 0; border-bottom: 1px solid var(--border); list-style: none; }
.review-item:last-child { border-bottom: none; }
.review-item .review-vote { font-size: 0.8rem; margin-right: 0.4rem; }
.review-item .review-vote.positive { color: var(--success); }
.review-item .review-vote.negative { color: var(--danger); }
.review-item .review-playtime { font-size: 0.72rem; color: var(--text-tertiary); font-family: var(--font-mono); }
.review-item .review-content { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.25rem; line-height: 1.6; }
.btn-translate { display: inline-block; font-size: 0.72rem; font-weight: 500; color: var(--accent); background: none; border: none; cursor: pointer; font-family: var(--font-body); padding: 2px 0; margin-top: 0.2rem; }
.btn-translate:hover { color: var(--accent-active); text-decoration: underline; }
.review-translation { font-size: 0.82rem; color: var(--text); margin-top: 0.3rem; line-height: 1.6; }
.review-translation::before { content: "[译] "; font-size: 0.7rem; color: var(--accent); font-weight: 600; }

/* ── Steam Button ──────────────────────────── */

.btn-appstore {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-top: 1rem; padding: 10px 20px;
  background: var(--accent); color: #1a1d23;
  border-radius: var(--radius); text-decoration: none;
  font-size: 14px; font-weight: 600;
  transition: background var(--duration) var(--ease-out);
}
.btn-appstore:hover { background: var(--accent-active); }

/* ── Responsive ────────────────────────────── */

@media (max-width: 768px) {
  .app-header { padding: 2rem 1rem 1.75rem; }
  .app-header h1 { font-size: 1.6rem; }
  .tag-selector { max-width: 100%; }
  .detail-body { grid-template-columns: 1fr; }
  .report-row { grid-template-columns: 1fr; }
  .feature-gap-columns { grid-template-columns: 1fr; }
  .app-detail-header { flex-direction: column; align-items: center; text-align: center; }
  .app-detail-stats { justify-content: center; }
}

@media (max-width: 480px) {
  .main-content { padding: 1rem 0.75rem 3rem; }
  .detail-body { padding: 1rem; }
  .score-dim .dim-hint { display: none; }
  .tag-actions { flex-wrap: wrap; }
  .cat-stats { grid-template-columns: repeat(2, 1fr); }
  .cat-detail-row { grid-template-columns: 1fr; }
}

/* ── Category Summary ── */

#categorySummary {
  grid-column: 1 / -1;
}

.cat-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.cat-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.cat-stat-card {
  background: var(--bg-raised);
  border-radius: var(--radius);
  padding: 0.75rem;
  text-align: center;
}

.cat-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-mono);
}

.cat-stat-label {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.cat-detail-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.cat-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cat-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-raised);
  margin-bottom: 0.5rem;
}

.cat-bar-segment {
  transition: width var(--duration) var(--ease-out);
}

.cat-bar-high { background: var(--success); }
.cat-bar-med { background: var(--warning); }
.cat-bar-low { background: var(--text-tertiary); opacity: 0.5; }

.cat-distribution-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.legend-item {
  font-size: 0.7rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cat-price-bars {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.cat-price-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cat-price-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  width: 3rem;
  flex-shrink: 0;
  text-align: right;
}

.cat-price-track {
  flex: 1;
  height: 6px;
  background: var(--bg-raised);
  border-radius: 3px;
  overflow: hidden;
}

.cat-price-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width var(--duration) var(--ease-out);
}

.cat-price-count {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  width: 1.5rem;
  font-family: var(--font-mono);
}

.cat-pricing-meta {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-top: 0.4rem;
}

.cat-summary-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.cat-summary-icon {
  margin-right: 0.3rem;
}

@media (max-width: 768px) {
  .cat-stats { grid-template-columns: repeat(2, 1fr); }
  .cat-detail-row { grid-template-columns: 1fr; }
}
