/*
 * Rocky Global design system: components.
 *
 * Reusable building blocks for every admin panel. All values come from
 * tokens.css. Blocks are prefixed with `rg-` so they never collide with the
 * legacy theme classes.
 */

/* ---------------------------------------------------------------- Page */

.rg-page {
    display: flex;
    flex-direction: column;
    gap: var(--rg-space-5);
    padding: var(--rg-space-9) var(--rg-space-8) var(--rg-space-10);
    font-family: var(--rg-font-family);
    color: var(--rg-color-ink);
    -webkit-font-smoothing: antialiased;
}

.rg-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--rg-space-6);
    padding: 0 var(--rg-space-1) var(--rg-space-2);
}

.rg-page-header__lead {
    display: flex;
    align-items: center;
    gap: var(--rg-space-5);
    flex-wrap: wrap;
}

.rg-page-header__date {
    display: flex;
    align-items: center;
    gap: var(--rg-space-3);
}

.rg-page-header__day-number {
    font-size: var(--rg-font-size-7xl);
    line-height: 56px;
    font-weight: var(--rg-font-weight-light);
    letter-spacing: -2.5px;
    color: var(--rg-color-ink);
}

.rg-page-header__date-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rg-page-header__weekday {
    font-size: var(--rg-font-size-md);
    line-height: 16px;
    color: var(--rg-color-text-muted);
}

.rg-page-header__month {
    font-size: var(--rg-font-size-lg);
    line-height: 18px;
    font-weight: var(--rg-font-weight-regular);
    color: var(--rg-color-ink);
}

.rg-page-header__separator {
    width: 1px;
    height: 40px;
    background: var(--rg-color-line-strong);
}

.rg-page-header__greeting {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--rg-space-1);
    text-align: right;
}

.rg-page-header__title {
    margin: 0;
    font-size: var(--rg-font-size-4xl);
    line-height: 40px;
    font-weight: var(--rg-font-weight-regular);
    letter-spacing: -1px;
    color: var(--rg-color-ink);
}

.rg-page-header__subtitle {
    margin: 0;
    font-size: var(--rg-font-size-base);
    color: var(--rg-color-text-muted);
}

/* ---------------------------------------------------------------- Grid */

.rg-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--rg-grid-gap);
}

.rg-grid__cell--span-2 { grid-column: span 2; }
.rg-grid__cell--span-3 { grid-column: span 3; }
.rg-grid__cell--span-4 { grid-column: span 4; }
.rg-grid__cell--span-5 { grid-column: span 5; }
.rg-grid__cell--span-6 { grid-column: span 6; }
.rg-grid__cell--span-7 { grid-column: span 7; }
.rg-grid__cell--span-8 { grid-column: span 8; }
.rg-grid__cell--span-12 { grid-column: span 12; }

/* ---------------------------------------------------------------- Card */

.rg-card {
    display: flex;
    flex-direction: column;
    gap: var(--rg-space-4);
    min-width: 0;
    padding: var(--rg-card-padding);
    background: var(--rg-color-surface);
    border-radius: var(--rg-radius-xl);
    color: var(--rg-color-ink);
}

.rg-card--wide {
    padding: var(--rg-card-padding-wide);
}

.rg-card--spread {
    justify-content: space-between;
    gap: var(--rg-space-5);
}

.rg-card--inverse {
    background: var(--rg-color-inverse);
    color: var(--rg-color-inverse-text);
}

.rg-card--link {
    text-decoration: none;
    transition: background var(--rg-transition), transform var(--rg-transition);
}

.rg-card--link:hover,
.rg-card--link:focus-visible {
    color: var(--rg-color-ink);
    background: var(--rg-color-surface-hover);
}

.rg-card--inverse.rg-card--link:hover,
.rg-card--inverse.rg-card--link:focus-visible {
    background: var(--rg-color-inverse-hover);
    color: var(--rg-color-inverse-text);
}

.rg-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--rg-space-4);
}

.rg-card__header--top {
    align-items: flex-start;
}

.rg-card__title {
    margin: 0;
    font-size: var(--rg-font-size-base);
    font-weight: var(--rg-font-weight-regular);
    line-height: 18px;
    color: inherit;
}

.rg-card__meta {
    font-size: var(--rg-font-size-sm);
    color: var(--rg-color-text-muted);
}

.rg-card__divider {
    height: 1px;
    border: 0;
    margin: 0;
    background: var(--rg-color-line);
}

.rg-card__footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--rg-space-3);
}

/* ---------------------------------------------------------------- Pill */

.rg-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--rg-space-1);
    padding: 4px 10px;
    border-radius: var(--rg-radius-pill);
    background: var(--rg-color-surface-sunken);
    color: var(--rg-color-text-muted);
    font-size: var(--rg-font-size-sm);
    line-height: 16px;
    white-space: nowrap;
}

.rg-pill--strong {
    color: var(--rg-color-ink-soft);
}

.rg-pill--compact {
    padding: 2px 8px;
    font-size: var(--rg-font-size-xs);
    font-weight: var(--rg-font-weight-regular);
}

.rg-pill--success {
    background: var(--rg-color-success-tint);
    color: var(--rg-color-success);
}

.rg-pill--danger {
    background: var(--rg-color-danger-tint);
    color: var(--rg-color-danger);
}

.rg-pill--warning {
    background: var(--rg-color-warning-tint);
    color: var(--rg-color-warning);
}

.rg-pill--brand {
    background: var(--rg-color-brand);
    color: var(--rg-color-inverse-text);
}

.rg-pill__icon {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

/* -------------------------------------------------------------- Button */

.rg-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: var(--rg-control-height);
    padding: 0 20px;
    border: 0;
    border-radius: var(--rg-radius-pill);
    background: var(--rg-color-surface-sunken);
    color: var(--rg-color-ink);
    font-family: inherit;
    font-size: var(--rg-font-size-base);
    font-weight: var(--rg-font-weight-medium);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--rg-transition), color var(--rg-transition);
}

.rg-button--with-icon {
    padding-right: var(--rg-space-2);
}

.rg-button--primary {
    background: var(--rg-color-brand);
    color: var(--rg-color-inverse-text);
}

.rg-button--primary:hover,
.rg-button--primary:focus-visible {
    background: var(--rg-color-brand-hover);
    color: var(--rg-color-inverse-text);
}

.rg-button--light {
    background: var(--rg-color-surface);
    color: var(--rg-color-ink);
    font-weight: var(--rg-font-weight-regular);
}

.rg-button--light:hover,
.rg-button--light:focus-visible {
    background: var(--rg-color-line-strong);
    color: var(--rg-color-ink);
}

.rg-button--dark {
    background: var(--rg-color-ink);
    color: var(--rg-color-inverse-text);
}

.rg-button--dark:hover,
.rg-button--dark:focus-visible {
    background: var(--rg-color-ink-soft);
    color: var(--rg-color-inverse-text);
}

.rg-button__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
}

.rg-button__icon svg {
    width: 12px;
    height: 12px;
}

/* ----------------------------------------------------------- Segmented */

.rg-segmented {
    display: inline-flex;
    gap: 2px;
    padding: var(--rg-space-1);
    border-radius: var(--rg-radius-pill);
    background: var(--rg-color-surface-sunken);
}

.rg-segmented__option {
    height: var(--rg-control-height-sm);
    padding: 0 var(--rg-space-4);
    border: 0;
    border-radius: var(--rg-radius-pill);
    background: transparent;
    color: var(--rg-color-ink-muted);
    font-family: inherit;
    font-size: var(--rg-font-size-md);
    cursor: pointer;
    transition: background var(--rg-transition), color var(--rg-transition);
}

.rg-segmented__option[aria-pressed='true'],
.rg-segmented__option[aria-selected='true'] {
    background: var(--rg-color-ink);
    color: var(--rg-color-inverse-text);
}

/* ---------------------------------------------------------------- Stat */

.rg-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.rg-stat__value {
    margin: 0;
    font-size: var(--rg-font-size-2xl);
    font-weight: var(--rg-font-weight-regular);
    letter-spacing: var(--rg-letter-spacing-tight);
    color: inherit;
}

.rg-stat__value--md {
    font-size: var(--rg-font-size-xl);
    letter-spacing: 0;
}

.rg-stat__value--lg {
    font-weight: var(--rg-font-weight-light);
    font-size: var(--rg-font-size-5xl);
    line-height: 44px;
    letter-spacing: -1.4px;
}

.rg-stat__value--xl {
    font-weight: var(--rg-font-weight-light);
    font-size: var(--rg-font-size-6xl);
    line-height: 56px;
    letter-spacing: var(--rg-letter-spacing-display);
}

.rg-stat__value--display {
    font-weight: var(--rg-font-weight-light);
    font-size: var(--rg-font-size-7xl);
    line-height: 60px;
    letter-spacing: -2.6px;
}

.rg-stat__decimals {
    color: var(--rg-color-text-ghost);
}

.rg-stat__label {
    font-size: var(--rg-font-size-sm);
    color: var(--rg-color-text-muted);
}

.rg-stat__label--xs {
    font-size: var(--rg-font-size-xs);
}

.rg-stat__caption {
    font-size: var(--rg-font-size-xs);
    color: var(--rg-color-text-faint);
}

.rg-card--inverse .rg-stat__label,
.rg-card--inverse .rg-stat__caption {
    color: var(--rg-color-inverse-muted);
}

.rg-stat-row {
    display: flex;
    gap: var(--rg-space-5);
}

.rg-stat-row__separator {
    width: 1px;
    background: var(--rg-color-line);
}

.rg-card--inverse .rg-stat-row__separator {
    background: var(--rg-color-inverse-line);
}

/* --------------------------------------------------------------- Trend */

.rg-trend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--rg-space-2);
}

.rg-trend--stacked {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

/* -------------------------------------------------------------- Avatar */

.rg-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--rg-color-surface-sunken);
    color: var(--rg-color-ink-soft);
    font-size: var(--rg-font-size-xs);
    font-weight: var(--rg-font-weight-regular);
}

/* ----------------------------------------------------------- Date tile */

.rg-date-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
    height: 52px;
    border-radius: var(--rg-radius-md);
    background: var(--rg-color-surface-sunken);
    color: var(--rg-color-ink);
}

.rg-date-tile__day {
    font-weight: var(--rg-font-weight-light);
    font-size: var(--rg-font-size-xl);
    line-height: 20px;
}

.rg-date-tile__month {
    font-size: var(--rg-font-size-2xs);
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--rg-color-text-muted);
}

.rg-date-tile--active {
    background: var(--rg-color-brand);
    color: var(--rg-color-inverse-text);
}

.rg-date-tile--active .rg-date-tile__month {
    color: rgba(255, 255, 255, 0.8);
}

/* ----------------------------------------------------------------- Dot */

.rg-dot {
    display: inline-block;
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rg-color-dot-idle);
}

.rg-dot--brand { background: var(--rg-color-brand); }
.rg-dot--ink { background: var(--rg-color-ink); }
.rg-dot--shade-1 { background: var(--rg-color-brand-100); }
.rg-dot--shade-2 { background: var(--rg-color-brand-200); }
.rg-dot--shade-3 { background: var(--rg-color-brand-300); }
.rg-dot--shade-4 { background: var(--rg-color-brand-400); }
.rg-dot--shade-5 { background: var(--rg-color-brand-500); }

/* -------------------------------------------------------------- Series */

/* Sets --rg-series-color for a dot, meter or donut segment of a categorical chart. */
.rg-series--1 { --rg-series-color: var(--rg-color-series-1); }
.rg-series--2 { --rg-series-color: var(--rg-color-series-2); }
.rg-series--3 { --rg-series-color: var(--rg-color-series-3); }
.rg-series--4 { --rg-series-color: var(--rg-color-series-4); }
.rg-series--5 { --rg-series-color: var(--rg-color-series-5); }
.rg-series--6 { --rg-series-color: var(--rg-color-series-6); }
.rg-series--7 { --rg-series-color: var(--rg-color-series-other); }

.rg-dot.rg-dot--series {
    width: 10px;
    height: 10px;
    background: var(--rg-series-color);
}

/* --------------------------------------------------------------- Donut */

/* Segments are <circle> strokes whose dash array/offset are computed server-side. */
.rg-donut {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 220px;
    aspect-ratio: 1;
    margin: 0;
}

.rg-donut__svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.rg-donut__segment {
    fill: none;
    stroke: var(--rg-series-color);
    stroke-width: 20;
}

.rg-donut__label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.rg-donut__value {
    font-size: var(--rg-font-size-3xl);
    letter-spacing: -0.8px;
    color: var(--rg-color-ink);
}

.rg-donut__caption {
    font-size: var(--rg-font-size-sm);
    color: var(--rg-color-text-muted);
}

/* ---------------------------------------------------------------- List */

.rg-list {
    display: flex;
    flex-direction: column;
    gap: var(--rg-space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.rg-list--spacious {
    gap: 6px;
}

.rg-list__item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-size: var(--rg-font-size-md);
}

.rg-list__item--interactive {
    gap: 14px;
    margin: 0 -10px;
    padding: 10px;
    border-radius: var(--rg-radius-lg);
    color: inherit;
    text-decoration: none;
    transition: background var(--rg-transition);
}

.rg-list__item--interactive:hover,
.rg-list__item--interactive:focus-visible {
    background: var(--rg-color-surface-hover);
    color: inherit;
}

.rg-list__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.rg-list__name {
    overflow: hidden;
    color: var(--rg-color-ink-soft);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.rg-list__title {
    font-size: var(--rg-font-size-base);
    line-height: 18px;
    color: var(--rg-color-ink);
    text-wrap: pretty;
}

.rg-list__subtitle {
    font-size: var(--rg-font-size-sm);
    color: var(--rg-color-text-muted);
}

.rg-list__value {
    flex-shrink: 0;
    margin-left: auto;
    color: var(--rg-color-ink);
}

.rg-list__value--muted {
    color: var(--rg-color-text-muted);
}

/* ---------------------------------------------------------------- Meter */

.rg-meter {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rg-meter__header {
    display: flex;
    justify-content: space-between;
    font-size: var(--rg-font-size-md);
    color: var(--rg-color-ink-soft);
}

.rg-meter__track {
    height: 8px;
    overflow: hidden;
    border: 0;
    border-radius: var(--rg-radius-pill);
    background: var(--rg-color-surface-sunken);
    appearance: none;
    width: 100%;
}

.rg-meter__track::-webkit-progress-bar {
    background: var(--rg-color-surface-sunken);
    border-radius: var(--rg-radius-pill);
}

.rg-meter__track::-webkit-progress-value {
    background: var(--rg-series-color, var(--rg-color-brand));
    border-radius: var(--rg-radius-pill);
}

.rg-meter__track::-moz-progress-bar {
    background: var(--rg-series-color, var(--rg-color-brand));
    border-radius: var(--rg-radius-pill);
}

/* ---------------------------------------------------------- Data table */

.rg-table {
    display: flex;
    flex-direction: column;
}

.rg-table__row {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.6fr) 80px 96px;
    align-items: center;
    gap: var(--rg-space-4);
    padding: 6px 0;
}

.rg-table__row--head {
    padding: var(--rg-space-2) 0;
    border-bottom: 1px solid var(--rg-color-line);
    font-size: var(--rg-font-size-xs);
    letter-spacing: 0.3px;
    color: var(--rg-color-text-faint);
}

.rg-table__cell {
    min-width: 0;
    overflow: hidden;
    font-size: var(--rg-font-size-md);
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--rg-color-ink-muted);
}

.rg-table__cell--primary {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--rg-font-size-base);
    color: var(--rg-color-ink);
}

.rg-table__cell--end {
    text-align: right;
    color: var(--rg-color-text-muted);
}

.rg-table__row--head .rg-table__cell {
    font-size: inherit;
    color: inherit;
}

/* ---------------------------------------------------------------- Link */

.rg-link {
    color: var(--rg-color-brand);
    font-size: var(--rg-font-size-sm);
    text-decoration: none;
}

.rg-link:hover,
.rg-link:focus-visible {
    color: var(--rg-color-brand-strong);
}

.rg-link--strong {
    font-size: var(--rg-font-size-md);
}

.rg-list__item--link {
    margin: 0 -8px;
    padding: 6px 8px;
    border-radius: var(--rg-radius-sm);
    color: inherit;
    text-decoration: none;
    transition: background var(--rg-transition);
}

.rg-list__item--link:hover,
.rg-list__item--link:focus-visible {
    background: var(--rg-color-surface-hover);
    color: inherit;
}

.rg-table__link {
    color: inherit;
    text-decoration: none;
    transition: color var(--rg-transition);
}

.rg-table__link:hover,
.rg-table__link:focus-visible {
    color: var(--rg-color-brand);
}

/* --------------------------------------------------------------- Empty */

.rg-empty {
    margin: 0;
    padding: var(--rg-space-4) 0;
    font-size: var(--rg-font-size-md);
    color: var(--rg-color-text-muted);
}

/* ------------------------------------------------------------ Shortcut */

.rg-shortcut {
    display: flex;
    align-items: center;
    gap: var(--rg-space-4);
}

.rg-shortcut__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: var(--rg-radius-md);
    background: var(--rg-color-brand-tint);
    color: var(--rg-color-brand);
    font-size: 22px;
}

.rg-shortcut__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.rg-shortcut__title {
    font-size: var(--rg-font-size-lg);
    font-weight: var(--rg-font-weight-medium);
    color: var(--rg-color-ink);
}

.rg-shortcut__desc {
    font-size: var(--rg-font-size-md);
    color: var(--rg-color-text-muted);
}

.rg-shortcut__arrow {
    flex-shrink: 0;
    color: var(--rg-color-text-faint);
    font-size: 20px;
}

/* ---------------------------------------------------------- Responsive */

@media (max-width: 1399px) {
    .rg-grid__cell--span-2,
    .rg-grid__cell--span-3,
    .rg-grid__cell--span-4,
    .rg-grid__cell--span-5 {
        grid-column: span 6;
    }

    .rg-grid__cell--span-6,
    .rg-grid__cell--span-7,
    .rg-grid__cell--span-8 {
        grid-column: span 12;
    }
}

@media (max-width: 991px) {
    .rg-grid__cell--span-4,
    .rg-grid__cell--span-5 {
        grid-column: span 12;
    }
}

@media (max-width: 767px) {
    .rg-page {
        padding: var(--rg-space-6) var(--rg-space-4) var(--rg-space-8);
    }

    .rg-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .rg-page-header__greeting {
        align-items: flex-start;
        text-align: left;
    }

    .rg-page-header__title {
        font-size: var(--rg-font-size-3xl);
        line-height: 34px;
    }

    .rg-grid__cell--span-2,
    .rg-grid__cell--span-3,
    .rg-grid__cell--span-6 {
        grid-column: span 12;
    }

    .rg-table__row {
        grid-template-columns: minmax(0, 1fr) 72px;
    }

    .rg-table__cell--secondary,
    .rg-table__cell--end {
        display: none;
    }
}

/* --------------------------------------------------------------- Chart */

rg-bar-chart {
    display: block;
    min-height: 248px;
}

rg-bar-chart[aria-busy='true'] {
    opacity: 0.5;
}

.rg-chart__bars {
    display: grid;
    grid-template-columns: repeat(var(--rg-chart-columns, 7), minmax(0, 1fr));
    align-items: end;
    gap: 14px;
    height: 248px;
}

.rg-chart__column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    height: 100%;
    min-width: 0;
    cursor: default;
}

.rg-chart__value {
    font-size: var(--rg-font-size-sm);
    font-weight: var(--rg-font-weight-regular);
    color: var(--rg-color-text-ghost);
    white-space: nowrap;
}

.rg-chart__bar {
    width: 100%;
    max-width: 72px;
    height: var(--rg-bar-height, 8px);
    border-radius: var(--rg-radius-md);
    background: var(--rg-color-brand-soft);
    transition: background var(--rg-transition);
}

.rg-chart__bar--empty {
    background: repeating-linear-gradient(
        135deg,
        var(--rg-color-hatch-a) 0 3px,
        var(--rg-color-hatch-b) 3px 6px
    );
}

.rg-chart__label {
    overflow: hidden;
    max-width: 100%;
    font-size: var(--rg-font-size-sm);
    color: var(--rg-color-text-faint);
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.rg-chart__column--active .rg-chart__value,
.rg-chart__column--active .rg-chart__label {
    color: var(--rg-color-ink);
}

.rg-chart__column--active .rg-chart__bar:not(.rg-chart__bar--empty) {
    background: var(--rg-color-brand);
}

.rg-chart__area {
    position: relative;
    height: 248px;
}

.rg-chart__svg {
    display: block;
    width: 100%;
    height: 220px;
}

.rg-chart__gridline {
    stroke: var(--rg-color-line);
    stroke-dasharray: 4 6;
}

.rg-chart__line {
    fill: none;
    stroke: var(--rg-color-brand);
    stroke-width: 2.5;
}

.rg-chart__gradient-start {
    stop-color: var(--rg-color-brand);
    stop-opacity: 0.22;
}

.rg-chart__gradient-end {
    stop-color: var(--rg-color-brand);
    stop-opacity: 0;
}

.rg-chart__area-labels {
    display: grid;
    grid-template-columns: repeat(var(--rg-chart-columns, 7), minmax(0, 1fr));
    margin-top: 10px;
}

/* ------------------------------------------------------ Calendar strip */

.rg-calendar-strip {
    display: grid;
    grid-template-columns: repeat(15, minmax(0, 1fr));
    gap: 2px 0;
    justify-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rg-calendar-strip__day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    min-width: 0;
}

.rg-calendar-strip__month {
    height: 10px;
    font-size: 8px;
    line-height: 10px;
    letter-spacing: 0.3px;
    text-transform: lowercase;
    color: var(--rg-color-brand);
    white-space: nowrap;
}

.rg-calendar-strip__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    font-size: var(--rg-font-size-2xs);
    font-weight: var(--rg-font-weight-light);
    font-variant-numeric: tabular-nums;
    color: var(--rg-color-text-ghost);
    transition: background var(--rg-transition), color var(--rg-transition);
}

.rg-calendar-strip__day--countdown .rg-calendar-strip__number {
    background: var(--rg-color-surface-sunken);
    color: var(--rg-color-ink-soft);
}

.rg-calendar-strip__day--event .rg-calendar-strip__number {
    background: var(--rg-color-brand);
    color: var(--rg-color-inverse-text);
    font-weight: var(--rg-font-weight-regular);
}

.rg-calendar-strip__day--today .rg-calendar-strip__number {
    box-shadow: inset 0 0 0 1px var(--rg-color-ink);
    color: var(--rg-color-ink);
}

/* ------------------------------------------------------------- Bubbles */

.rg-bubbles {
    display: block;
    width: 100%;
    max-width: 200px;
    height: 200px;
    margin: 0 auto;
    overflow: visible;
}

.rg-bubbles__circle--shade-1 { fill: var(--rg-color-brand-100); }
.rg-bubbles__circle--shade-2 { fill: var(--rg-color-brand-200); }
.rg-bubbles__circle--shade-3 { fill: var(--rg-color-brand-300); }
.rg-bubbles__circle--shade-4 { fill: var(--rg-color-brand-400); }
.rg-bubbles__circle--shade-5 { fill: var(--rg-color-brand-500); }

.rg-bubbles__label {
    font-family: var(--rg-font-family);
    font-size: var(--rg-font-size-xs);
    font-weight: var(--rg-font-weight-regular);
    fill: var(--rg-color-brand-ink-strong);
    text-anchor: middle;
}

.rg-bubbles__label--shade-3 { fill: var(--rg-color-brand-ink-deep); }

.rg-bubbles__label--shade-4,
.rg-bubbles__label--shade-5 {
    fill: var(--rg-color-inverse-text);
}

/* ---------------------------------------------------------------- Ring */

.rg-ring {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 150px;
    flex-shrink: 0;
}

.rg-ring__chart {
    position: relative;
    width: 132px;
    height: 132px;
}

.rg-ring__svg {
    width: 132px;
    height: 132px;
    transform: rotate(-90deg);
}

.rg-ring__track,
.rg-ring__value {
    fill: none;
    stroke-width: 8;
}

.rg-ring__track {
    stroke: var(--rg-color-inverse-track);
}

.rg-ring__value {
    stroke: var(--rg-color-brand);
    stroke-linecap: round;
}

.rg-ring__label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--rg-font-size-3xl);
    font-weight: var(--rg-font-weight-light);
    letter-spacing: -1px;
}

.rg-ring__caption {
    font-size: var(--rg-font-size-xs);
    line-height: 14px;
    color: var(--rg-color-inverse-muted);
    text-align: center;
}

/* ------------------------------------------------------- Inverse split */

.rg-split {
    display: flex;
    align-items: stretch;
    gap: var(--rg-space-5);
}

.rg-split__main {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--rg-space-4);
    min-width: 0;
}

@media (max-width: 575px) {
    .rg-split {
        flex-direction: column;
    }

    .rg-chart__bars {
        gap: 6px;
    }
}

/* ----------------------------------------------------------- Entrance */

@keyframes rg-enter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.rg-page-header,
.rg-grid > .rg-card,
.rg-grid > .rg-grid > .rg-card {
    animation: rg-enter var(--rg-enter-duration) var(--rg-enter-easing) both;
}

.rg-grid > :nth-child(1) { animation-delay: calc(var(--rg-enter-stagger) * 1); }
.rg-grid > :nth-child(2) { animation-delay: calc(var(--rg-enter-stagger) * 2); }
.rg-grid > :nth-child(3) { animation-delay: calc(var(--rg-enter-stagger) * 3); }
.rg-grid > :nth-child(4) { animation-delay: calc(var(--rg-enter-stagger) * 4); }
.rg-grid > :nth-child(5) { animation-delay: calc(var(--rg-enter-stagger) * 5); }
.rg-grid > :nth-child(6) { animation-delay: calc(var(--rg-enter-stagger) * 6); }
.rg-grid > :nth-child(7) { animation-delay: calc(var(--rg-enter-stagger) * 7); }
.rg-grid > :nth-child(8) { animation-delay: calc(var(--rg-enter-stagger) * 8); }
.rg-grid > :nth-child(9) { animation-delay: calc(var(--rg-enter-stagger) * 9); }
.rg-grid > :nth-child(n + 10) { animation-delay: calc(var(--rg-enter-stagger) * 10); }

@media (prefers-reduced-motion: reduce) {
    .rg-page-header,
    .rg-grid > .rg-card,
    .rg-grid > .rg-grid > .rg-card {
        animation: none;
    }
}

/* ---------------------------------------------------- Calendar preview */

rg-calendar-preview {
    display: flex;
    flex-direction: column;
    gap: var(--rg-space-4);
}

.rg-calendar-strip__link {
    text-decoration: none;
    cursor: pointer;
}

.rg-calendar-strip__link:hover,
.rg-calendar-strip__link:focus-visible {
    color: var(--rg-color-inverse-text);
    box-shadow: 0 0 0 2px var(--rg-color-surface), 0 0 0 3px var(--rg-color-brand);
    outline: none;
}

@keyframes rg-preview-swap {
    from {
        opacity: 0.35;
        transform: translateY(2px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.rg-calendar-preview__footer--swap {
    animation: rg-preview-swap 0.22s var(--rg-enter-easing);
}

@media (prefers-reduced-motion: reduce) {
    .rg-calendar-preview__footer--swap {
        animation: none;
    }
}
