/* Store ratings page. Base chrome (container, header, footer, aurora) comes from support.css. */

.back-link {
  display: inline-block;
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.back-link:hover {
  color: var(--text-primary);
}

.ratings-intro,
.ratings-synced,
.ratings-empty {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0 0 1.5rem;
}

.ratings-synced {
  font-size: 0.8rem;
  margin-top: 1.5rem;
}

.ratings-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}

.rating-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1rem 1.1rem 1.2rem;
  min-width: 0;
}

.rating-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.rating-head h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.rating-icon {
  border-radius: 10px;
  flex-shrink: 0;
}

.store-block + .store-block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.store-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.store-now {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
}

.chart-label {
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0.6rem 0 0.2rem;
}

.chart {
  width: 100%;
  height: auto;
  display: block;
}

.chart .grid {
  stroke: var(--border-color);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.chart .tick {
  fill: var(--text-secondary);
  font-size: 10px;
  font-family: inherit;
}

.chart .line {
  fill: none;
  stroke: var(--accent-violet);
  stroke-width: 2;
  stroke-linejoin: round;
}

.chart .dot {
  fill: var(--accent-violet);
}

.ratings-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1rem 1.1rem 1.2rem;
  margin-bottom: 1.25rem;
}

.ratings-table-wrap {
  overflow-x: auto;
  margin-top: 0.8rem;
}

.ratings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.ratings-table th,
.ratings-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  white-space: nowrap;
}

.ratings-table th {
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.ratings-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.platform-filter {
  display: inline-flex;
  gap: 0.3rem;
  margin: 0 0 1rem;
  padding: 0.25rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 999px;
}

.platform-filter button {
  font: inherit;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
}

.platform-filter button[aria-pressed="true"] {
  color: var(--text-primary);
  background: var(--accent-violet);
  color: #0d1117;
}

.downloads-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.range-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.range-select {
  font: inherit;
  color: var(--text-primary);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
}

.downloads-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
}

.total-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.chart-wrap {
  position: relative;
}

.chart-tip {
  position: absolute;
  top: 8px;
  z-index: 2;
  min-width: 170px;
  max-height: 80%;
  overflow: auto;
  pointer-events: none;
  padding: 0.5rem 0.65rem;
  background: #0d1117;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  font-size: 0.78rem;
  color: var(--text-primary);
}

.chart-tip[hidden] {
  display: none;
}

.chart-tip .tip-date {
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.chart-tip .tip-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.1rem 0;
}

.chart-tip .tip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.chart-tip .tip-val {
  margin-left: auto;
  padding-left: 0.6rem;
  font-variant-numeric: tabular-nums;
}

.chart-tip .tip-sw {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.chart-tip .tip-sw-total {
  background: #e5e7eb;
}

.downloads-card .guide {
  stroke: var(--text-secondary);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.downloads-legend .swatch-total {
  background: repeating-linear-gradient(90deg, #e5e7eb 0 4px, transparent 4px 7px);
}

.platform-empty {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0.8rem 0 0;
}

.ratings-note {
  color: var(--text-secondary);
  font-size: 0.75rem;
  margin: 0.8rem 0 0;
}

.downloads-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1rem 1.1rem 1.2rem;
  margin-bottom: 1.25rem;
}

.downloads-title {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.downloads-chart .hit {
  fill: none;
  stroke: transparent;
  stroke-width: 12;
  pointer-events: stroke;
}

.downloads-chart .line {
  cursor: pointer;
  transition: opacity 0.15s;
}

.downloads-card.is-focus .line {
  opacity: 0.15;
}

.downloads-card.is-focus .line.on {
  opacity: 1;
}

.downloads-card.is-focus .line.on .series {
  stroke-width: 3;
}

.downloads-legend li[data-i] {
  cursor: pointer;
  border-radius: 6px;
  padding: 0.1rem 0.3rem;
  margin: 0 -0.3rem;
}

.downloads-card.is-focus .downloads-legend li {
  opacity: 0.4;
}

.downloads-card.is-focus .downloads-legend li.on {
  opacity: 1;
  background: rgba(255, 255, 255, 0.06);
}

.downloads-legend {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  font-size: 0.85rem;
  color: var(--text-primary);
}

.downloads-legend li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.downloads-legend .swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.downloads-legend .total {
  color: var(--text-secondary);
  margin-left: auto;
}

/* Store badges in the ratings table link to the store page. */
a.badge {
  text-decoration: none;
  cursor: pointer;
}

a.badge:hover,
a.badge:focus-visible {
  filter: brightness(1.25);
}

/* Store icons next to names in the downloads legend and totals. */
.downloads-legend .store-ic {
  width: 0.9rem;
  height: 0.9rem;
  vertical-align: -0.12rem;
}

/* Same colours as the store badges on the dashboard. */
.downloads-legend .store-ic.android { color: #7ee787; }
.downloads-legend .store-ic.ios { color: #79c0ff; }
.downloads-legend .store-ic.mac { color: #d2a8ff; }

/* Store icons on the platform filter. The selected button is filled, so its icon goes dark. */
.platform-filter .store-ic {
  width: 1rem;
  height: 1rem;
  vertical-align: -0.15rem;
  margin-right: 0.3rem;
}

.platform-filter .store-ic.android { color: #7ee787; }
.platform-filter .store-ic.ios { color: #79c0ff; }
.platform-filter .store-ic.mac { color: #d2a8ff; }
.platform-filter button[aria-pressed="true"] .store-ic { color: #0d1117; }
