* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f5efe7;
    color: #213555;
}

a {
    color: inherit;
}

.app-header,
.app-footer {
    text-align: center;
    padding: 24px 16px;
    background: linear-gradient(180deg, rgba(33, 53, 85, 0.08), rgba(33, 53, 85, 0));
}

.app-header h1 {
    margin: 0;
    font-size: clamp(1.8rem, 2.5vw, 2.4rem);
    font-weight: 700;
}

.app-header p {
    margin: 8px auto 0;
    max-width: 640px;
    color: rgba(33, 53, 85, 0.75);
}

.layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    padding: 0 24px 48px;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: rgba(216, 196, 182, 0.45);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 20px 60px -30px rgba(33, 53, 85, 0.35);
    backdrop-filter: blur(6px);
}

.card h2 {
    margin-top: 0;
    font-size: 1.4rem;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.field-group.inline {
    align-items: center;
    flex-direction: row;
    gap: 12px;
}

.field-group.inline label {
    flex: 0 0 auto;
}

.field-group select,
.field-group input[type="number"],
.field-group input[type="text"],
.field-group input[type="range"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(33, 53, 85, 0.2);
    background: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    color: inherit;
    transition: border-color 0.2s ease;
}

.field-group input[type="range"] {
    padding: 0;
    accent-color: #3e5879;
}

.field-group select:focus,
.field-group input:focus {
    outline: none;
    border-color: #3e5879;
    box-shadow: 0 0 0 3px rgba(62, 88, 121, 0.15);
}

.segmented {
    display: inline-flex;
    border-radius: 999px;
    background: rgba(33, 53, 85, 0.08);
    padding: 4px;
    margin-bottom: 16px;
}

.segment-button {
    border: none;
    background: transparent;
    color: rgba(33, 53, 85, 0.65);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.segment-button.active {
    background: #d8c4b6;
    color: #213555;
    font-weight: 600;
}

.primary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 12px 20px;
    border-radius: 12px;
    background: #3e5879;
    color: #fff;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px -18px rgba(33, 53, 85, 0.6);
}

.result {
    font-size: 1.1rem;
    font-weight: 600;
    color: #213555;
    margin-top: 12px;
}

.results {
    margin-top: 20px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.result-grid h3 {
    margin: 0 0 4px;
    font-size: 0.95rem;
    color: rgba(33, 53, 85, 0.7);
}

.result-grid p {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.time-blocks {
    width: 100%;
    border-collapse: collapse;
    margin-top: 24px;
}

.time-blocks th,
.time-blocks td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(33, 53, 85, 0.1);
    text-align: left;
}

.time-blocks th {
    background: rgba(62, 88, 121, 0.12);
    font-size: 0.85rem;
    font-weight: 600;
}

.time-blocks td:last-child,
.time-blocks td:nth-child(2) {
    font-weight: 600;
    color: #3e5879;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.hint {
    font-size: 0.85rem;
    color: rgba(33, 53, 85, 0.6);
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .layout {
        padding: 0 16px 40px;
        gap: 16px;
    }

    .card {
        padding: 20px;
    }
}
