/* Visitors page. Base chrome from support.css; cards, range select and chart basics from ratings.css. */

.v-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0.4rem 0 0.8rem;
}

.v-tile {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  min-width: 0;
}

.v-tile-label {
  color: var(--text-secondary);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.v-tile-value {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.trend {
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.trend.up { color: #34d399; }
.trend.down { color: #f87171; }
.trend.flat { color: var(--text-secondary); }

.visitors-chart .visits { fill: var(--accent-violet); opacity: 0.85; }
.visitors-chart .bar:hover .visits { opacity: 1; }
.visitors-chart .bar .hit { pointer-events: all; }
.visitors-chart .views { stroke: #38bdf8; stroke-width: 1.75; stroke-linejoin: round; pointer-events: none; }
.visitors-chart .views-dot { fill: #38bdf8; pointer-events: none; }

.v-legend { grid-template-columns: repeat(auto-fill, minmax(120px, max-content)); }
.sw-visits { background: var(--accent-violet); }
.sw-views { background: #38bdf8; }

.v-subtitle {
  margin: 1.2rem 0 0.4rem;
  font-size: 0.95rem;
  color: var(--text-primary);
}

/* Country rows: a grid shared by the header and each <summary>. */
.countries {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.country-head,
.country summary {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(40px, 1fr) 80px 64px 64px 52px 64px;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.4rem;
}

.country-head {
  color: var(--text-secondary);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
}

.countries .num,
.country summary .trend {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.country {
  border-bottom: 1px solid var(--border-color);
}

.country summary {
  cursor: pointer;
  list-style: none;
  border-radius: 8px;
}

.country summary::-webkit-details-marker { display: none; }
.country summary:hover { background: rgba(255, 255, 255, 0.04); }

.c-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.c-name::before {
  content: '▸';
  color: var(--text-secondary);
  font-size: 0.75rem;
  transition: transform 0.15s;
}

.country[open] .c-name::before { transform: rotate(90deg); }

.flag { font-size: 1.1rem; line-height: 1; }

.c-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.c-bar span {
  display: block;
  height: 100%;
  background: var(--accent-violet);
  border-radius: 3px;
}

.spark { width: 80px; height: 22px; }
.spark polyline { fill: none; stroke: #38bdf8; stroke-width: 1.4; stroke-linejoin: round; }

.c-views,
.c-share { color: var(--text-secondary); }

.c-detail {
  padding: 0.2rem 0.4rem 0.8rem 1.6rem;
}

.c-detail-title {
  color: var(--text-secondary);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.3rem;
}

.c-pages {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 520px;
}

.c-pages li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.2rem 0;
  font-size: 0.85rem;
}

.c-pages a {
  color: var(--text-primary);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.c-pages a:hover { text-decoration: underline; }
.c-pages .more { color: var(--text-secondary); }

/* Phones: drop the share bar, sparkline and views columns. */
@media (max-width: 600px) {
  .v-tiles { gap: 0.5rem; }
  .v-tile { padding: 0.55rem 0.6rem; }
  .v-tile-value { font-size: 1.2rem; }

  .country-head,
  .country summary {
    grid-template-columns: minmax(0, 1fr) 56px 48px 56px;
    gap: 0.4rem;
  }

  .country-head span:nth-child(2),
  .country-head span:nth-child(3),
  .country-head span:nth-child(5),
  .country summary .c-bar,
  .country summary .spark,
  .country summary .c-views {
    display: none;
  }

  .c-detail { padding-left: 1rem; }
}
