.letter-stage {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 6);
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

.letter-stage.stage-ready {
    opacity: 1;
}

.letter-parchment {
    width: 100%;
    max-width: 540px;
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2.5);
    padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 2.5);
    border-left: 1px solid rgba(244, 244, 245, 0.08);
}

.letter-verse {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
    will-change: opacity, transform;
}

.letter-verse.verse-visible {
    opacity: 1;
    transform: translateY(0);
}

.letter-dateline {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.35em;
    color: rgba(244, 244, 245, 0.4);
}

.letter-heading {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4.5vw, 2.5rem);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--color-starlight);
    margin-top: calc(var(--spacing-unit) * 0.5);
}

.letter-address-field {
    margin-top: calc(var(--spacing-unit) * 0.75);
}

.letter-address-input {
    width: 100%;
    max-width: 280px;
    padding: calc(var(--spacing-unit) * 0.5) 0;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-starlight);
    border-bottom: 1px solid var(--color-nebula-dim);
    transition: border-color 0.3s ease;
    letter-spacing: 0.01em;
}

.letter-address-input::placeholder {
    color: rgba(244, 244, 245, 0.25);
    font-style: italic;
}

.letter-address-input:focus {
    border-bottom-color: rgba(244, 244, 245, 0.5);
}

.letter-rule {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1.5);
    padding: calc(var(--spacing-unit) * 0.5) 0;
}

.letter-rule::before,
.letter-rule::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(244, 244, 245, 0.06);
}

.letter-rule-glyph {
    font-size: 0.625rem;
    color: rgba(244, 244, 245, 0.12);
    line-height: 1;
}

.letter-figure {
    width: 100%;
    max-width: 480px;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(244, 244, 245, 0.06);
    background: rgba(255, 255, 255, 0.01);
}

.letter-figure-source {
    font-size: 0.5625rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: rgba(244, 244, 245, 0.35);
    padding: calc(var(--spacing-unit) * 0.75) calc(var(--spacing-unit) * 1);
    display: block;
}

.letter-figure-frame {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    position: relative;
}

.letter-figure-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.letter-figure-frame img.kl-img-loaded {
    opacity: 1;
}

.letter-figure-meta {
    padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 1);
    border-top: 1px solid rgba(244, 244, 245, 0.04);
}

.letter-figure-title {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 400;
    color: rgba(244, 244, 245, 0.85);
    line-height: 1.3;
}

.letter-figure-caption {
    font-size: 0.6875rem;
    color: rgba(244, 244, 245, 0.45);
    letter-spacing: 0.04em;
    margin-top: 2px;
}

.letter-picker-tray {
    margin-top: calc(var(--spacing-unit) * 0.75);
}

.letter-picker-label {
    font-size: 0.5625rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(244, 244, 245, 0.3);
    margin-bottom: calc(var(--spacing-unit) * 0.5);
    display: block;
}

.letter-picker-scroll {
    display: flex;
    gap: calc(var(--spacing-unit) * 0.625);
    overflow-x: auto;
    padding-bottom: calc(var(--spacing-unit) * 0.5);
    scrollbar-width: thin;
    scrollbar-color: rgba(244, 244, 245, 0.06) transparent;
    -webkit-overflow-scrolling: touch;
}

.letter-picker-scroll::-webkit-scrollbar {
    height: 2px;
}

.letter-picker-scroll::-webkit-scrollbar-thumb {
    background: rgba(244, 244, 245, 0.06);
    border-radius: 2px;
}

.letter-thumb {
    flex: 0 0 80px;
    height: 55px;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    border: 1px solid transparent;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.3s ease, border-color 0.3s ease;
}

.letter-thumb.letter-thumb-active {
    opacity: 1;
    border-color: rgba(244, 244, 245, 0.5);
}

.letter-thumb:hover {
    opacity: 0.85;
}

.letter-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.letter-thumb-year {
    position: absolute;
    bottom: 2px;
    right: 3px;
    font-size: 0.5625rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 1px 3px;
    border-radius: 1px;
    letter-spacing: 0.04em;
    color: rgba(244, 244, 245, 0.8);
}

.letter-vitals-prose {
    font-family: var(--font-display);
    font-size: 1.0625rem;
    line-height: 1.75;
    color: rgba(244, 244, 245, 0.7);
    font-style: italic;
}

.letter-enrichment-block {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 1);
}

.letter-enrichment-label {
    font-size: 0.5625rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: rgba(244, 244, 245, 0.3);
}

.letter-enrichment-card {
    padding: calc(var(--spacing-unit) * 1.25) calc(var(--spacing-unit) * 1.5);
    border-left: 2px solid rgba(244, 244, 245, 0.12);
    background: rgba(255, 255, 255, 0.01);
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 0.35);
}

.letter-enrichment-value {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 400;
    color: var(--color-starlight);
    line-height: 1.15;
}

.letter-planet-name {
    font-size: 1.125rem;
}

.letter-enrichment-host {
    font-size: 0.8125rem;
    color: rgba(244, 244, 245, 0.45);
}

.letter-enrichment-caption {
    font-size: 0.6875rem;
    color: rgba(244, 244, 245, 0.5);
    letter-spacing: 0.04em;
}

.letter-enrichment-details {
    display: flex;
    flex-wrap: wrap;
    gap: calc(var(--spacing-unit) * 0.35) calc(var(--spacing-unit) * 1.25);
    margin-top: calc(var(--spacing-unit) * 0.25);
}

.letter-detail-item {
    font-size: 0.6875rem;
    color: rgba(244, 244, 245, 0.35);
}

.letter-enrichment-picks {
    display: flex;
    gap: calc(var(--spacing-unit) * 0.5);
    overflow-x: auto;
    padding-bottom: calc(var(--spacing-unit) * 0.5);
    scrollbar-width: thin;
    scrollbar-color: rgba(244, 244, 245, 0.06) transparent;
    -webkit-overflow-scrolling: touch;
    margin-top: calc(var(--spacing-unit) * 0.5);
}

.letter-enrichment-picks::-webkit-scrollbar {
    height: 2px;
}

.letter-enrichment-picks::-webkit-scrollbar-thumb {
    background: rgba(244, 244, 245, 0.06);
    border-radius: 2px;
}

.letter-pick {
    flex: 0 0 auto;
    min-width: 60px;
    padding: calc(var(--spacing-unit) * 0.35) calc(var(--spacing-unit) * 0.6);
    border: 1px solid transparent;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.015);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.3s ease, border-color 0.3s ease;
    touch-action: manipulation;
    min-height: 44px;
    justify-content: center;
}

.letter-pick:hover {
    opacity: 0.8;
}

.letter-pick.letter-pick-active {
    opacity: 1;
    border-color: rgba(244, 244, 245, 0.4);
    background: rgba(255, 255, 255, 0.03);
}

.letter-pick-main {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--color-starlight);
}

.letter-pick-sub {
    font-size: 0.5rem;
    color: rgba(244, 244, 245, 0.35);
    letter-spacing: 0.06em;
}

.letter-dormant {
    text-align: center;
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 1.5);
    border: 1px dashed rgba(244, 244, 245, 0.06);
    border-radius: 2px;
}

.letter-dormant-text {
    font-size: 0.8125rem;
    color: rgba(244, 244, 245, 0.4);
    line-height: 1.5;
    margin-bottom: calc(var(--spacing-unit) * 1.25);
}

.letter-opt-in-btn {
    padding: calc(var(--spacing-unit) * 0.6) calc(var(--spacing-unit) * 1.25);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border: 1px solid rgba(244, 244, 245, 0.2);
    color: rgba(244, 244, 245, 0.6);
    border-radius: 2px;
    transition: border-color 0.3s ease, color 0.3s ease;
}

.letter-opt-in-btn:hover {
    border-color: rgba(244, 244, 245, 0.6);
    color: var(--color-starlight);
}

.letter-narrative-field {
    width: 100%;
    min-height: 140px;
    font-family: var(--font-display);
    font-size: 1.125rem;
    line-height: 1.7;
    color: rgba(244, 244, 245, 0.85);
    resize: none;
    padding: calc(var(--spacing-unit) * 0.5) 0;
    border-bottom: 1px solid rgba(244, 244, 245, 0.04);
    transition: border-color 0.3s ease;
}

.letter-narrative-field:focus {
    border-bottom-color: rgba(244, 244, 245, 0.15);
}

.letter-message-block {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 0.75);
    padding: calc(var(--spacing-unit) * 1.5);
    border: 1px solid rgba(244, 244, 245, 0.05);
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.01);
}

.letter-message-label {
    font-size: 0.5625rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(244, 244, 245, 0.25);
}

.letter-message-input {
    width: 100%;
    min-height: 100px;
    padding: calc(var(--spacing-unit) * 0.75);
    font-size: 0.8125rem;
    line-height: 1.6;
    border: 1px solid rgba(244, 244, 245, 0.06);
    background: rgba(0, 0, 0, 0.2);
    color: var(--color-starlight);
    resize: vertical;
    border-radius: 2px;
}

.letter-message-input::placeholder {
    color: rgba(244, 244, 245, 0.18);
    font-style: italic;
}

.letter-message-input:focus {
    border-color: rgba(244, 244, 245, 0.2);
}

.letter-style-btn {
    align-self: flex-end;
    padding: calc(var(--spacing-unit) * 0.6) calc(var(--spacing-unit) * 1.25);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border: 1px solid var(--color-starlight);
    color: var(--color-starlight);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.letter-style-btn:hover {
    background: var(--color-starlight);
    color: var(--color-void);
}

.letter-style-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.letter-closing {
    display: flex;
    gap: calc(var(--spacing-unit) * 1.5);
    flex-wrap: wrap;
    padding-top: calc(var(--spacing-unit) * 1);
}

.letter-action {
    padding: calc(var(--spacing-unit) * 0.75) calc(var(--spacing-unit) * 2);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.letter-action-primary {
    background: var(--color-starlight);
    color: var(--color-void);
}

.letter-action-secondary {
    border: 1px solid rgba(244, 244, 245, 0.15);
    color: rgba(244, 244, 245, 0.7);
}

.letter-action:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

.letter-action:disabled {
    opacity: 0.35;
    cursor: default;
    transform: none;
}

@media (max-width: 600px) {
    .letter-stage {
        padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 4);
    }

    .letter-parchment {
        padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 1.5);
        gap: calc(var(--spacing-unit) * 2);
    }

    .letter-heading {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }

    .letter-address-input {
        max-width: 220px;
        font-size: 0.9375rem;
    }

    .letter-figure {
        max-width: 100%;
    }

    .letter-vitals-prose {
        font-size: 1rem;
    }

    .letter-narrative-field {
        font-size: 1rem;
    }

    .letter-enrichment-value {
        font-size: 1.125rem;
    }

    .letter-closing {
        gap: calc(var(--spacing-unit) * 1);
    }

    .letter-action {
        padding: calc(var(--spacing-unit) * 0.75) calc(var(--spacing-unit) * 1.5);
        font-size: 0.6875rem;
    }
}