:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --muted: #f4f4f5;
  --hover: #f7f7f8;
  --ink: #0a0a0a;
  --ink-2: #52525b;
  --ink-3: #a1a1aa;
  --line: #ececee;
  --line-strong: #d9d9de;
  --up: #16a34a;
  --down: #dc2626;
  --radius: 14px;
  --sidebar-w: 268px;
  --shadow-sm: 0 1px 2px rgba(10, 10, 10, .04);
  --shadow: 0 1px 2px rgba(10, 10, 10, .04), 0 6px 20px -10px rgba(10, 10, 10, .12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 "Google Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.flag { display: block; width: 20px; height: 15px; border-radius: 3px; flex: none; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.08); background: var(--muted); }

.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 22px 14px 28px; display: flex; flex-direction: column; gap: 16px;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px; }
.logo { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); display: grid; place-items: center; flex: none; }
.logo svg { width: 30px; height: 30px; }
.wordmark { font-weight: 600; font-size: 15.5px; letter-spacing: -.02em; }
.wordmark span { color: var(--ink-3); font-weight: 500; }

/* Country picker button — looks and behaves like a control (hover, press, focus, chevron) */
.country-wrap { position: relative; }
.country {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: 11px; padding: 8px 10px 8px 11px; background: var(--surface);
  box-shadow: var(--shadow-sm); transition: border-color .15s, background .15s, box-shadow .15s, transform .08s;
}
.country:hover { border-color: var(--line-strong); background: var(--hover); box-shadow: 0 1px 2px rgba(10,10,10,.06), 0 4px 12px -6px rgba(10,10,10,.18); }
.country:active { transform: scale(.985); }
.country[aria-expanded="true"] { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(10,10,10,.06); }
.country-flag { display: grid; flex: none; }
.country-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.country-caption { font-size: 10.5px; color: var(--ink-3); font-weight: 500; letter-spacing: .02em; }
.country-name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.country-code { font: 500 11px/1 "Google Sans Code", ui-monospace, monospace; color: var(--ink-2); background: var(--muted); border-radius: 6px; padding: 4px 6px; }
.country-chevron { width: 16px; height: 16px; flex: none; color: var(--ink-3); transition: color .15s; }
.country:hover .country-chevron, .country[aria-expanded="true"] .country-chevron { color: var(--ink); }

.cpop {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(10,10,10,.06), 0 16px 40px -12px rgba(10,10,10,.28);
  animation: cpop-in .12s ease-out;
}
@keyframes cpop-in { from { opacity: 0; transform: translateY(-4px); } }
.cpop-search { display: flex; align-items: center; gap: 8px; padding: 0 11px; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.cpop-search input { border: 0; outline: none; background: none; font: inherit; font-size: 13.5px; padding: 10px 0; width: 100%; color: var(--ink); }
.cpop-list { max-height: min(380px, 60vh); overflow-y: auto; padding: 4px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.cpop-label { font-size: 11px; font-weight: 500; color: var(--ink-3); padding: 10px 8px 4px; }
.cpop-item {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto 14px; align-items: center; gap: 9px;
  width: 100%; border: 0; background: none; border-radius: 8px; padding: 7px 8px; text-align: left; cursor: pointer; font-size: 13.5px;
}
.cpop-item.active { background: var(--muted); }
.cpop-item[aria-selected="true"] { font-weight: 600; }
.cpop-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cpop-code { font: 500 10.5px "Google Sans Code", ui-monospace, monospace; color: var(--ink-3); }
.cpop-check { width: 14px; height: 14px; stroke-width: 2.4; visibility: hidden; }
.cpop-item[aria-selected="true"] .cpop-check { visibility: visible; }
.cpop-empty { padding: 18px 10px; text-align: center; color: var(--ink-3); font-size: 13px; }

.search {
  display: flex; align-items: center; gap: 8px; color: var(--ink-3);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 11px;
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(10,10,10,.06); }
.search input { border: 0; background: transparent; outline: none; color: var(--ink); font: inherit; width: 100%; padding: 9px 0; }
.search input::placeholder { color: var(--ink-3); }
.cat-search { background: var(--muted); border-color: transparent; }
kbd { font: 500 11px/1 "Google Sans Code", ui-monospace, monospace; color: var(--ink-3); border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; }

.cat-nav { display: flex; flex-direction: column; gap: 1px; }
.cat-group-label { font-size: 11.5px; font-weight: 500; color: var(--ink-3); padding: 16px 10px 6px; }
.cat {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: 0; border-radius: 8px; padding: 6.5px 10px; color: var(--ink-2); font-size: 13.5px;
  transition: background .12s, color .12s;
}
.cat:hover { background: var(--muted); color: var(--ink); }
.cat[aria-current="true"] { background: var(--ink); color: #fff; font-weight: 500; }
.cat .ico { width: 17px; height: 17px; flex: none; fill: currentColor; stroke: none; color: var(--ink-2); }
.cat:hover .ico { color: var(--ink); }
.cat[aria-current="true"] .ico { color: #fff; }
.cat.sub { padding-left: 24px; font-size: 13px; color: var(--ink-2); }
.cat.sub .ico { width: 15px; height: 15px; }

/* ---------- Main ---------- */
.main { min-width: 0; width: 100%; max-width: 1100px; margin-inline: auto; padding: 32px clamp(16px, 4vw, 56px) 48px; }
.topbar { display: flex; align-items: flex-end; gap: 14px; }
.title-block { flex: 1; min-width: 0; }
.crumbs { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--ink-2); font-size: 13px; }
.crumb-country { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-weight: 500; }
.crumb-country .flag { width: 18px; height: 13.5px; border-radius: 2px; }
.sep { color: var(--line-strong); }
h1 { margin: 0; font-weight: 600; font-size: clamp(28px, 4.2vw, 40px); line-height: 1.1; letter-spacing: -.035em; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; flex: none; color: var(--ink-2); box-shadow: var(--shadow-sm);
  transition: border-color .15s, color .15s;
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.menu-btn { display: none; }
.refresh.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 24px; }
.tabs { display: inline-flex; background: var(--muted); border-radius: 11px; padding: 3px; gap: 2px; }
.tabs [role="tab"] {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: none; padding: 7px 14px; border-radius: 8px; color: var(--ink-2);
  font-weight: 500; font-size: 13.5px; white-space: nowrap; transition: color .12s;
}
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(10,10,10,.08), 0 0 0 1px rgba(10,10,10,.04); }
.app-search { flex: 1; min-width: 220px; box-shadow: var(--shadow-sm); }

.lede { color: var(--ink-2); font-size: 13.5px; line-height: 1.55; margin: 8px 0 0; max-width: 760px; }
.lede:empty { display: none; }
.lede a { text-decoration: underline; text-underline-offset: 2px; }
.detail .lede { margin: -6px 0 22px; }
.meta { color: var(--ink-3); font-size: 12.5px; margin: 16px 0 18px; min-height: 1em; }

/* ---------- Podium ---------- */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.podium:empty { display: none; }
.pod {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.pod:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.pod .medal { position: absolute; top: 16px; right: 18px; font: 500 13px/1 "Google Sans Code", ui-monospace, monospace; color: var(--ink-3); }
.pod img { width: 64px; height: 64px; border-radius: 15px; border: 1px solid var(--line); background: var(--muted); }
.pod .name { font-weight: 600; font-size: 15.5px; letter-spacing: -.015em; line-height: 1.25; }
.pod .dev { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.pod:first-child { background: var(--ink); border-color: var(--ink); color: #fff; }
.pod:first-child .dev, .pod:first-child .medal { color: rgba(255,255,255,.6); }
.pod:first-child img { border-color: rgba(255,255,255,.12); }
.pod:first-child .delta.same, .pod:first-child .delta.new { color: rgba(255,255,255,.7); border-color: rgba(255,255,255,.3); }
.pod:first-child .delta.up { color: #4ade80; }
.pod:first-child .delta.down { color: #f87171; }
.pod-body { min-width: 0; flex: 1; }
.pod-rating { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12.5px; }
.pod-stats { display: flex; gap: 18px; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.pod-stats dt { font-size: 11px; color: var(--ink-3); margin-bottom: 2px; }
.pod-stats dd { margin: 0; font: 500 13.5px/1.2 "Google Sans Code", ui-monospace, monospace; }
.pod:first-child .pod-stats { border-color: rgba(255,255,255,.14); }
.pod:first-child .pod-stats dt, .pod:first-child .muted { color: rgba(255,255,255,.55); }
.pod:first-child .stars { --star-off: rgba(255,255,255,.25); --star-on: #fff; }

/* ---------- Stars / rating ---------- */
.stars { --star-on: var(--ink); --star-off: var(--line-strong); display: inline-block; font-size: 13px; line-height: 1; letter-spacing: 1px; vertical-align: -1px; }
.stars::before {
  content: "★★★★★";
  background: linear-gradient(90deg, var(--star-on) calc(var(--r) / 5 * 100%), var(--star-off) 0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stars.sm { font-size: 11px; letter-spacing: .5px; }
.stars.lg { font-size: 20px; letter-spacing: 2px; }
.rating { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12.5px; }
.rating b { font-weight: 600; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }

/* ---------- List ---------- */
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.list:empty { display: none; }
.item, .list-head { border-top: 1px solid var(--line); }
.list-head { border-top: 0; }
.item a, .item .row-a, .list-head {
  display: grid; grid-template-columns: 34px 48px minmax(0, 1fr) 148px 92px 92px 52px;
  align-items: center; gap: 14px; padding: 10px 18px 10px 12px;
}
.list-head { font-size: 11.5px; color: var(--ink-3); background: #fcfcfc; }
.list-head span:first-child { text-align: right; }
.list-head sup { font-size: 9px; }
.item a { transition: background .1s; }
.item a:hover { background: var(--hover); }
.rank { font: 500 13.5px/1 "Google Sans Code", ui-monospace, monospace; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.item img { width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--muted); }
.info { min-width: 0; display: flex; flex-direction: column; }
.info .name { font-weight: 500; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info .name .chip { font-size: 11px; padding: 1px 7px; margin-left: 4px; vertical-align: 1px; }
.info .dev { color: var(--ink-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-meta { display: none; }
.num { text-align: right; }
.c-est { font: 500 13px/1 "Google Sans Code", ui-monospace, monospace; font-variant-numeric: tabular-nums; }

.chip { font-size: 12px; padding: 3px 9px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.price { font-family: "Google Sans Code", ui-monospace, monospace; color: var(--ink); }
.delta { font: 500 12px/1 "Google Sans Code", ui-monospace, monospace; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.delta.same { color: var(--line-strong); }
.delta.new { color: var(--ink); border: 1px solid var(--ink); border-radius: 5px; padding: 3px 5px; font-size: 10.5px; letter-spacing: .04em; justify-self: end; }

mark { background: #fef08a; color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- States ---------- */
.state { text-align: center; padding: 56px 16px; color: var(--ink-2); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.state button { margin-top: 14px; border: 0; background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 9px; font-weight: 500; }
.skeleton .bar { height: 11px; border-radius: 6px; background: var(--muted); animation: pulse 1.2s ease-in-out infinite; }
.skeleton .ico { width: 48px; height: 48px; border-radius: 12px; background: var(--muted); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }

.foot { margin-top: 28px; color: var(--ink-3); font-size: 12px; line-height: 1.6; }
.foot-links { margin-bottom: 12px; }
.foot-links b { font-weight: 500; color: var(--ink-2); }
.foot-links a { color: var(--ink-2); }
.foot-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.tbl td a:hover { text-decoration: underline; text-underline-offset: 2px; }
.scrim { display: none; }

/* ---------- Detail ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13.5px; padding: 6px 0; }
.back:hover { color: var(--ink); }
.d-head { display: flex; gap: 22px; align-items: flex-start; margin: 14px 0 22px; }
.d-icon { width: 104px; height: 104px; border-radius: 24px; border: 1px solid var(--line); background: var(--muted); flex: none; box-shadow: var(--shadow-sm); }
.d-title { flex: 1; min-width: 0; }
.d-title h1 { font-size: clamp(24px, 3.4vw, 34px); }
.d-sub { margin: 6px 0 0; color: var(--ink-2); font-size: 16px; }
.d-dev { display: inline-block; margin-top: 6px; font-size: 13.5px; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.d-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  background: var(--ink); color: #fff; border: 0; border-radius: 10px; padding: 9px 14px; font-weight: 500; font-size: 13.5px;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { background: #262626; }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); margin-top: 12px; }
.btn.ghost:hover { border-color: var(--line-strong); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); min-width: 0; }
.kpi-label { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; display: flex; align-items: center; gap: 10px; }
.kpi-note { font-size: 12px; color: var(--ink-3); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.est { font-size: 10.5px; color: var(--ink-2); border: 1px dashed var(--line-strong); border-radius: 5px; padding: 1px 5px; cursor: help; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); margin-bottom: 14px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head.sub { margin: 22px 0 8px; justify-content: flex-start; }
.card h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.015em; }
.card h3 { margin: 0; font-size: 14px; font-weight: 600; }
.card-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--muted); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 5px 10px; border-radius: 7px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(10,10,10,.08), 0 0 0 1px rgba(10,10,10,.04); }
.note { font-size: 12px; color: var(--ink-3); margin: 10px 0 0; line-height: 1.55; }

.chart { position: relative; }
.chart-empty { padding: 48px 12px; text-align: center; color: var(--ink-3); font-size: 13px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; font-size: 12.5px; color: var(--ink-2); }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend i { width: 14px; height: 3px; border-radius: 2px; }
.chart-box { position: relative; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; stroke: none; fill: none; }
.chart-svg .hit { fill: transparent; stroke: none; }
.chart-svg .grid { stroke: #f0f0f2; stroke-width: 1; }
.chart-svg .ax { font: 500 11px "Google Sans Code", ui-monospace, monospace; fill: var(--ink-3); }
.chart-svg .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .ring { stroke: var(--surface); stroke-width: 2; }
.chart-svg .cross { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-svg .end-label { font: 600 11.5px "Google Sans Code", ui-monospace, monospace; fill: var(--ink); }
.chart-tip {
  position: absolute; top: 8px; pointer-events: none; z-index: 2; min-width: 170px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
  box-shadow: var(--shadow); font-size: 12px;
}
.tip-when { color: var(--ink-3); margin-bottom: 6px; font-size: 11.5px; }
.tip-row { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; padding: 2px 0; }
.tip-row i { width: 8px; height: 8px; border-radius: 50%; }
.tip-row b { font: 600 12px "Google Sans Code", ui-monospace, monospace; }

.tbl { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 500; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl td b { font: 600 13px "Google Sans Code", ui-monospace, monospace; }
.tbl tbody tr[data-type] { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl b.top { background: var(--ink); color: #fff; border-radius: 5px; padding: 2px 6px; }
.tag { font-size: 10.5px; color: var(--ink-2); background: var(--muted); border-radius: 5px; padding: 1px 6px; margin-left: 4px; }
.x { border: 0; background: none; color: var(--ink-3); font-size: 18px; line-height: 1; padding: 0 4px; border-radius: 5px; }
.x:hover { color: var(--down); background: var(--muted); }
.spin-dot::after { content: "…"; animation: pulse 1s infinite; }

.kw-form { display: flex; gap: 6px; }
.kw-form input { border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; font: inherit; font-size: 13px; width: 180px; outline: none; background: var(--surface); }
.kw-form input:focus { border-color: var(--ink); }

.shots { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.shot { flex: none; border: 0; padding: 0; background: none; scroll-snap-align: start; border-radius: 14px; overflow: hidden; cursor: zoom-in; }
.shot img { display: block; height: 380px; width: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--muted); }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(10,10,10,.92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox img {
  display: block; width: auto; height: auto; object-fit: contain; cursor: default;
  /* leave room for arrows on the sides and the counter below */
  max-width: min(calc(100vw - 168px), 1100px); max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px);
  border-radius: 16px; background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.lb-btn {
  position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; transition: background .15s;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.lb-btn:hover { background: rgba(255,255,255,.24); }
.lb-btn svg { width: 22px; height: 22px; stroke-width: 2.2; }
.lb-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 24px; top: 50%; transform: translateY(-50%); }
.lb-close { top: 20px; right: 24px; width: 40px; height: 40px; }
.lb-close svg { width: 18px; height: 18px; }
.lb-count { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: #fff; background: rgba(255,255,255,.12); border-radius: 99px; padding: 5px 12px; font: 500 13px "Google Sans Code", ui-monospace, monospace; }
.lightbox.single .lb-prev, .lightbox.single .lb-next, .lightbox.single .lb-count { display: none; }
@media (max-width: 560px) {
  .lightbox { padding: 16px; }
  .lightbox img { max-width: calc(100vw - 32px); max-height: calc(100dvh - 120px); }
  .lb-btn { width: 40px; height: 40px; background: rgba(10,10,10,.45); }
  .lb-prev { left: 10px; }
  .lb-next { right: 10px; }
  .lb-close { top: 12px; right: 12px; }
}

.cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.desc { white-space: pre-line; color: var(--ink-2); font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.desc.small { font-size: 13.5px; }
.desc.clamp { max-height: calc(1.65em * 9); overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.link-btn { border: 0; background: none; padding: 6px 0 0; font-weight: 500; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.info-grid { margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.info-grid > div { padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.info-grid > div:nth-child(5n) { border-right: 0; }
.info-grid > div:nth-last-child(-n + 5) { border-bottom: 0; }
.info-grid dt { font-size: 11.5px; color: var(--ink-3); margin-bottom: 4px; }
.info-grid dd { margin: 0; font-size: 13.5px; font-weight: 500; overflow-wrap: anywhere; }
.iap { list-style: none; margin: 0; padding: 0; font-size: 13px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); column-gap: 28px; }
.iap li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.iap b { font: 500 12.5px "Google Sans Code", ui-monospace, monospace; }

.reviews { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; }
.rating-summary { position: static; }
.rev-scroll {
  height: 440px; overflow-y: auto; overscroll-behavior: contain; padding-right: 10px;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.rev-sentinel { text-align: center; font-size: 12px; color: var(--ink-3); padding: 14px 0 6px; }
.rating-summary .big { font-size: 52px; font-weight: 600; letter-spacing: -.04em; line-height: 1; margin-bottom: 8px; }
.rating-summary .muted { margin-top: 6px; font-size: 13px; }
.hist { margin-top: 16px; display: grid; gap: 6px; }
.hist-row { display: grid; grid-template-columns: 26px 1fr 34px; align-items: center; gap: 8px; font-size: 12px; }
.hist-row .muted { margin: 0; text-align: right; font-size: 11.5px; }
.hist-bar { height: 6px; background: var(--muted); border-radius: 3px; overflow: hidden; }
.hist-bar i { display: block; height: 100%; background: var(--ink); border-radius: 3px; }
.review { padding: 14px 0; border-bottom: 1px solid var(--line); }
.review:first-child { padding-top: 0; }
.review-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.review h4 { margin: 6px 0 4px; font-size: 14px; font-weight: 600; }
.review p { margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }

/* ---------- StoreRanks Pro ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lock-ico { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; }

/* Locked value: blurred sample + lock; clicking opens the paywall */
.locked {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 2px 4px; margin: -2px -4px;
  border-radius: 6px; cursor: pointer; color: var(--ink); font: inherit; vertical-align: middle;
}
.locked-blur { filter: blur(5px); opacity: .55; user-select: none; }
.locked .lock-ico { color: var(--ink-2); }
.locked:hover { background: var(--muted); }
.locked:hover .locked-blur { opacity: .75; }
.pod:first-child .locked { color: #fff; }
.pod:first-child .locked .lock-ico { color: rgba(255,255,255,.75); }
.pod:first-child .locked:hover { background: rgba(255,255,255,.1); }
.locked.big { font-size: 26px; font-weight: 600; gap: 10px; margin: 0; padding: 0 6px 0 0; }
.locked.big .lock-ico { width: 18px; height: 18px; }
.link-btn.small { font-size: 12px; padding: 0; color: var(--ink); }

.pro-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 10px; border: 0;
  background: var(--ink); color: #fff; font-weight: 600; font-size: 13.5px; flex: none; cursor: pointer;
  box-shadow: 0 1px 2px rgba(10,10,10,.12), 0 6px 16px -8px rgba(10,10,10,.5); transition: transform .1s, background .15s;
}
.pro-btn svg { width: 15px; height: 15px; fill: #fff; stroke: none; }
.pro-btn:hover { background: #262626; }
.pro-btn:active { transform: scale(.97); }

.export-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 500; font-size: 13.5px; box-shadow: var(--shadow-sm);
}
.export-btn svg { width: 16px; height: 16px; }
.export-btn:hover { border-color: var(--line-strong); }
.pro-tag { font: 700 9.5px/1 "Google Sans Code", monospace; letter-spacing: .06em; background: var(--ink); color: #fff; border-radius: 4px; padding: 3px 5px; }

.seg button.is-locked { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); }
.seg button.is-locked .lock-ico { width: 11px; height: 11px; }
.seg button.is-locked:hover { color: var(--ink); }

/* Sidebar card */
.pro-card { margin-top: auto; padding-top: 14px; }
.pro-card-in {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 14px; overflow: hidden;
  background: radial-gradient(120% 90% at 100% 0%, #2a2a2a 0%, #0a0a0a 60%); color: #fff;
}
.pro-card-in b { font-size: 14.5px; letter-spacing: -.01em; }
.pro-card-in span:not(.pro-card-badge) { font-size: 12.5px; color: rgba(255,255,255,.65); line-height: 1.45; }
.pro-card-badge { align-self: flex-start; font: 700 9.5px/1 "Google Sans Code", monospace; letter-spacing: .08em; background: #fff; color: #0a0a0a; border-radius: 4px; padding: 4px 6px; }
.pro-card-btn { margin-top: 6px; border: 0; border-radius: 9px; padding: 9px 12px; background: #fff; color: #0a0a0a; font-weight: 600; font-size: 13px; cursor: pointer; }
.pro-card-btn:hover { background: #f0f0f0; }
.pro-card-btn.ghost { background: rgba(255,255,255,.1); color: #fff; }
.pro-card-in.is-pro { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.pro-card-in.is-pro span:not(.pro-card-badge) { color: var(--ink-3); }
.pro-card-in.is-pro .pro-card-badge { background: var(--ink); color: #fff; }
.pro-card-in.is-pro .pro-card-btn.ghost { background: var(--muted); color: var(--ink); }

/* Keyword + review locks */
.kw-locked { position: relative; margin-top: 4px; }
.kw-locked-rows > div { display: flex; justify-content: space-between; padding: 9px 10px; border-bottom: 1px solid var(--line); filter: blur(4px); opacity: .5; user-select: none; font-size: 13.5px; }
.kw-locked-cta {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  background: linear-gradient(rgba(255,255,255,.55), rgba(255,255,255,.92));
}
.kw-locked-cta .lock-ico { width: 18px; height: 18px; }
.kw-locked-cta span { font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.rev-lock { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 12px 6px; color: var(--ink); font-size: 13px; }
.rev-lock .lock-ico { width: 18px; height: 18px; }
.rev-lock span { color: var(--ink-2); font-size: 12.5px; margin-bottom: 6px; }

/* Paywall dialog */
body.pw-open { overflow: hidden; }
.pw-backdrop {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px;
  background: rgba(10,10,10,.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: pw-fade .15s ease-out;
}
.pw-backdrop[hidden] { display: none; }
@keyframes pw-fade { from { opacity: 0; } }
@keyframes pw-rise { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.pw {
  position: relative; width: min(900px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto;
  background: var(--surface); border-radius: 22px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.45); animation: pw-rise .2s ease-out;
}
.pw-close {
  position: absolute; top: 14px; right: 14px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 0;
  display: grid; place-items: center; background: var(--muted); color: var(--ink-2); cursor: pointer;
}
.pw-close:hover { color: var(--ink); background: var(--line); }
.pw-close svg { width: 16px; height: 16px; }
.pw-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.pw-left { padding: 36px 34px; background: radial-gradient(130% 80% at 0% 0%, #262626 0%, #0a0a0a 55%); color: #fff; border-radius: 22px 0 0 22px; }
.pw-right { padding: 36px 30px 28px; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.pw-badge {
  display: inline-flex; align-items: center; gap: 6px; font: 700 11px/1 "Google Sans Code", monospace; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(255,255,255,.12); color: #fff; border-radius: 99px; padding: 6px 10px;
}
.pw-badge .lock-ico, .pw-badge .pw-check { width: 12px; height: 12px; }
.pw-left h2 { margin: 16px 0 10px; font-size: clamp(24px, 3vw, 31px); line-height: 1.12; letter-spacing: -.03em; }
.pw-lead { margin: 0; color: rgba(255,255,255,.7); font-size: 14.5px; line-height: 1.55; }
.pw-features { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 4px; }
.pw-features li { display: flex; gap: 12px; padding: 9px 10px; margin: 0 -10px; border-radius: 12px; transition: background .2s; }
.pw-features li.hl { background: rgba(255,255,255,.09); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.pw-features b { display: block; font-size: 14px; font-weight: 600; }
.pw-features li > span:last-child > span { display: block; font-size: 12.5px; color: rgba(255,255,255,.6); line-height: 1.45; margin-top: 2px; }
.pw-fi { width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,.1); }
.pw-fi svg { width: 17px; height: 17px; stroke: #fff; stroke-width: 1.8; }

.pw-plans { display: grid; gap: 10px; }
.pw-plan {
  position: relative; display: grid; gap: 2px; text-align: left; cursor: pointer; padding: 14px 16px 14px 46px;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); font: inherit; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.pw-plan::before {
  content: ""; position: absolute; left: 16px; top: 17px; width: 18px; height: 18px; border-radius: 50%;
  box-sizing: border-box; border: 1.5px solid var(--line-strong); background: var(--surface); transition: border .15s;
}
.pw-plan:hover { border-color: var(--line-strong); }
.pw-plan[aria-checked="true"] { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(10,10,10,.06); }
.pw-plan[aria-checked="true"]::before { border: 5.5px solid var(--ink); }
.pw-plan-top { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.pw-save { font: 700 10.5px/1 "Google Sans Code", monospace; background: #16a34a; color: #fff; border-radius: 99px; padding: 4px 7px; letter-spacing: .02em; }
.pw-price { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.pw-price small { font-size: 13px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.pw-sub { font-size: 12.5px; color: var(--ink-3); }

.pw-cta {
  height: 50px; border: 0; border-radius: 13px; background: var(--ink); color: #fff; font: inherit; font-weight: 600; font-size: 15px;
  cursor: pointer; transition: background .15s, transform .1s; box-shadow: 0 10px 24px -12px rgba(10,10,10,.6);
}
.pw-cta:hover:not(:disabled) { background: #262626; }
.pw-cta:active:not(:disabled) { transform: scale(.985); }
.pw-cta:disabled { opacity: .45; cursor: not-allowed; }
.pw-cta.busy { opacity: .7; }
.pw-trust { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.pw-trust li { display: flex; align-items: center; gap: 8px; }
.pw-check { width: 14px; height: 14px; flex: none; stroke: #16a34a; stroke-width: 2.6; }
.pw-key { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 2px; }
.pw-link { border: 0; background: none; padding: 0; font: inherit; font-size: 13px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.pw-key-form { display: flex; gap: 6px; margin-top: 10px; }
.pw-key-form[hidden] { display: none; }
.pw-key-form input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font: 500 13px "Google Sans Code", monospace; outline: none; }
.pw-key-form input:focus { border-color: var(--ink); }
.pw-key-form button { border: 0; border-radius: 10px; padding: 0 14px; background: var(--ink); color: #fff; font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.pw-msg { margin: 8px 0 0; font-size: 12.5px; color: var(--ink-2); min-height: 1em; }
.pw-msg.err { color: var(--down); }
.pw-unconfigured { border: 1px dashed var(--line-strong); border-radius: 14px; padding: 16px; font-size: 13.5px; color: var(--ink-2); text-align: center; }
.pw-unconfigured code { font: 500 12px "Google Sans Code", monospace; background: var(--muted); padding: 2px 5px; border-radius: 4px; }

.pw-done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 48px 40px 40px; max-width: 520px; margin: 0 auto; }
.pw-done h2 { margin: 4px 0 0; font-size: 26px; letter-spacing: -.03em; }
.pw-done .pw-lead { color: var(--ink-2); }
.pw-done .pw-cta { width: 100%; max-width: 320px; margin-top: 8px; }
.pw-done .pw-badge { background: var(--muted); color: var(--ink); }
.pw-done-ico { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: #dcfce7; }
.pw-done-ico .pw-check { width: 28px; height: 28px; }
.pw-keybox { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; text-align: left; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--bg); }
.pw-keybox span { grid-column: 1 / -1; font-size: 11.5px; color: var(--ink-3); }
.pw-keybox code { font: 600 14px "Google Sans Code", monospace; overflow-wrap: anywhere; }
.pw-copy { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 12.5px; cursor: pointer; }
.pw-fine { margin: 0; font-size: 12px; color: var(--ink-3); }
.pw-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; }

@media (max-width: 760px) {
  .pw-backdrop { padding: 0; place-items: end center; }
  .pw { border-radius: 20px 20px 0 0; max-height: 94dvh; }
  .pw-grid { grid-template-columns: minmax(0, 1fr); }
  .pw-left { border-radius: 20px 20px 0 0; padding: 28px 22px; }
  .pw-features { margin-top: 16px; }
  .pw-features li:nth-child(n + 5) { display: none; }
  .pw-right { padding: 22px; }
  .export-btn { flex: 1; justify-content: center; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .item a, .item .row-a, .list-head { grid-template-columns: 30px 48px minmax(0, 1fr) 112px 84px 84px 48px; gap: 12px; }
  .c-rating .muted { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 20;
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .scrim:not([hidden]) { display: block; position: fixed; inset: 0; background: rgba(10,10,10,.25); backdrop-filter: blur(2px); z-index: 10; }
  .menu-btn { display: grid; }
  .topbar { align-items: center; }
  .podium { grid-template-columns: minmax(0, 1fr); }
  .pod { flex-direction: row; align-items: flex-start; padding: 14px; }
  .pod img { width: 56px; height: 56px; border-radius: 13px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols, .reviews { grid-template-columns: minmax(0, 1fr); }
  .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .info-grid > div { border-right: 1px solid var(--line) !important; border-bottom: 1px solid var(--line) !important; }
  .info-grid > div:nth-child(2n) { border-right: 0 !important; }
  .info-grid > div:nth-last-child(-n + 2) { border-bottom: 0 !important; }
  .rating-summary { position: static; }
  .item a, .item .row-a, .list-head { grid-template-columns: 28px 44px minmax(0, 1fr) 80px 80px 44px; }
  .c-rating, .list-head span:nth-child(4) { display: none; }
  .mobile-meta { display: flex; gap: 10px; align-items: center; margin-top: 3px; font: 500 11.5px "Google Sans Code", ui-monospace, monospace; color: var(--ink-2); }
  .mobile-meta > span:not(.rating) { display: none; }
}
@media (max-width: 560px) {
  .main { padding: 20px 16px 32px; }
  .tabs { width: 100%; }
  .tabs [role="tab"] { flex: 1; padding: 7px 4px; font-size: 13px; }
  .app-search { min-width: 0; width: 100%; }
  kbd { display: none; }
  .list-head { display: none; }
  .item a, .item .row-a { grid-template-columns: 24px 44px minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px 10px 6px; }
  .item img { width: 44px; height: 44px; border-radius: 11px; }
  .item .c-est { display: none; }
  .info .name .chip { display: none; }
  .mobile-meta > span:not(.rating) { display: inline; }
  .d-head { flex-wrap: wrap; gap: 14px; }
  .d-icon { width: 80px; height: 80px; border-radius: 18px; }
  .d-head .btn { width: 100%; justify-content: center; }
  .kpi-value { font-size: 22px; }
  .card { padding: 16px; }
  .shot img { height: 300px; }
  .hide-sm { display: none; }
  .kw-form { width: 100%; }
  .kw-form input { flex: 1; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
