/* ===================================================================
   The overview page (src/pages/overview.html). Shared building blocks are in style/pages.css; only this page's own parts go here.

   stage ........... .ov-stage (the big working example under the head): .ov-top .ov-visbtn .ov-vis .ov-sw (switches) .ov-finder
                     .ov-fchip (filter chips) .ov-kpis .ov-kpi .ov-tiles .ov-tile .ov-list .ov-row .ov-ring .ov-cursor
   rows ............ .ov-mini (a small app frame): .ov-flt (click to filter), .ov-web (websites and dates), .ov-vmini (visibility)
   tiles ........... .ov-gauges (visit quality), .ov-flow (how visitors flow), .ov-pace (this month's pace)
   Every moving part is driven by scripts/overview.js through StaseeAnim; one-off moves are transitions (so they are never
   paused half way), and the few endless ones sit inside [data-anim] and stop with reduced motion.
   =================================================================== */

.ov-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ===================================================================
   The stage: a small working copy of the Overview screen
   =================================================================== */

.ov-stage {
    --ov-red: #dc2626;
}

:root[data-theme="dark"] .ov-stage,
:root[data-theme="dark"] .ov-mini,
:root[data-theme="dark"] .ov-gauges {
    --ov-red: #f87171;
}

.ov-app {
    display: grid;
    gap: 14px;
}

/* ----- the title and the Visibility button ----- */

.ov-top {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ov-h {
    font-size: clamp(18px, 1.8vw, 22px);
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.2;
}

.ov-sub {
    font-size: 13px;
    color: var(--color-text-soft);
}

.ov-visbox {
    position: relative;
    flex: none;
}

.ov-visbtn {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    height: 36px;
    padding-inline: 12px;

    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-bg);

    font-size: 13.5px;
    font-weight: 700;
    transition: border-color .18s var(--ease), background-color .18s var(--ease);
}

:root[data-theme="dark"] .ov-visbtn {
    background: var(--color-bg-soft);
}

.ov-visbtn:hover,
.ov-visbtn[aria-expanded="true"] {
    border-color: color-mix(in srgb, var(--color-green) 55%, var(--color-border));
}

.ov-visbtn svg {
    width: 16px;
    height: 16px;
}

.ov-chev {
    transition: transform .2s var(--ease);
}

.ov-visbtn[aria-expanded="true"] .ov-chev {
    transform: rotate(180deg);
}

/* the panel under the button: it fades in; "visibility" keeps the closed switches out of the tab order */
.ov-vis {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 8px);

    display: grid;
    gap: 2px;
    width: 230px;
    padding: 6px;

    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-bg);
    box-shadow: var(--shadow-lg);

    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .2s ease, transform .25s var(--ease), visibility 0s linear .25s;
}

:root[data-theme="dark"] .ov-vis {
    background: var(--color-bg-soft);
}

.ov-vis.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .2s ease, transform .25s var(--ease), visibility 0s;
}

/* a switch: its name and a small toggle (the same in the panel and in the visibility row below) */
.ov-sw {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    width: 100%;
    padding: 8px 10px;

    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 700;
    text-align: start;
    transition: background-color .18s var(--ease);
}

button.ov-sw:hover {
    background: var(--color-bg-soft);
}

:root[data-theme="dark"] button.ov-sw:hover {
    background: var(--color-bg);
}

.ov-sw-k {
    position: relative;
    flex: none;
    width: 32px;
    height: 18px;

    border-radius: 999px;
    background: var(--color-border);
    transition: background-color .25s var(--ease);
}

.ov-sw-k::after {
    content: "";
    position: absolute;
    top: 2px;
    inset-inline-start: 2px;
    width: 14px;
    height: 14px;

    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .25);
    transition: transform .25s var(--ease);
}

.ov-sw[aria-checked="true"] .ov-sw-k {
    background: var(--color-green);
}

.ov-sw[aria-checked="true"] .ov-sw-k::after {
    transform: translateX(14px);
}

[dir="rtl"] .ov-sw[aria-checked="true"] .ov-sw-k::after {
    transform: translateX(-14px);
}

/* ----- the websites, the dates and the filter chips ----- */

.ov-finder {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: 32px;
}

.ov-pick svg {
    color: var(--color-text-quiet);
}

.ov-dots {
    display: inline-flex;
    padding-inline-start: 2px;
}

.ov-dots .site-dot {
    width: 9px;
    height: 9px;
    margin-inline-start: -2px;
    box-shadow: 0 0 0 2px var(--color-bg);
    transition: opacity .3s ease, transform .3s var(--ease);
}

:root[data-theme="dark"] .ov-dots .site-dot {
    box-shadow: 0 0 0 2px var(--color-bg-soft);
}

/* the chips of the filters live in the same row */
.ov-filters {
    display: contents;
}

.ov-fchip {
    padding-inline-end: 4px;
    transition: opacity .3s ease, transform .35s var(--ease);
}

.ov-fchip.is-new,
.ov-fchip.is-gone {
    opacity: 0;
    transform: scale(.7);
}

.ov-fchip svg.ov-fchip-i {
    color: var(--green-text);
}

.ov-x {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;

    border-radius: 50%;
    color: var(--color-text-soft);
    transition: background-color .15s var(--ease), color .15s var(--ease);
}

.ov-x:hover {
    background: color-mix(in srgb, var(--color-green) 22%, transparent);
    color: var(--color-text);
}

.ov-x svg {
    width: 12px;
    height: 12px;
}

.ov-add {
    border-style: dashed;
    color: var(--color-text-quiet);
}

/* ----- the headline numbers ----- */

.ov-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.ov-kpi {
    padding: 12px 14px;
    transition: border-color .5s ease, box-shadow .5s ease, opacity .45s ease, transform .55s var(--ease);
}

/* a number that just changed: a soft green edge for a moment (no flashing: it comes and goes slowly) */
.ov-kpi.is-changed {
    border-color: color-mix(in srgb, var(--color-green) 60%, var(--color-border));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-green) 16%, transparent);
}

.ov-kpi-h {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.ov-kpi-h .app-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ov-kpi-ico {
    display: grid;
    place-items: center;
    flex: none;
    width: 28px;
    height: 28px;

    border-radius: 8px;
    background: color-mix(in srgb, var(--tone) 14%, transparent);
    color: var(--tone);
}

.ov-kpi-ico svg {
    width: 16px;
    height: 16px;
}

.ov-kpi .app-num {
    margin-top: 8px;
}

.ov-trend {
    margin-top: 3px;
    overflow: hidden;

    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-quiet);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ov-chg {
    font-weight: 800;
    color: var(--green-text);
    font-variant-numeric: tabular-nums;
}

.ov-chg.is-bad {
    color: var(--ov-red);
}

/* ----- the tiles ----- */

.ov-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 12px;
}

.ov-tile {
    padding: 14px 14px 12px;
    transition: transform .5s var(--ease), opacity .35s ease;
}

.ov-tile[hidden] {
    display: none;
}

/* leaving or coming back (scripts/overview.js moves the others into their new places) */
.ov-tile.is-out {
    opacity: 0;
    transform: scale(.94);
}

/* the start of the playing example: the numbers and tiles come in one by one */
.ov-stage.is-pre :is(.ov-kpi, .ov-tile) {
    opacity: 0;
    transform: translateY(16px);
}

.ov-tile-h {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ov-tile-ico {
    display: grid;
    place-items: center;
    flex: none;
    width: 32px;
    height: 32px;

    border-radius: 9px;
    background: var(--color-green-soft);
    color: var(--color-green-dark);
}

:root[data-theme="dark"] .ov-tile-ico {
    color: var(--color-green);
}

.ov-tile-ico svg {
    width: 17px;
    height: 17px;
}

.ov-tile-t {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.3;
}

.ov-tile-p {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-quiet);
}

.ov-tile-sum {
    min-height: 1.5em;
    margin-top: 10px;

    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-soft);
}

.ov-list {
    display: grid;
    gap: 2px;
    margin-top: 6px;
}

/* the rows are kept most-first (scripts/overview.js); after a filter they slide to their new places */
.ov-list > li {
    transition: transform .45s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
    .ov-list > li {
        transition: none;
    }
}

.ov-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 8px;

    width: 100%;
    padding: 6px 8px 7px;

    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 600;
    text-align: start;
    transition: background-color .25s var(--ease), box-shadow .25s var(--ease);
}

.ov-list[data-dim="country"] .ov-row {
    grid-template-columns: 26px minmax(0, 1fr) auto;
}

.ov-legend .ov-row {
    grid-template-columns: 10px minmax(0, 1fr) auto;
    padding-block: 7px;
}

.ov-row:hover {
    background: var(--color-bg-soft);
}

:root[data-theme="dark"] .ov-row:hover {
    background: var(--color-bg);
}

/* a value that is a filter */
.ov-row[aria-pressed="true"],
:root[data-theme="dark"] .ov-row[aria-pressed="true"] {
    background: var(--color-green-soft);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-green) 45%, transparent);
}

.ov-code {
    padding-block: 2px;

    border-radius: 5px;
    background: var(--color-bg-soft);

    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-align: center;
    color: var(--color-text-soft);
}

:root[data-theme="dark"] .ov-code {
    background: var(--color-border);
}

.ov-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ov-val {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.ov-bar {
    grid-column: 1 / -1;
    display: block;
    height: 4px;
    margin-top: 5px;
    overflow: hidden;

    border-radius: 2px;
    background: var(--color-border-soft);
}

:root[data-theme="dark"] .ov-bar {
    background: var(--color-border);
}

.ov-bar i {
    display: block;
    width: var(--w, 0%);
    height: 100%;

    border-radius: inherit;
    background: var(--color-green);
    transition: width .7s var(--ease);
}

/* the ring of the devices */
.ov-ringbox {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin-top: 6px;
}

.ov-ring {
    position: relative;
    width: 108px;
    aspect-ratio: 1;
}

.ov-ring svg {
    width: 100%;
    height: 100%;
}

.ov-ring-bg {
    fill: none;
    stroke: var(--color-border-soft);
    stroke-width: 14;
}

:root[data-theme="dark"] .ov-ring-bg {
    stroke: var(--color-border);
}

.ov-ring-segs circle {
    fill: none;
    stroke: var(--c);
    stroke-width: 14;
    cursor: pointer;
    transition: stroke-width .25s var(--ease), opacity .25s ease;
}

.ov-ring-segs circle.is-on {
    stroke-width: 18;
}

.ov-ring-mid {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
    pointer-events: none;
}

.ov-ring-n {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

.ov-ring-l {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-quiet);
}

.ov-sq {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--c);
}

/* ----- the pointer of the playing example (positions are measured from the frame's left edge, so "left" is right here) ----- */

.ov-cursor {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 6;

    width: 22px;
    height: 22px;

    opacity: 0;
    pointer-events: none;
    transition: transform .8s cubic-bezier(.45, .05, .25, 1), opacity .35s ease;
}

.ov-cursor.is-on {
    opacity: 1;
}

.ov-cursor svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    transform-origin: 30% 20%;
    transition: transform .12s ease;
}

.ov-cursor path {
    fill: var(--color-text);
    stroke: var(--color-bg);
    stroke-width: 1.6;
    stroke-linejoin: round;
}

.ov-cursor.is-down svg {
    transform: scale(.8);
}

/* the ring where it clicks */
.ov-cursor::before {
    content: "";
    position: absolute;
    top: -10px;
    left: -10px;
    width: 26px;
    height: 26px;

    border: 2px solid var(--color-green);
    border-radius: 50%;
    opacity: 0;
}

.ov-cursor.is-click::before {
    animation: ov-click .6s ease-out;
}

@keyframes ov-click {
    0% { opacity: .9; transform: scale(.4); }
    100% { opacity: 0; transform: scale(1.5); }
}

/* ===================================================================
   The small app frames of the rows
   =================================================================== */

.ov-mini {
    max-width: 640px;
    margin-inline: auto;
}

.ov-mini .app-body {
    padding: clamp(14px, 2vw, 20px);
}

/* ----- click to filter ----- */

.ov-flt-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: 32px;
}

.ov-flt-none {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-quiet);
}

.ov-flt-chips .chip {
    transition: opacity .3s ease, transform .35s var(--ease);
}

.ov-flt-chips .chip.is-new,
.ov-flt-chips .chip.is-gone {
    opacity: 0;
    transform: scale(.7);
}

.ov-flt-chips .chip svg {
    width: 13px;
    height: 13px;
    color: var(--green-text);
}

.ov-flt-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 12px;
    margin-top: 12px;
}

.ov-flt-t {
    font-size: 14px;
    font-weight: 800;
}

.ov-ring-sm {
    width: 96px;
    margin: 10px auto 6px;
}

.ov-ring-sm .ov-ring-n {
    font-size: 15px;
}

.ov-flt-keys {
    display: grid;
    gap: 2px;
}

.ov-flt-keys li,
.ov-flt-pages li {
    position: relative;
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 4px 8px;

    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: background-color .3s var(--ease), box-shadow .3s var(--ease);
}

.ov-flt-pages {
    display: grid;
    gap: 4px;
    margin-top: 8px;
}

.ov-flt-pages li {
    grid-template-columns: minmax(0, 1fr) auto;
    padding-block: 5px 6px;
}

.ov-flt-p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ov-flt-n {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.ov-flt-keys li.is-on,
.ov-flt-pages li.is-on {
    background: var(--color-green-soft);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-green) 45%, transparent);
}

/* the dot where the example "clicks" */
.ov-tap {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;

    border: 2px solid var(--color-green);
    border-radius: 50%;
    background: color-mix(in srgb, var(--color-green) 22%, transparent);
    opacity: 0;
    pointer-events: none;
}

.ov-tap.is-go {
    animation: ov-tap .7s ease-out;
}

@keyframes ov-tap {
    0% { opacity: 0; transform: scale(.4); }
    30% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.5); }
}

/* ----- every website, or one ----- */

.ov-web-finder {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ov-web-finder .chip {
    min-height: 34px;
    transition: border-color .25s ease, background-color .25s ease;
}

.ov-web-finder .chip.is-open {
    border-color: color-mix(in srgb, var(--color-green) 55%, var(--color-border));
}

.ov-web-finder .chip > svg {
    color: var(--color-text-quiet);
}

.ov-web-name[hidden] {
    display: none;
}

.ov-web-finder .site-dot.is-off {
    opacity: 0;
    transform: scale(.3);
}

.ov-web-menu {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-start: 0;

    display: grid;
    gap: 2px;
    min-width: 210px;
    padding: 6px;

    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-bg);
    box-shadow: var(--shadow-lg);

    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .2s ease, transform .25s var(--ease);
}

:root[data-theme="dark"] .ov-web-menu {
    background: var(--color-bg-soft);
}

.ov-web-menu.is-open {
    opacity: 1;
    transform: none;
}

.ov-web-menu li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;

    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    transition: background-color .2s ease;
}

.ov-web-menu li.is-hover {
    background: var(--color-bg-soft);
}

:root[data-theme="dark"] .ov-web-menu li.is-hover {
    background: var(--color-bg);
}

.ov-web-box {
    position: relative;
    width: 16px;
    height: 16px;

    border: 1.5px solid var(--color-border);
    border-radius: 5px;
    transition: background-color .2s ease, border-color .2s ease;
}

.ov-web-menu li.is-on .ov-web-box {
    border-color: var(--color-green);
    background: var(--color-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23052e16' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 11px no-repeat;
}

.ov-web-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.ov-web-kpis .app-card {
    padding: 10px 12px;
}

.ov-web-split {
    margin-top: 10px;
}

.ov-web-bar {
    display: flex;
    gap: 3px;
    height: 12px;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 4px;
}

.ov-web-bar i {
    flex: 0 0 auto;
    width: var(--w, 33%);
    height: 100%;

    border-radius: 4px;
    background: var(--dot);
    transition: width .7s var(--ease);
}

.ov-web-keys {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 10px;

    font-size: 12.5px;
    font-weight: 600;
    color: var(--color-text-soft);
}

.ov-web-keys li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: opacity .35s ease;
}

.ov-web-keys li.is-off {
    opacity: .35;
}

.ov-web-keys b {
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

/* ----- visibility ----- */

.ov-vm-switches {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.ov-vm-switches .ov-sw {
    border: 1px solid var(--color-border-soft);
    background: var(--color-bg);
    font-size: 12.5px;
    transition: border-color .3s ease, background-color .3s ease;
}

:root[data-theme="dark"] .ov-vm-switches .ov-sw {
    border-color: var(--color-border);
    background: var(--color-bg-soft);
}

.ov-vm-switches .ov-sw > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ov-vm-switches .ov-sw.is-touch {
    border-color: color-mix(in srgb, var(--color-green) 55%, var(--color-border));
}

.ov-vm-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 92px;
    gap: 8px;
    margin-top: 12px;
}

.ov-vm-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 10px;
    overflow: hidden;

    border: 1px solid var(--color-border-soft);
    border-radius: 12px;
    background: var(--color-bg);
    transition: transform .5s var(--ease), opacity .3s ease;
}

:root[data-theme="dark"] .ov-vm-tile {
    border-color: var(--color-border);
    background: var(--color-bg-soft);
}

.ov-vm-tile.is-wide {
    grid-column: span 2;
}

.ov-vm-tile[hidden] {
    display: none;
}

.ov-vm-tile.is-out {
    opacity: 0;
    transform: scale(.9);
}

.ov-vm-t {
    font-size: 11.5px;
    font-weight: 800;
    color: var(--color-text-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ov-vm-map {
    position: relative;
    flex: 1;
    border-radius: 8px;
    background:
        radial-gradient(ellipse 18% 26% at 24% 42%, var(--map-land) 98%, transparent),
        radial-gradient(ellipse 10% 20% at 30% 72%, var(--map-land) 98%, transparent),
        radial-gradient(ellipse 16% 18% at 52% 36%, var(--map-land) 98%, transparent),
        radial-gradient(ellipse 9% 20% at 54% 66%, var(--map-land) 98%, transparent),
        radial-gradient(ellipse 20% 22% at 74% 42%, var(--map-land) 98%, transparent),
        radial-gradient(ellipse 7% 8% at 86% 76%, var(--map-land) 98%, transparent);
}

/* (a map is never mirrored, so its dots are placed from the left in every language) */
.ov-vm-map i {
    position: absolute;
    top: var(--y);
    left: var(--x);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-green);
    box-shadow: 0 0 0 2px var(--map-dot-ring);
}

.ov-vm-ring {
    flex: 1;
    align-self: center;
    aspect-ratio: 1;
    max-height: 56px;
    border-radius: 50%;
    background: conic-gradient(#3b82f6 0 49%, #16a34a 0 92%, #f97316 0 99%, #8b5cf6 0);
    -webkit-mask: radial-gradient(circle, transparent 52%, #000 53%);
    mask: radial-gradient(circle, transparent 52%, #000 53%);
}

.ov-vm-lines {
    display: grid;
    gap: 7px;
}

.ov-vm-lines i {
    display: block;
    width: var(--w);
    height: 6px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--color-green) 70%, transparent);
}

.ov-vm-bars {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 3px;
}

.ov-vm-bars i {
    flex: 1;
    height: var(--h);
    border-radius: 2px 2px 0 0;
    background: #22d3ee;
}

/* ===================================================================
   The three tiles of the second section
   =================================================================== */

/* ----- visit quality: four dials ----- */

.ov-gauges {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 14px;
}

.ov-g-chip {
    display: flex;
    justify-content: center;
    min-height: 30px;
}

.ov-g-chip .chip {
    transition: opacity .3s ease, transform .35s var(--ease);
}

.ov-g-chip .chip[hidden] {
    display: none;
}

.ov-g-chip .chip.is-new {
    opacity: 0;
    transform: scale(.7);
}

.ov-g-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.ov-g {
    display: grid;
    justify-items: center;
    text-align: center;
    min-width: 0;
}

.ov-g svg {
    width: 100%;
    max-width: 86px;
}

.ov-g path {
    fill: none;
    stroke-width: 9;
    stroke-linecap: round;
}

.ov-g-bg {
    stroke: var(--color-border);
}

.ov-g-fg {
    stroke: var(--c);
    stroke-dasharray: var(--p, 0) 100;
}

.ov-g b {
    margin-top: -16px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

.ov-g span {
    margin-top: 2px;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--color-text-soft);
}

/* ----- how visitors flow ----- */

.ov-flow {
    display: grid;
    place-items: center;
    padding: 8px;
}

.ov-flow svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.ov-flow-links path {
    fill: none;
    stroke: var(--c);
    stroke-width: var(--w);
    stroke-opacity: .42;
    stroke-dasharray: 260;
    stroke-dashoffset: var(--off, 0);
    transition: stroke-opacity .45s ease;
}

.ov-flow.is-focus .ov-flow-links path {
    stroke-opacity: .1;
}

.ov-flow.is-focus .ov-flow-links path.is-lit {
    stroke-opacity: .62;
}

.ov-flow-nodes rect {
    fill: var(--c);
}

:root[data-theme="dark"] .ov-flow-nodes rect[style*="#475569"] {
    fill: #94a3b8;
}

.ov-flow-text text {
    font-size: 10.5px;
    font-weight: 700;
    fill: var(--color-text-soft);
    /* a halo in the colour of the tile, so a name stays readable over the links */
    paint-order: stroke;
    stroke: var(--color-bg-soft);
    stroke-width: 3px;
    stroke-linejoin: round;
}

:root[data-theme="dark"] .ov-flow-text text {
    stroke: var(--color-bg);
}

/* ----- this month's pace ----- */

.ov-pace {
    display: flex;
    flex-direction: column;
    padding: 14px 16px 10px;
}

.ov-pace-top {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.ov-pace-top p {
    display: grid;
    min-width: 0;
}

.ov-pace-top .app-label {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ov-pace-top b {
    font-size: clamp(15px, 1.5vw, 18px);
    font-weight: 800;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

.ov-pace-top b.is-green {
    color: var(--green-text);
}

.ov-pace-chart {
    flex: 1;
    width: 100%;
    min-height: 0;
    margin-top: 8px;
    overflow: visible;
}

.ov-pace-last {
    fill: none;
    stroke: var(--color-text-muted);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 0 5;
    vector-effect: non-scaling-stroke;
}

.ov-pace-area {
    fill: color-mix(in srgb, var(--color-green) 16%, transparent);
}

.ov-pace-line {
    fill: none;
    stroke: var(--color-green);
    stroke-width: 2.5;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.ov-pace-proj {
    fill: none;
    stroke: var(--color-green);
    stroke-width: 2;
    stroke-dasharray: 6 5;
    vector-effect: non-scaling-stroke;
}

.ov-pace-dot {
    fill: var(--color-green);
    stroke: var(--color-bg);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.ov-pace-day {
    margin-top: 4px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--color-text-quiet);
    text-align: end;
}

/* the two links at the end of the page: Compare, and Real-time */
.ov-next {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 32px;

    margin-top: 28px;
}

/* a text link under a row's text */
.ov-row-link {
    margin-top: 18px;
}

/* ===================================================================
   Narrower screens
   =================================================================== */

@media (max-width: 1080px) {

    .ov-trend .ov-vs {
        display: none;
    }
}

@media (max-width: 899px) {

    /* four numbers and two tiles: the screen stays short */
    .ov-kpis {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .ov-kpi[data-kpi="conversion_rate"],
    .ov-tile[data-tile="channels"],
    .ov-sw[data-tile="channels"] {
        display: none;
    }

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

@media (max-width: 640px) {

    .ov-sub,
    .ov-add {
        display: none;
    }

    .ov-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .ov-kpi {
        padding: 10px 12px;
    }

    .ov-kpi-ico {
        width: 24px;
        height: 24px;
    }

    .ov-tiles {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .ov-ringbox {
        grid-template-columns: 96px minmax(0, 1fr);
    }

    .ov-ring {
        width: 96px;
    }

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

    .ov-flt-grid .ov-flt-card:first-child {
        display: grid;
        grid-template-columns: 96px minmax(0, 1fr);
        align-items: center;
        column-gap: 12px;
    }

    .ov-flt-grid .ov-flt-card:first-child .ov-flt-t {
        grid-column: 1 / -1;
    }

    .ov-ring-sm {
        margin: 8px 0;
    }

    .ov-web-kpis {
        gap: 6px;
    }

    .ov-web-kpis .app-card {
        padding: 8px 10px;
    }

    .ov-web-kpis .app-num {
        font-size: 18px;
    }

    .ov-vm-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 84px;
    }

    .ov-g b {
        font-size: 13px;
        margin-top: -12px;
    }

    .ov-g span {
        font-size: 10px;
    }
}

@media (max-width: 380px) {

    /* an eye only (the word stays for screen readers) */
    .ov-visbtn span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

/* ===================================================================
   Less motion: everything is simply there (scripts/overview.js draws the final state)
   =================================================================== */

@media (prefers-reduced-motion: reduce) {

    .ov-stage.is-pre :is(.ov-kpi, .ov-tile) {
        opacity: 1;
        transform: none;
    }

    .ov-cursor {
        display: none;
    }

    .ov-tap.is-go,
    .ov-cursor.is-click::before {
        animation: none;
    }
}
