:root {
    --bg-top: #f2efe9;
    --bg-bottom: #d9e3d6;
    --panel: #fffefb;
    --ink: #1f2a25;
    --muted: #5f6d66;
    --line: #d4d3ca;
    --brand: #1d7f60;
    --brand-dark: #0f5f49;
    --accent: #e68a2e;
    --shadow: 0 16px 40px rgba(23, 39, 33, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "Manrope", "Segoe UI", sans-serif;
    background:
        radial-gradient(1200px 480px at 100% -20%, rgba(230, 138, 46, 0.24), transparent 65%),
        radial-gradient(900px 420px at -10% 10%, rgba(29, 127, 96, 0.24), transparent 62%),
        linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
    min-height: 100vh;
}

.app-shell {
    width: min(1080px, 100% - 2.4rem);
    margin: 2.2rem auto 3rem;
    display: grid;
    gap: 1rem;
}

.hero-card,
.panel {
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(250, 247, 240, 0.96));
    box-shadow: var(--shadow);
    backdrop-filter: blur(2px);
}

.hero-card {
    padding: 1.4rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.hero-card::after {
    content: "";
    position: absolute;
    inset: auto -90px -110px auto;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(230, 138, 46, 0.28), transparent 70%);
}

.eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.74rem;
    color: var(--brand-dark);
    font-weight: 700;
}

h1,
h2 {
    font-family: "Fraunces", Georgia, serif;
    line-height: 1.16;
    margin: 0;
}

h1 {
    margin-top: 0.4rem;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
}

h2 {
    font-size: 1.35rem;
}

.lead {
    margin: 0.72rem 0 0;
    color: var(--muted);
    max-width: 75ch;
}

.panel {
    padding: 1rem;
}

.week-night-selector {
    margin-top: 0.8rem;
    display: grid;
    gap: 0.55rem;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.chips label {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.25rem 0.5rem;
    background: #f0f6f0;
    border: 1px solid #cadece;
    border-radius: 999px;
    font-size: 0.82rem;
}

.panel-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.7rem;
}

.grid {
    display: grid;
    gap: 0.75rem;
}

.grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.four-cols {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.span-1 {
    grid-column: span 1;
}

.span-2 {
    grid-column: span 2;
}

.grid.three-split {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
}

.grid.half-term-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.term-dates {
    margin-top: 0.45rem;
}

.grid.term-dates + .grid.half-term-row {
    margin-top: 0.45rem;
}

label {
    display: grid;
    gap: 0.36rem;
    font-size: 0.93rem;
    font-weight: 700;
    min-width: 0;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.66rem 0.72rem;
    background: #fffcf5;
    color: var(--ink);
    font: inherit;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
button:focus {
    outline: 3px solid rgba(29, 127, 96, 0.2);
    outline-offset: 1px;
}

.stack {
    display: grid;
    gap: 0.72rem;
}

.item-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 0.72rem;
    background: #fffdfa;
    display: grid;
    gap: 0.64rem;
}

.meeting-item.type-joint   { background: #f0f4ff; border-color: #c2cef5; }
.meeting-item.type-special { background: #fff8ec; border-color: #f0d898; }
.meeting-item.type-camp    { background: #f0faf2; border-color: #aadbb6; }

.item-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.66rem;
}

.item-row.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.item-row.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-row label {
    font-size: 0.84rem;
}

.inline-check {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.2rem 0;
}

.inline-check input {
    width: auto;
}

select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.66rem 0.72rem;
    background: #fffcf5;
    color: var(--ink);
    font: inherit;
}

.btn,
.remove-item {
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn {
    padding: 0.64rem 1rem;
}

.btn:active,
.remove-item:active {
    transform: translateY(1px);
}

.btn-primary {
    background: linear-gradient(165deg, #1f8e6c, #0f624a);
    color: #fff;
}

.btn-secondary {
    background: #174f61;
    color: #fff;
}

.btn-ghost {
    background: #eef6f2;
    color: var(--brand-dark);
    border: 1px solid #c2d9d0;
}

.remove-item {
    justify-self: end;
    padding: 0.32rem 0.66rem;
    background: #f8ece6;
    color: #9e3f27;
}

.panel-actions {
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.98), rgba(236, 246, 239, 0.98));
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.75rem;
}

.export-tuning {
    margin-top: 0.7rem;
    align-items: end;
}

.helper {
    margin: 0.5rem 0 0;
    color: var(--muted);
    font-size: 0.91rem;
}

.autosave-ts {
    font-size: 0.8rem;
    color: #8a9e8a;
    margin-top: 0.15rem;
}

@media (max-width: 860px) {
    .grid.two,
    .grid.four-cols,
    .grid.three-split,
    .grid.half-term-row,
    .item-row,
    .item-row.three,
    .item-row.four {
        grid-template-columns: 1fr;
    }

    .span-1,
    .span-2 {
        grid-column: auto;
    }

    .app-shell {
        width: min(1080px, 100% - 1rem);
        margin-top: 1rem;
    }

    .panel,
    .hero-card {
        border-radius: 16px;
    }
}
