/* ==============================================
   MANIFEST COMPOSE - APPLE-INSPIRED DESIGN
   ============================================== */

.manifest-page {
    min-height: 100vh;
    padding: clamp(var(--space-8), 6vw, var(--space-12)) clamp(var(--space-4), 4vw, var(--space-10));
    background: var(--page-gradient);
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    position: relative;
    overflow-x: hidden;
}

.manifest-page__hero {
    text-align: center;
    color: var(--color-text-primary);
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.manifest-page__eyebrow {
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--color-text-tertiary);
}

.manifest-page__hero h1 {
    font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
    margin: 0;
    font-family: var(--font-heading);
}

.manifest-page__summary {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: var(--text-base);
}

.manifest-page__hero-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.manifest-page__body {
    display: flex;
    justify-content: center;
}

/* Apple Card-Inspired Shell with Glassmorphism */
.manifest-composer-shell {
    width: min(1200px, 100%);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-radius: var(--radius-apple-xxl);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow:
        0 1px 1px rgba(0, 0, 0, 0.02),
        0 4px 8px rgba(0, 0, 0, 0.04),
        0 16px 32px rgba(15, 23, 42, 0.08),
        0 40px 80px rgba(15, 23, 42, 0.12);
    padding: clamp(var(--space-5), 4vw, var(--space-10));
    position: relative;
    transition: transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.manifest-composer-shell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-apple-xxl);
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.6) 0%,
            rgba(255, 255, 255, 0.1) 100%);
    pointer-events: none;
    z-index: -1;
}

body.dark-theme .manifest-composer-shell {
    background: rgba(10, 16, 28, 0.88);
    border-color: rgba(123, 168, 255, 0.18);
    box-shadow:
        0 1px 1px rgba(0, 0, 0, 0.12),
        0 8px 16px rgba(0, 0, 0, 0.3),
        0 24px 48px rgba(0, 0, 0, 0.4);
}

.manifest-composer {
    width: 100%;
}

.manifest-composer__content,
.manifest-composer__success {
    padding: 0;
}

.manifest-composer__content {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.manifest-composer.composer-success-visible .manifest-composer__content {
    display: none !important;
}

.manifest-composer.composer-success-visible .manifest-composer__success {
    display: flex !important;
    flex-direction: column;
    gap: var(--space-4);
}

.composer-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-5);
    align-items: start;
}

.composer-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.sidebar-card {
    background: var(--surface-card-alt);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-apple-xl);
    padding: var(--space-4);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.sidebar-card__title {
    font-weight: 700;
    font-size: var(--text-base);
    margin: 0;
}

.composer-top-bar {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--surface-card-alt);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-apple-xl);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

body.dark-theme .composer-top-bar {
    background: rgba(12, 21, 36, 0.72);
    border-color: rgba(230, 236, 255, 0.16);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.composer-top-bar--compact {
    margin-bottom: var(--space-2);
}

.composer-coordinates {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--color-primary);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-full);
    background: rgba(123, 168, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(123, 168, 255, 0.26);
}

.composer-coordinates-sub {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    margin: 0;
}

.modal-close-btn {
    border: 1px solid var(--color-border-light);
    background: var(--surface-card-alt);
    border-radius: var(--radius-full);
    width: 44px;
    height: 44px;
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all var(--transition-base);
}

.modal-close-btn:hover {
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    transform: translateY(-1px);
}

.coordinate-editor {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-apple-l);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--color-border-light);
}

.coordinate-editor__item {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.coordinate-editor__item input {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.92);
    font-size: var(--text-base);
}

.coordinate-editor__help {
    margin: 0;
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
}

/* Coordinate Card with Apple Glass Effect */
.coordinate-card {
    margin-top: var(--space-4);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-4);
    background: rgba(250, 250, 250, 0.75);
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    border: 1.5px solid rgba(229, 229, 229, 0.5);
    border-radius: var(--radius-apple-xl);
    padding: var(--space-4);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.02),
        0 4px 12px rgba(15, 23, 42, 0.05),
        0 16px 32px rgba(15, 23, 42, 0.08);
    position: relative;
    overflow: hidden;
}

.coordinate-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, transparent 100%);
    pointer-events: none;
}

body.dark-theme .coordinate-card {
    background: rgba(31, 41, 59, 0.65);
    border-color: rgba(255, 255, 255, 0.1);
}

.coordinate-card__info {
    display: grid;
    gap: var(--space-2);
    align-content: start;
}

/* Apple-Style Progress Tracking */
.manifest-steps-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin: var(--space-2) 0 var(--space-4);
    align-items: center;
}

.manifest-steps-wrapper--inline {
    margin: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
}

.manifest-steps-wrapper--inline .manifest-steps {
    width: 100%;
    justify-content: space-between;
    gap: var(--space-2);
    flex-wrap: nowrap;
    align-items: center;
}

.manifest-steps-wrapper--inline .manifest-steps .step-line {
    flex: 1;
    min-width: 0;
}

.manifest-steps-wrapper--inline .progress-indicator {
    align-self: stretch;
    width: 100%;
    justify-content: space-between;
}

.manifest-steps-wrapper--inline .progress-indicator .progress-bar {
    width: 100%;
    max-width: none;
}

.manifest-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-6);
    /* 24px - Apple-style generous spacing */
    flex-wrap: wrap;
}

.progress-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-full);
    border: 1px solid rgba(229, 229, 229, 0.5);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-secondary);
}

.progress-bar {
    width: 120px;
    height: 4px;
    background: rgba(229, 229, 229, 0.5);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-bar__fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: var(--radius-full);
    width: 33%;
    transition: width 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 8px rgba(40, 85, 202, 0.4);
}

.progress-indicator[data-step="1"] .progress-bar__fill {
    width: 33%;
}

.progress-indicator[data-step="2"] .progress-bar__fill {
    width: 66%;
}

.progress-indicator[data-step="3"] .progress-bar__fill {
    width: 100%;
}

body.dark-theme .progress-indicator {
    background: rgba(14, 22, 36, 0.7);
    border-color: rgba(123, 168, 255, 0.2);
}

body.dark-theme .progress-bar {
    background: rgba(232, 238, 255, 0.12);
}

/* Apple-Inspired Step Indicators */
.manifest-steps .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    color: var(--color-text-tertiary);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    transition: all 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Active step label color matches button */
.manifest-steps .step.active {
    color: var(--color-primary);
}

/* Complete step label color */
.manifest-steps .step.complete {
    color: var(--color-success);
}

.manifest-steps .step-number {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    border: 2.5px solid rgba(229, 229, 229, 0.6);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--text-base);
    transition: all 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.manifest-steps .step-number::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4), transparent);
    opacity: 0;
    transition: opacity 280ms ease;
}

.manifest-steps .step.active .step-number,
.manifest-steps .step.complete .step-number {
    border-color: transparent;
    background: var(--color-primary);
    color: #fff;
    box-shadow:
        0 2px 8px rgba(40, 85, 202, 0.25),
        0 8px 20px rgba(40, 85, 202, 0.18);
    transform: scale(1.05);
}

.manifest-steps .step.active .step-number::before,
.manifest-steps .step.complete .step-number::before {
    opacity: 1;
}

.manifest-steps .step.complete .step-number {
    background: var(--color-success);
    box-shadow:
        0 2px 8px rgba(16, 185, 129, 0.25),
        0 8px 20px rgba(16, 185, 129, 0.18);
}

.manifest-steps .step-line {
    flex: 1;
    min-width: 60px;
    /* Minimum 60px for generous spacing */
    height: 2.5px;
    background: linear-gradient(90deg, rgba(229, 229, 229, 0.5), rgba(229, 229, 229, 0.2));
    border-radius: var(--radius-full);
    position: relative;
    overflow: hidden;
}

.manifest-steps .step-line::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    background: linear-gradient(90deg, rgba(40, 85, 202, 0.8), rgba(40, 85, 202, 0.4));
    transition: width 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
}

.modal-subtitle {
    margin: 0 auto var(--space-4);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    max-width: 560px;
}

/* Apple-Inspired Step Content with Subtle Animation */
.step-content {
    display: none;
    flex-direction: column;
    gap: var(--space-3);
    background: rgba(250, 250, 250, 0.85);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid rgba(229, 229, 229, 0.6);
    border-radius: var(--radius-apple-l);
    padding: clamp(var(--space-4), 3vw, var(--space-5));
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.03),
        0 8px 16px rgba(15, 23, 42, 0.06),
        0 20px 40px rgba(15, 23, 42, 0.08);
    transform-origin: top center;
    animation: stepFadeIn 400ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes stepFadeIn {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

body.dark-theme .step-content {
    background: rgba(12, 21, 36, 0.72);
    border-color: rgba(230, 236, 255, 0.16);
}

.step-content.active {
    display: flex;
}

.step-head {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.step-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: rgba(123, 168, 255, 0.14);
    color: var(--color-primary);
    font-weight: 700;
    width: fit-content;
    font-size: var(--text-xs);
}

.step-head h3 {
    margin: 0;
    font-size: var(--text-lg);
}

.guide-box {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-3);
    border-radius: var(--radius-2xl);
    background: linear-gradient(135deg, rgba(123, 168, 255, 0.12), rgba(165, 196, 255, 0.12));
}

.guide-icon {
    font-size: 28px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.form-group label {
    font-weight: 600;
    font-size: var(--text-sm);
}

/* Apple-Style Input Fields with Focus Glow */
.form-group input,
.form-group textarea {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-apple-m);
    border: 1.5px solid rgba(229, 229, 229, 0.8);
    font-size: var(--text-base);
    font-family: inherit;
    background: rgba(255, 255, 255, 0.95);
    transition: all 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: rgba(40, 85, 202, 0.6);
    background: rgba(255, 255, 255, 1);
    box-shadow:
        0 0 0 4px rgba(40, 85, 202, 0.1),
        0 2px 8px rgba(40, 85, 202, 0.08);
    transform: translateY(-1px);
}

.form-group input:hover:not(:focus),
.form-group textarea:hover:not(:focus) {
    border-color: rgba(163, 163, 163, 0.6);
    background: rgba(255, 255, 255, 1);
}

body.dark-theme .form-group input,
body.dark-theme .form-group textarea {
    background: rgba(14, 22, 36, 0.6);
    border-color: rgba(230, 236, 255, 0.18);
    color: var(--color-text-primary);
}

body.dark-theme .form-group input:focus,
body.dark-theme .form-group textarea:focus {
    background: rgba(14, 22, 36, 0.85);
    border-color: rgba(123, 168, 255, 0.5);
    box-shadow:
        0 0 0 4px rgba(123, 168, 255, 0.16),
        0 2px 8px rgba(123, 168, 255, 0.14);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group.checkbox label {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    font-weight: 500;
}

/* Apple-Style Character Counter with Animation */
.char-count {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    text-align: right;
    transition: all 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
}

.char-count #composerCharCount {
    font-weight: 700;
    color: var(--brand-blue-primary);
    transition: all 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.char-count.warning #composerCharCount {
    color: var(--color-warning);
    transform: scale(1.1);
}

.char-count.danger #composerCharCount {
    color: #dc2626;
    transform: scale(1.15);
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* Apple-Style Help Text with Validation States */
.help-text {
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    margin: 0;
    transition: all 240ms ease;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.help-text .material-icons {
    font-size: 16px;
    display: none;
}

.help-text.success {
    color: var(--color-success);
}

.help-text.success .material-icons {
    display: inline-block;
}

.help-text.error {
    color: #dc2626;
}

.help-text.error .material-icons {
    display: inline-block;
}

/* Input Field Validation States */
.form-group.has-error input,
.form-group.has-error textarea {
    border-color: rgba(220, 38, 38, 0.6);
}

.form-group.has-error input:focus,
.form-group.has-error textarea:focus {
    border-color: rgba(220, 38, 38, 0.8);
    box-shadow:
        0 0 0 4px rgba(220, 38, 38, 0.1),
        0 2px 8px rgba(220, 38, 38, 0.12);
}

.form-group.has-success input {
    border-color: rgba(16, 185, 129, 0.5);
}

.form-group.has-success input:focus {
    border-color: rgba(16, 185, 129, 0.7);
    box-shadow:
        0 0 0 4px rgba(16, 185, 129, 0.1),
        0 2px 8px rgba(16, 185, 129, 0.08);
}

/* Validation Icon Animation */
@keyframes validationAppear {
    from {
        opacity: 0;
        transform: scale(0.5) rotate(-12deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.help-text .material-icons {
    animation: validationAppear 320ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.size-selector {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

/* Apple-Style Size Picker with Spring Animation */
.size-option {
    flex: 1;
    min-width: 140px;
    border-radius: var(--radius-apple-xl);
    border: 2px solid rgba(229, 229, 229, 0.7);
    background: rgba(255, 255, 255, 0.5);
    padding: var(--space-3);
    cursor: pointer;
    transition: all 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.size-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(40, 85, 202, 0.05), transparent);
    opacity: 0;
    transition: opacity 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.size-option:hover:not(.selected) {
    border-color: rgba(163, 163, 163, 0.5);
    transform: translateY(-3px) scale(1.02);
    background: rgba(255, 255, 255, 0.85);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.05),
        0 12px 28px rgba(0, 0, 0, 0.08);
}

.size-option.selected {
    border-color: rgba(40, 85, 202, 0.8);
    background: rgba(40, 85, 202, 0.08);
    box-shadow:
        0 0 0 4px rgba(40, 85, 202, 0.12),
        0 8px 20px rgba(40, 85, 202, 0.15),
        0 20px 48px rgba(40, 85, 202, 0.12);
    transform: translateY(-4px) scale(1.03);
}

.size-option.selected::before {
    opacity: 1;
}

body.dark-theme .size-option {
    background: rgba(12, 21, 36, 0.55);
    border-color: rgba(230, 236, 255, 0.16);
}

body.dark-theme .size-option.selected {
    background: rgba(123, 168, 255, 0.16);
    border-color: rgba(123, 168, 255, 0.6);
}

.size-value {
    font-size: var(--text-xl);
    font-weight: 700;
}

.size-label {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
}

.custom-price {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.btn-full {
    width: 100%;
}

.step-actions {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.step-actions__group {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Apple-Style Summary Box */
.manifestation-summary {
    border: 1.5px solid rgba(229, 229, 229, 0.5);
    border-radius: var(--radius-apple-l);
    padding: var(--space-3);
    background: linear-gradient(135deg, rgba(249, 250, 255, 0.7) 0%, rgba(255, 255, 255, 0.5) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    box-shadow:
        inset 0 0 0 1px rgba(40, 85, 202, 0.08),
        0 2px 8px rgba(40, 85, 202, 0.06);
    position: relative;
    overflow: hidden;
}

.manifestation-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, rgba(40, 85, 202, 0.4), transparent);
}

body.dark-theme .manifestation-summary {
    background: linear-gradient(135deg, rgba(12, 21, 36, 0.62) 0%, rgba(9, 16, 28, 0.52) 100%);
    border-color: rgba(230, 236, 255, 0.16);
    box-shadow:
        inset 0 0 0 1px rgba(123, 168, 255, 0.14),
        0 2px 8px rgba(123, 168, 255, 0.08);
}

.manifestation-summary h4 {
    margin: 0;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    font-size: var(--text-sm);
}

.composer-error {
    margin-top: var(--space-4);
    padding: var(--space-3);
    border-radius: var(--radius-xl);
    background: rgba(248, 113, 113, 0.12);
    color: #b91c1c;
    font-size: var(--text-sm);
    display: none;
}

.composer-error.show {
    display: block;
}

.manifest-composer__success {
    text-align: center;
}

/* Apple-Inspired Success Animation */
.success-animation {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    align-items: center;
    animation: successFadeIn 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes successFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.paper-animation .paper {
    width: 240px;
    min-height: 140px;
    padding: var(--space-4);
    border-radius: var(--radius-2xl);
    background: linear-gradient(135deg, rgba(255, 255, 255, 1) 0%, rgba(250, 250, 250, 1) 100%);
    backdrop-filter: blur(20px);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.04),
        0 12px 32px rgba(15, 23, 42, 0.12),
        0 32px 72px rgba(15, 23, 42, 0.16);
    border: 1px solid rgba(229, 229, 229, 0.6);
    animation: paperFloat 3s ease-in-out infinite;
    position: relative;
}

.paper-animation .paper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-2xl);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, transparent 100%);
    pointer-events: none;
}

@keyframes paperFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-8px) rotate(1deg);
    }
}

.paper-text {
    font-size: var(--text-base);
    line-height: 1.4;
}

.manifestation-preview {
    border: 1px dashed var(--color-border-light);
    border-radius: var(--radius-2xl);
    padding: var(--space-4);
    font-size: var(--text-base);
    line-height: 1.5;
    max-width: 420px;
}

.processing-dots {
    display: inline-flex;
    margin-left: var(--space-1);
}

.processing-dots span {
    animation: blink 1.2s infinite;
    display: inline-block;
}

.processing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.processing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

.success-actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    justify-content: center;
}

@keyframes blink {
    0% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.3;
    }
}

@media (min-width: 992px) {
    .step-content.active {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: var(--space-4);
        row-gap: var(--space-3);
        align-items: start;
    }

    .step-content.active>.step-head,
    .step-content.active>.form-group--full,
    .step-content.active>.manifestation-summary,
    .step-content.active>.step-actions,
    .step-content.active>.btn-full {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .manifest-page {
        padding: var(--space-6) var(--space-3);
    }

    .composer-top-bar {
        grid-template-columns: 1fr;
        padding: var(--space-3);
    }

    .modal-close-btn {
        justify-self: end;
    }

    .manifest-composer-shell {
        padding: var(--space-4);
        border-radius: var(--radius-2xl);
    }

    .composer-layout {
        grid-template-columns: 1fr;
    }

    .size-selector {
        flex-direction: column;
    }

    .step-actions,
    .step-actions__group {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ==============================================
   BUTTON PERFORMANCE OPTIMIZATIONS
   (Keeps global styles, adds anti-flicker fixes)
   ============================================== */

/* Primary Button - Performance optimizations only */
.manifest-composer .btn-primary {
    /* Inherit global styles from style.css */
    transition: transform var(--transition-base),
        background var(--transition-base),
        box-shadow var(--transition-base);
    will-change: transform;
    position: relative;
}

/* Prevent hover flickering on all buttons */
.manifest-composer .btn-primary::before,
.manifest-composer .btn-secondary::before,
.manifest-composer .btn-ghost::before {
    pointer-events: none;
}

/* Secondary Button - Performance optimizations */
.manifest-composer .btn-secondary {
    transition: transform var(--transition-base),
        background var(--transition-base),
        border-color var(--transition-base),
        box-shadow var(--transition-base);
    will-change: transform;
}

/* Ghost Button - Performance optimizations */
.manifest-composer .btn-ghost {
    transition: transform var(--transition-base),
        background var(--transition-base),
        border-color var(--transition-base);
    will-change: transform;
}


/* Dark Theme Button Adjustments (colors only) */
body.dark-theme .manifest-composer .btn-primary {
    background: linear-gradient(180deg, #7ba8ff 0%, #4b82e5 100%);
}

body.dark-theme .manifest-composer .btn-secondary {
    background: rgba(12, 21, 36, 0.65);
    border-color: rgba(230, 236, 255, 0.22);
}

/* ==============================================
   APPLE-STYLE TOOLTIPS
   ============================================== */

.tooltip-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: rgba(163, 163, 163, 0.2);
    color: var(--color-text-tertiary);
    font-size: 12px;
    cursor: help;
    transition: all 220ms ease;
}

.tooltip-trigger:hover {
    background: rgba(40, 85, 202, 0.15);
    color: var(--brand-blue-primary);
    transform: scale(1.1);
}

.tooltip-trigger .material-icons {
    font-size: 14px;
}

.tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(28, 28, 28, 0.95);
    backdrop-filter: blur(20px);
    color: #ffffff;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-apple-m);
    font-size: var(--text-xs);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: all 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.25);
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(28, 28, 28, 0.95);
}

.tooltip-trigger:hover .tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

body.dark-theme .tooltip {
    background: rgba(5, 8, 16, 0.95);
    color: #e8eeff;
}

body.dark-theme .tooltip::after {
    border-top-color: rgba(5, 8, 16, 0.95);
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    .manifest-composer .btn-primary,
    .manifest-composer .btn-secondary,
    .manifest-composer .btn-ghost,
    .manifest-composer-shell,
    .step-content,
    .size-option,
    .form-group input,
    .form-group textarea {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* ===========================
   Manifest Compose Skeleton Loading
   =========================== */

/* Hero Skeleton */
.skeleton-manifest-hero {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    align-items: center;
}

.skeleton-manifest-hero .skeleton-eyebrow {
    height: 0.75rem;
    width: 140px;
}

.skeleton-manifest-hero .skeleton-title {
    height: 3rem;
    width: 60%;
}

.skeleton-manifest-hero .skeleton-summary {
    height: 1rem;
    width: 80%;
}

.skeleton-manifest-hero .skeleton-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
}

/* Composer Shell Skeleton */
.skeleton-composer-shell {
    width: min(1200px, 100%);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(40px) saturate(180%);
    border-radius: var(--radius-apple-xxl);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow:
        0 16px 32px rgba(15, 23, 42, 0.08),
        0 40px 80px rgba(15, 23, 42, 0.12);
    padding: clamp(var(--space-5), 4vw, var(--space-10));
    margin: 0 auto;
}

body.dark-theme .skeleton-composer-shell {
    background: rgba(10, 16, 28, 0.88);
    border-color: rgba(123, 168, 255, 0.18);
}

/* Top Bar Skeleton */
.skeleton-top-bar {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--surface-card-alt);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-apple-xl);
    margin-bottom: var(--space-4);
}

.skeleton-top-bar .skeleton-coordinates {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.skeleton-top-bar .skeleton-coord-pill {
    height: 28px;
    width: 100px;
    border-radius: var(--radius-full);
}

.skeleton-top-bar .skeleton-coord-sub {
    height: 0.75rem;
    width: 180px;
}

/* Steps Skeleton */
.skeleton-steps-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    align-items: center;
}

.skeleton-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-6);
    flex-wrap: wrap;
}

.skeleton-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.skeleton-step-number {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
}

.skeleton-step-label {
    height: 0.65rem;
    width: 60px;
}

.skeleton-step-line {
    width: 60px;
    height: 2.5px;
    border-radius: var(--radius-full);
}

.skeleton-progress-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-full);
    border: 1px solid rgba(229, 229, 229, 0.5);
}

body.dark-theme .skeleton-progress-indicator {
    background: rgba(14, 22, 36, 0.7);
    border-color: rgba(123, 168, 255, 0.2);
}

.skeleton-progress-bar {
    width: 120px;
    height: 4px;
    border-radius: var(--radius-full);
}

/* Step Content Skeleton */
.skeleton-step-content {
    background: rgba(250, 250, 250, 0.85);
    backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid rgba(229, 229, 229, 0.6);
    border-radius: var(--radius-apple-l);
    padding: clamp(var(--space-4), 3vw, var(--space-5));
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

body.dark-theme .skeleton-step-content {
    background: rgba(12, 21, 36, 0.72);
    border-color: rgba(230, 236, 255, 0.16);
}

.skeleton-step-head {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.skeleton-step-chip {
    height: 28px;
    width: 80px;
    border-radius: var(--radius-full);
}

.skeleton-step-title {
    height: 1.5rem;
    width: 50%;
}

.skeleton-guide-box {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-2xl);
    background: linear-gradient(135deg, rgba(123, 168, 255, 0.12), rgba(165, 196, 255, 0.12));
}

.skeleton-guide-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-md);
}

.skeleton-guide-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* Form Group Skeleton */
.skeleton-form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.skeleton-label {
    height: 0.875rem;
    width: 100px;
}

.skeleton-input {
    height: 44px;
    border-radius: var(--radius-apple-m);
}

.skeleton-textarea {
    height: 120px;
    border-radius: var(--radius-apple-m);
}

/* Size Selector Skeleton */
.skeleton-size-selector {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.skeleton-size-option {
    flex: 1;
    min-width: 140px;
    height: 100px;
    border-radius: var(--radius-apple-xl);
}

/* Summary Skeleton */
.skeleton-summary-box {
    border: 1.5px solid rgba(229, 229, 229, 0.5);
    border-radius: var(--radius-apple-l);
    padding: var(--space-3);
    background: linear-gradient(135deg, rgba(249, 250, 255, 0.7) 0%, rgba(255, 255, 255, 0.5) 100%);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

body.dark-theme .skeleton-summary-box {
    background: linear-gradient(135deg, rgba(12, 21, 36, 0.62) 0%, rgba(9, 16, 28, 0.52) 100%);
    border-color: rgba(230, 236, 255, 0.16);
}

.skeleton-summary-item {
    display: flex;
    justify-content: space-between;
}

/* Step Actions Skeleton */
.skeleton-step-actions {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-2);
}

.skeleton-actions-group {
    display: flex;
    gap: var(--space-3);
}

@media (max-width: 768px) {
    .skeleton-size-selector {
        flex-direction: column;
    }

    .skeleton-step-actions,
    .skeleton-actions-group {
        flex-direction: column;
        align-items: stretch;
    }
}