/* ==========================================================================
   Surface: Overview (#page-overview) + Analytics (#page-analytics)
   (owned by dashboard-core; markup from account-shell.js)
   Owns: .overview-page, .analytics-page, .ov-hero (.hero-profile*, .hero-main,
   .hero-status, .hero-publish, .hero-url, .hero-actions, .hero-more-btn), .hero-menu (the
   link card's «…» popover), .ov-stats-empty (one card instead of empty statistics, r164),
   .ov-geo.is-teaser > .geo-teaser (compact Premium row on the overview), .ov-checklist (.progress-ring,
   .checklist, .check-task), .kpi-grid > .kpi (.kpi-label/-value/-foot, .delta.up/.down/.flat),
   .ov-row(.three), .ov-chart (.chart-box, .chart-svg, .chart-*, .chart-tip, .chart-legend,
   .legend-dot, details.chart-data), .rank-list > .rank-row (.rank-tile, .rank-main, .rank-bar,
   .rank-value), .device-bar (.seg-1/-2/-3 by share), .legend-list (.legend-swatch), .mini-empty,
   .ov-geo (.geo-grid, .country-list, .country-flag, .country-map, .country-map-*; --heat
   inline), .geo-locked. Brand tiles (.brand-tile) are shared with links.css.
   r181 (unslop): quiet chrome (no washes, glows, icon tiles or sparklines). The colour lives in two
   moments: the main chart (one orange line over a quiet grid, clicks a neutral step) and the world
   map. The owner's mini page keeps the owner's colours. The share sheet's address label
   (.share-qr-address, dash-share.js) is at the end of this file.
   ========================================================================== */

@layer surfaces {
  .app-shell .page:is(.overview-page, .analytics-page).active {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--nv-space-4);
  }

  :is(.overview-page, .analytics-page) > .page-header {
    margin-bottom: var(--nv-space-2);
  }

  .analytics-controls .analytics-profile {
    width: auto;
    min-width: min(180px, 100%);
    max-width: 100%;
    min-height: 32px;
    border-radius: var(--nv-r-control);
    font-size: var(--nv-fs-13);
  }

  .ov-analytics {
    display: grid;
    gap: var(--nv-space-4);
  }

  /* ---- Hero: the owner's mini page + the address ------------------------------ */
  .ov-hero {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    gap: var(--nv-space-6);
    align-items: stretch;
    padding: var(--nv-space-5);
    overflow: hidden;
  }

  /* The mini page shows the owner's own colours (--hp-*): their background, image, text and accent. */
  .hero-profile {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 220px;
    padding: var(--nv-space-5);
    overflow: hidden;
    border: 1px solid var(--nv-line);
    border-radius: var(--nv-r-md);
    background: var(--hp-bg);
    isolation: isolate;
  }

  .hero-profile-backdrop {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--hp-image, none) center / cover;
    opacity: .55;
  }

  /* Their background a step toward their text colour, a hairline in their text colour; no glass, no shadow. */
  .hero-profile-card {
    display: grid;
    justify-items: center;
    gap: var(--nv-space-1);
    width: 100%;
    max-width: 232px;
    padding: var(--nv-space-5) var(--nv-space-4) var(--nv-space-4);
    border: 1px solid color-mix(in srgb, var(--hp-text) 12%, transparent);
    border-radius: var(--nv-r-md);
    background: color-mix(in srgb, var(--hp-bg) 82%, var(--hp-text) 6%);
    color: var(--hp-text);
    text-align: center;
  }

  .hero-profile-avatar {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: var(--nv-space-1);
    overflow: hidden;
    border-radius: 50%;
    background: color-mix(in srgb, var(--hp-accent) 30%, var(--hp-bg));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--hp-text) 72%, transparent);
    color: var(--hp-text);
    font-size: 24px;
    font-weight: var(--nv-fw-medium);
  }

  .hero-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .hero-profile-card > b {
    max-width: 100%;
    overflow: hidden;
    font-size: var(--nv-fs-16);
    font-weight: var(--nv-fw-medium);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero-profile-card > small {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    color: inherit;
    font-size: var(--nv-fs-12);
    line-height: 1.4;
    opacity: .78;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .hero-profile-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--nv-space-2);
    margin-top: var(--nv-space-1);
  }

  .hero-link {
    --tile: 28px;
    display: grid;
    place-items: center;
    width: var(--tile);
    height: var(--tile);
    border-radius: var(--nv-r-xs);
    background: color-mix(in srgb, var(--hp-accent) 24%, transparent);
    color: var(--hp-text);
  }

  .hero-link :is(svg, .nv-icon, .brand-glyph) {
    width: 16px;
    height: 16px;
  }

  .hero-link img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
  }

  .hero-link b {
    font-size: var(--nv-fs-12);
  }

  .hero-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: var(--nv-space-3);
    min-width: 0;
  }

  .hero-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--nv-space-3);
  }

  .hero-status small {
    color: var(--nv-text-3);
  }

  .hero-main > .eyebrow {
    margin-top: var(--nv-space-1);
  }

  /* The address in the signature (.nv-address in components.css): mono, the host dim, the name bright. */
  .hero-url {
    max-width: 100%;
    overflow: hidden;
    color: var(--nv-text);
    font-size: clamp(20px, 2.4vw, 28px);
    font-weight: var(--nv-fw-medium);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  a.hero-url:hover {
    color: var(--nv-text);
    text-decoration-line: underline;
    text-underline-offset: .18em;
  }

  .hero-url.is-empty {
    color: var(--nv-text-3);
    font-family: var(--nv-font-sans);
    font-size: var(--nv-fs-22);
  }

  /* One primary action (Поделиться), Копировать, and «…» for the rest (r164). */
  .hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--nv-space-2);
    margin-top: var(--nv-space-1);
  }

  .hero-actions > .hero-more-btn {
    flex: none;
  }

  .hero-more-btn[aria-expanded="true"] {
    border-color: var(--nv-line-strong);
    background: var(--nv-surface-3);
    color: var(--nv-text);
  }

  .hero-publish {
    margin-left: auto;
  }

  .hero-menu {
    position: fixed;
    z-index: var(--nv-z-dropdown);
    min-width: 208px;
    animation: nv-pop var(--nv-dur-2) var(--nv-ease);
  }

  /* ---- No statistics yet: one compact card ----------------------------------- */
  .ov-stats-empty {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--nv-space-4);
    padding: var(--nv-space-5);
  }

  .ov-stats-empty[aria-busy="true"] {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--nv-space-2);
  }

  .ov-stats-empty[aria-busy="true"] > .skeleton.title {
    width: 46%;
  }

  /* A quiet empty state: the icon alone in the muted role (no tile, no accent). */
  .ov-empty-icon {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    color: var(--nv-text-3);
  }

  .ov-empty-icon .nv-icon {
    width: 20px;
    height: 20px;
  }

  .ov-empty-copy h2 {
    color: var(--nv-text);
    font-size: var(--nv-fs-16);
    font-weight: var(--nv-fw-medium);
    line-height: var(--nv-lh-ui);
    letter-spacing: 0;
  }

  .ov-empty-copy p {
    margin-top: var(--nv-space-1);
    color: var(--nv-text-2);
    font-size: var(--nv-fs-13);
    line-height: var(--nv-lh-ui);
  }

  /* ---- Premium teaser on the overview: one quiet row, no map ------------------ */
  .ov-geo.is-teaser {
    padding: 0;
    overflow: hidden;
  }

  /* The icon column and its gap match the empty-statistics card above (24px + 16px), so both texts start
     on one line. */
  .geo-teaser {
    display: flex;
    align-items: center;
    gap: var(--nv-space-4);
    width: 100%;
    min-height: 64px;
    padding: var(--nv-space-3) var(--nv-space-5);
    border: 0;
    border-radius: inherit;
    background: transparent;
    color: var(--nv-text);
    text-align: left;
    cursor: pointer;
    transition: background-color var(--nv-dur-1) var(--nv-ease);
  }

  .geo-teaser:hover {
    background-color: var(--nv-surface-2);
  }

  .geo-teaser:focus-visible {
    outline: 2px solid var(--nv-focus);
    outline-offset: -2px;
  }

  .geo-teaser-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 24px;
    height: 24px;
    color: var(--nv-text-3);
  }

  .geo-teaser-icon .nv-icon {
    width: 18px;
    height: 18px;
  }

  .geo-teaser-copy {
    display: grid;
    flex: 1;
    gap: 2px;
    min-width: 0;
  }

  .geo-teaser-copy b {
    font-size: var(--nv-fs-14);
    font-weight: var(--nv-fw-medium);
  }

  .geo-teaser-copy small {
    color: var(--nv-text-2);
    font-size: var(--nv-fs-12);
  }

  .geo-teaser .chip-premium {
    flex: none;
  }

  .geo-teaser-arrow {
    flex: none;
    width: 16px;
    height: 16px;
    color: var(--nv-text-3);
  }

  /* ---- Checklist -------------------------------------------------------------- */
  .ov-checklist {
    display: grid;
    gap: var(--nv-space-4);
  }

  .checklist-head {
    display: flex;
    align-items: center;
    gap: var(--nv-space-4);
  }

  .checklist-head h2 {
    font-size: var(--nv-fs-18);
    letter-spacing: 0;
  }

  .checklist-head p {
    margin-top: var(--nv-space-1);
    color: var(--nv-text-2);
    font-size: var(--nv-fs-13);
  }

  /* One thin accent arc on a neutral track, the share in mono (no glow). The ring is drawn in 64 units. */
  .progress-ring {
    flex: none;
    width: 64px;
    height: 64px;
    transform: rotate(-90deg);
  }

  .progress-ring circle {
    fill: none;
    stroke-width: 4;
  }

  .ring-track {
    stroke: var(--nv-surface-3);
  }

  .ring-value {
    stroke: var(--nv-accent);
    stroke-linecap: round;
    transition: stroke-dashoffset var(--nv-dur-4) var(--nv-ease);
  }

  .progress-ring text {
    fill: var(--nv-text);
    font-family: var(--nv-font-mono);
    font-size: 13px;
    font-weight: var(--nv-fw-medium);
    transform: rotate(90deg);
    transform-origin: 32px 32px;
  }

  /* auto-fit: the open steps share the card's width (with auto-fill one last step sat in the left third). */
  .checklist {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: var(--nv-space-2);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .check-task {
    display: flex;
    align-items: center;
    gap: var(--nv-space-3);
    min-height: 64px;
    padding: var(--nv-space-3);
    border: 1px solid var(--nv-line);
    border-radius: var(--nv-r-md);
    background: var(--nv-surface-2);
  }

  .check-task > div {
    display: grid;
    flex: 1;
    min-width: 0;
  }

  .check-task b {
    color: var(--nv-text);
    font-size: var(--nv-fs-14);
    font-weight: var(--nv-fw-medium);
  }

  .check-task small {
    overflow: hidden;
    color: var(--nv-text-3);
    font-size: var(--nv-fs-12);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* The step's icon in one 20px column, in the muted role (no tile); a finished step gets a green check. */
  .check-mark {
    display: grid;
    flex: none;
    place-items: center;
    width: 20px;
    height: 20px;
    color: var(--nv-text-3);
  }

  .check-mark .nv-icon {
    width: 18px;
    height: 18px;
  }

  .check-task.is-done {
    background: transparent;
  }

  .check-task.is-done .check-mark {
    color: var(--nv-success);
  }

  .check-task.is-done b {
    color: var(--nv-text-2);
  }

  /* r166 (O1): an open step without its own button is one tappable row (stretched chevron). */
  .check-task.is-row {
    position: relative;
  }

  .check-task.is-row:hover {
    border-color: var(--nv-line-strong);
    background: var(--nv-surface-3);
  }

  .check-go {
    --btn-h: 36px;
    position: static;
    color: var(--nv-text-3);
  }

  .check-go::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
  }

  .check-task:not(.is-done) small {
    display: -webkit-box;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  /* r166 (O2): finished steps behind one quiet line; the count is quiet mono meta. */
  .check-done > summary {
    width: fit-content;
    color: var(--nv-text-2);
    font-size: var(--nv-fs-13);
    font-weight: var(--nv-fw-medium);
    cursor: pointer;
  }

  .check-done > summary b {
    color: var(--nv-text-3);
    font-family: var(--nv-font-mono);
    font-weight: var(--nv-fw-regular);
  }

  .check-done[open] > .checklist {
    margin-top: var(--nv-space-2);
  }

  /* r166 (O5): the period switch sits on top of the numbers it changes. */
  .ov-stats-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--nv-space-2);
  }

  /* ---- Stat cards: the label, the figure and the change with what it compares to ---- */
  .kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--nv-space-4);
  }

  .kpi {
    display: grid;
    align-content: start;
    gap: var(--nv-space-2);
    padding: var(--nv-space-5);
  }

  .kpi.is-loading {
    gap: var(--nv-space-3);
  }

  .kpi-label {
    color: var(--nv-text-2);
    font-size: var(--nv-fs-13);
  }

  .kpi-value {
    color: var(--nv-text);
    font-size: var(--nv-fs-28);
    font-weight: var(--nv-fw-medium);
    line-height: var(--nv-lh-tight);
    letter-spacing: var(--nv-tracking-tight);
    font-variant-numeric: tabular-nums;
  }

  /* «↑ 17% к прошлым 7 дн.»: the change in its semantic tone, what it compares to in muted text. The figure
     face (Onest, tabular), not mono: Cyrillic words in mono read as «к  прошлым  7  дн.». */
  .kpi-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px var(--nv-space-2);
    color: var(--nv-text-3);
    font-family: var(--nv-font-figure);
    font-size: var(--nv-fs-12);
    font-variant-numeric: tabular-nums;
  }

  .delta {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: var(--nv-fs-12);
    font-weight: var(--nv-fw-medium);
    font-variant-numeric: tabular-nums;
  }

  /* 2 units at 12px draw the same 1px line as the 1.5 stroke of a 16px icon. */
  .delta .nv-icon {
    width: 12px;
    height: 12px;
    stroke-width: 2;
  }

  .delta.up {
    color: var(--nv-success);
  }

  .delta.down {
    color: var(--nv-danger);
  }

  .delta.flat {
    color: var(--nv-text-3);
  }

  /* ---- Rows of cards: the chart takes two thirds -------------------------------------- */
  .ov-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: var(--nv-space-4);
    align-items: stretch;
  }

  /* Devices (a short bar and three lines) | sources (long domains) | browsers: not three equal cards. */
  .ov-row.three {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr);
  }

  :is(.overview-page, .analytics-page) .card-head :is(h2, h3) {
    display: block;
    color: var(--nv-text);
    font-size: var(--nv-fs-16);
    font-weight: var(--nv-fw-medium);
  }

  :is(.overview-page, .analytics-page) .card-head .ghost .nv-icon {
    width: 16px;
    height: 16px;
  }

  .skeleton.chart-skeleton {
    height: 180px;
    margin-top: var(--nv-space-4);
    border-radius: var(--nv-r-md);
  }

  [data-block] > .skeleton.title {
    width: 38%;
  }

  /* ---- The main chart: one orange line over a quiet grid, muted mono labels -------------- */
  .ov-chart {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .chart-box {
    position: relative;
    flex: 1;
    min-height: 200px;
  }

  /* r180: a sideways finger scrub reads the days (pointermove); a vertical drag still scrolls the page.
     Set on the <svg> root: Chromium ignores touch-action on shapes inside it. */
  .chart-svg {
    display: block;
    max-width: none;
    overflow: visible;
    touch-action: pan-y pinch-zoom;
  }

  .chart-grid {
    stroke: var(--nv-line-soft);
  }

  .chart-x,
  .chart-y {
    fill: var(--nv-text-3);
    font-family: var(--nv-font-mono);
    font-size: var(--nv-fs-12);
    font-variant-numeric: tabular-nums;
  }

  .chart-fill-top {
    stop-color: var(--nv-accent);
    stop-opacity: .1;
  }

  .chart-fill-bottom {
    stop-color: var(--nv-accent);
    stop-opacity: 0;
  }

  .chart-line {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .chart-line.views {
    stroke: var(--nv-accent);
  }

  /* The second series is a neutral step, thinner, so the views line leads. */
  .chart-line.clicks {
    stroke: var(--nv-text-3);
    stroke-width: 1.5;
  }

  .chart-cursor {
    stroke: var(--nv-line-strong);
  }

  .chart-dot {
    stroke: var(--nv-surface-1);
    stroke-width: 2;
  }

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

  .chart-dot.clicks {
    fill: var(--nv-text-3);
  }

  .chart-hit {
    cursor: crosshair;
  }

  .chart-tip {
    position: absolute;
    z-index: 2;
    display: grid;
    gap: var(--nv-space-1);
    min-width: 160px;
    padding: var(--nv-space-2) var(--nv-space-3);
    border: 1px solid var(--nv-line-strong);
    border-radius: var(--nv-r-md);
    background: var(--nv-surface-4);
    color: var(--nv-text-2);
    font-size: var(--nv-fs-12);
    box-shadow: var(--nv-shadow-2);
    pointer-events: none;
  }

  .chart-tip b {
    color: var(--nv-text);
    font-size: var(--nv-fs-12);
    font-weight: var(--nv-fw-medium);
  }

  .chart-tip span {
    display: flex;
    align-items: center;
    gap: var(--nv-space-2);
  }

  .chart-tip strong {
    margin-left: auto;
    color: var(--nv-text);
    font-family: var(--nv-font-figure);
    font-weight: var(--nv-fw-regular);
    font-variant-numeric: tabular-nums;
  }

  .chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--nv-space-1) var(--nv-space-3);
    color: var(--nv-text-3);
    font-size: var(--nv-fs-12);
  }

  .chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: var(--nv-space-2);
  }

  .legend-dot {
    display: inline-block;
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
  }

  .legend-dot.views {
    background: var(--nv-accent);
  }

  .legend-dot.clicks {
    background: var(--nv-text-3);
  }

  details.chart-data {
    margin-top: var(--nv-space-3);
    color: var(--nv-text-3);
    font-size: var(--nv-fs-12);
  }

  details.chart-data summary {
    width: fit-content;
    padding: var(--nv-space-1);
    border-radius: var(--nv-r-xs);
  }

  details.chart-data summary:hover {
    color: var(--nv-text-2);
  }

  details.chart-data .table-wrap {
    max-height: 260px;
    margin-top: var(--nv-space-2);
  }

  details.chart-data .table {
    min-width: 0;
  }

  /* ---- Ranked lists (top links, sources, browsers, countries): name, thin neutral bar, figure ---- */
  .rank-list {
    display: grid;
    gap: var(--nv-space-1);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .rank-row {
    display: flex;
    align-items: center;
    gap: var(--nv-space-3);
    min-height: 44px;
  }

  .rank-tile {
    --tile: 32px;
  }

  .rank-main {
    display: grid;
    flex: 1;
    gap: var(--nv-space-2);
    min-width: 0;
  }

  .rank-main b {
    display: flex;
    align-items: center;
    gap: var(--nv-space-2);
    min-width: 0;
    overflow: hidden;
    color: var(--nv-text);
    font-size: var(--nv-fs-13);
    font-weight: var(--nv-fw-regular);
    white-space: nowrap;
  }

  /* The name gives way with an ellipsis (a flex container never draws one); the «deleted» tag stays whole. */
  .rank-main .rank-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .rank-main b > .chip {
    flex: none;
  }

  .rank-bar {
    display: block;
    height: 4px;
    overflow: hidden;
    border-radius: var(--nv-r-round);
    background: var(--nv-surface-2);
  }

  .rank-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--nv-text-3);
  }

  .rank-value {
    flex: none;
    min-width: 40px;
    color: var(--nv-text-2);
    font-family: var(--nv-font-figure);
    font-size: var(--nv-fs-13);
    font-weight: var(--nv-fw-regular);
    font-variant-numeric: tabular-nums;
    text-align: right;
  }

  /* ---- Devices: one stacked bar; the largest share in the accent, the others in neutral steps ---- */
  .device-bar {
    display: flex;
    gap: 2px;
    height: 8px;
    margin: var(--nv-space-2) 0 var(--nv-space-4);
    overflow: hidden;
    border-radius: var(--nv-r-round);
  }

  .device-bar i {
    display: block;
    height: 100%;
  }

  .seg-1 {
    --seg: var(--nv-accent);
  }

  .seg-2 {
    --seg: var(--nv-text-3);
  }

  .seg-3 {
    --seg: var(--nv-text-disabled);
  }

  .device-bar i,
  .legend-swatch {
    background: var(--seg, var(--nv-text-3));
  }

  .legend-list {
    display: grid;
    gap: var(--nv-space-1);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .legend-list li {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: var(--nv-space-3);
    min-height: 32px;
    color: var(--nv-text-2);
    font-size: var(--nv-fs-13);
  }

  .legend-swatch {
    width: 8px;
    height: 8px;
    border-radius: 50%;
  }

  .legend-list b {
    color: var(--nv-text);
    font-family: var(--nv-font-figure);
    font-weight: var(--nv-fw-regular);
    font-variant-numeric: tabular-nums;
  }

  .legend-list small {
    min-width: 40px;
    color: var(--nv-text-3);
    font-family: var(--nv-font-figure);
    font-variant-numeric: tabular-nums;
    text-align: right;
  }

  /* ---- Empty state inside a card: quiet (the icon alone, muted; no tile) ---------------- */
  .mini-empty {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: var(--nv-space-1);
    min-height: 160px;
    padding: var(--nv-space-4);
    border: 1px dashed var(--nv-line);
    border-radius: var(--nv-r-md);
    color: var(--nv-text-3);
    font-size: var(--nv-fs-13);
    line-height: var(--nv-lh-ui);
    text-align: center;
  }

  .mini-empty b {
    color: var(--nv-text-2);
    font-size: var(--nv-fs-14);
    font-weight: var(--nv-fw-medium);
  }

  .mini-empty-icon {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    margin-bottom: var(--nv-space-1);
    color: var(--nv-text-3);
  }

  .mini-empty-icon .nv-icon {
    width: 20px;
    height: 20px;
  }

  .ov-chart .mini-empty {
    flex: 1;
    min-height: 220px;
    margin-top: var(--nv-space-2);
  }

  /* ---- Geography ------------------------------------------------------------------- */
  /* The map is top-aligned beside the country list (centred, a long list left an empty block above it). */
  .geo-grid {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: var(--nv-space-6);
    align-items: start;
  }

  .country-list {
    display: grid;
    gap: var(--nv-space-2);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .country-list li {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: var(--nv-space-3);
    row-gap: var(--nv-space-1);
    min-height: 40px;
  }

  .country-list li.country-empty {
    display: block;
  }

  .country-flag {
    grid-row: 1 / span 2;
    width: 24px;
    height: 18px;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 0 0 1px var(--nv-line);
  }

  .country-list li > div {
    display: grid;
    gap: var(--nv-space-2);
    min-width: 0;
  }

  .country-list b {
    overflow: hidden;
    color: var(--nv-text);
    font-size: var(--nv-fs-13);
    font-weight: var(--nv-fw-regular);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .country-list strong {
    color: var(--nv-text-2);
    font-family: var(--nv-font-figure);
    font-size: var(--nv-fs-13);
    font-weight: var(--nv-fw-regular);
    font-variant-numeric: tabular-nums;
    text-align: right;
  }

  .country-list small {
    grid-column: 3;
    color: var(--nv-text-3);
    font-family: var(--nv-font-figure);
    font-size: var(--nv-fs-12);
    font-variant-numeric: tabular-nums;
    text-align: right;
  }

  /* The world map, the second moment: the accent as heat on a neutral world (no wash behind it). */
  .country-map {
    position: relative;
    display: grid;
    gap: var(--nv-space-2);
    padding: var(--nv-space-3);
    border: 1px solid var(--nv-line-soft);
    border-radius: var(--nv-r-md);
    background: var(--nv-bg-deep);
  }

  .country-map svg {
    width: 100%;
    height: auto;
  }

  .country-map-country {
    fill: var(--nv-surface-3);
    stroke: var(--nv-bg-deep);
    stroke-width: .6;
    transition: fill var(--nv-dur-2) var(--nv-ease);
  }

  .country-map-country.active {
    fill: color-mix(in srgb, var(--nv-accent) calc(var(--heat, .4) * 100%), var(--nv-surface-3));
  }

  .country-map-country.active:hover {
    fill: var(--nv-amber);
  }

  /* A disc sized by views (data, not a glow) with the place marked by a dot. */
  .country-map-marker circle:first-child {
    fill: var(--nv-accent-soft-2);
    stroke: var(--nv-accent-line);
    stroke-width: .8;
  }

  .country-map-marker circle:last-child {
    fill: var(--nv-amber);
  }

  .country-map-legend {
    display: flex;
    align-items: center;
    gap: var(--nv-space-2);
    color: var(--nv-text-3);
    font-size: var(--nv-fs-12);
  }

  /* «DB-IP» never breaks at its hyphen on a narrow phone. */
  .country-map-legend a {
    white-space: nowrap;
  }

  /* The heat scale of the map (a data legend), from the empty land to the accent. */
  .country-map-legend span {
    width: 24px;
    height: 4px;
    border-radius: var(--nv-r-round);
    background: linear-gradient(90deg, var(--nv-surface-3), var(--nv-accent));
  }

  .ov-geo.is-locked {
    padding: 0;
    overflow: hidden;
  }

  .geo-locked {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: center;
    min-height: 260px;
  }

  /* A locked preview of the map: dimmed and softened, fading into the card. */
  .geo-locked-art {
    position: relative;
    align-self: stretch;
    display: grid;
    place-items: center;
    padding: var(--nv-space-5);
    filter: blur(1.5px);
    opacity: .6;
    mask-image: linear-gradient(90deg, #000 60%, transparent);
  }

  .geo-locked-art svg {
    width: 100%;
    height: auto;
  }

  .geo-locked-copy {
    display: grid;
    justify-items: start;
    gap: var(--nv-space-3);
    padding: var(--nv-space-6);
  }

  .geo-locked-copy h3 {
    font-size: var(--nv-fs-22);
    letter-spacing: 0;
  }

  .geo-locked-copy p {
    color: var(--nv-text-2);
    font-size: var(--nv-fs-14);
    line-height: var(--nv-lh-body);
  }

  /* ---- Responsive -------------------------------------------------------------------- */
  @media (max-width: 1180px) {
    .kpi-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ov-row.three {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ov-row.three > :last-child {
      grid-column: 1 / -1;
    }
  }

  @media (max-width: 1023px) {
    .ov-row {
      grid-template-columns: minmax(0, 1fr);
    }

    .geo-grid {
      grid-template-columns: minmax(0, 1fr);
    }

    .geo-grid .country-map {
      order: -1;
    }
  }

  @media (max-width: 760px) {
    .ov-hero {
      grid-template-columns: minmax(0, 1fr);
      padding: var(--nv-space-4);
    }

    .hero-profile {
      min-height: 192px;
    }

    .ov-row.three {
      grid-template-columns: minmax(0, 1fr);
    }

    .geo-locked {
      grid-template-columns: minmax(0, 1fr);
    }

    .geo-locked-art {
      display: none;
    }
  }

  @media (max-width: 560px) {
    /* Share + Copy share one row with the «…» button. */
    .hero-actions {
      flex-wrap: nowrap;
      width: 100%;
    }

    .hero-actions > * {
      --btn-px: 12px;
      flex: 1 1 0;
      min-width: 0;
    }

    .analytics-controls {
      width: 100%;
    }

    /* The page select takes its own line; the period switch keeps its labels (it shrank to a 30px sliver
       beside the select, also in r180) and shares the second line with CSV. */
    .analytics-controls .analytics-profile {
      flex: 1 1 100%;
    }

    .analytics-controls .segmented {
      flex: 1 1 auto;
      min-width: max-content;
    }
  }

  /* ---- Phones: compact + calm (r160) -------------------------------------------------- */
  @media (max-width: 640px) {
    .app-shell .page:is(.overview-page, .analytics-page).active,
    .ov-analytics,
    .ov-row {
      gap: var(--nv-space-3);
    }

    /* r181: the top bar names the page on a phone, so the overview's whole header is for screen readers only
       (the analytics title follows the one page-title rule in app-shell.css; its line and controls stay). */
    .overview-page > .page-header {
      position: absolute;
      width: 1px;
      height: 1px;
      margin: -1px;
      overflow: hidden;
      clip-path: inset(50%);
      white-space: nowrap;
    }

    .ov-hero {
      gap: var(--nv-space-3);
      padding: var(--nv-space-3);
    }

    /* The mini profile preview: a short strip instead of a second tall card. */
    .hero-profile {
      min-height: 0;
      padding: var(--nv-space-3);
    }

    .hero-profile-backdrop {
      opacity: .4;
    }

    .hero-profile-card {
      grid-template-columns: auto minmax(0, 1fr);
      justify-items: start;
      align-items: center;
      column-gap: var(--nv-space-3);
      row-gap: var(--nv-space-1);
      max-width: none;
      padding: var(--nv-space-3);
      text-align: left;
    }

    .hero-profile-avatar {
      grid-row: 1 / span 3;
      width: 44px;
      height: 44px;
      margin: 0;
      font-size: 18px;
      box-shadow: 0 0 0 1px color-mix(in srgb, var(--hp-text) 50%, transparent);
    }

    .hero-profile-card > small {
      -webkit-line-clamp: 1;
    }

    .hero-profile-links {
      justify-content: flex-start;
      gap: var(--nv-space-1);
      margin-top: 0;
    }

    .hero-link {
      --tile: 24px;
    }

    .hero-link :is(svg, .nv-icon, .brand-glyph) {
      width: 14px;
      height: 14px;
    }

    .hero-main {
      gap: var(--nv-space-2);
    }

    .hero-url {
      font-size: 18px;
    }

    /* The greeting says enough on a phone; the most useful card (checklist) comes right after. */
    .overview-page > .page-header .subtitle {
      display: none;
    }

    .ov-stats-empty {
      grid-template-columns: auto minmax(0, 1fr);
      gap: var(--nv-space-2) var(--nv-space-3);
      padding: var(--nv-space-3);
    }

    .ov-empty-copy h2 {
      font-size: var(--nv-fs-14);
    }

    .ov-empty-copy p {
      font-size: var(--nv-fs-12);
    }

    .ov-empty-share {
      grid-column: 2;
      justify-self: start;
    }

    .geo-teaser {
      gap: var(--nv-space-3);
      min-height: 56px;
      padding: var(--nv-space-3);
    }

    .geo-teaser-copy b {
      font-size: var(--nv-fs-13);
    }

    /* Checklist: done steps collapse to one quiet line. */
    .ov-checklist {
      gap: var(--nv-space-3);
    }

    .checklist-head {
      gap: var(--nv-space-3);
    }

    .checklist-head h2 {
      font-size: var(--nv-fs-16);
    }

    .progress-ring {
      width: 48px;
      height: 48px;
    }

    /* 16 units of a ring drawn at 48 of 64 = 12px on screen. */
    .progress-ring text {
      font-size: 16px;
    }

    .check-task {
      min-height: 52px;
      padding: var(--nv-space-2) var(--nv-space-3);
    }

    .check-task.is-done {
      min-height: 40px;
      padding-block: var(--nv-space-1);
      border-color: var(--nv-line-soft);
    }

    .check-task.is-done small {
      display: none;
    }

    .check-task.is-done .check-mark .nv-icon {
      width: 16px;
      height: 16px;
    }

    .check-task.is-done b {
      font-size: var(--nv-fs-13);
      font-weight: var(--nv-fw-regular);
    }

    /* r166 (O5): on a phone the overview is a summary — numbers, chart and top links. Devices, sources,
       browsers and the map live on «Аналитика» («Вся статистика»). The free plan's map teaser stays. */
    #page-overview[data-stats="data"] [data-ov-analytics-root] :is(.ov-row.three, [data-geo]) {
      display: none;
    }

    .ov-stats-head > .secondary {
      margin-left: auto;
    }

    /* Stat cards: 2-up and short, still with what the change compares to. */
    .kpi-grid {
      gap: var(--nv-space-2);
    }

    .kpi {
      gap: var(--nv-space-1);
      padding: var(--nv-space-3);
    }

    .kpi-foot:empty {
      display: none;
    }

    .rank-row {
      min-height: 40px;
    }

    .device-bar {
      margin: var(--nv-space-1) 0 var(--nv-space-3);
    }

    .mini-empty {
      min-height: 0;
      padding: var(--nv-space-4) var(--nv-space-3);
      border-color: var(--nv-line-soft);
      font-size: var(--nv-fs-12);
    }

    .mini-empty b {
      font-size: var(--nv-fs-13);
    }

    .mini-empty-icon .nv-icon {
      width: 18px;
      height: 18px;
    }

    .ov-chart .mini-empty {
      min-height: 120px;
    }

    .geo-grid {
      gap: var(--nv-space-3);
    }

    .country-map {
      padding: var(--nv-space-2);
    }

    .geo-locked-copy {
      padding: var(--nv-space-4);
    }
  }
}

/* ---- r180: phones and touch ------------------------------------------------------------ */
@layer surfaces {
  /* A long unbroken display name wraps instead of widening the page. */
  #overviewTitle {
    overflow-wrap: anywhere;
  }

  .hero-support {
    font-size: var(--nv-fs-13);
  }

  /* World map: a tap shows that country's numbers (.country-map-pick); Analytics lists every country. */
  .country-map-country.is-picked {
    fill: var(--nv-amber);
  }

  .country-map-pick {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--nv-space-1) var(--nv-space-3);
    color: var(--nv-text-2);
    font-size: var(--nv-fs-13);
  }

  .country-map-pick :is(b, strong) {
    color: var(--nv-text);
    font-variant-numeric: tabular-nums;
  }

  .country-map-pick strong {
    font-family: var(--nv-font-figure);
    font-weight: var(--nv-fw-regular);
  }

  .country-list li.country-more {
    display: block;
    min-height: 0;
  }

  .country-more summary {
    width: fit-content;
    padding: var(--nv-space-1) var(--nv-space-2);
    border-radius: var(--nv-r-xs);
    color: var(--nv-text-2);
    font-size: var(--nv-fs-13);
    cursor: pointer;
  }

  .country-more summary span {
    color: var(--nv-text-3);
  }

  .country-more .country-list {
    margin-top: var(--nv-space-2);
  }

  @media (max-width: 640px) {
    /* The chart legend drops under the title when both do not fit on one line. */
    .ov-chart .card-head {
      flex-wrap: wrap;
      row-gap: var(--nv-space-2);
    }

    .ov-chart .card-head > div {
      flex: 1 1 auto;
    }
  }

  /* 320px: Share and Copy keep their labels and side padding; the icons go. */
  @media (max-width: 359px) {
    .hero-actions > :not(.hero-more-btn) > .nv-icon {
      display: none;
    }
  }

  /* r181: a phone on its side has the same top bar naming the page, so the overview's whole header goes to
     screen readers there too (the analytics title: the one page-title rule in app-shell.css). */
  @media (max-width: 900px) and (max-height: 500px) {
    .overview-page > .page-header {
      position: absolute;
      width: 1px;
      height: 1px;
      margin: -1px;
      overflow: hidden;
      clip-path: inset(50%);
      white-space: nowrap;
    }
  }

  @media (pointer: coarse) {
    .analytics-controls .analytics-profile {
      min-height: var(--nv-hit);
    }

    details.chart-data summary,
    .country-more summary,
    .check-done > summary {
      min-height: var(--nv-hit);
      padding-block: 12px;
    }

    /* r181: the DB-IP credit in the map legend gets a 44px touch area around the word. */
    .country-map-legend a {
      padding: 14px 10px;
      margin: -14px -10px;
    }

    .hero-support {
      display: inline-flex;
      align-items: center;
      min-height: var(--nv-hit);
    }

    /* A 44px tall link without moving anything around it. */
    a.hero-url {
      padding-block: 10px;
      margin-block: -10px;
    }
  }
}

/* ---- Share sheet (dash-share.js; its base rules are in app-shell.css) --------------------- */
@layer surfaces {
  /* r181: under the QR, the address in the signature (mono, the host dim, the name bright), like a
     printed card; the field below keeps the full link for copying. */
  .share-qr-frame {
    gap: var(--nv-space-3);
  }

  .share-qr-address {
    max-width: 100%;
    margin: 0;
    font-size: var(--nv-fs-14);
    line-height: var(--nv-lh-ui);
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  @media (min-width: 641px) {
    /* Three secondary actions in two columns: «Открыть» takes the last line instead of sitting alone. */
    .share-actions > [data-share-open] {
      grid-column: 1 / -1;
    }

    /* The messengers as one 2 × 2 grid instead of 3 + 1. */
    .share-socials {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .share-socials > .chip {
      justify-content: center;
    }
  }
}
