:root,
[data-theme="purple"] {
    --page-bg: #890fa1;
    --accent: #dd00ff;
    --accent-hover: #0056b3;
    --link: #890fa1;
}

[data-theme="blue"] {
    --page-bg: #0b3a5b;
    --accent: #1d6fbf;
    --accent-hover: #154e87;
    --link: #1d6fbf;
}

[data-theme="green"] {
    --page-bg: #0e5c45;
    --accent: #178f62;
    --accent-hover: #0c6b49;
    --link: #0e5c45;
}

[data-theme="slate"] {
    --page-bg: #2c333a;
    --accent: #4a5568;
    --accent-hover: #2d3748;
    --link: #4a5568;
}

body {
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    margin: 0;
    padding: 16px;
    background-color: var(--page-bg);
    display: flex;
    justify-content: center;
    align-items: stretch;
    height: 100vh;
    box-sizing: border-box;
    overflow: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: -40%;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.28) 0 3px, transparent 4px);
    background-size: 48px 48px;
    animation: drift 16s linear infinite;
    pointer-events: none;
    z-index: 0;
}

.container {
    width: min(1400px, 100%);
    height: 100%;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.tagline {
    text-align: center;
    margin: -4px 0 12px;
    min-height: 1.4em;
    color: var(--link);
    font-weight: 600;
}

#cheer {
    margin: 0 0 8px;
    text-align: center;
    color: var(--link);
    font-weight: 600;
}

.confetti {
    position: fixed;
    top: -16px;
    width: 10px;
    height: 14px;
    border-radius: 2px;
    z-index: 5;
    pointer-events: none;
    animation: confetti-fall 1.4s ease-in forwards;
}

@keyframes drift {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(48px, 48px, 0); }
}

@keyframes confetti-fall {
    to {
        transform: translateY(110vh) rotate(540deg);
        opacity: 0;
    }
}

h2, h1 {
    font-family: "Fraunces", Georgia, serif;
    font-weight: 600;
    text-align: center;
    color: #333;
}

.config-link {
    text-align: center;
    margin: 0 0 10px;
}

.config-link a {
    color: var(--link);
}

label {
    font-weight: bold;
    margin-right: 10px;
    color: #555;
}

input[type="date"],
input[type="text"],
select {
    padding: 8px;
    font-size: 16px;
    width: 100%;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

button,
input[type="submit"] {
    padding: 10px 20px;
    background-color: var(--accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    margin-top: 10px;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

button:hover,
input[type="submit"]:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.meal-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.meal-shortcuts button {
    width: auto;
    flex: 1 1 30%;
    margin-top: 0;
}

table {
    width: 100%;
    margin-top: 30px;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border: 1px solid #ddd;
    font-size: 14px;
}

th {
    background-color: #f4f4f4;
    color: #333;
}

td {
    background-color: #fafafa;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
}

.checkbox-group label {
    margin-bottom: 5px;
}

.purpose-input {
    padding: 8px;
    width: 100%;
    font-size: 14px;
    margin-top: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.hotel-stay {
    display: block;
    margin-bottom: 10px;
}

#hotel-cost {
    margin-left: 10px;
    width: 160px;
}

#summary-panel {
    margin-top: 10px;
    font-size: 14px;
    color: #333;
}

#date-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 10px;
}

#import-preview {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#import-preview.is-hidden {
    display: none;
}

#import-text {
    flex: 1;
    min-height: 200px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 10px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    white-space: pre;
    overflow: auto;
    resize: none;
}

.is-hidden {
    display: none;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
        width: 100%;
    }

    h2 {
        font-size: 20px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px;
    }

    input[type="date"],
    input[type="text"],
    select {
        font-size: 14px;
    }

    button,
    input[type="submit"] {
        font-size: 14px;
        padding: 8px 16px;
    }

    .checkbox-group {
        flex-direction: row;
    }

    .purpose-input {
        font-size: 12px;
        padding: 6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body::before,
    .confetti {
        animation: none;
    }

    button,
    input[type="submit"] {
        transition: none;
    }

    button:hover,
    input[type="submit"]:hover {
        transform: none;
    }
}
