:root {
  --bg: #f8fafc;
  --bg2: #edf7fa;
  --text: #0f172a;
  --muted: #526176;
  --line: #dbe6f5;
  --card: rgba(255, 255, 255, .90);
  --ink: #111827;
  --blue: #2563eb;
  --teal: #0891b2;
  --accent: #ea580c;
  --green: #118451;
  --red: #dc2626;
  --amber: #b7791f;
  --violet: #7251d1;
  --ring: rgba(37,99,235,.32);
  --shadow: 0 20px 54px rgba(15, 23, 42, .10);
  --shadow-sm: 0 10px 28px rgba(15, 23, 42, .08);
  --font: "Fira Sans", Inter, system-ui, sans-serif;
  --mono: "Fira Code", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 12%, rgba(37,99,235,.10), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(8,145,178,.14), transparent 34%),
    radial-gradient(circle at 84% 88%, rgba(234,88,12,.08), transparent 24%),
    linear-gradient(135deg, #f8fafc 0%, var(--bg2) 52%, #fff7ed 100%);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  overflow-x: hidden;
}
a { color: inherit; text-underline-offset: 3px; }
a,
button,
input {
  touch-action: manipulation;
}
button,
a {
  -webkit-tap-highlight-color: rgba(37,99,235,.14);
}
:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 1000;
  transform: translateY(-140%);
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  transition: transform .18s ease;
}
.skip-link:focus {
  transform: translateY(0);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
  padding: 10px clamp(16px, 3vw, 42px);
  border-bottom: 1px solid rgba(216,224,235,.85);
  background: rgba(250,252,255,.88);
  backdrop-filter: blur(18px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: #fff;
  font-family: var(--mono);
}
nav {
  display: flex;
  gap: 8px;
  margin-left: auto;
  white-space: nowrap;
}
nav a, .footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
  transition: background .18s ease, color .18s ease;
}
nav a:hover, .footer a:hover {
  color: var(--text);
  background: rgba(37,99,235,.08);
}
.top-search,
.hero-search,
.search-page-form {
  position: relative;
  display: flex;
}
.top-search { width: min(430px, 34vw); }
.top-search input,
.hero-search input,
.search-page-form input {
  width: 100%;
  min-width: 0;
  height: 48px;
  border: 1px solid #cbd7e6;
  border-radius: 999px;
  padding: 0 112px 0 18px;
  background: #fff;
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.top-search input { height: 44px; padding-right: 96px; font-size: 14px; }
.top-search input:focus,
.hero-search input:focus,
.search-page-form input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--ring);
}
.top-search button,
.hero-search button,
.search-page-form button {
  position: absolute;
  right: 4px;
  top: 4px;
  min-width: 86px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: 800 13px/1 var(--font);
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.top-search button:hover,
.hero-search button:hover,
.search-page-form button:hover {
  background: var(--blue);
  box-shadow: 0 10px 22px rgba(37,99,235,.22);
}
.top-search button:active,
.hero-search button:active,
.search-page-form button:active {
  transform: scale(.98);
}
.top-search button { min-width: 78px; height: 36px; font-size: 12px; }
main {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font: 700 12px/1.2 var(--mono);
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(34px, 4.4vw, 64px);
  line-height: 1.02;
  letter-spacing: 0;
  font-weight: 800;
}
h2 {
  font-size: 24px;
  letter-spacing: 0;
  font-weight: 800;
}
.lead {
  max-width: 670px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(390px, .95fr);
  gap: 18px;
  padding: 28px 0 24px;
  align-items: start;
}
.hero-copy,
.signal-panel,
.country-chart-card,
.side-visual,
.history-card,
.meta-card,
.page-card {
  border: 1px solid rgba(204,216,230,.95);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.hero-copy {
  padding: clamp(24px, 3.3vw, 38px);
}
.hero-search { width: min(620px, 100%); margin: 22px 0 18px; }
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.stat {
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.68);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.stat:hover {
  transform: translateY(-2px);
  border-color: rgba(37,99,235,.25);
  box-shadow: var(--shadow-sm);
}
.stat span,
.panel-head span,
.rank-line,
.app-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.stat strong {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 24px;
}
.stat em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}
.featured-tiles {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.featured-tile {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,255,255,.62)),
    radial-gradient(circle at 90% 10%, rgba(234,88,12,.10), transparent 35%);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.featured-tile:first-child {
  grid-row: span 2;
  align-content: center;
}
.featured-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(37,99,235,.24);
  box-shadow: var(--shadow-sm);
}
.tile-rank {
  position: absolute;
  right: 10px;
  top: 8px;
  color: var(--accent);
  font: 700 12px/1 var(--mono);
}
.featured-tile span:not(.tile-rank) {
  min-width: 0;
}
.featured-tile strong,
.featured-tile em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.featured-tile strong {
  padding-right: 24px;
  font-size: 14px;
}
.featured-tile em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}
.signal-panel {
  position: relative;
  min-height: 0;
  padding: 22px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,.90), rgba(255,255,255,.72)),
    radial-gradient(circle at 22% 28%, rgba(114,81,209,.18), transparent 28%),
    radial-gradient(circle at 76% 18%, rgba(40,104,216,.16), transparent 24%),
    radial-gradient(circle at 65% 82%, rgba(7,130,124,.14), transparent 32%);
}
.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.panel-head strong {
  max-width: 260px;
  text-align: right;
  font-size: 18px;
}
.heat-board {
  padding: 12px;
  border: 1px solid rgba(216,224,235,.84);
  border-radius: 14px;
  background: rgba(255,255,255,.46);
}
.heat-board + .heat-board {
  margin-top: 12px;
}
.mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.mini-head span {
  color: var(--teal);
  font: 700 12px/1.2 var(--mono);
}
.mini-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.heat-ladder {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.heat-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(216,224,235,.84);
  border-radius: 12px;
  background: rgba(255,255,255,.68);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.heat-row:hover {
  transform: translateX(2px);
  border-color: rgba(8,145,178,.25);
  box-shadow: var(--shadow-sm);
}
.heat-row span {
  min-width: 0;
}
.heat-row strong,
.heat-row em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.heat-row strong {
  font-size: 14px;
}
.heat-row em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}
.heat-row b {
  font-family: var(--mono);
  font-size: 13px;
}
.heat-row i {
  grid-column: 2 / -1;
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf5;
}
.heat-row i u {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--teal));
}
.signal-panel canvas {
  width: 100%;
  max-height: 250px;
}
.app-icon {
  display: inline-block;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid rgba(15,25,35,.08);
  background:
    linear-gradient(135deg, rgba(37,99,235,.16), rgba(8,145,178,.14)),
    #e9eef5;
  background-size: cover;
  background-position: center;
  box-shadow: 0 8px 18px rgba(16,24,39,.12);
}
.app-icon.sm { width: 44px; height: 44px; border-radius: 12px; }
.app-icon.tiny { width: 38px; height: 38px; border-radius: 10px; }
.app-icon.lg { width: 64px; height: 64px; border-radius: 16px; }
.app-icon.xl { width: 132px; height: 132px; border-radius: 28px; }
.app-icon.placeholder {
  background:
    linear-gradient(135deg, rgba(37,99,235,.16), rgba(8,145,178,.14)),
    #e9eef5;
}
.flag-icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 20px;
  height: 15px;
  border: 1px solid rgba(15,25,35,.16);
  border-radius: 2px;
  background: #fff;
  box-shadow: none;
  object-fit: contain;
  vertical-align: -2px;
}
.flag-icon.md { width: 24px; height: 18px; }
.flag-icon.lg {
  width: 40px;
  height: 30px;
  border-radius: 3px;
}
.country-chip { max-width: 160px; }
.country-chip .flag-icon { margin-right: 1px; }
.eyebrow .flag-icon { margin-right: 2px; }
.section {
  padding: 28px 0;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.section-head span {
  color: var(--muted);
  font: 700 13px/1.2 var(--mono);
}
.section-head a,
.source-link,
.primary-link,
.tabs a,
.country-card a {
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}
.section-head a:hover,
.source-link:hover,
.primary-link:hover,
.tabs a:hover,
.country-card a:hover {
  color: var(--blue);
}
.country-chart-card {
  display: grid;
  gap: 18px;
  padding: 18px;
  min-height: 0;
}
.country-chart-card canvas {
  width: 100%;
  height: 188px !important;
  max-height: 188px;
}
.market-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.market-snapshot {
  display: grid;
  gap: 4px;
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.74);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.market-snapshot:hover {
  transform: translateY(-2px);
  border-color: rgba(8,145,178,.28);
  box-shadow: var(--shadow-sm);
}
.market-flag { line-height: 1; }
.market-snapshot strong {
  font-size: 14px;
}
.market-snapshot em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}
.market-meter {
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf5;
}
.market-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--teal));
}
.app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.app-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.78);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.app-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37,99,235,.24);
  box-shadow: 0 14px 32px rgba(38,52,74,.12);
}
.app-card h3 {
  margin: 6px 0 5px;
  font-size: 17px;
  line-height: 1.25;
}
.app-card h3 a,
.rank-row h2 a {
  text-decoration: none;
}
.app-card p {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}
.rank-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.rank-line span,
.movement,
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef3f8;
}
.movement.up, .movement.new, .status.ok { color: var(--green); background: #e6f5ee; }
.movement.down, .status.bad { color: var(--red); background: #fde8ec; }
.movement.flat { color: var(--muted); }
.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.stack {
  display: grid;
  gap: 10px;
}
.page-title {
  padding: 36px 0 22px;
}
.page-title h1 {
  font-size: clamp(34px, 4vw, 58px);
}
.country-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 44px;
}
.history-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 44px;
}
.history-day-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.78);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.history-day-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37,99,235,.22);
  box-shadow: var(--shadow-sm);
}
.history-day-card div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.history-day-card strong {
  font: 700 18px/1.2 var(--mono);
}
.history-day-card span,
.history-day-card p {
  color: var(--muted);
  font-size: 13px;
}
.history-day-card p {
  margin-bottom: 0;
}
.history-day-card .primary-link {
  width: fit-content;
}
.country-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.78);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.country-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37,99,235,.22);
  box-shadow: var(--shadow-sm);
}
.country-card strong {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 18px;
}
.country-card-icons {
  display: flex;
  align-items: center;
  min-height: 46px;
  margin: 0 0 14px 8px;
}
.country-card-icons a {
  display: inline-flex;
  margin-left: -8px;
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 12px;
  transition: transform .18s ease;
}
.country-card-icons a:first-child { margin-left: 0; }
.country-card-icons a:hover { transform: translateY(-2px); }
.country-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.country-card-links span,
.tabs a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.tabs a.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}
.country-detail,
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 420px);
  gap: 16px;
  align-items: start;
  padding-bottom: 40px;
}
.detail-grid {
  padding-bottom: 0;
}
.rank-list {
  display: grid;
  gap: 10px;
}
.rank-row {
  display: grid;
  grid-template-columns: 62px auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.82);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.rank-row:hover {
  transform: translateY(-1px);
  border-color: rgba(37,99,235,.22);
  box-shadow: var(--shadow-sm);
}
.rank-number {
  color: var(--blue);
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 800;
}
.rank-row h2 {
  margin: 0 0 4px;
  font-size: 18px;
}
.rank-row p {
  margin: 0;
  color: var(--muted);
}
.side-visual,
.history-card,
.meta-card {
  padding: 18px;
}
.side-visual {
  position: sticky;
  top: 82px;
}
.rank-shape {
  display: grid;
  gap: 8px;
  margin: 12px 0 14px;
}
.rank-shape-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.70);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.rank-shape-row:hover {
  transform: translateX(2px);
  border-color: rgba(37,99,235,.24);
  box-shadow: var(--shadow-sm);
}
.rank-shape-row span {
  min-width: 0;
}
.rank-shape-row strong,
.rank-shape-row em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-shape-row strong {
  font-size: 13px;
}
.rank-shape-row em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}
.rank-shape-row b {
  font: 700 12px/1 var(--mono);
}
.rank-shape-row i {
  grid-column: 2 / -1;
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf5;
}
.rank-shape-row i u {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--teal));
}
.side-visual canvas,
.history-card canvas {
  width: 100%;
  max-height: 320px;
}
.app-trend-card {
  min-height: 420px;
  min-width: 0;
}
.trend-card-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 16px;
  min-width: 0;
}
.trend-card-head > div {
  min-width: 0;
}
.trend-card-head h2 {
  margin-bottom: 6px;
}
.trend-card-head p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}
.trend-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 420px;
  min-width: 240px;
}
.trend-summary span {
  display: grid;
  gap: 3px;
  min-width: 96px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.74);
}
.trend-summary small {
  color: var(--muted);
  font: 800 10px/1 var(--font);
  text-transform: uppercase;
}
.trend-summary strong {
  color: var(--text);
  font: 700 12px/1.25 var(--mono);
  letter-spacing: 0;
}
.app-trend-layout {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  min-width: 0;
}
.market-list {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 330px;
  overflow-y: auto;
  padding-right: 4px;
}
.market-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  min-height: 66px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.72);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.market-option:hover,
.market-option.active {
  transform: translateX(2px);
  border-color: rgba(37,99,235,.35);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.market-option.active {
  box-shadow: inset 3px 0 0 var(--blue), var(--shadow-sm);
}
.market-option span,
.market-option em {
  min-width: 0;
}
.market-option span {
  display: flex;
  gap: 7px;
  align-items: center;
}
.market-option strong,
.market-option em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.market-option em {
  grid-column: 1;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}
.market-option b {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--blue);
  font: 800 16px/1 var(--mono);
}
.trend-chart-box {
  min-height: 330px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.70);
}
.trend-chart-box canvas {
  min-height: 300px;
  max-height: 300px;
}
.app-detail {
  display: grid;
  gap: 24px;
  padding-top: 28px;
  padding-bottom: 44px;
}
.detail-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 8% 20%, rgba(40,104,216,.12), transparent 26%),
    rgba(255,255,255,.82);
  box-shadow: var(--shadow);
}
.detail-hero h1 {
  font-size: clamp(34px, 4vw, 60px);
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.primary-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.primary-link:hover {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 10px 22px rgba(37,99,235,.22);
}
.primary-link:active {
  transform: scale(.98);
}
dl {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px 12px;
}
dt {
  color: var(--muted);
  font-weight: 800;
}
dd { margin: 0; }
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.8);
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
tbody tr {
  transition: background .18s ease;
}
tbody tr:hover {
  background: rgba(37,99,235,.05);
}
td .flag-icon { margin-right: 6px; }
th {
  color: var(--muted);
  font-size: 13px;
}
.legal-title {
  max-width: 760px;
}
.legal-page {
  display: grid;
  gap: 14px;
  padding-bottom: 50px;
}
.page-card {
  padding: clamp(18px, 3vw, 26px);
}
.empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.74);
  color: var(--muted);
}
.js-local-time { white-space: nowrap; }
.footer {
  border-top: 1px solid var(--line);
  padding: 26px clamp(16px, 4vw, 48px);
  color: var(--muted);
  font-size: 13px;
}
.footer nav {
  margin-left: 0;
  flex-wrap: wrap;
}
@media (max-width: 1040px) {
  .hero-grid,
  .country-detail,
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .side-visual { position: static; }
  .top-search { width: min(420px, 42vw); }
  .app-grid,
  .country-grid,
  .history-grid,
  .market-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .featured-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .featured-tile:first-child {
    grid-row: auto;
  }
}
@media (max-width: 760px) {
  .topbar {
    position: static;
    flex-direction: column;
    align-items: stretch;
  }
  .brand {
    min-height: 44px;
  }
  nav {
    margin-left: 0;
    overflow-x: auto;
  }
  .top-search { width: 100%; }
  main { width: min(100% - 24px, 1280px); }
  h1 {
    font-size: clamp(34px, 10vw, 44px);
  }
  .stats,
  .split,
  .app-grid,
  .country-grid,
  .history-grid,
  .featured-tiles,
  .market-grid {
    grid-template-columns: 1fr;
  }
  .signal-panel {
    min-height: 0;
  }
  .app-icon-cloud {
    min-height: 0;
    justify-content: center;
  }
  .heat-row {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .heat-row b {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: start;
  }
  .heat-row i {
    grid-column: 2;
  }
  .rank-row {
    grid-template-columns: 48px auto minmax(0, 1fr);
  }
  .rank-row .movement {
    grid-column: 2 / -1;
    width: fit-content;
  }
  .detail-hero {
    grid-template-columns: 1fr;
  }
  .app-icon.xl {
    width: 104px;
    height: 104px;
  }
  .trend-card-head,
  .app-trend-layout {
    grid-template-columns: 1fr;
  }
  .trend-card-head {
    display: grid;
  }
  .trend-card-head span {
    max-width: none;
    text-align: left;
  }
  .trend-summary {
    justify-content: stretch;
    max-width: none;
    min-width: 0;
  }
  .trend-summary span {
    min-width: 0;
  }
  .market-list {
    max-height: 260px;
  }
  dl {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 430px) {
  main { width: min(100% - 20px, 1280px); }
  .hero-copy,
  .signal-panel,
  .country-chart-card,
  .side-visual,
  .history-card,
  .meta-card,
  .page-card {
    border-radius: 12px;
  }
  .hero-copy,
  .signal-panel {
    padding: 20px;
  }
  .top-search input,
  .hero-search input,
  .search-page-form input {
    padding-left: 16px;
    padding-right: 98px;
  }
  .top-search button,
  .hero-search button,
  .search-page-form button {
    min-width: 78px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}