:root {
    --paper: #f3ecdf;
    --card: #fffaf3;
    --ink: #241c16;
    --muted: #6f6256;
    --line: #e4d5c4;
    --herb: #234838;
    --clay: #b55233;
    --clay-deep: #8d3d24;
    --shadow: 0 18px 40px rgba(60, 36, 16, 0.06);
    --serif: "Fraunces", "Iowan Old Style", Palatino, "Palatino Linotype", serif;
    --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
    color-scheme: light;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(1100px 480px at 8% -12%, #f8e4cf 0%, transparent 55%),
        radial-gradient(800px 420px at 110% -8%, #e4efe6 0%, transparent 48%),
        var(--paper);
    font-family: var(--sans);
    font-size: 1.05rem;
    line-height: 1.5;
}

body::before {
    content: "";
    display: block;
    height: 6px;
    background: linear-gradient(90deg, var(--herb) 0 72%, var(--clay) 72% 100%);
}

h1:focus { outline: none; }

button { font: inherit; }

a { color: var(--herb); }

.board {
    width: min(920px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2.4rem 0 4.5rem;
}

.mast {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.6rem;
}

.brand {
    margin: 0;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--clay-deep);
}

h1 {
    font-family: var(--serif);
    font-weight: 560;
    font-size: clamp(2.7rem, 7vw, 4.4rem);
    line-height: 0.92;
    margin: 0.15rem 0 0.35rem;
    letter-spacing: -0.035em;
}

.lede {
    margin: 0;
    color: var(--muted);
    font-size: 1.05rem;
}

.actions {
    display: flex;
    gap: 0.45rem;
    padding-bottom: 0.35rem;
}

.today-button,
.pager {
    appearance: none;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink);
    cursor: pointer;
}

.today-button {
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
}

.today-button:disabled {
    opacity: 0.4;
    cursor: default;
}

.today-button:hover:not(:disabled),
.pager:hover,
.day:hover {
    border-color: #d3c1ab;
}

.week-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.45rem;
    align-items: stretch;
    margin-bottom: 2rem;
}

.pager {
    width: 2.3rem;
    border-radius: 14px;
    font-size: 1.4rem;
    line-height: 1;
}

.days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.3rem;
}

.day {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    border-radius: 16px;
    padding: 0.5rem 0.1rem 0.65rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.05rem;
    min-height: 4.6rem;
}

.day.is-selected {
    background: var(--herb);
    color: #f6f1e7;
}

.day.is-today:not(.is-selected) .num {
    box-shadow: inset 0 -2px 0 var(--clay);
}

.dow {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.72;
}

.num {
    font-family: var(--serif);
    font-size: 1.35rem;
    line-height: 1.2;
}

.mark {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--clay);
    margin-top: 0.15rem;
}

.day.is-selected .mark { background: #f3c7b8; }

.slot { margin: 0 0 1.35rem; }

.slot h2 {
    margin: 0 0 0.55rem;
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--herb);
    font-weight: 600;
}

.meal {
    background: var(--card);
    border: 1px solid var(--line);
    border-top: 4px solid var(--line);
    border-radius: 22px;
    padding: 1.2rem 1.3rem 1.35rem;
    box-shadow: var(--shadow);
    margin-bottom: 0.75rem;
}

.tone-morning { border-top-color: #d4923f; }
.tone-midday { border-top-color: #2f6f4e; }
.tone-evening { border-top-color: var(--clay); }
.tone-snack { border-top-color: #c9b59a; }

.meal header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

.meal h3 {
    font-family: var(--serif);
    font-size: clamp(1.55rem, 3vw, 2rem);
    font-weight: 560;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 0;
}

.servings,
.summary,
.footer-note,
.status,
.empty p,
.day-notes {
    color: var(--muted);
}

.servings {
    margin: 0;
    white-space: nowrap;
    font-size: 0.92rem;
}

.summary { margin: 0.4rem 0 0; }

.meal h4 {
    margin: 1.05rem 0 0.35rem;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.ingredients {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ingredients li {
    display: grid;
    grid-template-columns: 7.2rem 1fr;
    gap: 0.25rem 0.85rem;
    padding: 0.42rem 0;
    border-top: 1px solid var(--line);
}

.measure {
    font-variant-numeric: tabular-nums;
    color: var(--herb);
    font-weight: 600;
}

.note { color: var(--muted); font-weight: 400; }
.note::before { content: "· "; }

.unmeasured { grid-template-columns: 1fr; }
.unmeasured .measure { display: none; }

.steps {
    margin: 0;
    padding-left: 1.15rem;
}

.steps li { padding: 0.28rem 0 0.28rem 0.15rem; }
.steps li::marker {
    color: var(--clay);
    font-family: var(--serif);
    font-weight: 600;
}

.day-notes {
    margin: 0 0 1.3rem;
    padding: 0.85rem 1rem;
    background: #f8e6df;
    color: var(--ink);
    border-radius: 14px;
}

.empty {
    border: 1px dashed #d9c8b3;
    border-radius: 22px;
    padding: 2.6rem 1.4rem;
    text-align: center;
    background: rgba(255, 250, 243, 0.55);
}

.empty h2 {
    font-family: var(--serif);
    font-weight: 560;
    font-size: 2rem;
    margin: 0 0 0.35rem;
    color: var(--ink);
}

.empty p { margin: 0 auto; max-width: 34rem; }

.status { margin: 1rem 0; }
.status.error { color: var(--clay-deep); }

.footer-note {
    margin: 1.4rem 0 0;
    font-size: 0.92rem;
}

button:focus-visible {
    outline: 2px solid var(--clay);
    outline-offset: 2px;
}

.blazor-error-boundary {
    background: #8d3d24;
    padding: 1rem 1.2rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "This page hit an unexpected error.";
}

@media (max-width: 700px) {
    .board { padding-top: 1.5rem; }
    .mast { align-items: flex-start; flex-direction: column; }
    .actions { padding-bottom: 0; }
    .dow { font-size: 0.6rem; letter-spacing: 0.04em; }
    .ingredients li { grid-template-columns: 1fr; }
    .measure { font-size: 0.95rem; }
    .meal header { flex-direction: column; gap: 0.2rem; }
}

.login-board {
    width: min(440px, calc(100% - 2rem));
    padding-top: 12vh;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    margin-top: 1.6rem;
}

.login-form label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
}

.login-form input {
    text-transform: none;
    letter-spacing: 0;
    font: inherit;
    font-weight: 400;
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0.75rem 0.85rem;
}

.login-form input:focus-visible {
    outline: 2px solid var(--clay);
    outline-offset: 2px;
}

.today-button.primary {
    background: var(--herb);
    color: #f6f1e7;
    border-color: var(--herb);
    align-self: flex-start;
    padding: 0.6rem 1.15rem;
}

.sign-out {
    display: contents;
}
