/* Reset, body, typography, inputs, buttons, back-link, animations, media queries */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.screen {
    display: none;
    text-align: center;
    padding: 2rem 1.2rem;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.screen.active.scroll-screen {
    align-self: flex-start;
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

/* Typography */
h1 {
    font-size: 2.2rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

h2 {
    font-size: 1.4rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.muted {
    font-size: 1rem;
    color: var(--text-muted);
    letter-spacing: 0.15em;
    text-transform: lowercase;
    line-height: 1.8;
}

.small-muted {
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    line-height: 1.6;
    font-style: italic;
    margin-top: 0.5rem;
}

.line {
    width: 40px;
    height: 1px;
    background: var(--border-default);
    margin: 2rem auto;
}

/* Inputs */
input[type="password"],
input[type="text"],
input[type="number"] {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-default);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1.1rem;
    text-align: center;
    padding: 0.5rem 1rem;
    width: 100%;
    max-width: 280px;
    letter-spacing: 0.1em;
    outline: none;
    transition: border-color 0.3s ease;
    -webkit-appearance: none;
}

input:focus {
    border-bottom-color: var(--text-muted);
}

input::placeholder {
    color: var(--text-faintest);
    font-style: italic;
    font-size: 1rem;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] { -moz-appearance: textfield; }

.error-msg {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--error);
    height: 1.2rem;
    transition: opacity 0.3s ease;
}

/* Buttons */
.btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 0.5rem auto;
    padding: 0.9rem 1.5rem;
    border: 1px solid var(--border-default);
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    letter-spacing: 0.12em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.btn:hover, .btn:active {
    border-color: var(--text-muted);
    color: #fff;
}

/* Back link */
.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--text-ghost);
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: color 0.3s ease;
    text-decoration: none;
    padding: 0.5rem 0;
    -webkit-tap-highlight-color: transparent;
}

.back-link:hover, .back-link:active {
    color: var(--text-muted);
}

/* Card entrance animation */
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Inline-style replacements */
.trip-note-input-inline {
    width: 100%;
    background: transparent;
    border: 1px solid var(--bg-raised);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.8rem;
    padding: 0.4rem 0.5rem;
    outline: none;
    margin-bottom: 0.5rem;
    transition: border-color 0.3s ease;
}

.prompt-body-text {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.9;
    text-align: left;
    padding: 0 0.5rem;
}

.prompt-intro-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 0.5rem;
    text-align: center;
}

.prompt-intro-text-mb {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    text-align: center;
}

.suggestion-label {
    color: var(--text-ghost);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.suggestion-text {
    color: var(--text-primary);
    font-size: 1.2rem;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.suggestion-empty {
    color: var(--text-ghost);
    font-size: 0.85rem;
    font-style: italic;
}

.suggestion-empty-link {
    cursor: pointer;
    color: var(--text-muted);
}

.no-results-text {
    font-size: 0.75rem;
    color: var(--text-faintest);
}

.no-trips-text {
    font-size: 0.8rem;
    color: var(--text-faintest);
    font-style: italic;
    text-align: center;
}

/* Desktop: widen landing page into two-column layout */
@media (min-width: 768px) {
    #screen-landing.active {
        max-width: 900px;
        text-align: left;
        padding: 3rem 3rem;
    }

    .landing-inner {
        display: flex;
        align-items: center;
        gap: 4rem;
    }

    .landing-inner .landing-left {
        flex: 1;
        min-width: 280px;
    }

    .landing-inner .landing-cards {
        flex: 0 0 400px;
        margin-top: 0;
    }

    #screen-landing .landing-ticker {
        justify-content: flex-start;
        margin-bottom: 0.8rem;
    }

    #screen-landing #greeting-heading {
        font-size: 2.6rem;
        letter-spacing: 0.04em;
        margin-bottom: 0.5rem;
    }

    #screen-landing .landing-date {
        font-size: 0.9rem;
        margin-bottom: 1.2rem;
    }

    #screen-landing .landing-subtitle {
        font-size: 1.05rem;
        line-height: 1.9;
    }

    #screen-landing .line {
        margin: 1.2rem 0;
    }

    #screen-landing .landing-card {
        text-align: center;
        padding: 1.1rem 1.6rem;
    }

    #screen-landing .landing-card-featured {
        text-align: center;
        padding: 1.4rem 1.6rem;
    }

    #screen-landing .landing-grid {
        gap: 0.85rem;
        margin-top: 0.85rem;
    }
}

@media (max-width: 480px) {
    .screen {
        padding: 1.5rem 1rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    .prompt-title-large {
        font-size: 1.2rem;
    }

    .search-result {
        padding: 0.7rem 0.5rem;
    }

    .bucket-photo-wrapper, .bucket-photo {
        width: 70px;
        height: 70px;
    }

    .map-search-row input {
        width: 100%;
        max-width: 260px;
    }

    #greeting-heading {
        font-size: 1.8rem;
    }

    .landing-grid {
        gap: 0.6rem;
    }

    .landing-card {
        padding: 0.85rem 1.2rem;
    }

    .landing-card-featured {
        padding: 1.1rem 1.2rem;
    }

    .map-mark-form input {
        width: 60px;
    }
}
