/* ========================================
   WORLD: ARCHIVE (Stein's Archive)
   Dark terminal aesthetic, clean layout.
   Lore -> Wall -> Quests funnel.
======================================== */

/* ---- HERO ---- */
.archive-hero {
    position: relative;
    padding: calc(var(--nav-height) + 56px) 0 80px;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

/* ---- HERO :: MAIN SHEET (two-column) ---- */
.archive-hero__sheet {
    max-width: var(--container-max);
    width: 100%;
    margin: 24px auto 0;
    padding: 0 var(--container-padding);
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
    gap: clamp(40px, 6vw, 96px);
    align-items: start;
    position: relative;
}

.archive-hero__main {
    display: flex;
    flex-direction: column;
    gap: 28px;
    max-width: 640px;
    position: relative;
}

/* ---- HERO :: TITLE BLOCK ---- */
.archive-hero__title-block {
    position: relative;
}

.archive-hero__title {
    margin: 0;
    line-height: 0.9;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.archive-hero__title-script {
    font-family: 'Over the Rainbow', 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(56px, 9vw, 104px);
    line-height: 1;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    align-self: flex-start;
    padding-left: 4px;
}

.archive-hero__title-serif {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 800;
    font-size: clamp(88px, 14vw, 168px);
    line-height: 0.92;
    color: var(--accent-primary);
    letter-spacing: -0.02em;
    align-self: flex-start;
}

.archive-hero__title-period {
    color: var(--accent-primary);
}

.archive-hero__annotation {
    position: absolute;
    top: 18%;
    left: clamp(220px, 28vw, 340px);
    font-family: 'Caveat', cursive;
    font-size: clamp(20px, 2vw, 26px);
    color: var(--accent-primary);
    line-height: 1.1;
    transform: rotate(-4deg);
    white-space: nowrap;
    pointer-events: none;
}

.archive-hero__annotation::after {
    content: '';
    display: block;
    width: 70%;
    height: 2px;
    margin-top: 2px;
    background: var(--accent-primary);
    border-radius: 2px;
    opacity: 0.8;
}

/* ---- HERO :: META + DESC ---- */
.archive-hero__meta {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 2px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin: 4px 0 0;
}

.archive-hero__desc {
    font-family: var(--font-display);
    font-size: clamp(18px, 1.6vw, 22px);
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    margin: 0;
    max-width: 540px;
    position: relative;
}

.archive-hero__desc-accent {
    color: var(--accent-primary);
    font-style: italic;
    font-weight: 500;
    position: relative;
    white-space: nowrap;
}

.archive-hero__desc-underline {
    position: absolute;
    left: -2%;
    right: -2%;
    bottom: -10px;
    width: 104%;
    height: 12px;
    color: var(--accent-primary);
    pointer-events: none;
    overflow: visible;
}

.archive-hero__note {
    align-self: flex-end;
    margin-top: 12px;
    margin-right: clamp(0px, 4vw, 60px);
    max-width: 260px;
    position: relative;
    z-index: 2;
}

.archive-hero__note-anchor {
    /* Wrapping span so JS can measure the "More" word's left edge as the arrow tail */
    display: inline-block;
}

/* Curved annotation arrow: tail at "More" word, tip pointing at OrangeVerse.
   Path is rebuilt by JS (drawArchiveArrow) on load + resize so positions
   always line up regardless of viewport, font load, or text wrapping. */
.archive-hero__arrow {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    color: var(--text-secondary);
    pointer-events: none;
    overflow: visible;
    z-index: 1;
}

@media (max-width: 900px) {
    .archive-hero__arrow {
        display: none;
    }
}

.archive-hero__handwritten {
    font-family: 'Caveat', cursive;
    font-size: clamp(20px, 1.9vw, 26px);
    color: var(--text-secondary);
    line-height: 1.2;
    transform: rotate(-3deg);
    display: inline-block;
    text-align: left;
    white-space: nowrap;
}

/* ---- HERO :: ASIDE (stamp + telemetry) ---- */
.archive-hero__aside {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: flex-end;
    position: relative;
}

.archive-hero__stamp-img {
    width: clamp(140px, 16vw, 200px);
    height: auto;
    transform: rotate(6deg);
    align-self: flex-end;
    margin-right: clamp(0px, 2vw, 24px);
    margin-bottom: -8px;
    pointer-events: none;
    user-select: none;
    filter: drop-shadow(0 2px 4px rgba(43, 34, 24, 0.08));
}

.archive-hero__coffee {
    position: absolute;
    /* Ring stain sits across the right edge of the telemetry card: ~half inside,
       ~half spilling past the box to the right. Multiply blend keeps the stain
       reading as ink-on-paper wherever it overlaps. */
    bottom: -90px;
    right: -110px;
    width: clamp(180px, 20vw, 260px);
    height: auto;
    opacity: 0.9;
    z-index: 2;
    pointer-events: none;
    user-select: none;
    mix-blend-mode: multiply;
}

.archive-telemetry {
    position: relative;
    z-index: 1;
}

.archive-hero__fox {
    /* Absolute, peeking from the bottom-left corner of the entire hero — fills
       the bottom-left dead space at wide viewports without flowing into the
       text column. */
    position: absolute;
    bottom: 24px;
    left: clamp(8px, 4vw, 64px);
    width: clamp(140px, 16vw, 220px);
    height: auto;
    pointer-events: none;
    user-select: none;
    z-index: 1;
}

/* ---- HERO :: TELEMETRY CARD ---- */
.archive-telemetry {
    width: 100%;
    max-width: 360px;
    background: var(--bg-elevated);
    /* Dark ink border to match the "Stein's" handwriting tone. */
    border: 1px solid var(--text-primary);
    border-radius: 6px;
    padding: 20px 22px 18px;
    box-shadow:
        0 1px 0 rgba(43, 34, 24, 0.04),
        0 12px 24px -16px rgba(43, 34, 24, 0.22);
    position: relative;
}

.archive-telemetry__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(43, 34, 24, 0.12);
}

.archive-telemetry__title {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent-primary);
    margin: 0;
    text-transform: uppercase;
}

.archive-telemetry__check {
    font-family: 'Caveat', cursive;
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1;
}

.archive-telemetry__rows {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
}

.archive-telemetry__row {
    display: grid;
    grid-template-columns: 22px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(43, 34, 24, 0.12);
}

.archive-telemetry__row:last-child {
    border-bottom: none;
}

.archive-telemetry__icon {
    color: var(--accent-tertiary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.archive-telemetry__row dt {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin: 0;
}

.archive-telemetry__row dd {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-primary);
    margin: 0;
    letter-spacing: 1px;
}

/* Position hero relative for fox/coffee absolute children */
.archive-hero {
    overflow: hidden;
}

.archive-hero__sheet {
    position: relative;
}

/* ---- HERO :: RESPONSIVE ---- */
@media (max-width: 900px) {
    .archive-hero__sheet {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .archive-hero__aside {
        align-items: center;
    }

    .archive-hero__stamp {
        margin-right: 0;
    }

    .archive-hero__annotation {
        left: auto;
        right: 0;
        top: 8%;
    }

    .archive-hero__handwritten {
        align-self: flex-start;
        text-align: left;
        margin-right: 0;
    }

    .archive-breadcrumb__title {
        font-size: 11px;
        letter-spacing: 2px;
    }

    .archive-breadcrumb__back {
        font-size: 12px;
    }
}

/* Legacy classes kept for backwards-compat fades (no-op) */
.archive-hero__terminal,
.archive-title,
.archive-sub,
.archive-stats,
.archive-stat,
.archive-stat__label,
.archive-stat__value { display: none; }

/* ---- SECTION LABELS ---- */
.archive-section-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.archive-section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 900;
    color: var(--text-primary);
    margin: 0 0 40px;
    letter-spacing: -0.01em;
}

/* ---- LORE ---- */
/* Manila-folder section: stronger top/bottom edges, distinct paper-inside-folder feel */
.archive-lore {
    padding: 64px var(--container-padding);
    max-width: var(--container-max);
    margin: 0 auto;
    border-top: 2px solid rgba(43, 34, 24, 0.55);
    border-bottom: 2px solid rgba(43, 34, 24, 0.55);
    position: relative;
}

.archive-lore::before,
.archive-lore::after {
    content: '';
    position: absolute;
    left: var(--container-padding);
    right: var(--container-padding);
    height: 1px;
    background: rgba(43, 34, 24, 0.18);
}

.archive-lore::before { top: 6px; }
.archive-lore::after  { bottom: 6px; }

.archive-lore .archive-section-title {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
    font-size: clamp(28px, 3.6vw, 44px);
    color: var(--text-primary);
    margin: 0 0 32px;
}

/* ---- SHELF SELECTOR ---- */
.archive-shelves {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 0;
    position: relative;
    z-index: 2;
}

/* Each shelf-item: roman numeral OUTSIDE the card box (like a manila-folder label) */
.archive-shelf-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    position: relative;
}

.archive-shelf__num {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
    font-size: 26px;
    color: var(--text-primary);
    text-align: center;
    line-height: 1;
    letter-spacing: -0.02em;
}

.archive-shelf-item.is-locked .archive-shelf__num {
    color: var(--text-muted);
    opacity: 0.7;
}

.archive-shelf {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 24px;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-elevated);
    border: 1px solid rgba(43, 34, 24, 0.28);
    border-radius: 3px 3px 0 0;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: var(--text-primary);
    box-shadow: 0 1px 0 rgba(43, 34, 24, 0.04);
    transition: border-color 0.2s var(--ease-out-expo), background 0.2s var(--ease-out-expo), transform 0.2s var(--ease-out-expo), box-shadow 0.2s var(--ease-out-expo);
    min-width: 0;
}

.archive-shelf:hover {
    border-color: rgba(192, 68, 0, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -6px rgba(43, 34, 24, 0.15);
}

/* Active shelf = selected folder tab — connects visually to the content panel below */
.archive-shelf-item.is-active {
    z-index: 3;
}

.archive-shelf-item.is-active .archive-shelf {
    background: #FFFAF0;
    border: 2px solid var(--accent-primary);
    border-bottom: none;
    padding: 11px 13px 14px;
    margin-bottom: -2px;
    box-shadow: 0 -6px 14px -10px rgba(192, 68, 0, 0.35);
}

.archive-shelf-item.is-locked .archive-shelf {
    background: transparent;
    cursor: not-allowed;
    box-shadow: none;
}

.archive-shelf-item.is-locked .archive-shelf:hover {
    border-color: rgba(43, 34, 24, 0.28);
    transform: none;
    box-shadow: none;
}

.archive-shelf-item.is-locked .archive-shelf__name {
    text-decoration: line-through;
    text-decoration-color: rgba(43, 34, 24, 0.5);
    color: var(--text-muted);
}

.archive-shelf__body {
    min-width: 0;
}

.archive-shelf__name {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.4px;
    color: var(--text-primary);
    line-height: 1.15;
}

.archive-shelf__icon {
    color: var(--accent-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.archive-shelf.is-locked .archive-shelf__icon {
    color: var(--text-muted);
}

/* ---- ENTRY CONTENT (paper sheet sitting inside the open folder) ---- */
.archive-entry {
    background: #FFFAF0;
    border: 2px solid var(--accent-primary);
    border-radius: 0 3px 3px 3px;
    padding: 32px 40px 40px;
    position: relative;
    margin-top: 0;
    box-shadow:
        0 1px 0 rgba(43, 34, 24, 0.04),
        0 16px 28px -22px rgba(43, 34, 24, 0.4),
        0 4px 0 -2px #F0E6D2;
}

.archive-entry__tab {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent-primary);
    background: rgba(192, 68, 0, 0.12);
    border: 1px solid rgba(192, 68, 0, 0.3);
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 24px;
    text-transform: uppercase;
}

.archive-entry__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 36px;
    align-items: center;
}

.archive-entry__text {
    padding-left: 14px;
    border-left: 3px solid var(--accent-primary);
}

.archive-entry__title {
    font-family: var(--font-display);
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 18px;
    line-height: 1.05;
    letter-spacing: -0.01em;
}

.archive-entry__accent {
    color: var(--accent-primary);
    font-style: italic;
    position: relative;
    white-space: nowrap;
}

.archive-entry__underline {
    position: absolute;
    left: -2%;
    right: -2%;
    bottom: -8px;
    width: 104%;
    height: 10px;
    color: var(--accent-primary);
    pointer-events: none;
    overflow: visible;
}

.archive-entry__quote {
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-primary);
    margin: 0;
}

.archive-entry__image {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
    .archive-shelves {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .archive-entry__body {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 540px) {
    .archive-shelves {
        grid-template-columns: 1fr;
    }
}

/* ---- THE WALL ---- */
.archive-wall {
    padding: 80px var(--container-padding);
    max-width: var(--container-max);
    margin: 0 auto;
}

.wall-subtitle {
    font-family: 'Caveat', cursive;
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.wall-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

/* JS-managed: slots beyond visibleCount get .is-hidden */
.wall-slot.is-hidden {
    display: none;
}

/* ---- WALL CONTROLS (archival paper-action buttons) ---- */
.wall-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 36px;
}

.wall-control-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 22px;
    background: var(--bg-elevated);
    color: var(--accent-primary);
    border: 1.5px solid var(--accent-primary);
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(43, 34, 24, 0.04);
    transition: background 0.2s var(--ease-out-expo), color 0.2s var(--ease-out-expo), transform 0.15s var(--ease-out-expo), box-shadow 0.2s var(--ease-out-expo);
}

.wall-control-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-elevated);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px -8px rgba(192, 68, 0, 0.45);
}

.wall-control-btn--ghost {
    background: transparent;
    border-color: rgba(43, 34, 24, 0.3);
    color: var(--text-secondary);
}

.wall-control-btn--ghost:hover {
    background: transparent;
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: none;
}

/* ---- FLOATING COLLAPSE FAB (paper-tab style, matches archival theme) ---- */
.wall-collapse-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: var(--z-scroll-progress);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1.5px solid rgba(43, 34, 24, 0.32);
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow:
        0 1px 0 rgba(43, 34, 24, 0.05),
        0 8px 20px -10px rgba(43, 34, 24, 0.4),
        0 4px 0 -2px #F0E6D2;
    opacity: 0;
    transform: translateY(60px);
    pointer-events: none;
    transition: opacity 0.3s var(--ease-out-expo), transform 0.3s var(--ease-out-expo), background 0.2s var(--ease-out-expo), color 0.2s var(--ease-out-expo), border-color 0.2s var(--ease-out-expo);
}

.wall-collapse-fab.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.wall-collapse-fab:hover {
    background: var(--accent-primary);
    color: var(--bg-elevated);
    border-color: var(--accent-primary);
}

.wall-collapse-fab svg {
    color: var(--accent-primary);
    transition: color 0.2s var(--ease-out-expo);
}

.wall-collapse-fab:hover svg {
    color: var(--bg-elevated);
}

.wall-slot {
    aspect-ratio: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Filled slot */
.wall-slot.filled {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
}

.wall-slot.filled .wall-slot__pfp {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}

.wall-slot.filled .wall-slot__num {
    position: absolute;
    bottom: 4px;
    left: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--bg-elevated);
    background: rgba(0, 0, 0, 0.7);
    padding: 1px 5px;
    letter-spacing: 0.5px;
    z-index: 1;
}

.wall-slot.filled .wall-slot__cardno {
    position: absolute;
    top: 4px;
    right: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--bg-elevated);
    background: var(--accent-primary);
    padding: 1px 5px;
    letter-spacing: 0.5px;
    z-index: 1;
}

/* Vacant slot */
.wall-slot.vacant {
    border: 2px dashed rgba(43, 34, 24, 0.2);
    background: rgba(43, 34, 24, 0.02);
}

.wall-slot.vacant .wall-slot__num {
    font-family: var(--font-mono);
    font-size: clamp(18px, 2.5vw, 28px);
    font-weight: 700;
    color: var(--text-muted);
}

.wall-slot.vacant .wall-slot__label {
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: 2px;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 2px;
    text-transform: uppercase;
}

/* Muted X handle in parens beside an IGN. Keeps "xgfox (@xgfox)" readable
   but visually subordinate to the chosen identity. Inherits from <strong>
   when nested, so we force normal weight here. */
.identity-handle {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.78em;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    margin-left: 4px;
}

/* ---- QUESTS ---- */
.archive-quests {
    padding: 80px var(--container-padding);
    max-width: var(--container-max);
    margin: 0 auto;
}

.archive-quests__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 48px;
    align-items: start;
}

.archive-quests__main {
    min-width: 0;
}

.archive-quests__aside {
    position: sticky;
    top: calc(var(--nav-height) + 24px);
}

.quest-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ---- PROCESS TRACKER (right sidebar, paper-sheet styled) ---- */
.process-tracker {
    background: #FFFAF0;
    border: 1px solid rgba(43, 34, 24, 0.2);
    border-radius: 3px;
    padding: 26px 24px 28px;
    box-shadow:
        0 1px 0 rgba(43, 34, 24, 0.04),
        0 16px 28px -22px rgba(43, 34, 24, 0.4),
        0 4px 0 -2px #F0E6D2;
    position: relative;
}

/* Mono tab label at top — matches the archive-entry__tab style */
.process-tracker::before {
    content: '\00a7 APP / FLOW';
    position: absolute;
    top: -8px;
    left: 24px;
    padding: 4px 10px;
    background: rgba(192, 68, 0, 0.12);
    border: 1px solid rgba(192, 68, 0, 0.3);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent-primary);
    text-transform: uppercase;
}

.process-tracker__title {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
    font-size: 24px;
    margin: 14px 0 6px;
    color: var(--text-primary);
}

.process-tracker__hint {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0 0 24px;
}

.process-tracker__steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
}

/* Connector line behind the markers */
.process-tracker__steps::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 16px;
    bottom: 16px;
    width: 2px;
    background: rgba(43, 34, 24, 0.15);
    z-index: 0;
}

.process-step {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    position: relative;
    z-index: 1;
}

.process-step__marker {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 2px solid rgba(43, 34, 24, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
}

.process-step__num {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    line-height: 1;
}

.process-step.is-current .process-step__marker {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(192, 68, 0, 0.15);
}

.process-step.is-current .process-step__num {
    color: var(--bg-elevated);
}

.process-step.is-done .process-step__marker {
    background: rgba(192, 68, 0, 0.12);
    border-color: var(--accent-primary);
}

.process-step.is-done .process-step__num {
    color: var(--accent-primary);
}

.process-step__name {
    font-family: var(--font-mono);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.2;
}

.process-step.is-current .process-step__name {
    color: var(--accent-primary);
}

.process-step__desc {
    font-family: var(--font-body);
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.process-tracker__footnote {
    font-family: 'Caveat', cursive;
    font-size: 18px;
    color: var(--text-secondary);
    margin: 24px 0 0;
    line-height: 1.3;
    padding-top: 18px;
    border-top: 1px dashed rgba(43, 34, 24, 0.18);
}

/* Rejected state: dim every step, indicate terminal failure */
.process-step.is-rejected .process-step__marker {
    background: rgba(196, 43, 59, 0.12);
    border-color: #c42b3b;
}

.process-step.is-rejected .process-step__num {
    color: #c42b3b;
}

.process-step.is-rejected .process-step__name {
    color: #c42b3b;
    text-decoration: line-through;
    text-decoration-color: rgba(196, 43, 59, 0.4);
}

/* ---- STATUS LOOKUP (returning applicants) ---- */
.status-lookup {
    background: #FFFAF0;
    border: 1px solid rgba(43, 34, 24, 0.2);
    border-radius: 3px;
    padding: 22px 24px 20px;
    margin-bottom: 24px;
    position: relative;
    box-shadow:
        0 1px 0 rgba(43, 34, 24, 0.04),
        0 4px 0 -2px #F0E6D2;
}

.status-lookup__header {
    margin-bottom: 14px;
}

.status-lookup__title {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 700;
    font-size: 22px;
    color: var(--text-primary);
    margin: 0 0 4px;
    line-height: 1.1;
}

.status-lookup__desc {
    font-family: var(--font-body);
    font-size: 13.5px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.status-lookup__form { margin: 0; }

.status-lookup__input-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border: 1px solid rgba(43, 34, 24, 0.22);
    border-radius: 3px;
    transition: border-color 0.2s var(--ease-out-expo);
}

.status-lookup__input-row:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px var(--accent-primary);
}

.status-lookup__icon {
    flex-shrink: 0;
    opacity: 0.85;
}

.status-lookup__input {
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    padding: 4px 0;
    min-width: 0;
}

.status-lookup__input::placeholder {
    color: var(--text-muted);
    letter-spacing: 1px;
}

.status-lookup__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--accent-primary);
    color: #FFFAF0;
    border: 1.5px solid var(--accent-primary);
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s var(--ease-out-expo);
    white-space: nowrap;
}

.status-lookup__btn:hover { background: var(--accent-secondary); border-color: var(--accent-secondary); }

.status-lookup__btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.status-lookup__btn--secondary {
    background: transparent;
    color: var(--accent-primary);
}

.status-lookup__btn--secondary:hover {
    background: rgba(192, 68, 0, 0.08);
}

.status-lookup__hint {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin: 8px 4px 0;
    min-height: 14px;
}

.status-lookup__hint.is-error {
    color: #c42b3b;
}

/* ---- LOOKUP RESULT BLOCK ---- */
.status-lookup__result {
    margin-top: 16px;
    padding: 16px 18px;
    background: var(--bg-primary);
    border: 1px solid rgba(43, 34, 24, 0.16);
    border-radius: 3px;
}

.status-lookup__result.is-loading,
.status-lookup__result.is-empty,
.status-lookup__result.is-error {
    background: rgba(43, 34, 24, 0.04);
    border-style: dashed;
}

.status-lookup__loading,
.status-lookup__msg {
    font-family: var(--font-body);
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.status-lookup__msg strong {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 4px;
}

.status-lookup__result.is-approved {
    background: rgba(192, 68, 0, 0.06);
    border-color: rgba(192, 68, 0, 0.35);
}

.status-lookup__result.is-rejected {
    background: rgba(196, 43, 59, 0.06);
    border-color: rgba(196, 43, 59, 0.4);
}

.status-lookup__result.is-pending {
    background: rgba(192, 68, 0, 0.04);
    border-color: rgba(192, 68, 0, 0.25);
}

.status-lookup__badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 2.5px;
    padding: 3px 8px;
    border-radius: 3px;
    background: var(--accent-primary);
    color: #FFFAF0;
    text-transform: uppercase;
}

.is-rejected .status-lookup__badge {
    background: #c42b3b;
}

.is-pending .status-lookup__badge {
    background: var(--bg-elevated);
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}

.status-lookup__name {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 10px 0 6px;
    line-height: 1.2;
}

.status-lookup__msg-text {
    font-family: var(--font-body);
    font-size: 13.5px;
    color: var(--text-secondary);
    margin: 0 0 12px;
    line-height: 1.45;
}

.status-lookup__reason {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(196, 43, 59, 0.08);
    border-left: 3px solid #c42b3b;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}

.status-lookup__reason-label {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 2px;
    color: #c42b3b;
    font-weight: 700;
    margin-right: 8px;
}

.status-lookup__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

/* ---- MOBILE: sidebar stacks on top, steps stay vertical ---- */
@media (max-width: 900px) {
    .archive-quests__layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .archive-quests__aside {
        position: static;
        order: -1;
    }

    .process-tracker {
        padding: 22px 20px;
    }
}

@media (max-width: 540px) {
    .status-lookup__input-row {
        grid-template-columns: 28px minmax(0, 1fr);
        grid-template-rows: auto auto;
    }
    .status-lookup__btn {
        grid-column: 1 / -1;
        justify-content: center;
        padding: 10px 16px;
    }
}

.quest-item {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.quest-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.quest-number {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--accent-primary);
    background: rgba(192, 68, 0, 0.1);
    padding: 4px 10px;
    flex-shrink: 0;
}

.quest-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.quest-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quest-desc {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* GIF placeholder */
.quest-steps {
    list-style: none;
    counter-reset: quest-step;
    padding: 0;
    margin: 0 0 16px;
}

.quest-steps li {
    counter-increment: quest-step;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    padding: 8px 0 8px 32px;
    position: relative;
    border-bottom: 1px solid var(--border-light);
}

.quest-steps li:last-child { border-bottom: none; }

.quest-steps li::before {
    content: counter(quest-step);
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-weight: 700;
}

.quest-steps a {
    color: var(--accent-primary);
    text-decoration: underline;
}

.quest-steps strong {
    color: var(--text-primary);
}

/* Profile reveal after code verification */
.quest-profile-reveal {
    background: var(--bg-elevated);
    border: 1px solid var(--border-accent);
    padding: 16px;
    display: none;
}

.quest-profile-reveal.is-visible {
    display: block;
}

.quest-profile-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.quest-profile-field:last-child {
    border-bottom: none;
}

.quest-profile-field__label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.quest-profile-field__value {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Form inputs */
.quest-input {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 12px 16px;
    width: 100%;
    outline: none;
    transition: border-color 0.2s ease;
}

.quest-input:focus {
    border-color: var(--accent-primary);
}

.quest-input::placeholder {
    color: var(--text-muted);
}

.quest-input-row {
    display: flex;
    gap: 8px;
}

.quest-input-row .quest-input {
    flex: 1;
}

.quest-wallet-row {
    align-items: center;
}

.quest-wallet-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    opacity: 0.5;
}

.quest-wallet-row .quest-input {
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

/* Toggles */
.quest-toggles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quest-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    cursor: pointer;
    user-select: none;
}

.quest-toggle__label {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.quest-toggle__switch {
    position: relative;
    width: 40px;
    height: 22px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: 11px;
    transition: background 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

.quest-toggle__switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: transform 0.2s ease, background 0.2s ease;
}

.quest-toggle input {
    display: none;
}

.quest-toggle input:checked + .quest-toggle__switch {
    background: rgba(192, 68, 0, 0.15);
    border-color: var(--accent-primary);
}

.quest-toggle input:checked + .quest-toggle__switch::after {
    transform: translateX(18px);
    background: var(--accent-primary);
}

/* PFP upload */
.quest-pfp-upload {
    display: flex;
    align-items: center;
    gap: 16px;
}

.quest-pfp-preview {
    width: 64px;
    height: 64px;
    background: var(--bg-elevated);
    border: 2px dashed var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    padding: 0;
    color: inherit;
}

.quest-pfp-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.quest-pfp-preview svg {
    width: 24px;
    height: 24px;
    opacity: 0.3;
}

.quest-pfp-label {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.quest-pfp-label span {
    color: var(--text-muted);
    font-size: 11px;
}

.quest-pfp-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 14px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    border-radius: 2px;
}

.quest-pfp-remove:hover { background: #c42b3b; }

.quest-pfp-status {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #c42b3b;
    margin-top: 4px;
}

/* Verify button */
.quest-btn {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    padding: 12px 24px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s ease;
    flex-shrink: 0;
}

.quest-btn:hover {
    background: var(--accent-tertiary);
}

.quest-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.quest-btn.secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.quest-btn.secondary:hover {
    border-color: var(--accent-primary);
}

/* Submit section */
.quest-submit {
    padding: 32px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.quest-submit .quest-btn {
    padding: 16px 48px;
    font-size: 14px;
}

.quest-submit__status {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-primary);
    min-height: 18px;
    text-align: center;
}

/* ---- CTA BRIDGE (archive to quests scroll anchor) ---- */
.archive-cta {
    padding: 60px var(--container-padding);
    text-align: center;
}

.archive-cta .quest-btn {
    padding: 18px 48px;
    font-size: 14px;
}

/* ---- STATUS BANNER (returning applicants) ---- */
.crushid-status-banner {
    padding: 60px var(--container-padding);
    max-width: 720px;
    margin: 0 auto;
}

.crushid-status__inner {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    padding: 32px;
    text-align: center;
}

.crushid-status--approved {
    border-color: #1a8a4a;
}

.crushid-status--pending {
    border-color: var(--accent-primary);
}

.crushid-status--error {
    border-color: #c42b3b;
}

.crushid-status__badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 4px 12px;
    margin-bottom: 16px;
    text-transform: uppercase;
    background: rgba(43, 34, 24, 0.04);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.crushid-status--approved .crushid-status__badge {
    background: rgba(26, 138, 74, 0.1);
    color: #1a8a4a;
    border-color: rgba(26, 138, 74, 0.3);
}

.crushid-status--pending .crushid-status__badge {
    background: rgba(192, 68, 0, 0.1);
    color: var(--accent-primary);
    border-color: rgba(192, 68, 0, 0.3);
}

.crushid-status--error .crushid-status__badge {
    background: rgba(196, 43, 59, 0.1);
    color: #c42b3b;
    border-color: rgba(196, 43, 59, 0.3);
}

.crushid-status__title {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.crushid-status__desc {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 24px;
}

.crushid-status__desc strong {
    color: var(--text-primary);
}

.crushid-status__actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.crushid-status__actions .quest-btn {
    text-decoration: none;
}

/* Wall error state */
.wall-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-muted);
}

.wall-error button {
    background: none;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 6px 16px;
    cursor: pointer;
    margin-top: 8px;
}

.wall-error button:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Focus-visible for keyboard nav */
.quest-input:focus-visible,
.quest-btn:focus-visible,
.quest-pfp-preview:focus-visible,
.quest-toggle input:focus-visible + .quest-toggle__switch {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
    .wall-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 640px) {
    .archive-hero {
        padding: 100px 20px 40px;
        min-height: 50vh;
    }
    .archive-stats {
        gap: 20px;
    }
    .wall-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    .wall-slot.vacant .wall-slot__num {
        font-size: 16px;
    }
    .lore-grid {
        grid-template-columns: 1fr;
    }
    .quest-input-row {
        flex-direction: column;
    }
}

@media (max-width: 400px) {
    .wall-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Old mobile wall collapse removed — superseded by the universal Show-more/Show-all/Collapse controls */

/* ---- FIX A: Rejected status ---- */
.crushid-status--rejected {
    border-color: #c42b3b;
}

.crushid-status--rejected .crushid-status__badge {
    background: rgba(196, 43, 59, 0.1);
    color: #c42b3b;
    border-color: rgba(196, 43, 59, 0.3);
}

.crushid-status__reason {
    background: rgba(43, 34, 24, 0.03);
    border: 1px solid var(--border-subtle);
    padding: 12px 16px;
    margin: 16px 0;
    text-align: left;
}

.crushid-status__reason-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 6px;
}

.crushid-status__reason-text {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.crushid-status__reapply {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 16px;
}

/* ---- FIX B: Countdown timer ---- */
.quest-countdown {
    padding: 8px 0;
    text-align: center;
}

.quest-countdown__time {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 1.5px;
    color: #1a8a4a;
    padding: 4px 12px;
    border: 1px solid rgba(26, 138, 74, 0.3);
    background: rgba(26, 138, 74, 0.05);
}

.quest-countdown--low {
    color: #c42b3b;
    border-color: rgba(196, 43, 59, 0.3);
    background: rgba(196, 43, 59, 0.05);
    animation: countdown-pulse 1s ease-in-out infinite;
}

.quest-countdown--expired {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 1.5px;
    color: #c42b3b;
    padding: 4px 12px;
    border: 1px solid rgba(196, 43, 59, 0.3);
    background: rgba(196, 43, 59, 0.05);
}

@keyframes countdown-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ---- FIX C: Identity prompt ---- */
.crushid-identity-prompt__inner {
    border-color: var(--border-accent);
}

/* Wall slots are decorative -- no click, no hover affordance. The PFP, slot
   N° and card # number sit there as a roster snapshot only. */

/* ---- FIX F: Cap notice ---- */
.crushid-cap-notice {
    margin-bottom: 24px;
}

.crushid-cap-notice__inner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(192, 68, 0, 0.05);
    border: 1px solid rgba(192, 68, 0, 0.3);
    padding: 12px 16px;
}

.crushid-cap-notice__icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(192, 68, 0, 0.15);
    color: #C04400;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.crushid-cap-notice__text {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* ---- COMING SOON GATE ----
   Rendered as an absolutely-positioned overlay on top of #world-archive so the
   underlying lore DOM survives when Supabase flips the gate closed mid-session.
   See archive.js showComingSoon() for the mounting logic. */
.archive-coming-soon {
    position: absolute;
    inset: 0;
    z-index: 50;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px var(--container-padding);
    background: var(--bg-primary, #F5ECD7);
    /* Subtle vignette so the gate reads as a frosted classifier rather than a
       flat color swap. Falls back to a solid bg above if the variable resolves
       to undefined. */
    background-image:
        radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(43, 34, 24, 0.08) 100%);
    overflow: auto;
}

.archive-coming-soon__inner {
    text-align: center;
    max-width: 480px;
}

.archive-coming-soon__badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 3px;
    color: #c42b3b;
    border: 1px solid rgba(196, 43, 59, 0.3);
    background: rgba(196, 43, 59, 0.08);
    padding: 6px 18px;
    margin-bottom: 28px;
}

.archive-coming-soon__title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(28px, 5vw, 42px);
    color: var(--text-primary);
    margin: 0 0 16px;
    letter-spacing: 2px;
}

.archive-coming-soon__desc {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 0 0 28px;
}

.archive-coming-soon__line {
    width: 40px;
    height: 1px;
    background: var(--border-light);
    margin: 0 auto 20px;
}

.archive-coming-soon__sub {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin: 0;
}

/* ─── EDIT CARD PANEL ───────────────────────────────────────────────────
   The code-gated edit panel lives inside a second .status-lookup wrapper
   so spacing / borders match the "check status" panel above it. The
   .edit-card-form block appears once the code resolves.
*/

#edit-card-lookup {
    margin-top: 20px;
}

.edit-card-form {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid rgba(43, 34, 24, 0.15);
    display: grid;
    gap: 18px;
}

/* explicit override: display:grid above outranks the user-agent [hidden] rule */
.edit-card-form[hidden] {
    display: none;
}

.edit-card-form__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.edit-card-form__label {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--text-primary);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
}

.edit-card-form__hint {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-transform: none;
    font-weight: 400;
}

.edit-card-form__input {
    font-family: var(--font-mono);
    font-size: 14px;
    padding: 10px 14px;
    border: 1px solid rgba(43, 34, 24, 0.28);
    border-radius: 4px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s ease;
}

.edit-card-form__input:focus {
    border-color: var(--accent-primary);
}

.edit-card-form__pfp-row {
    display: flex;
    gap: 14px;
    align-items: center;
}

.edit-card-form__pfp-preview {
    width: 64px;
    height: 64px;
    border: 1px dashed rgba(43, 34, 24, 0.4);
    background: var(--bg-elevated);
    color: var(--text-muted);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    flex-shrink: 0;
}

.edit-card-form__pfp-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.edit-card-form__pfp-preview:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.edit-card-form__pfp-preview svg {
    width: 24px;
    height: 24px;
}

.edit-card-form__pfp-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.edit-card-form__pfp-status {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-primary);
    margin: 0;
    min-height: 14px;
}

.edit-card-form__toggles {
    display: grid;
    gap: 8px;
}

.edit-card-form__toggles label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}

.edit-card-form__submit {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    padding-top: 8px;
    border-top: 1px dashed rgba(43, 34, 24, 0.15);
    margin-top: 4px;
}

.edit-card-form__cancel {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    cursor: pointer;
    padding: 8px 10px;
}

.edit-card-form__cancel:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.edit-card-form__status {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    flex: 1;
    min-width: 0;
}

.edit-card-form__status.is-success { color: #2e6b3a; }
.edit-card-form__status.is-error   { color: var(--warn); }
