/* ===================================================================
   Real-time: the map is the background of the WHOLE page (fixed, behind the top bar too);
   the finder, the cards and the tiles float over it as frosted glass (translucent at rest, solid on hover, like the first dashboard).
   Big screens: the panels sit in the page's frame and the map shows between them.
   Small / short screens: a clear "window" onto the map, then the panels, and the page scrolls over the map.
   "Visibility" (the tiles on or off) is a button at the end of the finder, as on the Overview.
   =================================================================== */

.rt-page {
    /* the glass: translucent at rest (the map shows through), solid on hover */
    --glass: rgba(255, 255, 255, .46);
    --glass-hover: #ffffff;
    --glass-border: rgba(255, 255, 255, .75);
    --glass-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 6px 20px rgba(15, 23, 42, .09);
    --glass-shadow-hover: 0 10px 28px rgba(15, 23, 42, .2);
    --glass-blur: blur(12px) saturate(1.5);
    --glass-field: rgba(255, 255, 255, .66);
    --glass-pop: rgba(255, 255, 255, .95);
    --glass-ease: .5s ease;

    --rt-views: #2a78d6;
    --rt-bad: #dc2626;
    --rt-good: #15803d;
    --rt-grid: rgba(15, 23, 42, .07);
    /* on glass the muted text needs a little more ink */
    --color-text-muted: #64748b;

    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: transparent;
}

:root[data-theme="dark"] .rt-page {
    --glass: rgba(15, 23, 42, .44);
    --glass-hover: #111b2f;
    --glass-border: rgba(255, 255, 255, .11);
    --glass-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .3);
    --glass-shadow-hover: 0 12px 30px rgba(0, 0, 0, .55);
    --glass-field: rgba(15, 23, 42, .62);
    --glass-pop: rgba(15, 23, 42, .96);

    --rt-views: #3987e5;
    --rt-bad: #f87171;
    --rt-good: var(--color-green);
    --rt-grid: rgba(255, 255, 255, .08);
    --color-text-muted: #8b9bb3;
}

/* a browser without backdrop-filter gets a more opaque surface, so the text stays readable */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .rt-page { --glass: rgba(255, 255, 255, .88); --glass-field: rgba(255, 255, 255, .92); }
    :root[data-theme="dark"] .rt-page { --glass: rgba(15, 23, 42, .9); --glass-field: rgba(15, 23, 42, .94); }
}

/* no page colour anywhere: only the map (the colour under it shows until the map has loaded) */
html:has(.rt-page) {
    background: var(--color-bg-soft);
}

/* ===== the map: the whole viewport, behind everything ===== */

.rt-page .rt-map {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(900px 500px at 50% 35%, color-mix(in srgb, var(--color-green) 10%, transparent), transparent 70%),
        var(--color-bg-soft);
}

/* the top of the map fades into the colour of the page, so the finder reads well on any map (as on the first dashboard) */
.rt-page .rt-map::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 300px;
    pointer-events: none;
    z-index: 2;
    background: linear-gradient(to bottom,
        color-mix(in srgb, var(--color-bg) 72%, transparent) 25%,
        color-mix(in srgb, var(--color-bg) 50%, transparent) 50%,
        color-mix(in srgb, var(--color-bg) 22%, transparent) 78%,
        transparent 100%);
}

.rt-map-off {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 0 24px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-muted);
    pointer-events: none;
}

.rt-map-off[hidden] {
    display: none;
}

.rt-page .planbar {
    position: relative;
    z-index: 51;
}

/* the page layer: it does not catch the pointer, so the map can be dragged and zoomed between the panels */
.rt {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.rt-ui {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 12px clamp(12px, 2vw, 20px) 8px;
    pointer-events: none;
}

/* ===== a panel: frosted glass; translucent at rest, solid when the pointer is on it ===== */

.rt-glass {
    position: relative;
    isolation: isolate;
    pointer-events: auto;
}

.rt-glass::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    pointer-events: none;
    transition: background var(--glass-ease), box-shadow var(--glass-ease), border-color var(--glass-ease);
}

.rt-glass:hover::before,
.rt-glass:focus-within::before {
    background: var(--glass-hover);
    box-shadow: var(--glass-shadow-hover);
}

@media (prefers-reduced-motion: reduce) {
    .rt-glass::before { transition: none; }
}

/* a tile switched off in "Visibility" is hidden; with none left, the row goes too */
.rt-tile[hidden],
.rt-tiles:not(:has(> :not([hidden]))) {
    display: none;
}

/* ===== the finder: ONE row, no panel, straight on the map: GROUPS -> WEBSITES -> live filter -> time window ===== */

.rt-filterbar {
    position: relative;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 20px;
    padding: 2px 2px 0;
    pointer-events: none;
}

.rt-filterbar > * {
    pointer-events: auto;
}

/* the width of the first panel below the filters (.rt-active / the first column of .rt-top) */
.rt-page {
    --rt-card-w: clamp(340px, 29vw, 420px);
}

.rt-f-groups {
    width: calc(var(--rt-card-w) * .36 - 5px);
    min-width: 0;
}

/* at least as wide as the panel below it, wider when the chosen websites need it: their names stay visible
   (the owner: "w wybieraczu domen powinny być widoczne wybrane domeny"); past 640 px the rest go into "+N" */
.rt-f-websites {
    width: max-content;
    min-width: var(--rt-card-w);
    max-width: min(640px, 100%);
}

/* with the groups field in front of it, the two together are (at least) as wide as the panel */
.rt-f-groups:not([hidden]) + .rt-f-websites {
    min-width: calc(var(--rt-card-w) * .64 - 5px);
}

.rt-f-groups[hidden] {
    display: none;
}

/* (it shares its row with "Visibility": the button goes onto a row of its own only when the two do not fit side by side) */
.rt-f-filter {
    flex: 1 1 160px;
    min-width: 0;
}

/* the labels above the fields, as on the first dashboard */
.rt-filterbar .xselect-label,
.rt-f-label {
    margin-bottom: 6px;
    color: var(--color-text);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
}

/* the fields are frosted too */
.rt-filterbar .xselect-button,
.rt-filterbar .xlivefilter-chip {
    -webkit-backdrop-filter: blur(10px) saturate(1.4);
    backdrop-filter: blur(10px) saturate(1.4);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}

.rt-filterbar .xselect-button:hover,
.rt-filterbar .xselect.opened .xselect-button {
    background: var(--glass-hover);
}

/* ===== "Visibility", as on the Overview: a soft green button at the end of the finder; the panel it opens hangs under the row,
   with a tile for each tile of the page and its switch (green when the tile is on) ===== */

.rt-f-vis {
    flex: none;
    margin-inline-start: auto;
}

.rt-vis-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px;
    padding: 0 12px 0 14px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--color-green) 14%, var(--glass-field));
    color: var(--color-green-dark);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    -webkit-backdrop-filter: blur(10px) saturate(1.4);
    backdrop-filter: blur(10px) saturate(1.4);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
    transition: background .15s, box-shadow .15s;
}

.rt-vis-btn[hidden] { display: none; }
:root[data-theme="dark"] .rt-vis-btn { color: var(--color-green); }

.rt-vis-btn:hover,
.rt-vis-btn[aria-expanded="true"] {
    background: color-mix(in srgb, var(--color-green) 24%, var(--glass-field));
}

.rt-vis-btn:focus-visible {
    outline: 2px solid var(--color-green);
    outline-offset: 2px;
}

.rt-vis-btn .material-symbols-outlined { font-size: 19px; }
.rt-vis-btn .rt-vis-chev { transition: transform .2s var(--ease); }
.rt-vis-btn[aria-expanded="true"] .rt-vis-chev { transform: rotate(180deg); }

/* (placed against the whole row: under it, at the end where the button is) */
.rt-vispanel {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 2px;
    z-index: 30;
    width: min(640px, calc(100% - 4px));
    max-height: min(560px, 70vh);
    max-height: min(560px, 70dvh);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px 16px 16px;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    background: var(--glass-pop);
    box-shadow: var(--glass-shadow-hover);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    scrollbar-width: thin;
}

.rt-vispanel[hidden] { display: none; }

.rt-vispanel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.rt-vispanel-t {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -.01em;
}

.rt-vispanel-x {
    display: grid;
    flex: none;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    color: var(--color-text-soft);
    transition: background .15s, color .15s;
}

.rt-vispanel-x:hover {
    background: color-mix(in srgb, var(--color-text) 7%, transparent);
    color: var(--color-text);
}

.rt-vispanel-x .material-symbols-outlined { font-size: 20px; }

.rt-vis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.rt-vis-tile {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 48px;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--color-bg) 55%, transparent);
    color: var(--color-text-soft);
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.25;
    text-align: start;
    transition: border-color .15s, background .15s, color .15s;
}

.rt-vis-tile:hover { border-color: color-mix(in srgb, var(--color-green) 45%, var(--color-border)); }

.rt-vis-tile[aria-checked="true"] {
    border-color: color-mix(in srgb, var(--color-green) 55%, transparent);
    background: color-mix(in srgb, var(--color-green) 9%, transparent);
    color: var(--color-text);
}

/* (.rt-vis-tile in front: a stylesheet NEX adds after ours also styles .material-symbols-outlined) */
.rt-vis-tile .rt-vis-ico { flex: none; font-size: 19px; }
.rt-vis-tile[aria-checked="true"] .rt-vis-ico { color: var(--color-green-dark); }
:root[data-theme="dark"] .rt-vis-tile[aria-checked="true"] .rt-vis-ico { color: var(--color-green); }

.rt-vis-name {
    flex: 1;
    min-width: 0;
    overflow-wrap: break-word;   /* (a long name goes onto a second line between words, not inside one) */
}

/* the switch: grey and to the start when off, green and to the end when on */
.rt-vis-sw {
    position: relative;
    flex: none;
    width: 34px;
    height: 20px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--color-text) 22%, transparent);
    transition: background .15s;
}

.rt-vis-sw::after {
    content: "";
    position: absolute;
    top: 2px;
    inset-inline-start: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .3);
    transition: transform .15s var(--ease);
}

.rt-vis-tile[aria-checked="true"] .rt-vis-sw { background: var(--color-green); }
.rt-vis-tile[aria-checked="true"] .rt-vis-sw::after { transform: translateX(14px); }
[dir="rtl"] .rt-vis-tile[aria-checked="true"] .rt-vis-sw::after { transform: translateX(-14px); }

/* the time window: a tiny switch at the top of the charts card (a NEX segment made small) */
.rt-win-mini {
    display: flex;
    justify-content: flex-end;
    margin: 0;
    margin-inline-start: auto;   /* on the title line, next to the chevron */
}

.rt-active .rt-card-h {
    flex-wrap: nowrap;
}

.is-folded .rt-win-mini {
    display: none;
}

@media (max-width: 359px) {
    .rt-active .rt-card-h { flex-wrap: wrap; }
}

.rt-win-mini .nexsegment {
    min-height: 24px;
    font-size: 11px;
    border-radius: 9px;
}

/* the live status: its own small glass pill at the right end */
.rt-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    margin: 0;
    margin-inline-start: auto;
    padding-inline: 14px;
    border: 1px solid var(--glass-border);
    border-radius: 99px;
    background: var(--glass-field);
    -webkit-backdrop-filter: blur(10px) saturate(1.4);
    backdrop-filter: blur(10px) saturate(1.4);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
    font-size: 12px;
    line-height: 1.3;
    color: var(--color-text-soft);
}

.rt-status strong {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--color-text);
}

.rt-status strong[hidden] {
    display: none;
}

.rt-status-dot {
    width: 8px;
    height: 8px;
    flex: none;
    border-radius: 50%;
    background: var(--color-green);
}

.rt-status.is-error .rt-status-dot {
    background: #f59e0b;
    animation: none;
}

.rt-status[data-mode="paused"] .rt-status-dot {
    background: var(--color-text-muted);
    animation: none;
}

/* ===== cards ===== */

.rt-top {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), clamp(340px, 29vw, 420px)));
    gap: 14px;
    align-items: start;
    pointer-events: none;
}

.rt-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 14px 16px 12px;
    border-radius: 16px;
}

.rt-card-h {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 10px;
}

/* the chevron that folds a card up to its header */
.rt-fold {
    display: grid;
    place-items: center;
    flex: none;
    width: 28px;
    height: 28px;
    margin-inline-start: auto;
    border-radius: 8px;
    color: var(--color-text-soft);
    transition: background .15s, color .15s;
}

.rt-fold:hover {
    background: color-mix(in srgb, var(--color-text) 9%, transparent);
    color: var(--color-text);
}

.rt-fold .material-symbols-outlined {
    font-size: 22px;
}

/* the number that stays in the header of a folded "Active now" */
.rt-fold-n {
    display: none;
    margin-inline-start: 4px;
    font-size: 20px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.is-folded .rt-fold-n {
    display: inline;
}

.rt-card-h {
    cursor: default;
}

/* the body of a card folds smoothly (the height eases between its own and nothing) */
.rt-fold-body {
    display: grid;
    grid-template-rows: 1fr;
    min-height: 0;
    transition: grid-template-rows .3s var(--ease), opacity .25s ease;
}

.rt-fold-inner {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
}

.is-folded {
    gap: 0;
}

.is-folded .rt-fold-body {
    grid-template-rows: 0fr;
    opacity: 0;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .rt-fold-body { transition: none; }
}

.rt-card-t {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--color-text);
}

/* the chart's title is a sentence */
.rt-card-t-big {
    font-size: 15.5px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.rt-dot {
    width: 6px;
    height: 6px;
    flex: none;
    border-radius: 50%;
    background: var(--color-green);
}

.rt-sub {
    margin: 0;
    font-size: 11.5px;
    color: var(--color-text-soft);
}

@keyframes rt-pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-green) 55%, transparent); }
    70%, 100% { box-shadow: 0 0 0 7px transparent; }
}

/* "Filtered by 2 filters" */
.rt-filtered {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    margin: 0;
    padding: 2px 9px;
    border-radius: 99px;
    background: color-mix(in srgb, #f59e0b 20%, transparent);
    color: #92400e;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}

:root[data-theme="dark"] .rt-filtered {
    color: #fbbf24;
}

.rt-filtered[hidden] {
    display: none;
}

/* ----- active now ----- */

.rt-kpi {
    min-height: 62px;
    padding-top: 2px;
}

/* the big number: the number and its words on the left, the change on the right (the NEX parts, laid out like the first dashboard) */
.rt-kpi .nexkpi {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "value trend" "label note";
    align-items: start;
    gap: 3px 12px;
    padding: 0;
}

.rt-kpi .nexkpi-row {
    display: contents;
}

.rt-kpi .nexkpi-head {
    grid-area: label;
}

.rt-kpi .nexkpi-label {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    /* long labels (Russian, Arabic ...) wrap instead of being cut */
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.3;
}

.rt-kpi .nexkpi-value {
    grid-area: value;
    font-size: 40px !important;
    font-weight: 700;
    line-height: .95;
    letter-spacing: -2px;
}

.rt-kpi .nexkpi-trend {
    grid-area: trend;
    justify-self: end;
    padding: 8px 12px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
}

.rt-kpi .nexkpi-note {
    grid-area: note;
    justify-self: end;
    font-size: 10.5px;
}

/* the big number split by website (several websites in the picture), as on the home page: a bar each, as wide as its share, in the
   website's colour, and the numbers under them. The widths move smoothly with every update; a new bar grows from the start */
.rt-split {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: -4px 0 0;
}

.rt-split[hidden],
.is-nomatch .rt-split {
    display: none;
}

.rt-split-bar {
    display: flex;
    gap: 3px;
    height: 8px;
}

.rt-split-seg {
    flex: 1 1 0;
    min-width: 6px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--color-text) 22%, transparent);
    transform-origin: left center;
    transition: flex-grow .6s cubic-bezier(.2, .8, .2, 1), opacity .15s;
}

[dir="rtl"] .rt-split-seg {
    transform-origin: right center;
}

.rt-split-seg.is-new {
    animation: rt-split-grow .65s cubic-bezier(.2, .8, .2, 1) calc(var(--i, 0) * 110ms) both;
}

.rt-split-n {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 12.5px;
    line-height: 1.2;
}

.rt-split-seg[data-id],
.rt-split-i[data-id] {
    cursor: pointer;
}

.rt-split-i {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: opacity .15s;
}

.rt-split-i > i {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--color-text) 22%, transparent);
}

.rt-split-i b {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
}

.rt-split-i.is-new {
    animation: rt-split-in .45s cubic-bezier(.2, .8, .2, 1) calc(var(--i, 0) * 110ms + 180ms) both;
}

.rt-split .is-dim {
    opacity: .35;
}

@keyframes rt-split-grow { from { transform: scaleX(0); } }
@keyframes rt-split-in { from { opacity: 0; transform: translateY(5px); } }

@media (prefers-reduced-motion: reduce) {
    .rt-split-seg,
    .rt-split-i {
        animation: none !important;
        transition: none;
    }
}

.rt-metrics {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 8px;
    border-top: 1px solid color-mix(in srgb, var(--color-text) 10%, transparent);
}

.rt-metric {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    align-items: center;
    gap: 11px;
    min-height: 39px;
}

.rt-ico {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: 10px;
    color: var(--tone, var(--color-text-soft));
    background: color-mix(in srgb, var(--tone, var(--color-text-soft)) 16%, transparent);
}

.rt-ico .material-symbols-outlined {
    font-size: 17px;
}

.rt-metric-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.rt-metric-name {
    overflow-wrap: anywhere;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--color-text);
}

.rt-metric-sub {
    font-size: 10.5px;
    color: var(--color-text-muted);
}

.rt-metric-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

.rt-metric-val {
    font-size: 15px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.rt-delta {
    display: inline-block;
    min-width: 58px;
    padding: 2px 7px;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    text-align: center;
    white-space: nowrap;
}

.rt-delta-sm {
    min-width: 0;
    padding: 0;
    background: none !important;
    text-align: end;
}

.rt-delta.is-flat {
    color: var(--color-text-muted);
}

.rt-delta.is-good {
    color: var(--rt-good);
    background: color-mix(in srgb, var(--color-green) 14%, transparent);
}

.rt-delta.is-bad {
    color: var(--rt-bad);
    background: color-mix(in srgb, #ef4444 13%, transparent);
}

/* ----- "nothing matches the filters": calm, with a way out ----- */

.rt-nomatch-box[hidden] {
    display: none;
}

.rt-nomatch-box,
.rt-nomatch {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 4px 0 2px;
}

.rt-nomatch.rt-empty {
    align-items: center;
    padding: 18px 8px;
    text-align: center;
}

.rt-nomatch-t {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--color-text-soft);
}

.rt-nomatch-b {
    padding: 6px 14px;
    border: 1px solid color-mix(in srgb, var(--color-green) 45%, transparent);
    border-radius: 99px;
    background: color-mix(in srgb, var(--color-green) 14%, transparent);
    color: var(--rt-good);
    font-size: 12.5px;
    font-weight: 700;
    transition: background .15s;
}

.rt-nomatch-b:hover {
    background: color-mix(in srgb, var(--color-green) 26%, transparent);
}

.is-nomatch .rt-metrics {
    display: none;
}

/* ----- chart ----- */

.rt-chart-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rt-chart-cap {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--color-text-soft);
}

.rt-chart-max {
    margin-inline-start: auto;
    font-weight: 600;
    color: var(--color-text-muted);
}

.rt-key {
    width: 10px;
    height: 10px;
    flex: none;
    border-radius: 3px;
    background: var(--color-green);
}

.rt-key-views {
    height: 3px;
    border-radius: 2px;
    background: var(--rt-views);
}

.rt-chart-unit {
    font-weight: 500;
    color: var(--color-text-muted);
}

/* who is in the bars (several websites): colour, favicon, name */
.rt-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin: 0;
}

.rt-legend[hidden] {
    display: none;
}

.rt-leg {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--color-text-soft);
}

.rt-leg > i {
    width: 9px;
    height: 9px;
    flex: none;
    border-radius: 3px;
}

.rt-leg img {
    width: 14px;
    height: 14px;
    flex: none;
    border-radius: 3px;
    background: #fff;
    object-fit: contain;
}

.rt-leg span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* time runs left to right in every language */
.rt-plot {
    position: relative;
    height: 54px;
    direction: ltr;
    border-bottom: 1px solid color-mix(in srgb, var(--color-text) 14%, transparent);
    background-image: linear-gradient(to bottom, transparent calc(25% - 1px), var(--rt-grid) calc(25% - 1px), var(--rt-grid) 25%, transparent 25%, transparent calc(50% - 1px), var(--rt-grid) calc(50% - 1px), var(--rt-grid) 50%, transparent 50%, transparent calc(75% - 1px), var(--rt-grid) calc(75% - 1px), var(--rt-grid) 75%, transparent 75%);
}

.rt-plot-small {
    height: 38px;
    background-image: linear-gradient(to bottom, transparent calc(50% - 1px), var(--rt-grid) calc(50% - 1px), var(--rt-grid) 50%, transparent 50%);
}

.rt-plot-body {
    position: absolute;
    inset: 0;
}

.rt-bars {
    display: flex;
    align-items: flex-end;
    height: 100%;
}

.rt-col {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding-inline: 1px;
}

.rt-col i {
    display: block;
    width: 100%;
    max-width: 22px;
    margin: 0 auto;
    border-radius: 3px 3px 0 0;
    background: var(--plot, var(--color-green));
}

/* a bar split by website: the parts one over another */
.rt-col .rt-stack {
    display: flex;
    flex-direction: column-reverse;
    width: 100%;
    max-width: 22px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 3px 3px 0 0;
}

.rt-col .rt-stack i {
    max-width: none;
    margin: 0;
    border-radius: 0;
    min-height: 1px;
}

.rt-plot svg {
    width: 100%;
    height: 100%;
}

.rt-line.rt-multi {
    stroke-opacity: .7;
}

.rt-area.rt-multi {
    fill-opacity: .1;
}

.rt-line {
    fill: none;
    stroke: var(--plot, var(--rt-views));
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.rt-area {
    fill: color-mix(in srgb, var(--plot, var(--rt-views)) 14%, transparent);
    stroke: none;
}

.rt-hover {
    position: absolute;
    top: 0;
    bottom: 0;
    background: color-mix(in srgb, var(--color-text) 7%, transparent);
    pointer-events: none;
}

.rt-hover[hidden],
.rt-tip[hidden] {
    display: none;
}

.rt-tip {
    position: absolute;
    top: -2px;
    z-index: 3;
    transform: translate(-50%, -100%);
    padding: 3px 8px;
    border-radius: 7px;
    background: var(--color-black);
    color: var(--color-bg);
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
}

.rt-axis {
    display: flex;
    justify-content: space-between;
    direction: ltr;
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
    color: var(--color-text-muted);
}

/* ----- live feed ----- */

.rt-kinds {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rt-kind {
    padding: 5px 11px;
    border-radius: 10px;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.3;
    transition: background .15s, color .15s;
}

.rt-kind:hover {
    background: color-mix(in srgb, var(--color-text) 7%, transparent);
    color: var(--color-text-soft);
}

.rt-kind.is-on {
    /* the colour of the kind, a little deeper so the white text can be read */
    background: color-mix(in srgb, var(--kind) 80%, #000);
    color: #fff;
}

.rt-kind.is-on:hover {
    background: color-mix(in srgb, var(--kind) 70%, #000);
    color: #fff;
}

.rt-feed {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 120px;
    max-height: 360px;
    overflow-y: auto;
    margin-inline: -6px;
    padding-inline: 6px;
    padding-bottom: 14px;
    scrollbar-width: thin;
    /* the last row fades under the line of the footer */
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 26px), transparent);
}

.rt-ev {
    display: grid;
    /* the icons and the time sit on the first line, at the top right; the second line (what happened, and on which website) runs the full width */
    grid-template-columns: 36px minmax(0, 1fr) auto auto;
    grid-template-areas: "ico where meta time" "ico what what what";
    padding-inline-start: 9px;
    align-items: center;
    gap: 2px 9px;
    min-height: 56px;
    padding: 6px 4px;
    border-radius: 10px;
    transition: background .2s;
}

.rt-ev:hover {
    background: color-mix(in srgb, var(--color-text) 5%, transparent);
}

.rt-ev .rt-ico {
    width: 36px;
    height: 36px;
}

.rt-ev.is-new {
    animation: rt-new 1.6s var(--ease);
}

@keyframes rt-new {
    0% { background: color-mix(in srgb, var(--color-green) 22%, transparent); transform: translateY(-10px); opacity: .3; }
    25% { transform: none; opacity: 1; }
    100% { background: transparent; }
}

.rt-ev .rt-ico { grid-area: ico; }
.rt-ev-main { display: contents; }
.rt-ev-where { grid-area: where; min-width: 0; }
.rt-ev-what { grid-area: what; min-width: 0; }
.rt-ev-meta { grid-area: meta; align-self: start; }
.rt-ev-time { grid-area: time; align-self: start; padding-top: 2px; }

/* the colour of the website is the left border of the row (4px) */
.rt-ev {
    border-inline-start: 4px solid var(--stripe, var(--color-green));
    border-radius: 8px;
}

/* WHO IS HERE: rows of sessions that are active now are tinted; nothing is switched off by it (rows only fade while a website is picked in the legend of the charts) */
.rt-ev {
    transition: background .2s, opacity .6s, border-color .6s;
}

.rt-ev[data-active="1"] {
    background: color-mix(in srgb, var(--color-green) 7%, transparent);
}

.rt-ev-main {
    min-width: 0;
}

.rt-ev-where,
.rt-ev-what {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
}

.rt-ev-where {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.rt-ev-what {
    font-size: 11.5px;
    color: var(--color-text-soft);
    line-height: 1.4;
}

.rt-ev-what .rt-q,
.rt-ev-where .rt-q-place {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rt-ev-site {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--color-text-muted);
}

.rt-ev-fav {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: #fff;
    object-fit: contain;
}

/* a part of a row that is a quick filter */
.rt-q {
    display: inline-flex;
    align-items: center;
    padding: 0;
    border-radius: 6px;
    color: inherit;
    font: inherit;
    text-align: start;
    cursor: pointer;
}

.rt-q:hover {
    background: color-mix(in srgb, var(--color-green) 18%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-green) 18%, transparent);
}

.rt-q-page {
    white-space: nowrap;
}

.rt-ev-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rt-mi {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
}

.rt-mi .si {
    --si-size: 17px;
}

.rt-mi.is-blank {
    display: block;
}

.rt-ev-time {
    min-width: 40px;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-align: end;
    white-space: nowrap;
}

.rt-feed-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 9px;
    border-top: 1px solid color-mix(in srgb, var(--color-text) 10%, transparent);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--color-text-soft);
}

.rt-feed-live,
.rt-feed-auto {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rt-feed-foot.is-error .rt-dot {
    background: #f59e0b;
}

.rt-sensors {
    font-size: 17px;
    color: var(--rt-good);
}

.rt-feed-foot.is-error .rt-sensors,
.rt-feed-foot[data-mode="paused"] .rt-sensors {
    color: var(--color-text-muted);
}

@keyframes rt-blink {
    0%, 100% { opacity: .4; }
    50% { opacity: 1; }
}

.rt-empty {
    padding: 14px 6px;
    font-size: 12.5px;
    text-align: center;
    color: var(--color-text-muted);
}

/* ===== tiles ===== */

.rt-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 14px;
    pointer-events: none;
}

.rt-tile {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 12px 10px 10px;
    border-radius: 16px;
}

.rt-tile-t {
    margin: 0 6px 6px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--color-text);
}

.rt-rows {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-height: 0;
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.rt-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "name n" "bar bar";
    gap: 4px 8px;
    width: 100%;
    padding: 5px 6px 6px;
    border-radius: 8px;
    font-size: 12px;
    text-align: start;
    color: var(--color-text);
}

button.rt-row:hover {
    background: color-mix(in srgb, var(--color-text) 7%, transparent);
}

.rt-row.is-on {
    background: color-mix(in srgb, var(--color-green) 18%, transparent);
}

.rt-row-name {
    grid-area: name;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.rt-row-name .si {
    --si-size: 15px;
}

.rt-row-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rt-row-n {
    grid-area: n;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.rt-row-bar {
    grid-area: bar;
    height: 3px;
    border-radius: 99px;
    background: color-mix(in srgb, var(--color-text) 10%, transparent);
    overflow: hidden;
}

.rt-row-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--color-green);
}

/* ===== the map's popup (MapLibre) in the colours of the theme ===== */

.rt-popup .maplibregl-popup-content {
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    box-shadow: var(--shadow-lg);
}

.rt-popup .maplibregl-popup-tip {
    border-top-color: var(--color-bg);
    border-bottom-color: var(--color-bg);
}

.rt-popup-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12.5px;
}

.rt-popup-head {
    display: flex;
    align-items: center;
    gap: 7px;
}

.rt-popup-body span {
    color: var(--color-text-soft);
}

.rt-popup-body .rt-popup-site {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rt-popup-site i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.rt-pulse {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--pulse, var(--color-green));
    pointer-events: none;
}

/* somebody arrives: a filled flash and two rings spread out from the place */
.rt-pulse-in {
    background: color-mix(in srgb, var(--pulse, var(--color-green)) 35%, transparent);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--pulse, var(--color-green)) 55%, transparent);
    animation: rt-ring-in 1.7s cubic-bezier(.15, .7, .3, 1) forwards;
}

/* somebody leaves: a grey ring closes in on the dot, which turns faint */
.rt-pulse-out {
    border-color: var(--color-text-muted);
    animation: rt-ring-out 1.6s ease-in forwards;
}

@keyframes rt-ring-in {
    0% { transform: scale(.4); opacity: 1; box-shadow: 0 0 0 0 color-mix(in srgb, var(--pulse, var(--color-green)) 55%, transparent); }
    60% { opacity: .85; box-shadow: 0 0 0 16px transparent; }
    100% { transform: scale(3.8); opacity: 0; box-shadow: 0 0 0 26px transparent; }
}

@keyframes rt-ring-out {
    0% { transform: scale(3.4); opacity: 0; }
    25% { opacity: .8; }
    100% { transform: scale(.5); opacity: 0; }
}

/* rows of the feed of other websites, while one website is picked in the legend */
.rt-ev.is-off {
    opacity: .22;
    transition: opacity .15s;
}

/* (the .rt-page prefix: MapLibre's own sheet, loaded later, also positions its corner classes) */
.rt-page .rt-attr {
    position: fixed;
    bottom: 0;
    z-index: 60;
}

/* (MapLibre's own sheet is loaded after ours, so these are more specific) */
.rt-attr .maplibregl-ctrl.maplibregl-ctrl-attrib,
.rt-attr .maplibregl-ctrl.maplibregl-ctrl-attrib.maplibregl-compact {
    background: color-mix(in srgb, var(--color-bg) 82%, transparent);
    color: var(--color-text-soft);
    font-family: var(--font-sans);
}

.rt-attr .maplibregl-ctrl.maplibregl-ctrl-attrib a {
    color: var(--color-text);
}

:root[data-theme="dark"] .rt-attr .maplibregl-ctrl-attrib-button {
    filter: invert(1);
}

.rt-page .rt-attr.maplibregl-ctrl-bottom-right { right: 0; left: auto; }
.rt-page .rt-attr.maplibregl-ctrl-bottom-left { left: 0; right: auto; }

/* ===================================================================
   Big screens: the panels frame the page and the map shows between them.
   =================================================================== */

@media (min-width: 1100px) and (min-height: 840px) {

    .rt-page {
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    .rt-window {
        display: none;
    }

    /* the top row is two glass pieces, one at each side, with the map showing between and below them */
    .rt-top {
        flex: 1;
        min-height: 0;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        pointer-events: none;
    }

    .rt-card {
        max-height: min(100%, 70dvh);
    }

    .rt-active {
        flex: 0 0 clamp(340px, 29vw, 420px);
    }

    .rt-live {
        flex: 0 0 clamp(340px, 29vw, 420px);
        margin-inline-start: auto;
    }

    .rt-fold-body {
        flex: 1;
    }

    .rt-card.is-folded .rt-fold-body {
        flex: 0 0 auto;
    }

    .rt-feed {
        flex: 1;
        min-height: 0;
        max-height: none;
    }

    /* the tiles share the width of the row: 2, 3, 4 ... tiles fill it exactly, every one with its own rounded corners.
       Only when they cannot fit at their smallest the row scrolls (snapping, with a soft fade where it goes on), never a hard cut. */
    .rt-tiles {
        display: flex;
        align-self: stretch;
        gap: 14px;
        /* room for the shadows: the row is padded, and pulled back with a negative margin */
        margin: -6px -10px -14px;
        padding: 6px 10px 14px;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        scroll-padding-inline: 10px;
        pointer-events: auto;
        scrollbar-width: thin;
        scrollbar-color: color-mix(in srgb, var(--color-text) 35%, transparent) transparent;
    }

    .rt-tiles::-webkit-scrollbar { height: 8px; }
    .rt-tiles::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--color-text) 30%, transparent); border-radius: 99px; }
    .rt-tiles::-webkit-scrollbar-track { background: transparent; }

    .rt-tile {
        flex: 1 1 0;
        min-width: 190px;
        max-width: 340px;
        height: 168px;
        scroll-snap-align: start;
    }

    /* (a masked row cannot blur the map behind its tiles, so while it scrolls they are a little more opaque) */
    .rt-tiles[data-over="1"] .rt-tile {
        --glass: rgba(255, 255, 255, .72);
    }

    :root[data-theme="dark"] .rt-tiles[data-over="1"] .rt-tile {
        --glass: rgba(15, 23, 42, .7);
    }

    .rt-tiles[data-over="1"][data-start="1"]:not([data-end="1"]) {
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent);
        mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent);
    }

    .rt-tiles[data-over="1"][data-end="1"]:not([data-start="1"]) {
        -webkit-mask-image: linear-gradient(to right, transparent, #000 44px);
        mask-image: linear-gradient(to right, transparent, #000 44px);
    }

    .rt-tiles[data-over="1"]:not([data-start="1"]):not([data-end="1"]) {
        -webkit-mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent);
        mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent);
    }

    [dir="rtl"] .rt-tiles[data-over="1"][data-start="1"]:not([data-end="1"]) {
        -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 44px), transparent);
        mask-image: linear-gradient(to left, #000 calc(100% - 44px), transparent);
    }

    [dir="rtl"] .rt-tiles[data-over="1"][data-end="1"]:not([data-start="1"]) {
        -webkit-mask-image: linear-gradient(to left, transparent, #000 44px);
        mask-image: linear-gradient(to left, transparent, #000 44px);
    }

    [dir="rtl"] .rt-tiles[data-over="1"]:not([data-start="1"]):not([data-end="1"]) {
        -webkit-mask-image: linear-gradient(to left, transparent, #000 44px, #000 calc(100% - 44px), transparent);
        mask-image: linear-gradient(to left, transparent, #000 44px, #000 calc(100% - 44px), transparent);
    }

    .rt-rows {
        max-height: none;
    }

    /* under the tiles, the corner of the map's attribution stays free */
    .rt-ui {
        padding-bottom: 38px;
    }
}

/* ===================================================================
   Small / short screens: a clear window onto the map, the panels under it, the page scrolls over the map.
   =================================================================== */

@media not all and (min-width: 1100px) and (min-height: 840px) {

    .rt-filterbar { order: 1; }
    .rt-window { order: 2; flex: none; height: clamp(190px, 38vh, 420px); pointer-events: none; }
    .rt-top { order: 3; }
    .rt-tiles { order: 4; }

    .rt-ui {
        padding-bottom: 12px;
    }
}

@media (max-width: 900px) {

    /* one column: the websites field is exactly as wide as the panel below it */
    .rt-f-groups,
    .rt-f-websites,
    .rt-f-groups:not([hidden]) + .rt-f-websites {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .rt-top {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {

    .rt-filterbar {
        gap: 10px 12px;
    }

    .rt-f-groups,
    .rt-f-websites {
        flex: 1 1 100%;
        width: 100%;
    }

    .rt-top,
    .rt-tiles {
        grid-template-columns: 1fr;
    }

    .rt-ev {
        grid-template-columns: 36px minmax(0, 1fr) auto auto;
        grid-template-areas: "ico where meta time" "ico what what what";
    }

    /* the panel takes the whole width; two tiles side by side, without their icons (the names need the room) */
    .rt-vispanel { width: auto; inset-inline-start: 2px; padding: 12px; }
    .rt-vis-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
    .rt-vis-tile { gap: 8px; padding: 8px 10px; font-size: 13px; }
    .rt-vis-tile .rt-vis-ico { display: none; }

}

@media (max-width: 440px) {
    .rt-ev-meta { display: none; }
    .rt-ev { grid-template-areas: "ico where time" "ico what what"; grid-template-columns: 36px minmax(0, 1fr) auto; }
}

/* the legend of the charts: hover (or focus, or tap) a website to see only its charts */
.rt-leg {
    cursor: pointer;
    transition: opacity .15s;
}

.rt-leg.is-dim {
    opacity: .4;
}

.rt-leg.is-solo {
    font-weight: 700;
}

.rt-leg:focus-visible {
    outline: 2px solid var(--color-green);
    outline-offset: 2px;
    border-radius: 6px;
}

/* a new row of the feed slides in: it opens up its own height (the rows below move down smoothly), slides down from above and glows */
.rt-ev.is-new {
    overflow: hidden;
    animation: rt-new-in .75s cubic-bezier(.2, .8, .2, 1) backwards, rt-new-glow 2.4s ease-out;
}

@keyframes rt-new-in {
    0% { max-height: 0; min-height: 0; padding-block: 0; opacity: 0; transform: translateY(-22px) scale(.97); }
    55% { opacity: 1; }
    100% { max-height: 110px; min-height: 56px; padding-block: 6px; opacity: 1; transform: none; }
}

@keyframes rt-new-glow {
    0% { background: color-mix(in srgb, var(--color-green) 26%, transparent); }
    100% { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
    .rt-ev.is-new { animation: rt-new-glow 1.2s ease-out; }
}

/* a NEW SESSION: the place on the map lights up - a flash, a big pop of the dot, three rings one after another */
.rt-arrive {
    position: relative;
    width: 0;
    height: 0;
    pointer-events: none;
}

.rt-arrive i {
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
}

.rt-arr-flash {
    width: 26px;
    height: 26px;
    background: radial-gradient(circle, #fff 0, var(--pulse, var(--color-green)) 38%, transparent 72%);
    animation: rt-arr-flash 1.1s cubic-bezier(.1, .7, .3, 1) forwards;
}

/* after the first burst the place keeps pulsing for about 5 seconds: rings leave it again and again */
.rt-arr-ring {
    width: 22px;
    height: 22px;
    border: 3px solid var(--pulse, var(--color-green));
    animation: rt-arr-ring 1.7s cubic-bezier(.15, .6, .3, 1) 3 forwards;
}

.rt-arr-r2 { animation-delay: .55s; }
.rt-arr-r3 { animation-delay: 1.1s; }

.rt-arr-beat {
    width: 16px;
    height: 16px;
    background: color-mix(in srgb, var(--pulse, var(--color-green)) 55%, transparent);
    animation: rt-arr-beat 1s ease-in-out 5;
}

@keyframes rt-arr-beat {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: .9; }
    50% { transform: translate(-50%, -50%) scale(2.4); opacity: .15; }
}

.rt-arr-core {
    width: 18px;
    height: 18px;
    background: var(--pulse, var(--color-green));
    box-shadow: 0 0 0 3px #fff, 0 0 28px 10px color-mix(in srgb, var(--pulse, var(--color-green)) 75%, transparent);
    animation: rt-arr-core 2.6s cubic-bezier(.2, 1.2, .3, 1) forwards;
}

@keyframes rt-arr-flash {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(7); opacity: 0; }
}

@keyframes rt-arr-ring {
    0% { transform: translate(-50%, -50%) scale(.3); opacity: 0; }
    12% { opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(8); opacity: 0; }
}

@keyframes rt-arr-core {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    14% { transform: translate(-50%, -50%) scale(3.2); opacity: 1; }
    34% { transform: translate(-50%, -50%) scale(1.7); }
    52% { transform: translate(-50%, -50%) scale(2.2); }
    75% { transform: translate(-50%, -50%) scale(1.5); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .rt-arr-ring, .rt-arr-flash, .rt-arr-beat { display: none; }
}

/* the sessions behind a map dot (in its popup) */
.rt-popup-list {
    display: grid;
    gap: 6px;
    max-height: 240px;
    margin: 8px 0 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.rt-ps {
    position: relative;
    padding: 6px 8px 6px 12px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--color-text) 5%, transparent);
    font-size: 12px;
    line-height: 1.35;
}

.rt-ps::before {
    content: "";
    position: absolute;
    inset-block: 6px;
    inset-inline-start: 0;
    width: 3px;
    border-radius: 2px;
    background: var(--color-green);
}

.rt-ps.is-left { opacity: .6; }
.rt-ps.is-left::before { background: var(--color-text-muted); }

.rt-ps-status {
    float: inline-end;
    margin-inline-start: 8px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--color-green-dark);
}

.rt-ps.is-left .rt-ps-status { color: var(--color-text-muted); }

.rt-ps-path, .rt-ps-facts { margin: 0; word-break: break-all; }
.rt-ps-facts { color: var(--color-text-muted); }
.rt-ps-more { font-size: 11px; color: var(--color-text-muted); text-align: center; }
