/* ── CSS Variables ─────────────────────────────────────────────────────── */
:root {
  --bg:       #0f1117;
  --bg2:      #161b27;
  --bg3:      #1e2535;
  --border:   #2a3347;
  --text:     #e2e8f0;
  --text2:    #94a3b8;
  --text3:    #64748b;
  --accent:   #6366f1;
  --accent2:  #818cf8;
  --green:    #10b981;
  --yellow:   #f59e0b;
  --red:      #ef4444;
  --blue:     #3b82f6;
  --purple:   #a855f7;
  --shadow:   0 4px 24px rgba(0,0,0,.45);
  --radius:   1rem;
  --radius-sm:.5rem;
}
[data-theme="light"] {
  --bg:       #f1f5f9;
  --bg2:      #ffffff;
  --bg3:      #e2e8f0;
  --border:   #cbd5e1;
  --text:     #0f172a;
  --text2:    #475569;
  --text3:    #94a3b8;
  --accent:   #4f46e5;
  --accent2:  #6366f1;
  --shadow:   0 2px 12px rgba(0,0,0,.1);
}

/* ── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.6;
  transition: background .2s, color .2s;
  min-height: 100vh;
}
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
textarea, input, select, button { font-family: inherit; }

/* ── Topbar ────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 200;
  background: rgba(22,27,39,.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}
[data-theme="light"] .topbar { background: rgba(255,255,255,.92); }
.topbar-inner {
  max-width: 1400px; margin: 0 auto;
  padding: .65rem 1.5rem;
  display: flex; align-items: center; gap: .75rem;
}
.topbar-brand { display: flex; align-items: center; gap: .5rem; }
.brand-icon { font-size: 1.2rem; }
.brand-name { font-size: 1rem; font-weight: 600; letter-spacing: -.01em; }
.brand-name strong { color: var(--accent2); }
.topbar-nav { margin-left: auto; display: flex; align-items: center; gap: .5rem; }

/* ── Status badge ──────────────────────────────────────────────────────── */
.status-badge {
  padding: .2rem .65rem; border-radius: 99px;
  font-size: .75rem; font-weight: 500;
  background: var(--bg3); color: var(--text2);
  border: 1px solid var(--border);
}

/* ── Icon button ───────────────────────────────────────────────────────── */
.icon-btn {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .35rem .6rem;
  font-size: .95rem; cursor: pointer; color: var(--text);
  transition: all .15s; line-height: 1;
}
.icon-btn:hover { background: var(--border); border-color: var(--accent); }

/* ── Main layout ───────────────────────────────────────────────────────── */
main {
  max-width: 1400px; margin: 0 auto;
  padding: 1.5rem 1.5rem 5rem;
  display: flex; flex-direction: column; gap: 1.25rem;
}

/* ── Card ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card-header {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: 1.25rem; flex-wrap: wrap;
}
.card-header h2 { font-size: 1rem; font-weight: 600; }
.card-icon {
  width: 2rem; height: 2rem; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.bg-indigo { background: #4f46e5; }
.bg-green  { background: #059669; }
.bg-yellow { background: #d97706; }
.bg-purple { background: #7c3aed; }
.bg-blue   { background: #2563eb; }
.count-badge {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 99px; padding: .1rem .55rem;
  font-size: .75rem; color: var(--text2);
}
.header-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* ── Hidden ────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: .75rem; }
.mt-4 { margin-top: 1.5rem; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.text-sm { font-size: .8125rem; }

/* ── Form grid ─────────────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.form-col { display: flex; flex-direction: column; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.label { font-size: .8125rem; font-weight: 500; color: var(--text2); display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.hint  { font-size: .75rem; color: var(--text3); font-weight: 400; }
.label-sm { font-size: .8125rem; color: var(--text2); }
.form-note { font-size: .75rem; color: var(--text3); }
.form-actions { display: flex; align-items: center; gap: .75rem; margin-top: 1.25rem; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 1.25rem; }
.shortcut-hint { margin-left: auto; font-size: .72rem; color: var(--text3); }

/* ── Inputs ────────────────────────────────────────────────────────────── */
.inp {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .5rem .75rem;
  color: var(--text); font-size: .875rem; outline: none;
  transition: border-color .15s;
  width: 100%;
}
.inp:focus { border-color: var(--accent); }
.inp::placeholder { color: var(--text3); }
.row-gap { display: flex; gap: .75rem; align-items: center; }

/* ── Tag input ─────────────────────────────────────────────────────────── */
.tag-wrap {
  min-height: 2.5rem;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .35rem .5rem;
  display: flex; flex-wrap: wrap; gap: .35rem; align-items: center;
  cursor: text; transition: border-color .15s;
}
.tag-wrap:focus-within { border-color: var(--accent); }
.tag-input { background: transparent; border: none; outline: none; color: var(--text); font-size: .875rem; flex: 1; min-width: 120px; padding: .15rem .25rem; }
.tag-input::placeholder { color: var(--text3); }
.tag-chip {
  background: var(--accent); color: #fff; border-radius: 99px;
  padding: .15rem .6rem; font-size: .775rem; font-weight: 500;
  display: flex; align-items: center; gap: .25rem; white-space: nowrap;
}
.tag-chip-remove { cursor: pointer; opacity: .7; font-size: .9rem; line-height: 1; }
.tag-chip-remove:hover { opacity: 1; }

/* ── Segmented source buttons ──────────────────────────────────────────── */
.seg-btns { display: flex; gap: .5rem; flex-wrap: wrap; }
.seg-btn {
  padding: .45rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg3);
  color: var(--text2); font-size: .8125rem; font-weight: 500;
  cursor: pointer; transition: all .15s; display: flex; align-items: center; gap: .4rem;
}
.seg-btn:hover { border-color: var(--accent); color: var(--text); }
.seg-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Star picker ───────────────────────────────────────────────────────── */
.star-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.star-dash { color: var(--text3); }
.star-picker { display: flex; gap: .15rem; }
.star-picker .star {
  font-size: 1.35rem; cursor: pointer; color: var(--text3);
  transition: color .1s, transform .1s;
  user-select: none;
}
.star-picker .star.active { color: #f59e0b; }
.star-picker .star:hover { transform: scale(1.15); }

/* ── Slider ────────────────────────────────────────────────────────────── */
.slider {
  width: 100%; height: 4px; appearance: none; -webkit-appearance: none;
  background: var(--border); border-radius: 99px; outline: none;
  cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px;
  background: var(--accent); border-radius: 50%;
  cursor: pointer; border: 3px solid var(--bg2);
  box-shadow: 0 0 0 2px var(--accent);
  transition: transform .1s;
}
.slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.slider-ends { display: flex; justify-content: space-between; font-size: .72rem; color: var(--text3); margin-top: .2rem; }
.badge { background: var(--accent); color: #fff; border-radius: 99px; padding: .1rem .5rem; font-size: .75rem; font-weight: 600; }

/* ── Check row ─────────────────────────────────────────────────────────── */
.check-row { display: flex; align-items: center; gap: .5rem; font-size: .8125rem; color: var(--text2); cursor: pointer; }
.check { accent-color: var(--accent); width: 15px; height: 15px; }
.warning-tag { background: #7c2d12; color: #fb923c; border-radius: 99px; padding: .1rem .45rem; font-size: .7rem; font-weight: 600; }

/* ── Advanced details ──────────────────────────────────────────────────── */
.adv-details { border: 1px solid var(--border); border-radius: var(--radius-sm); }
.adv-details summary { padding: .5rem .75rem; cursor: pointer; font-size: .8125rem; color: var(--text2); font-weight: 500; list-style: none; }
.adv-details summary::-webkit-details-marker { display: none; }
.adv-details[open] summary { border-bottom: 1px solid var(--border); }
.adv-grid { padding: .75rem; display: grid; grid-template-columns: repeat(3,1fr); gap: .75rem; }

/* ── Countries picker ──────────────────────────────────────────────────── */
.countries-details { border: 1px solid var(--border); border-radius: var(--radius-sm); }
.countries-summary { padding: .5rem .75rem; cursor: pointer; font-size: .8125rem; color: var(--text2); font-weight: 500; display: flex; align-items: center; gap: .5rem; list-style: none; }
.countries-summary::-webkit-details-marker { display: none; }
.countries-details[open] .countries-summary { border-bottom: 1px solid var(--border); }
.countries-picker { padding: .75rem; display: flex; flex-wrap: wrap; gap: .35rem; max-height: 200px; overflow-y: auto; }
.country-flag-btn {
  padding: .2rem .5rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg3);
  cursor: pointer; font-size: .8rem; color: var(--text2);
  transition: all .12s; white-space: nowrap;
}
.country-flag-btn.selected { background: var(--accent); border-color: var(--accent); color: #fff; }
.countries-actions { padding: .4rem .75rem .6rem; display: flex; gap: .75rem; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  padding: .55rem 1.2rem; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; transition: all .15s;
  display: inline-flex; align-items: center; gap: .4rem;
  white-space: nowrap; line-height: 1.4;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover:not(:disabled) { background: #4f46e5; }
.btn-secondary { background: var(--bg3); color: var(--text); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent2); }
.btn-ghost { background: transparent; color: var(--text2); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--bg3); color: var(--text); }
.btn-sm { padding: .3rem .75rem; font-size: .8rem; }
.link-btn { background: none; border: none; color: var(--accent2); font-size: .8125rem; cursor: pointer; padding: .15rem .25rem; }
.link-btn:hover { text-decoration: underline; }

/* ── App groups & cards ────────────────────────────────────────────────── */
.app-group { margin-bottom: 1.25rem; }
.app-group-header {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: .75rem; padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.app-group-count { font-size: .8rem; color: var(--text3); }
.store-badge {
  padding: .2rem .65rem; border-radius: 99px; font-size: .775rem; font-weight: 600;
}
.store-badge.gp { background: #14532d; color: #86efac; }
.store-badge.as { background: #1e1b4b; color: #c7d2fe; }
.app-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem;
}
.app-card {
  background: var(--bg3); border: 2px solid var(--border);
  border-radius: .75rem; padding: .85rem .65rem;
  cursor: pointer; transition: all .15s; text-align: center;
  position: relative; user-select: none;
}
.app-card:hover { border-color: var(--accent2); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99,102,241,.2); }
.app-card.selected { border-color: var(--accent); background: #1e1b4b; }
.app-card-link {
  position: absolute; top: .4rem; right: .4rem;
  font-size: .75rem; opacity: .5; text-decoration: none;
}
.app-card-link:hover { opacity: 1; }
.app-card-check {
  position: absolute; top: .4rem; left: .4rem;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: .65rem; display: none; align-items: center; justify-content: center;
}
.app-card.selected .app-card-check { display: flex; }
.app-icon {
  width: 60px; height: 60px; border-radius: .85rem; margin: 0 auto .5rem;
  object-fit: cover; display: block; background: var(--border);
}
.app-store-badge {
  position: absolute; bottom: .4rem; right: .4rem;
  font-size: .65rem; font-weight: 700; padding: .1rem .35rem; border-radius: .25rem;
}
.app-store-badge.gp { background: #166534; color: #86efac; }
.app-store-badge.as { background: #312e81; color: #c7d2fe; }
.app-card-title { font-size: .8rem; font-weight: 600; margin-bottom: .2rem; line-height: 1.3; }
.app-card-dev   { font-size: .7rem; color: var(--text3); margin-bottom: .3rem; }
.app-card-id    { font-size: .65rem; color: var(--text3); word-break: break-all; }
.app-card-score { font-size: .75rem; color: #f59e0b; margin-top: .2rem; }

/* ── Progress section ──────────────────────────────────────────────────── */
.progress-bar-wrap {
  background: var(--bg3); border-radius: 99px; height: 6px;
  overflow: hidden; margin-bottom: 1rem;
}
.progress-bar {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px; transition: width .3s ease;
}
.progress-stats {
  display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.pstat { text-align: center; }
.pstat-val { font-size: 1.4rem; font-weight: 700; color: var(--accent2); }
.pstat-key { font-size: .72rem; color: var(--text3); text-transform: uppercase; letter-spacing: .05em; }
.pstat-app { font-size: .95rem !important; }
.progress-log {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .6rem .8rem;
  max-height: 120px; overflow-y: auto; font-size: .75rem;
  color: var(--text2); font-family: monospace;
}
.progress-log p { margin: .1rem 0; }

/* ── Quick filters ─────────────────────────────────────────────────────── */
.quick-filters {
  display: flex; gap: .5rem; flex-wrap: wrap; align-items: center;
  margin-bottom: .75rem;
}
.qf-label { font-size: .75rem; color: var(--text3); }
.qf-pill {
  padding: .25rem .75rem; border-radius: 99px; font-size: .775rem;
  border: 1px solid var(--border); background: var(--bg3); color: var(--text2);
  cursor: pointer; transition: all .12s; white-space: nowrap;
}
.qf-pill:hover, .qf-pill.active { border-color: var(--accent); background: #1e1b4b; color: var(--accent2); }
.active-clear { border-color: var(--red) !important; color: var(--red) !important; background: transparent !important; }

/* ── Compare table ──────────────────────────────────────────────────────── */
.compare-table {
  width: 100%; border-collapse: collapse; font-size: .82rem;
}
.compare-table th {
  background: var(--bg3); color: var(--text2); font-weight: 600;
  text-align: left; padding: .6rem .75rem;
  border-bottom: 2px solid var(--border); white-space: nowrap;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
}
.compare-table td {
  padding: .55rem .75rem; border-bottom: 1px solid var(--border);
  color: var(--text1); vertical-align: middle;
}
.compare-table tr:hover td { background: var(--bg3); }
.compare-best { color: #10b981 !important; font-weight: 700; }
.compare-worst { color: #ef4444 !important; font-weight: 700; }
.app-store-badge { display: inline-block; font-size: .6rem; font-weight: 700;
  padding: .1rem .3rem; border-radius: .25rem; margin-right: .25rem; }
.app-store-badge.gp { background: #34a853; color: #fff; }
.app-store-badge.as { background: #0071e3; color: #fff; }

/* ── Tab badge ─────────────────────────────────────────────────────────── */
.tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff;
  border-radius: 99px; font-size: .65rem; font-weight: 700;
  padding: .05rem .4rem; margin-left: .35rem;
  min-width: 1.2rem; line-height: 1.4;
}

/* ── Tabs ──────────────────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: .25rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem; margin-top: .25rem;
}
.tab {
  padding: .45rem .9rem; font-size: .8125rem; font-weight: 500;
  background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; color: var(--text2); transition: all .15s;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent2); border-bottom-color: var(--accent); }
.tab-panel { display: block; }
.tab-panel.hidden { display: none; }
.tab-desc { font-size: .8rem; color: var(--text2); margin-bottom: .75rem; }

/* ── Filter bar ────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex; gap: .5rem; flex-wrap: wrap; align-items: center;
  margin-bottom: .75rem; padding: .75rem; background: var(--bg3);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.filter-inp {
  flex: 1; min-width: 180px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .4rem .65rem; color: var(--text); font-size: .8125rem; outline: none;
}
.filter-inp:focus { border-color: var(--accent); }
.filter-sel {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .4rem .65rem;
  color: var(--text); font-size: .8125rem; outline: none;
  cursor: pointer;
}
.filter-sel:focus { border-color: var(--accent); }

/* ── Reviews list ──────────────────────────────────────────────────────── */
.reviews-list { display: flex; flex-direction: column; gap: .65rem; }
.review-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: .75rem; padding: .85rem 1rem;
  transition: border-color .12s; position: relative;
}
.review-card:hover { border-color: var(--accent2); }
.review-header { display: flex; align-items: flex-start; gap: .65rem; margin-bottom: .4rem; flex-wrap: wrap; }
.review-stars { color: #f59e0b; font-size: .85rem; white-space: nowrap; }
.review-author { font-size: .8rem; font-weight: 600; }
.review-meta { font-size: .72rem; color: var(--text3); display: flex; gap: .5rem; flex-wrap: wrap; margin-left: auto; }
.review-text { font-size: .8rem; color: var(--text2); line-height: 1.55; }
.review-text mark { background: rgba(99,102,241,.25); color: var(--accent2); border-radius: .15rem; padding: 0 .1rem; }
.review-body mark { background: rgba(99,102,241,.25); color: var(--accent2); border-radius: .15rem; padding: 0 .1rem; }
.asc-link { font-size: .68rem; color: var(--text3); border: 1px solid var(--border); border-radius: .3rem; padding: .1rem .35rem; text-decoration: none; white-space: nowrap; }
.asc-link:hover { border-color: var(--accent); color: var(--accent2); text-decoration: none; }
.review-footer { margin-top: .5rem; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.review-store-link { font-size: .72rem; color: var(--accent2); text-decoration: none; }
.review-store-link:hover { text-decoration: underline; }
.sentiment-chip {
  padding: .1rem .45rem; border-radius: 99px; font-size: .7rem; font-weight: 600;
}
.sentiment-chip.positive { background: #14532d; color: #86efac; }
.sentiment-chip.negative { background: #7f1d1d; color: #fca5a5; }
.sentiment-chip.neutral  { background: #1c1917; color: #a8a29e; }
.copy-btn {
  background: none; border: 1px solid var(--border); border-radius: .35rem;
  padding: .1rem .4rem; font-size: .7rem; cursor: pointer; color: var(--text3);
  margin-left: auto; line-height: 1.4;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent2); }
.btn-copy-review {
  background: none; border: 1px solid var(--border); border-radius: .35rem;
  padding: .15rem .45rem; font-size: .75rem; cursor: pointer;
  color: var(--text3); margin-left: auto; line-height: 1.4;
  filter: grayscale(1); transition: all .15s;
}
.btn-copy-review:hover { border-color: var(--accent); color: var(--accent2); filter: none; }
.dev-reply {
  margin-top: .5rem; padding: .5rem .75rem; border-left: 3px solid var(--accent);
  background: rgba(99,102,241,.07); border-radius: 0 .4rem .4rem 0;
  font-size: .775rem; color: var(--text2);
}
.dev-reply-label { font-size: .7rem; font-weight: 600; color: var(--accent2); margin-bottom: .2rem; }

/* ── Overview cards ────────────────────────────────────────────────────── */
.overview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.overview-stat {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: .75rem; padding: .9rem 1rem; text-align: center;
}
.overview-stat-val { font-size: 1.8rem; font-weight: 700; color: var(--accent2); }
.overview-stat-key { font-size: .75rem; color: var(--text2); margin-top: .15rem; }
.app-breakdown { display: flex; flex-direction: column; gap: .5rem; }
.breakdown-row { display: flex; align-items: center; gap: .75rem; }
.breakdown-bar-wrap { flex: 1; background: var(--bg3); border-radius: 99px; height: 6px; }
.breakdown-bar { height: 100%; border-radius: 99px; background: var(--accent); }
.breakdown-label { font-size: .775rem; color: var(--text2); min-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breakdown-count { font-size: .775rem; color: var(--text2); min-width: 40px; text-align: right; }

/* ── Charts ────────────────────────────────────────────────────────────── */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto;
  gap: 1.25rem;
}
.chart-box {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: .75rem; padding: 1.25rem 1.25rem 1rem;
  display: flex; flex-direction: column;
}
.chart-box h4 {
  font-size: .8rem; font-weight: 600; color: var(--text2);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: .75rem; flex-shrink: 0;
}
.chart-box .chart-canvas-wrap {
  flex: 1; position: relative; min-height: 240px;
}
.chart-box canvas {
  position: absolute; inset: 0; width: 100% !important; height: 100% !important;
}
/* Timeline & sentiment span full width */
.chart-box.chart-wide {
  grid-column: 1 / -1;
}
.chart-box.chart-wide .chart-canvas-wrap { min-height: 220px; }

/* ── Overview two-col grid ─────────────────────────────────────────────── */
.overview-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
@media (max-width: 700px) { .overview-two-col { grid-template-columns: 1fr; } }

/* ── Bar rows (overview charts) ────────────────────────────────────────── */
.star-bar-row, .bar-row {
  display: flex; align-items: center; gap: .5rem; margin-bottom: .35rem; font-size: .8rem;
}
.star-bar-row span:first-child, .bar-row span:first-child { min-width: 2.5rem; color: var(--text2); }
.star-bar-row span:last-child, .bar-row span:last-child { min-width: 2rem; text-align: right; color: var(--text3); }
.star-bar-track, .bar-track {
  flex: 1; height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden;
}
.star-bar-fill { height: 100%; background: #f59e0b; border-radius: 99px; transition: width .3s; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.bar-fill.app-fill { background: var(--purple); }

/* ── Pagination ────────────────────────────────────────────────────────── */
.pagination { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; margin: .75rem 0; }
.page-btn {
  min-width: 2rem; height: 2rem; border-radius: .4rem;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); font-size: .8rem; cursor: pointer; transition: all .12s;
  display: flex; align-items: center; justify-content: center;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent2); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Sentiment overview ────────────────────────────────────────────────── */
.sentiment-overview { display: grid; grid-template-columns: repeat(3,1fr); gap: .75rem; margin-bottom: 1rem; }
.sent-card { background: var(--bg3); border: 1px solid var(--border); border-radius: .75rem; padding: .85rem; text-align: center; }
.sent-card-val { font-size: 1.5rem; font-weight: 700; }
.sent-card.pos .sent-card-val { color: var(--green); }
.sent-card.neg .sent-card-val { color: var(--red); }
.sent-card.neu .sent-card-val { color: var(--text2); }
.sent-card-key { font-size: .75rem; color: var(--text2); }

/* ── ASO table ─────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.data-table th { background: var(--bg3); color: var(--text2); font-weight: 600; padding: .55rem .75rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: .5rem .75rem; border-bottom: 1px solid var(--border); color: var(--text); }
.data-table tr:hover td { background: var(--bg3); }
.data-table td:first-child { cursor: pointer; color: var(--accent2); font-weight: 500; }
.data-table td:first-child:hover { text-decoration: underline; }

/* ── Listing tab ───────────────────────────────────────────────────────── */
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px,1fr)); gap: 1rem; }
.listing-card { background: var(--bg3); border: 1px solid var(--border); border-radius: .75rem; padding: 1rem; }
.listing-header { display: flex; gap: .75rem; margin-bottom: .75rem; align-items: flex-start; }
.listing-icon { width: 54px; height: 54px; border-radius: .65rem; object-fit: cover; flex-shrink: 0; }
.listing-title { font-weight: 600; font-size: .9rem; }
.listing-dev { font-size: .75rem; color: var(--text2); }
.listing-version { font-size: .72rem; color: var(--text3); }
.listing-desc { font-size: .775rem; color: var(--text2); line-height: 1.55; max-height: 120px; overflow-y: auto; }
.listing-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .65rem; }
.listing-tag { background: var(--bg); border: 1px solid var(--border); border-radius: .35rem; padding: .1rem .45rem; font-size: .7rem; color: var(--text2); }

/* ── Compare tab ───────────────────────────────────────────────────────── */
.compare-table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.compare-table th { background: var(--bg3); font-weight: 600; padding: .55rem .75rem; text-align: left; border-bottom: 1px solid var(--border); }
.compare-table td { padding: .5rem .75rem; border-bottom: 1px solid var(--border); }
.compare-table tr:hover td { background: var(--bg3); }
.compare-best { color: var(--green); font-weight: 600; }
.compare-worst { color: var(--red); }

/* ── History drawer ────────────────────────────────────────────────────── */
.drawer { position: fixed; inset: 0; z-index: 300; }
.drawer-panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: 380px; max-width: 95vw;
  background: var(--bg2); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; box-shadow: -4px 0 24px rgba(0,0,0,.4);
  animation: slideIn .2s ease;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); z-index: -1; }
.drawer-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.drawer-header h2 { font-size: .95rem; font-weight: 600; }
.drawer-list { flex: 1; overflow-y: auto; padding: .75rem; display: flex; flex-direction: column; gap: .5rem; }
.history-item {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: .6rem; padding: .65rem .85rem; cursor: pointer;
  transition: border-color .12s;
}
.history-item:hover { border-color: var(--accent); }
.history-item-title { font-size: .8rem; font-weight: 600; margin-bottom: .2rem; }
.history-item-meta { font-size: .72rem; color: var(--text2); display: flex; gap: .5rem; flex-wrap: wrap; }
.history-item-actions { display: flex; gap: .4rem; margin-top: .4rem; }
.history-badge { padding: .1rem .4rem; border-radius: 99px; font-size: .68rem; font-weight: 600; }
.history-badge.done  { background: #14532d; color: #86efac; }
.history-badge.error { background: #7f1d1d; color: #fca5a5; }
.history-badge.running { background: #1e3a5f; color: #93c5fd; }

/* ── Lang switcher ─────────────────────────────────────────────────────── */
.lang-switcher { display: flex; gap: .25rem; }
.lang-btn {
  padding: .25rem .55rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg3);
  cursor: pointer; font-size: .75rem; font-weight: 500; color: var(--text2);
  transition: all .12s; display: flex; align-items: center; gap: .3rem;
}
.lang-btn.active { border-color: var(--accent); background: #1e1b4b; color: var(--accent2); }
.lang-btn:hover { border-color: var(--accent); }

/* ── Modal ─────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  z-index: 400; display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-box {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  width: 100%; max-width: 760px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  animation: popIn .18s ease;
}
.modal-sm { max-width: 440px; }
@keyframes popIn { from { opacity:0; transform: scale(.95); } to { opacity:1; transform: scale(1); } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; border-bottom: 1px solid var(--border); padding-bottom: .75rem; }
.modal-header h2 { font-size: 1rem; font-weight: 600; }
.modal-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }

/* ── AI Modal ──────────────────────────────────────────────────────────── */
.tpl-row { display: flex; flex-direction: column; gap: .75rem; margin-bottom: .75rem; }
.tpl-section-label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text3);
  display: flex; align-items: center; gap: .5rem;
}
.tpl-section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.tpl-section-label .step-pill {
  padding: .1rem .5rem; border-radius: 99px; font-size: .68rem;
}
.step-pill.step1 { background: #1e3a5f; color: #93c5fd; }
.step-pill.step2 { background: #2e1065; color: #d8b4fe; }
.tpl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: .5rem; }
.tpl-card {
  padding: .65rem .75rem; border-radius: .6rem;
  border: 1px solid var(--border); background: var(--bg3);
  cursor: pointer; transition: all .15s;
  display: flex; flex-direction: column; gap: .25rem;
}
.tpl-card:hover { border-color: var(--accent2); background: #1e1b4b; }
.tpl-card.tpl-active { border-color: var(--accent); background: #1e1b4b; }
.tpl-card-icon { font-size: 1.1rem; }
.tpl-card-name { font-size: .775rem; font-weight: 600; color: var(--text); }
.tpl-card-info { font-size: .7rem; color: var(--text3); line-height: 1.4; }
.ai-hint {
  font-size: .8rem; padding: .6rem .85rem; border-radius: var(--radius-sm);
  line-height: 1.5; margin-bottom: .5rem;
}
.ai-hint.step1-hint { background: #1e3a5f22; border: 1px solid #3b82f660; color: #93c5fd; }
.ai-hint.step2-hint { background: #2e106522; border: 1px solid #a855f760; color: #d8b4fe; }
.prompt-area {
  width: 100%; min-height: 200px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .75rem; color: var(--text); font-size: .8rem;
  font-family: monospace; resize: vertical; outline: none;
  margin-top: .75rem;
}
.ai-info {
  font-size: .775rem; color: var(--text2); background: var(--bg3);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .5rem .75rem; margin-top: .5rem;
}

/* ── Keyboard shortcuts ────────────────────────────────────────────────── */
.kbd-table { width: 100%; border-collapse: collapse; }
.kbd-table td { padding: .45rem .5rem; border-bottom: 1px solid var(--border); font-size: .85rem; }
.kbd-table td:first-child { width: 40%; }
kbd {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: .3rem; padding: .1rem .4rem; font-size: .8rem;
  font-family: monospace; color: var(--text);
}

/* ── Onboarding tooltip ────────────────────────────────────────────────── */
.onboarding {
  position: fixed; z-index: 500; max-width: 300px;
  background: var(--bg2); border: 2px solid var(--accent);
  border-radius: var(--radius); padding: 1rem;
  box-shadow: 0 8px 32px rgba(99,102,241,.35);
  animation: popIn .2s ease;
}
.onboarding-body { display: flex; flex-direction: column; gap: .75rem; }
.onboarding-step { font-size: .85rem; color: var(--text2); line-height: 1.5; }
.onboarding-nav { display: flex; align-items: center; gap: .5rem; }
.ob-dots { display: flex; gap: .35rem; flex: 1; justify-content: center; }
.ob-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.ob-dot.active { background: var(--accent); }
.onboarding-arrow {
  position: absolute; width: 12px; height: 12px;
  background: var(--bg2); border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
  top: -7px; left: 20px; transform: rotate(45deg);
}

/* ── Cross-job search ──────────────────────────────────────────────────── */
.cross-result { background: var(--bg3); border: 1px solid var(--border); border-radius: .6rem; padding: .65rem .85rem; margin-bottom: .5rem; font-size: .8rem; }
.cross-result-meta { font-size: .7rem; color: var(--text2); margin-bottom: .25rem; }

/* ── ASO grid ───────────────────────────────────────────────────────────── */
.aso-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .65rem; margin-top: .75rem; }
.aso-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: .75rem; padding: .75rem;
  cursor: pointer; transition: all .15s;
  display: flex; flex-direction: column; gap: .4rem;
}
.aso-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(99,102,241,.2); }
.aso-word { font-size: .95rem; font-weight: 700; color: var(--text); }
.aso-bar-wrap { height: 4px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.aso-bar { height: 100%; border-radius: 99px; transition: width .3s; }
.aso-meta { display: flex; justify-content: space-between; align-items: center; margin-top: .1rem; }
.aso-count { font-size: .72rem; color: var(--text3); }
.aso-btn { background: none; border: 1px solid var(--border); border-radius: .3rem; padding: .1rem .4rem; font-size: .7rem; cursor: pointer; color: var(--text3); }
.aso-btn:hover { border-color: var(--accent); color: var(--accent2); }

/* ── Listing improvements ───────────────────────────────────────────────── */
.listing-desc-full { margin-top: .75rem; }
.listing-notes-box { margin-top: .75rem; padding: .6rem .75rem; background: var(--bg); border-radius: .5rem; border: 1px solid var(--border); }
.listing-pre { font-family: inherit; font-size: .775rem; color: var(--text2); line-height: 1.6; white-space: pre-wrap; word-break: break-word; max-height: 300px; overflow-y: auto; margin-top: .35rem; }
.listing-screenshots { display: flex; gap: .5rem; overflow-x: auto; margin-top: .75rem; padding-bottom: .35rem; }
.listing-screenshot { height: 140px; border-radius: .5rem; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .sentiment-overview { grid-template-columns: 1fr 1fr; }
  .overview-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  main { padding: 1rem .75rem 4rem; }
  .card { padding: 1rem; }
  .topbar-inner { padding: .5rem .75rem; }
  .brand-name { font-size: .875rem; }
  .app-cards { grid-template-columns: repeat(2, 1fr); }
  .tpl-cards { grid-template-columns: 1fr 1fr; }
  .tpl-card-info { display: none; }
  .shortcut-hint { display: none; }
  .sentiment-overview { grid-template-columns: 1fr; }
  .overview-grid { grid-template-columns: 1fr; }
}

