:root {
  color-scheme: light;
  --ink: #14231d;
  --muted: #718077;
  --line: #dfe9e2;
  --soft: #f3f8f4;
  --accent: #1b7f52;
  --accent-dark: #0d5b38;
  --orange: #bd6b25;
  --red: #b34e4e;
  --shadow: 0 18px 48px rgba(31, 77, 52, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: #f7faf7;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 54px 0 42px; }
.topbar { display: flex; justify-content: space-between; gap: 28px; align-items: flex-end; margin-bottom: 30px; }
.topbar-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.app-nav { display: flex; gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.7); }
.nav-link { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 9px; font-size: 13px; font-weight: 750; }
.nav-link:hover, .nav-link.active { color: var(--accent-dark); background: #e4f3e9; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 11px; letter-spacing: .15em; font-weight: 800; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(34px, 6vw, 64px); line-height: .98; letter-spacing: -.055em; }
h2 { margin-bottom: 0; font-size: 22px; letter-spacing: -.03em; }
.subtitle { color: var(--muted); font-size: 16px; margin-bottom: 0; }
.card { border: 1px solid var(--line); background: rgba(255,255,255,.86); border-radius: 22px; box-shadow: var(--shadow); }
.controls { display: flex; gap: 18px; align-items: end; padding: 18px 20px; margin-bottom: 16px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
select, .watch-input { border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); padding: 11px 13px; font: inherit; }
.status { margin-left: auto; padding-bottom: 11px; color: var(--muted); font-size: 13px; }
button { border: 0; border-radius: 11px; padding: 11px 16px; font: inherit; font-weight: 750; cursor: pointer; transition: .18s ease; }
button:hover { transform: translateY(-1px); }
button:disabled { opacity: .65; cursor: wait; transform: none; }
.primary { color: white; background: var(--accent-dark); box-shadow: 0 8px 20px rgba(13, 91, 56, .18); }
.secondary { color: var(--accent-dark); background: #e4f3e9; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.stat { padding: 19px 20px; }
.stat span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.stat strong { font-size: 20px; letter-spacing: -.03em; }
.watch, .table-card, .add-watch { padding: 24px; margin-bottom: 16px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 18px; }
.helper, .muted, footer, small { color: var(--muted); font-size: 12px; }
.watch-input { display: block; width: min(560px, 100%); margin-bottom: 20px; }
.add-watch-row { display: flex; gap: 10px; align-items: center; }
.add-watch-row .watch-input { flex: 1; width: auto; margin-bottom: 0; }
.trend-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.trend-card { padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--soft); min-height: 116px; }
.trend-title { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 11px; font-size: 13px; }
.trend-title span { color: var(--accent); font-weight: 800; }
.sparkline { display: block; width: 100%; height: 42px; margin-bottom: 7px; }
.sparkline polyline { fill: none; stroke: var(--accent); stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.5; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: var(--muted); font-size: 11px; font-weight: 700; text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); }
td { padding: 12px 10px; border-bottom: 1px solid #edf2ee; vertical-align: middle; }
.rank-number { font-weight: 850; font-size: 16px; width: 70px; }
.movement { display: inline-flex; min-width: 55px; font-weight: 750; }
.movement.up { color: var(--accent); }
.movement.down { color: var(--red); }
.movement.neutral { color: var(--muted); font-weight: 600; }
.app-cell { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 750; min-width: 260px; }
.app-cell span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-cell:hover { color: var(--accent); }
.app-cell img { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 2px 7px rgba(0,0,0,.1); }
.actions-cell { white-space: nowrap; }
.row-action { display: inline-block; border: 0; border-radius: 8px; padding: 7px 9px; color: var(--accent-dark); background: #e4f3e9; font: inherit; font-size: 12px; font-weight: 750; text-decoration: none; cursor: pointer; }
.row-action + .row-action { margin-left: 5px; }
.row-action:hover { background: #cfead8; }
.row-action.is-watched { color: #7b5a1d; background: #fff0c8; }
.detail-action { color: #2c5b88; background: #e6f0fb; }
.remove-action { color: #9b4f4f; background: #fbe8e8; }
.top-link { text-decoration: none; white-space: nowrap; }
.is-watched-button { color: #7b5a1d; background: #fff0c8; }
.empty { padding: 35px 0 10px; text-align: center; color: var(--muted); }
.hidden { display: none; }
footer { padding: 10px 4px; line-height: 1.6; }

.list-heading { margin: 28px 0 16px; }
.watchlist-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.watch-card { padding: 20px; }
.watch-card-main { display: flex; align-items: center; gap: 13px; }
.watch-icon { width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 5px 16px rgba(0,0,0,.12); }
.watch-card-title { flex: 1; min-width: 0; }
.watch-card-title h3 { margin: 0 0 4px; font-size: 16px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.watch-card-title a { color: var(--ink); text-decoration: none; }
.watch-card-title a:hover { color: var(--accent); }
.watch-card-title p { margin: 0; color: var(--muted); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.rank-badge { color: var(--accent-dark); font-size: 14px; white-space: nowrap; }
.muted-badge { color: var(--muted); font-size: 12px; }
.watch-metrics { display: flex; gap: 16px; margin: 18px 0 10px 69px; color: var(--muted); font-size: 12px; }
.watch-card .sparkline { margin-left: 69px; width: calc(100% - 69px); }
.sparkline.large { height: 48px; }
.no-trend { padding: 18px 0; color: var(--muted); font-size: 12px; }
.watch-card-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 12px; }
.detail-status { margin: 0 0 16px; }
.detail-hero { display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 24px; padding: 28px; margin-bottom: 16px; }
.detail-icon { width: 120px; height: 120px; border-radius: 26px; box-shadow: 0 12px 28px rgba(0,0,0,.13); }
.detail-identity h2 { margin: 0 0 8px; font-size: 30px; letter-spacing: -.04em; }
.detail-artist { margin: 0 0 14px; color: var(--muted); }
.tag-row { display: flex; gap: 7px; flex-wrap: wrap; }
.tag { padding: 6px 9px; border-radius: 99px; color: var(--accent-dark); background: #e4f3e9; font-size: 12px; font-weight: 700; }
.detail-actions { display: flex; gap: 8px; margin-top: 18px; }
.detail-rank-box { min-width: 140px; padding-left: 24px; border-left: 1px solid var(--line); }
.detail-rank-box span, .detail-rank-box small { display: block; color: var(--muted); font-size: 12px; }
.detail-rank-box strong { display: block; margin: 7px 0; color: var(--accent-dark); font-size: 32px; letter-spacing: -.05em; }
.detail-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 16px; margin-bottom: 16px; }
.detail-panel { padding: 24px; margin-bottom: 16px; }
.detail-trend { min-height: 210px; display: flex; flex-direction: column; justify-content: center; }
.detail-sparkline { width: 100%; height: 190px; overflow: visible; }
.detail-sparkline polyline { fill: none; stroke: var(--accent); stroke-linecap: round; stroke-linejoin: round; stroke-width: 4; }
.trend-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.info-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; margin: 0; }
.info-list div { min-width: 0; }
.info-list dt { margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.info-list dd { margin: 0; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.description { margin: 0; color: #405047; line-height: 1.8; white-space: pre-wrap; }
.screenshots { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 5px; }
.screenshots img { width: 180px; max-height: 390px; object-fit: cover; object-position: top; border-radius: 14px; border: 1px solid var(--line); }
.cross-stats { grid-template-columns: repeat(4, 1fr); }
.analysis-table { min-width: 900px; }
.analysis-table .app-cell { min-width: 220px; }
.analysis-signal, .gap { display: inline-flex; align-items: center; border-radius: 99px; padding: 5px 8px; white-space: nowrap; font-size: 11px; font-weight: 800; }
.signal-triple { color: #6d4a00; background: #fff0c8; }
.signal-grossing { color: #8d4c23; background: #fff0e3; }
.signal-free { color: var(--accent-dark); background: #e4f3e9; }
.signal-neutral, .neutral-gap { color: var(--muted); background: var(--soft); }
.grossing-gap { color: #8d4c23; background: #fff0e3; }
.free-gap { color: var(--accent-dark); background: #e4f3e9; }
.reviews-list { display: grid; gap: 10px; }
.review-item { padding: 15px 16px; border: 1px solid var(--line); border-radius: 15px; background: var(--soft); }
.review-item.review-negative { border-color: #f0d0d0; background: #fff8f8; }
.review-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.review-head strong { font-size: 14px; }
.review-rating { color: #9a6a1d; font-size: 12px; white-space: nowrap; }
.review-content { margin: 9px 0 10px; color: #405047; font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.review-meta { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 11px; }

@media (max-width: 760px) {
  .shell { width: min(100% - 24px, 1180px); padding-top: 30px; }
  .topbar, .controls { align-items: stretch; flex-direction: column; }
  .topbar-actions { align-items: stretch; justify-content: stretch; }
  .app-nav { justify-content: center; }
  .status { margin-left: 0; padding-bottom: 0; }
  .stats, .trend-grid, .watchlist-grid, .detail-grid { grid-template-columns: 1fr; }
  .topbar .primary { width: 100%; }
  .detail-hero { grid-template-columns: 82px 1fr; gap: 16px; }
  .detail-icon { width: 82px; height: 82px; border-radius: 18px; }
  .detail-identity h2 { font-size: 22px; }
  .detail-rank-box { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); padding: 16px 0 0; }
  .watch-metrics, .watch-card .sparkline { margin-left: 0; width: 100%; }
  .add-watch-row { align-items: stretch; flex-direction: column; }
  .add-watch-row .watch-input { width: 100%; }
  .section-heading { align-items: flex-start; }
}

@media (max-width: 600px) {
  .shell { width: calc(100% - 20px); padding-top: 22px; }
  .topbar { gap: 18px; margin-bottom: 20px; }
  .topbar-actions { display: grid; grid-template-columns: 1fr; gap: 10px; width: 100%; }
  .app-nav { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
  .nav-link { text-align: center; }
  .controls { gap: 12px; padding: 14px; border-radius: 16px; }
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .stat strong { font-size: 16px; }
  .table-card, .add-watch, .detail-panel { padding: 16px; border-radius: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  table { min-width: 0; font-size: 12px; }
  th { padding: 9px 6px; }
  td { padding: 10px 6px; }
  .rank-number { width: 42px; font-size: 14px; }
  .movement { min-width: 42px; }
  .app-cell { min-width: 0; max-width: 100%; gap: 7px; }
  .app-cell img { width: 30px; height: 30px; border-radius: 7px; }
  .actions-cell { width: 112px; }
  .row-action { padding: 6px 7px; font-size: 11px; }
  .row-action + .row-action { margin-left: 2px; }
  .watch-card { padding: 16px; }
  .watch-icon { width: 48px; height: 48px; border-radius: 12px; }
  .watch-card-title h3 { font-size: 14px; }
  .rank-badge { font-size: 12px; }
  .watch-metrics { gap: 7px 12px; margin-top: 14px; }
  .watch-card-actions { justify-content: stretch; }
  .watch-card-actions .row-action { flex: 1; text-align: center; }
  .detail-hero { grid-template-columns: 64px 1fr; gap: 12px; padding: 18px; }
  .detail-icon { width: 64px; height: 64px; border-radius: 14px; }
  .detail-identity h2 { font-size: 20px; }
  .detail-actions { flex-direction: column; align-items: stretch; }
  .detail-actions a, .detail-actions button { text-align: center; }
  .detail-rank-box strong { font-size: 26px; }
  .info-list { gap: 12px; }
  .screenshots img { width: 150px; }
  .review-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .review-item { padding: 13px; }
}

@media (max-width: 430px) {
  .eyebrow { font-size: 10px; }
  h1 { font-size: 36px; }
  .subtitle { font-size: 14px; }
  .stats { grid-template-columns: 1fr; }
  .stat { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .stat span { margin-bottom: 0; }
  .stat strong { text-align: right; }
  .info-list { grid-template-columns: 1fr; }
}
