* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
}

/* Landing page */
.landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 2rem;
}

.landing h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.landing p {
    font-size: 1.1rem;
    color: #666;
    max-width: 400px;
}

.landing .subtle {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: #999;
}

/* Trip view */
#app {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem;
}

.hidden {
    display: none !important;
}

header {
    margin-bottom: 1rem;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.instructions {
    color: #888;
    font-size: 0.9rem;
}

/* Initials input */
#initials-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

#initials-bar label {
    font-weight: 500;
    font-size: 0.95rem;
}

#initials-input {
    width: 5rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

#initials-input:focus {
    outline: none;
    border-color: #4A90D9;
    box-shadow: 0 0 0 2px rgba(74,144,217,0.2);
}

/* Participant legend */
#legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    min-height: 2rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    background: #fff;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

/* Calendar controls */
#calendar-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

#calendar-controls button {
    padding: 0.4rem 0.8rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.15s;
}

#calendar-controls button:hover {
    background: #eee;
}

#month-range {
    font-weight: 500;
    font-size: 0.95rem;
}

/* Calendar grid — two columns on desktop for larger, clearer cells */
#calendar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.5rem;
}

.month-block {
    background: #fff;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.month-title {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.day-headers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}

.day-header {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #999;
    padding: 0.25rem 0;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.day-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.15s;
    min-height: 64px;
    padding: 2px;
}

.day-cell:hover {
    background: #ebebeb;
}

.day-cell.has-dates {
    background: #eee;
}

.day-cell.has-dates:hover {
    background: #e2e2e2;
}

.day-cell.empty {
    cursor: default;
    background: transparent;
}

.day-cell.empty:hover {
    background: transparent;
}

.day-cell.no-initials {
    cursor: not-allowed;
    opacity: 0.6;
}

.day-cell.no-initials:hover {
    background: transparent;
}

/* Date number in top-left */
.day-number {
    font-size: 0.7rem;
    color: #666;
    align-self: flex-start;
    line-height: 1;
}

/* Squircles in a 2x2 grid below the date number */
.squircles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    width: 100%;
    padding: 0 2px 2px;
}

.squircle {
    aspect-ratio: 1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 1px rgba(0,0,0,0.25);
    line-height: 1;
}

/* Locked-in: prominent gold glow + border */
.day-cell.locked-in {
    background: #FFF8E1;
    outline: 3px solid #F4B400;
    outline-offset: -1px;
    box-shadow: 0 0 8px rgba(244, 180, 0, 0.5);
    z-index: 3;
}

.day-cell.locked-in:hover {
    background: #FFF0C0;
}

/* Toast notifications */
#toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    z-index: 100;
    transition: opacity 0.3s;
}

#toast.success {
    background: #2ECC71;
}

#toast.error {
    background: #E74C3C;
}

#loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    font-size: 1.1rem;
    color: #999;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    #app {
        padding: 0.75rem;
    }

    header h1 {
        font-size: 1.3rem;
    }

    #calendar {
        grid-template-columns: 1fr;
    }

    .day-cell {
        min-height: 52px;
    }

    .squircle {
        font-size: 0.45rem;
        border-radius: 4px;
    }
}
