:root {
    --bg: #eef3fb;
    --bg-soft: #e1eaf7;
    --panel: rgba(255, 255, 255, 0.92);
    --panel-strong: #f6f9ff;
    --ink: #1f2d45;
    --muted: #5f6b7a;
    --brand: #304c82;
    --brand-dark: #243b66;
    --accent: #f78c36;
    --accent-dark: #e2711a;
    --brand-soft: rgba(48, 76, 130, 0.12);
    --line: rgba(48, 76, 130, 0.18);
    --shadow: 0 16px 34px rgba(26, 43, 77, 0.12);
    --border: rgba(48, 76, 130, 0.18);
    --surface: #ffffff;
    --surface-raised: #f4f7fc;
    --text: #1d2635;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

body.theme-dark {
    --bg: #081320;
    --bg-soft: #0d1e31;
    --panel: rgba(10, 28, 46, 0.78);
    --panel-strong: #0f2a43;
    --ink: #e6eef8;
    --muted: #9db3c9;
    --brand: #56f7cf;
    --brand-dark: #bcffe9;
    --accent: #ff9f43;
    --accent-dark: #ff7f2a;
    --brand-soft: rgba(86, 247, 207, 0.12);
    --line: rgba(132, 173, 207, 0.24);
    --shadow: 0 20px 50px rgba(1, 12, 22, 0.45);
    --border: rgba(118, 135, 177, 0.34);
    --surface: rgba(10, 28, 46, 0.94);
    --surface-raised: rgba(21, 37, 58, 0.94);
    --text: #e6eef8;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 10% 6%, rgba(106, 145, 209, 0.16), transparent 30%),
        radial-gradient(circle at 85% 14%, rgba(48, 76, 130, 0.16), transparent 32%),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 50%, #e9f0fa 100%);
    color: var(--ink);
    font-family: "Manrope", "Segoe UI", sans-serif;
    letter-spacing: 0.01em;
}

body.theme-light {
    font-family: "Raleway", "Manrope", "Segoe UI", sans-serif;
}

body.theme-dark {
    background:
        radial-gradient(circle at 8% 8%, rgba(255, 159, 67, 0.18), transparent 26%),
        radial-gradient(circle at 88% 12%, rgba(86, 247, 207, 0.2), transparent 30%),
        radial-gradient(circle at 40% 100%, rgba(143, 232, 255, 0.08), transparent 34%),
        linear-gradient(180deg, #06101c 0%, var(--bg) 42%, #050d17 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.shell {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
    background: linear-gradient(135deg, rgba(48, 76, 130, 0.96), rgba(41, 67, 117, 0.94));
    border-bottom: 1px solid var(--line);
}

body.theme-dark .site-header {
    background: linear-gradient(135deg, rgba(9, 17, 30, 0.96), rgba(12, 23, 39, 0.94));
}

.nav-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.48rem 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.58rem;
}

.brand-mark {
    display: block;
    width: 34px;
    height: 34px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-wordmark {
    display: inline-block;
    color: #f4f8ff;
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    font-family: "Raleway", "Manrope", sans-serif;
    line-height: 1;
}

body.theme-dark .brand-wordmark {
    color: #d9fff1;
    font-family: "Tomorrow", "Space Grotesk", "Manrope", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-size: 0.98rem;
}

.nav-links {
    display: flex;
    gap: 0.72rem;
    font-size: 0.95rem;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.nav-links a {
    color: #ecf6ff;
    opacity: 0.9;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: "Raleway", "Manrope", sans-serif;
}

body.theme-dark .nav-links a {
    font-family: "Tomorrow", "Manrope", sans-serif;
}

.nav-links a:hover {
    opacity: 1;
    color: var(--brand-dark);
}

.page-shell {
    padding: 3rem 0 4rem;
}

.auth-panel {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: nowrap;
    justify-content: flex-end;
    position: relative;
}

.auth-summary {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.34rem 0.58rem;
    border-radius: 999px;
    background: rgba(159, 212, 255, 0.10);
    border: 1px solid rgba(159, 212, 255, 0.22);
    color: #ffffff;
    min-width: 0;
}

body.theme-dark .auth-summary {
    background: rgba(124, 168, 218, 0.1);
    border: 1px solid rgba(124, 168, 218, 0.22);
}

.auth-name-row,
.auth-meta-row {
    margin: 0;
}

.auth-name-row {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: nowrap;
}

.auth-name {
    font-weight: 700;
    font-size: 0.75rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.42rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
}

.auth-status-pill.active {
    background: rgba(110, 208, 150, 0.18);
    color: #d5ffdf;
}

.auth-status-pill.inactive {
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.88);
}

.auth-meta-row {
    display: none;
}

.auth-button {
    padding: 0.36rem 0.62rem;
    font-size: 0.72rem;
}

.auth-button {
    white-space: nowrap;
}

.auth-details-toggle {
    padding: 0.36rem 0.62rem;
    font-size: 0.72rem;
}

.auth-details-panel {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 2.6rem;
    z-index: 30;
    width: min(320px, calc(100vw - 2rem));
    padding: 0.72rem 0.8rem;
    border-radius: 12px;
    border: 1px solid rgba(159, 212, 255, 0.28);
    background: rgba(15, 39, 64, 0.96);
    box-shadow: 0 14px 30px rgba(3, 12, 25, 0.35);
    color: #eef6ff;
}

body.theme-dark .auth-details-panel {
    border-color: rgba(124, 168, 218, 0.32);
    background: rgba(11, 26, 43, 0.98);
}

.auth-details-heading {
    margin: 0 0 0.5rem;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #acd0ff;
    font-weight: 800;
}

.auth-details-list {
    display: grid;
    gap: 0.45rem;
    margin: 0;
}

.auth-details-list div {
    display: grid;
    gap: 0.12rem;
}

.auth-details-list dt {
    margin: 0;
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(215, 231, 250, 0.8);
}

.auth-details-list dd {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.hero,
.page-header,
.detail-hero {
    margin-bottom: 2rem;
}

.detail-copy {
    max-width: 60ch;
    color: var(--muted);
    line-height: 1.7;
}

.warning-copy {
    color: var(--accent-dark);
}

.eyebrow,
.card-label {
    margin: 0 0 0.75rem;
    color: #8fdcff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0 0 1rem;
    line-height: 1.04;
    color: var(--brand-dark);
    font-family: "Space Grotesk", "Raleway", "Manrope", sans-serif;
    letter-spacing: -0.02em;
}

body.theme-dark h1,
body.theme-dark h2 {
    color: #f4fbff;
    font-family: "Tomorrow", "Space Grotesk", "Manrope", sans-serif;
}

h1 {
    font-size: clamp(2.25rem, 5vw, 4.5rem);
    max-width: 13ch;
}

h2 {
    font-size: 1.5rem;
}

.lede {
    max-width: 60ch;
    color: var(--muted);
    font-size: 1.07rem;
    line-height: 1.75;
}

.cta-row {
    margin-top: 1.5rem;
}

.button {
    display: inline-block;
    padding: 0.82rem 1.2rem;
    border-radius: 999px;
    font-weight: 700;
    border: 1px solid transparent;
    transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.button.primary {
    background: linear-gradient(120deg, var(--accent), #ffbf66);
    color: #172234;
    box-shadow: 0 12px 26px rgba(255, 159, 67, 0.3);
}

.button.primary:hover {
    background: linear-gradient(120deg, var(--accent-dark), #ffac50);
    transform: translateY(-1px);
}

.button.secondary {
    background: var(--brand-soft);
    color: var(--brand-dark);
    border-color: var(--line);
}

.button.secondary:hover {
    background: rgba(48, 76, 130, 0.18);
    transform: translateY(-1px);
}

body.theme-dark .button.secondary:hover {
    background: rgba(86, 247, 207, 0.22);
}

.theme-toggle-button {
    padding: 0.34rem 0.62rem;
    font-size: 0.7rem;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.45);
}

.theme-toggle-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

body.theme-light .theme-toggle-button {
    color: #f6fbff;
}

body.theme-dark .theme-toggle-button {
    background: rgba(86, 247, 207, 0.14);
    border-color: rgba(86, 247, 207, 0.38);
    color: #cbffe9;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.card-grid.single {
    grid-template-columns: minmax(280px, 620px);
}

.card,
.featured-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

.metric {
    margin: 1rem 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.meta-row {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.meta-pill {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 0.78rem;
    font-weight: 700;
}

.meta-pill.accent {
    background: rgba(255, 159, 67, 0.2);
    color: #8f4d00;
}

body.theme-dark .meta-pill.accent {
    color: #ffd5a6;
}

.muted {
    color: var(--muted);
}

.refresh-indicator {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 0.78rem;
    font-weight: 700;
    animation: refresh-pulse 1.6s ease-in-out infinite;
    vertical-align: middle;
}

.refresh-indicator.muted {
    background: rgba(95, 107, 122, 0.12);
    color: var(--muted);
    animation: none;
}

@keyframes refresh-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.45; }
}

.text-link {
    color: var(--brand);
    font-weight: 700;
}

.muted-link {
    color: var(--muted);
}

.action-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.action-stack {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.featured-card {
    background:
        radial-gradient(circle at top right, rgba(106, 145, 209, 0.2), transparent 42%),
        linear-gradient(180deg, rgba(244, 248, 255, 0.92), rgba(234, 241, 252, 0.9));
}

body.theme-dark .featured-card {
    background:
        radial-gradient(circle at top right, rgba(86, 247, 207, 0.18), transparent 42%),
        linear-gradient(180deg, rgba(13, 36, 58, 0.9), rgba(8, 24, 40, 0.9));
}

.breadcrumb-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1.5rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.tools-feedback {
    margin-bottom: 1rem;
}

.tools-feedback.success {
    border-color: rgba(84, 198, 139, 0.5);
    background: rgba(84, 198, 139, 0.14);
}

.tools-feedback.error {
    border-color: rgba(255, 127, 42, 0.5);
    background: rgba(255, 127, 42, 0.14);
}

.internal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
}

.internal-head {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: flex-start;
}

.badge-stack {
    justify-content: flex-end;
}

.internal-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.internal-info-list {
    margin: 0;
}

.checkbox-row {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    color: var(--muted);
    font-weight: 600;
}

.checkbox-row input {
    accent-color: var(--accent);
}

.internal-refresh-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

@media (max-width: 920px) {
    .nav-links {
        gap: 0.55rem;
    }

    .nav-links a {
        font-size: 0.68rem;
    }

    .auth-name {
        max-width: 92px;
    }
}

.breadcrumb-row a {
    color: var(--brand);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.user-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.9fr);
    gap: 1.25rem;
    align-items: stretch;
}

.hero-panel {
    min-height: 100%;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.badge-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.compact-row {
    margin-bottom: 0;
}

.badge {
    display: inline-block;
    padding: 0.38rem 0.75rem;
    border-radius: 999px;
    background: rgba(79, 195, 247, 0.12);
    color: #d6f4ff;
    font-size: 0.82rem;
    font-weight: 700;
}

.badge.accent {
    background: rgba(255, 159, 67, 0.18);
    color: #ffd3a0;
}

.kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    padding: 1.1rem 1.2rem;
}

.kpi-card strong {
    display: block;
    margin-top: 0.35rem;
    color: var(--brand-dark);
    font-size: 1.15rem;
}

.content-stack {
    display: grid;
    gap: 1.25rem;
}

.user-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.highlight-card {
    background:
        radial-gradient(circle at top left, rgba(106, 145, 209, 0.15), transparent 38%),
        linear-gradient(180deg, rgba(247, 250, 255, 0.95), rgba(238, 244, 253, 0.92));
}

body.theme-dark .highlight-card {
    background:
        radial-gradient(circle at top left, rgba(255, 159, 67, 0.14), transparent 38%),
        linear-gradient(180deg, rgba(16, 39, 63, 0.93), rgba(11, 29, 46, 0.9));
}

.section-head {
    margin-bottom: 1rem;
}

.section-head .eyebrow {
    margin-bottom: 0.5rem;
}

.short {
    max-width: none;
}

.info-list {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.rarity-focus {
    padding: 1.5rem;
}

.rarity-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.rarity-item {
    padding: 1.1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(248, 251, 255, 0.94);
}

body.theme-dark .rarity-item {
    background: rgba(8, 33, 53, 0.9);
}

.rarity-item h3 {
    margin: 0 0 0.75rem;
    color: var(--brand-dark);
    line-height: 1.25;
}

.dev-toggle-row {
    justify-content: space-between;
}

.dev-toggle-row h1 {
    margin-bottom: 0;
}

.json-panel {
    margin-top: 1.25rem;
}

.code-block {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
    border-radius: var(--radius-md);
    background: #1f2a44;
    color: #eef3fb;
    font-size: 0.88rem;
    line-height: 1.6;
}

.top-grid {
    margin-bottom: 1.25rem;
}

.definition-list {
    display: grid;
    gap: 0.9rem;
    margin: 0;
}

.definition-list div {
    display: grid;
    gap: 0.2rem;
}

.definition-list dt {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.definition-list dd {
    margin: 0;
    line-height: 1.5;
}

.definition-list.compact {
    gap: 0.7rem;
}

.hero-preview,
.media-placeholder {
    width: 100%;
    min-height: 240px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
}

.hero-preview {
    object-fit: cover;
}

.media-placeholder {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(48, 76, 130, 0.94), rgba(36, 59, 102, 0.94));
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.video-mode {
    background: linear-gradient(135deg, rgba(48, 76, 130, 0.94), rgba(249, 104, 84, 0.92));
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.8rem;
}

.stat-box {
    padding: 0.95rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(48, 76, 130, 0.08);
}

body.theme-dark .stat-box {
    background: rgba(79, 195, 247, 0.09);
}

.stat-box strong {
    display: block;
    margin-top: 0.25rem;
    font-size: 1.15rem;
    color: var(--brand-dark);
}

.stat-label {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.rarity-scroll {
    overflow-x: auto;
}

.rarity-table-v2 {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
}

.rarity-table-v2 th,
.rarity-table-v2 td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.rarity-table-v2 th {
    color: var(--brand-dark);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.bullet-list {
    margin: 0;
    padding-left: 1.2rem;
    line-height: 1.7;
}

.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.asset-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.asset-preview {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(232, 238, 248, 0.45);
}

.asset-meta-list {
    gap: 0.7rem;
}

.asset-action-row {
    margin-top: auto;
}

.value-break {
    overflow-wrap: anywhere;
}

.edition-legend {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.muted-badge {
    background: rgba(95, 107, 122, 0.14);
    color: var(--muted);
}

.group-browser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

.group-browser-card {
    padding: 1.2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(248, 251, 255, 0.95);
}

body.theme-dark .group-browser-card {
    background: rgba(10, 30, 48, 0.9);
}

.group-browser-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.group-browser-head h3 {
    margin: 0;
    color: var(--brand-dark);
}

.compact-stats {
    margin-bottom: 0.9rem;
}

.edition-panel {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.edition-controls {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.compact-actions {
    gap: 0.6rem;
}

.small-button {
    padding: 0.6rem 0.9rem;
    font-size: 0.85rem;
}

.edition-grid-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 0.55rem;
}

.edition-slot {
    display: grid;
    gap: 0.2rem;
    padding: 0.65rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    text-align: center;
    min-height: 76px;
    align-content: center;
}

.edition-slot strong {
    color: var(--brand-dark);
    font-size: 0.95rem;
}

.edition-slot span {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.edition-slot.is-active {
    background: rgba(58, 176, 119, 0.2);
    border-color: rgba(84, 198, 139, 0.5);
}

.edition-slot.is-burned {
    background: rgba(255, 127, 42, 0.2);
    border-color: rgba(255, 168, 94, 0.5);
}

.edition-slot.is-missing {
    background: rgba(95, 107, 122, 0.08);
    border-style: dashed;
}

.edition-slot:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(48, 76, 130, 0.08);
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.9rem;
    margin-top: 1rem;
}

.control-grid label {
    display: grid;
    gap: 0.45rem;
}

.control-grid select {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink);
}

body.theme-dark .control-grid select {
    background: rgba(11, 32, 52, 0.95);
}

.control-actions {
    align-self: end;
}

.pagination-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.top-pagination {
    margin-top: 1rem;
}

.pagination-footer {
    margin-top: 1.25rem;
}

.owner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.owner-card {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(248, 251, 255, 0.95);
}

body.theme-dark .owner-card {
    background: rgba(9, 31, 50, 0.9);
}

.reveal-up {
    opacity: 0;
    transform: translateY(20px);
    animation: reveal-up 520ms ease forwards;
}

.reveal-up.delay-1 { animation-delay: 90ms; }
.reveal-up.delay-2 { animation-delay: 180ms; }
.reveal-up.delay-3 { animation-delay: 270ms; }

@keyframes reveal-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.owner-card h3 {
    margin: 0 0 0.75rem;
    color: var(--brand-dark);
}

.wallet-nav-panel {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.wallet-nav-address,
.wallet-nav-connect,
.wallet-nav-disconnect {
    white-space: nowrap;
    font-size: 0.72rem;
    padding: 0.36rem 0.62rem;
}

.wallet-nav-error {
    display: none;
}

.wallet-page {
    display: grid;
    gap: 1rem;
}

.wallet-address-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0;
    color: var(--muted);
}

.wallet-address-code {
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.wallet-assets-section {
    display: grid;
    gap: 1rem;
}

.wallet-summary-strip {
    display: grid;
    gap: 0.9rem;
}

.wallet-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.8rem;
}

.wallet-summary-card,
.wallet-assets-toolbar,
.wallet-asset-card,
.wallet-connect-prompt {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow);
}

body.theme-dark .wallet-summary-card,
body.theme-dark .wallet-assets-toolbar,
body.theme-dark .wallet-asset-card,
body.theme-dark .wallet-connect-prompt {
    background: rgba(10, 28, 46, 0.92);
}

.wallet-summary-card {
    padding: 0.95rem 1rem;
}

.wallet-summary-label,
.wallet-summary-detail,
.wallet-rarity-heading,
.wallet-summary-muted,
.wallet-asset-collection,
.wallet-asset-description,
.wallet-asset-count,
.wallet-loading-msg,
.wallet-empty-msg,
.wallet-error-msg,
.wallet-error-message,
.wallet-no-wallet-hint {
    margin: 0;
    color: var(--muted);
}

.wallet-summary-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.wallet-summary-value {
    margin: 0.3rem 0 0.15rem;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--brand-dark);
}

.wallet-summary-detail {
    font-size: 0.82rem;
}

.wallet-rarity-summary {
    display: grid;
    gap: 0.55rem;
}

.wallet-rarity-heading {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.wallet-rarity-chip-row,
.wallet-asset-meta-row,
.wallet-asset-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.wallet-rarity-chip,
.wallet-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 0.75rem;
    font-weight: 700;
}

.wallet-meta-pill-accent {
    background: rgba(247, 140, 54, 0.14);
    color: var(--accent-dark);
}

.wallet-assets-toolbar {
    display: grid;
    gap: 0.8rem;
    padding: 0.95rem 1rem;
}

.wallet-filter-row {
    display: grid;
    gap: 0.65rem;
}

.wallet-filter-row-primary {
    grid-template-columns: minmax(280px, 2.2fr) minmax(160px, 1fr) minmax(180px, 1.2fr);
}

.wallet-filter-row-secondary {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    align-items: center;
}

.wallet-search-input,
.wallet-select-input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink);
    padding: 0.82rem 0.9rem;
    font: inherit;
}

body.theme-dark .wallet-search-input,
body.theme-dark .wallet-select-input {
    background: rgba(11, 32, 52, 0.95);
    color: var(--ink);
}

.wallet-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 46px;
    padding: 0 0.2rem;
    color: var(--ink);
    font-weight: 700;
}

.wallet-asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.85rem;
}

.wallet-asset-card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 0.9rem;
    padding: 0.8rem;
    align-items: start;
}

.wallet-asset-img-wrap {
    width: 96px;
    height: 96px;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(48, 76, 130, 0.08);
    display: grid;
    place-items: center;
}

.wallet-asset-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wallet-asset-img-placeholder {
    padding: 0.6rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.35;
}

.wallet-asset-info {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.wallet-asset-topline {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 0.75rem;
}

.wallet-asset-name {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--ink);
}

.wallet-asset-mint {
    white-space: nowrap;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: rgba(48, 76, 130, 0.08);
    color: var(--muted);
    font-size: 0.73rem;
}

.wallet-asset-collection {
    font-size: 0.82rem;
}

.wallet-asset-collection-empty {
    opacity: 0.7;
}

.wallet-dc3-block {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.wallet-dc3-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    background: rgba(48, 76, 130, 0.12);
    color: var(--brand-dark);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wallet-dc3-badge.is-muted {
    color: var(--muted);
    background: rgba(95, 107, 122, 0.12);
}

.wallet-dc3-link,
.wallet-inline-link {
    color: var(--brand-dark);
    font-size: 0.82rem;
    font-weight: 700;
}

.wallet-asset-description {
    font-size: 0.82rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wallet-pagination,
.wallet-disconnect-row {
    display: flex;
    justify-content: center;
}

.wallet-connect-prompt {
    padding: 1.2rem;
    display: grid;
    gap: 0.75rem;
}

.wallet-connect-lead {
    margin: 0;
    color: var(--ink);
    font-weight: 600;
}

.wallet-error-message,
.wallet-error-msg {
    color: #c5532d;
}

@media (max-width: 720px) {
    .nav-shell {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.55rem;
    }

    .brand-mark {
        width: 32px;
        height: 32px;
    }

    .brand-wordmark {
        font-size: 0.98rem;
    }

    .header-actions,
    .nav-links,
    .auth-panel,
    .wallet-nav-panel {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .auth-summary {
        max-width: 100%;
    }

    .auth-details-panel {
        right: 0;
    }

    .page-shell {
        padding-top: 2rem;
    }

    .user-hero,
    .kpi-strip {
        grid-template-columns: 1fr;
    }

    .pagination-row {
        align-items: flex-start;
    }

    .wallet-filter-row-primary,
    .wallet-filter-row-secondary,
    .wallet-asset-grid {
        grid-template-columns: 1fr;
    }

    .wallet-asset-card {
        grid-template-columns: 80px minmax(0, 1fr);
    }

    .wallet-asset-img-wrap {
        width: 80px;
        height: 80px;
    }
}

/* Terminal mode: denser, data-first layout for overview/internal surfaces. */
body.page-mode-terminal .page-shell {
    padding-top: 2.2rem;
}

body.page-mode-terminal h1 {
    font-size: clamp(1.9rem, 3.8vw, 2.8rem);
    max-width: none;
}

body.page-mode-terminal h2 {
    font-size: 1.22rem;
}

body.page-mode-terminal .lede,
body.page-mode-terminal .detail-copy {
    font-size: 0.96rem;
    line-height: 1.65;
}

body.page-mode-terminal .card,
body.page-mode-terminal .featured-card {
    border-radius: 14px;
    padding: 1.1rem;
    box-shadow: 0 12px 28px rgba(1, 11, 21, 0.36);
}

body.page-mode-terminal .content-stack {
    gap: 0.95rem;
}

body.page-mode-terminal .internal-grid {
    gap: 0.9rem;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

body.page-mode-terminal .meta-pill,
body.page-mode-terminal .refresh-indicator {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

body.page-mode-terminal .button {
    padding: 0.58rem 0.9rem;
    font-size: 0.82rem;
}

body.page-mode-terminal .definition-list dt {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
}

body.page-mode-terminal .definition-list dd {
    font-size: 0.9rem;
}

body.page-mode-terminal .overview-controls {
    gap: 0.75rem;
    padding: 0.72rem 0.95rem;
}

body.page-mode-terminal .overview-search {
    min-width: 200px;
    padding: 0.34rem 0.62rem;
    border-radius: 8px;
    font-size: 0.84rem;
}

body.page-mode-terminal .overview-count {
    font-size: 0.76rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

body.page-mode-terminal .overview-table {
    font-size: 0.82rem;
}

body.page-mode-terminal .overview-table thead th {
    padding: 0.48rem 0.62rem;
    font-size: 0.69rem;
    letter-spacing: 0.1em;
}

body.page-mode-terminal .overview-table tbody td {
    padding: 0.5rem 0.62rem;
}

body.page-mode-terminal .rarity-pill {
    padding: 0.12rem 0.42rem;
    border-radius: 8px;
    font-size: 0.72rem;
}

body.page-mode-terminal .rarity-count {
    font-size: 0.7rem;
}

body.page-mode-terminal .section-head {
    margin-bottom: 0.7rem;
}

body.page-mode-terminal .eyebrow,
body.page-mode-terminal .card-label {
    font-size: 0.72rem;
    margin-bottom: 0.42rem;
}
