/* ============================================================
   /v3/css/rich.css — XRPName Rich List
   Hallmark · macrostructure: data-first · mood: engineering

   All colour, radius, easing, typography routes through
   tokens.css (--v3-*).  No raw hex except the gradient brand
   accent reused from the rest of v3.
   ============================================================ */

/* shell + hero */
.v3-rich-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 40px 24px 64px;
    font-family: var(--v3-sans);
    color: var(--v3-ink-soft);
}

.v3-rich-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: start;
    padding-bottom: 32px;
    margin-bottom: 0;
}
.v3-rich-hero-main { min-width: 0; }

.v3-rich-title {
    font-family: var(--v3-display);
    font-size: clamp(28px, 3.2vw, 40px);
    font-weight: 600;
    color: var(--v3-ink);
    letter-spacing: -0.03em;
    line-height: 1;
    margin: 0;
}
.v3-rich-subtitle {
    font-family: var(--v3-sans);
    font-size: 14px;
    color: var(--v3-muted);
    margin: 8px 0 0;
    max-width: 44ch;
    line-height: 1.5;
}

.v3-rich-hero-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.v3-rich-btn {
    background: transparent;
    border: 1px solid var(--v3-line);
    color: var(--v3-ink-soft);
    padding: 9px 14px;
    border-radius: var(--v3-radius);
    font-family: var(--v3-sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: background-color 0.15s var(--v3-ease),
                border-color 0.15s var(--v3-ease);
}
.v3-rich-btn:hover {
    background: var(--v3-bg-3);
    border-color: var(--v3-line-2);
    color: var(--v3-ink);
}
.v3-rich-btn-primary {
    background: var(--v3-accent);
    border-color: var(--v3-accent);
    color: var(--v3-bg);
    font-weight: 600;
}
.v3-rich-btn-primary:hover {
    background: var(--v3-accent-soft);
    border-color: var(--v3-accent-soft);
    color: var(--v3-bg);
}

/* inline stats inside hero — definition list, no cards */
.v3-rich-stats-inline {
    display: flex;
    gap: 32px;
    margin: 22px 0 0;
    padding: 0;
    flex-wrap: wrap;
}
.v3-rich-stats-inline .v3-rich-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
}
.v3-rich-stats-inline dt {
    font-family: var(--v3-mono);
    font-size: 10px;
    color: var(--v3-mute);
    letter-spacing: var(--v3-track-caption);
    text-transform: uppercase;
    font-weight: 500;
}
.v3-rich-stats-inline dd {
    font-family: var(--v3-display);
    font-size: 22px;
    font-weight: 600;
    color: var(--v3-ink);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    margin: 0;
    line-height: 1.1;
}

/* toolbar — top strip of the single table card, hairline below */
.v3-rich-toolbar {
    display: flex;
    gap: 0;
    padding: 10px 14px;
    border-bottom: 1px solid var(--v3-line);
    flex-wrap: nowrap;
    align-items: stretch;
    background: transparent;
    min-height: 56px;
}
/* Search input — icon baked in as background SVG so there's zero
   chance of layout stacking issues.  Guaranteed left padding
   leaves 20px of breathing room before text starts.                */
.v3-rich-search-input {
    flex: 1;
    min-width: 0;
    background: transparent url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7689' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3e%3ccircle cx='11' cy='11' r='7'/%3e%3cline x1='21' y1='21' x2='16.65' y2='16.65'/%3e%3c/svg%3e") no-repeat 2px center;
    border: 0;
    outline: 0;
    appearance: none;
    -webkit-appearance: none;
    color: var(--v3-ink);
    font-family: var(--v3-sans);
    font-size: 14px;
    padding: 0 12px 0 24px;      /* 24px = 2 (bg-x) + 14 (icon w) + 8 gap */
    line-height: 44px;
    height: 44px;
    box-sizing: border-box;
    border-radius: 0;
    box-shadow: none;
    transition: background-image 0.15s var(--v3-ease);
}
.v3-rich-search-input::placeholder { color: var(--v3-mute); }
.v3-rich-search-input:focus {
    outline: 0;
    box-shadow: none;
    /* swap icon stroke colour to accent on focus */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2325aae1' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3e%3ccircle cx='11' cy='11' r='7'/%3e%3cline x1='21' y1='21' x2='16.65' y2='16.65'/%3e%3c/svg%3e");
}
.v3-rich-search-input::placeholder { color: var(--v3-mute); }

/* Divider between search and select */
.v3-rich-toolbar > * + * {
    border-left: 1px solid var(--v3-line);
}

/* Select — flat too, chevron only */
.v3-rich-select {
    background: transparent;
    border: 0;
    color: var(--v3-ink-soft);
    padding: 0 32px 0 16px;
    font-family: var(--v3-sans);
    font-size: 13px;
    cursor: pointer;
    min-width: 170px;
    height: 48px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7689' stroke-width='2.5'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: color 0.15s var(--v3-ease), background-color 0.15s var(--v3-ease);
}
.v3-rich-select:hover {
    color: var(--v3-ink);
    background-color: var(--v3-bg-3);
}
.v3-rich-select:focus {
    outline: none;
    color: var(--v3-ink);
}

/* table — single bordered card wrapping toolbar + head + rows */
.v3-rich-table {
    background: var(--v3-glass-bg);
    border: 1px solid var(--v3-line);
    border-radius: var(--v3-radius-lg);
    overflow: hidden;
}
.v3-rich-head,
.v3-rich-row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 100px 180px 90px;
    gap: 20px;
    padding: 16px 20px;
    align-items: center;
}
.v3-rich-head {
    border-bottom: 1px solid var(--v3-line);
    font-family: var(--v3-mono);
    font-size: 10px;
    letter-spacing: var(--v3-track-caption);
    text-transform: uppercase;
    color: var(--v3-mute);
    font-weight: 500;
    padding: 14px 20px;
    background: transparent;
}
.v3-rich-head-domains,
.v3-rich-count { text-align: right; }
.v3-rich-row {
    border-bottom: 1px solid var(--v3-line);
    transition: background-color 0.15s var(--v3-ease);
    position: relative;
}
.v3-rich-row:last-child { border-bottom: 0; }
.v3-rich-row:hover { background: var(--v3-bg-3); }

/* rank — just a number, no badge, no box.  Tabular mono. */
.v3-rich-rank {
    font-family: var(--v3-mono);
    font-weight: 500;
    font-size: 15px;
    letter-spacing: -0.02em;
    color: var(--v3-mute);
    text-align: center;
    font-variant-numeric: tabular-nums;
    background: transparent;
    border: 0;
    padding: 0;
    width: auto;
    height: auto;
    display: block;
}
/* Top 3 bumped up in weight / colour, no chrome. */
.v3-rich-rank-gold {
    color: var(--v3-accent);
    font-weight: 600;
    font-size: 16px;
}
.v3-rich-rank-silver,
.v3-rich-rank-bronze {
    color: var(--v3-ink-soft);
    font-weight: 500;
}

/* holder cell */
.v3-rich-holder {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.v3-rich-holder-head {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
/* avatar — no border, no outer bg.  Image fills a soft square;
   fallback is bare mono initials, no fill.  Hard-size with
   !important to prevent any BE-returned image from exploding
   to natural resolution.                                          */
.v3-rich-avatar {
    width: 36px !important;
    height: 36px !important;
    max-width: 36px;
    max-height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--v3-mute);
    font-family: var(--v3-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0;
    object-fit: cover;
    overflow: hidden;
    background: transparent;
    border: 0;
}
/* Safety net — nothing inside a row should ever render larger
   than its cell.  Catches stale JS / unexpected BE responses.   */
.v3-rich-row img,
.v3-rich-row svg,
.v3-rich-samples img,
.v3-rich-samples svg {
    max-width: 100%;
    height: auto;
}
.v3-rich-avatar-img { background: transparent; }
.v3-rich-avatar-fb {
    background: transparent;
    color: var(--v3-mute);
    border: 1px dashed var(--v3-line);
}

.v3-rich-holder-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.v3-rich-holder-title {
    font-size: 15px;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.v3-rich-primary {
    font-family: var(--v3-sans);
    color: var(--v3-ink);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
    transition: color 0.15s var(--v3-ease);
}
.v3-rich-primary:hover { color: var(--v3-accent); }
.v3-rich-primary-none {
    color: var(--v3-ink-soft);
    font-family: var(--v3-mono);
    font-size: 13px;
    font-weight: 400;
}
.v3-rich-holder-sub { font-size: 11.5px; color: var(--v3-mute); }

.v3-rich-addr {
    color: var(--v3-mute);
    font-family: var(--v3-mono);
    font-size: 11.5px;
    text-decoration: none;
    transition: color 0.15s var(--v3-ease);
}
.v3-rich-addr:hover { color: var(--v3-muted); }
.v3-rich-addr-muted {
    color: var(--v3-mute);
    font-family: var(--v3-mono);
    font-size: 11.5px;
}

/* sample strip — text-chip list of 3 notable domain names.
   Lives inline under the holder name block.  Readable, carries
   actual signal; replaces the identical-purple avatar roulette.   */
.v3-rich-samples {
    display: flex;
    align-items: center;
    padding-left: 48px;      /* avatar 36 + gap 12 — aligns under holder text */
    margin-top: 2px;
    gap: 6px;
    flex-wrap: wrap;
    font-family: var(--v3-mono);
    font-size: 11px;
    line-height: 1.5;
    color: var(--v3-mute);
}
.v3-rich-sample-name {
    color: var(--v3-ink-soft);
    text-decoration: none;
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s var(--v3-ease);
}
.v3-rich-sample-name:hover { color: var(--v3-accent); }
.v3-rich-sample-sep {
    color: var(--v3-line-2);
    user-select: none;
}
.v3-rich-sample-more {
    color: var(--v3-mute);
    margin-left: 2px;
}

/* count + share */
.v3-rich-count {
    font-family: var(--v3-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--v3-ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}
.v3-rich-share { min-width: 0; }
.v3-rich-share-pct {
    font-family: var(--v3-mono);
    font-size: 11px;
    color: var(--v3-muted);
    margin-bottom: 5px;
    font-variant-numeric: tabular-nums;
}
.v3-rich-share-bar {
    height: 3px;
    background: var(--v3-line);
    border-radius: 999px;
    overflow: hidden;
}
.v3-rich-share-bar-fill {
    height: 100%;
    background: var(--v3-accent);
    border-radius: 999px;
    transition: width 0.4s var(--v3-ease);
}

/* actions */
.v3-rich-actions { text-align: right; }
.v3-rich-view {
    font-family: var(--v3-sans);
    color: var(--v3-accent);
    font-size: 12.5px;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: var(--v3-radius);
    transition: background-color 0.15s var(--v3-ease);
}
.v3-rich-view:hover { background: var(--v3-glass-edge-cyan); }
.v3-rich-view i {
    font-size: 10px;
    transition: transform 0.15s var(--v3-ease);
}
.v3-rich-view:hover i { transform: translateX(2px); }

/* pager */
.v3-rich-pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    font-family: var(--v3-mono);
    font-size: 12px;
    color: var(--v3-muted);
    flex-wrap: wrap;
    gap: 10px;
}
.v3-rich-pager-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}
.v3-rich-pager-btn {
    background: transparent;
    border: 1px solid var(--v3-line);
    color: var(--v3-ink-soft);
    padding: 7px 12px;
    border-radius: var(--v3-radius);
    font-family: var(--v3-sans);
    font-size: 12.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.15s var(--v3-ease),
                border-color 0.15s var(--v3-ease);
}
.v3-rich-pager-btn:hover:not(:disabled) {
    background: var(--v3-bg-3);
    border-color: var(--v3-line-2);
}
.v3-rich-pager-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.v3-rich-pager-pos {
    color: var(--v3-mute);
    padding: 0 6px;
    font-variant-numeric: tabular-nums;
}

/* empty / error */
.v3-rich-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--v3-mute);
    font-family: var(--v3-sans);
    font-size: 14px;
}
.v3-rich-empty i {
    display: block;
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--v3-line-2);
}

/* skeleton — same grid shape as real row, soft breathing shimmer */
@keyframes v3RichPulse {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 1; }
}
.v3-rich-row-skel {
    pointer-events: none;
    animation: v3RichPulse 1.6s ease-in-out infinite;
}
.v3-rich-row-skel:nth-child(2) { animation-delay: 0.08s; }
.v3-rich-row-skel:nth-child(3) { animation-delay: 0.16s; }
.v3-rich-row-skel:nth-child(4) { animation-delay: 0.24s; }
.v3-rich-row-skel:nth-child(5) { animation-delay: 0.32s; }
.v3-rich-row-skel:nth-child(6) { animation-delay: 0.40s; }
.v3-rich-row-skel:nth-child(7) { animation-delay: 0.48s; }
.v3-rich-row-skel:nth-child(8) { animation-delay: 0.56s; }
.v3-rich-row-skel:nth-child(9) { animation-delay: 0.64s; }
.v3-rich-row-skel:nth-child(10) { animation-delay: 0.72s; }

.v3-skel-rank {
    width: 24px;
    height: 14px;
    border-radius: 3px;
    background: var(--v3-line);
    margin: 0 auto;
}
.v3-skel-holder {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.v3-skel-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--v3-bg-3);
    flex-shrink: 0;
}
.v3-skel-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1;
}
.v3-skel-bar {
    background: var(--v3-line);
    border-radius: 3px;
    height: 11px;
}
.v3-skel-primary { max-width: 220px; }
.v3-skel-addr {
    width: 110px;
    height: 9px;
}
.v3-skel-count {
    height: 14px;
    width: 42px;
    background: var(--v3-line);
    border-radius: 3px;
    margin-left: auto;
}
.v3-skel-share {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.v3-skel-share-pct {
    width: 36px;
    height: 9px;
}
.v3-skel-share-track {
    width: 100%;
    height: 3px;
    border-radius: 999px;
}

/* attribution */
.v3-rich-attribution {
    text-align: right;
    margin-top: 14px;
    font-family: var(--v3-mono);
    font-size: 10.5px;
    color: var(--v3-mute);
    letter-spacing: 0.02em;
}
.v3-rich-attribution a {
    color: var(--v3-muted);
    text-decoration: none;
    transition: color 0.15s var(--v3-ease);
}
.v3-rich-attribution a:hover { color: var(--v3-ink-soft); }

/* responsive */
@media (max-width: 900px) {
    .v3-rich-head,
    .v3-rich-row {
        grid-template-columns: 44px minmax(0, 1fr) 72px 60px;
        gap: 14px;
        padding: 14px 16px;
    }
    .v3-rich-head { padding: 12px 16px; }
    .v3-rich-head-share,
    .v3-rich-share,
    .v3-skel-share { display: none; }
    .v3-rich-samples { padding-left: 48px; }
    .v3-rich-stats-inline { gap: 24px; }
    .v3-rich-stats-inline dd { font-size: 20px; }
}
@media (max-width: 720px) {
    .v3-rich-shell { padding: 24px 14px 48px; }
    .v3-rich-hero {
        grid-template-columns: 1fr;
        gap: 16px;
        padding-bottom: 22px;
        margin-bottom: 16px;
    }
    .v3-rich-hero-actions { width: 100%; }
    .v3-rich-btn { flex: 1; justify-content: center; }
    .v3-rich-stats-inline { gap: 20px; margin-top: 18px; }
    .v3-rich-stats-inline dd { font-size: 18px; }
    /* Mobile toolbar: 2 controls get a subtle tinted frame lighter
       than the card border, inset padding so they don't touch the
       card edge.  Vertical rule between them is removed.            */
    .v3-rich-toolbar {
        flex-wrap: nowrap;
        padding: 12px;
        gap: 8px;
        min-height: auto;
    }
    .v3-rich-toolbar > * + * { border-left: 0; }
    .v3-rich-search-input,
    .v3-rich-select {
        flex: 1 1 auto;
        min-width: 0;
        height: 42px;
        line-height: 42px;
        font-size: 13.5px;
        background-color: rgba(255, 255, 255, 0.025);
        border: 1px solid rgba(255, 255, 255, 0.04);
        border-radius: var(--v3-radius);
        box-sizing: border-box;
    }
    .v3-rich-search-input {
        padding: 0 10px 0 32px;
        background-position: 10px center;
    }
    .v3-rich-search-input:focus {
        background-color: rgba(37, 170, 225, 0.05);
        border-color: rgba(37, 170, 225, 0.3);
    }
    .v3-rich-select {
        flex: 0 0 auto;
        max-width: 46%;
        padding: 0 32px 0 12px;
        background-position: right 10px center;
        background-size: 11px;
    }
    .v3-rich-select:hover,
    .v3-rich-select:focus {
        background-color: rgba(255, 255, 255, 0.04);
        outline: none;
    }
    .v3-rich-head,
    .v3-rich-row {
        grid-template-columns: 36px minmax(0, 1fr) 56px;
        gap: 12px;
        padding: 14px 14px;
    }
    .v3-rich-head { padding: 12px 14px; }
    .v3-rich-samples { padding-left: 42px; }
    .v3-rich-head-count,
    .v3-rich-count { text-align: right; }
    .v3-rich-head-actions,
    .v3-rich-actions { display: none; }
    .v3-rich-rank { font-size: 13px; }
    .v3-rich-rank-gold { font-size: 14px; }
    .v3-rich-avatar { width: 32px; height: 32px; }
    .v3-rich-primary { max-width: 160px; font-size: 14px; }
    .v3-rich-count { font-size: 16px; }
    .v3-rich-row { cursor: pointer; }
    .v3-skel-avatar { width: 32px; height: 32px; }
    .v3-rich-samples { padding-left: 44px; }
}
