:root {
    color-scheme: light;
    --ink: #202b2b;
    --muted: #667270;
    --paper: #f4f6f1;
    --surface: #ffffff;
    --line: #dce3dd;
    --green: #356c54;
    --green-dark: #244c3a;
    --lime: #d9e7a6;
    --coral: #bd573e;
    font-family: "Aptos", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background-color: var(--paper);
    background-image: radial-gradient(#dfe6dd 0.75px, transparent 0.75px);
    background-size: 18px 18px;
    color: var(--ink);
}

button, input, select { font: inherit; }
button, .week-nav a { cursor: pointer; }
a { color: inherit; }

.shell { width: min(1440px, calc(100% - 48px)); margin: 0 auto; }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.wordmark { font-size: 1.25rem; font-weight: 800; text-decoration: none; letter-spacing: 0; }
.wordmark span { color: var(--coral); }
.account-area { display: flex; align-items: center; gap: 20px; }
.signed-in, .nav-link { font-size: .9rem; }
.nav-link { color: var(--green-dark); font-weight: 700; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.account-area form { margin: 0; }
.quiet-button { padding: 8px 0; color: var(--muted); background: none; border: 0; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 42px 0 20px; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 2.4rem; line-height: 1.05; letter-spacing: 0; }
h2 { font-size: 1.05rem; }
.week-nav { display: flex; align-items: center; gap: 14px; }
.week-nav a { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--green-dark); text-decoration: none; }
.week-nav strong { min-width: 150px; text-align: center; font-size: .92rem; }
.board-hint { margin-bottom: 14px; color: var(--muted); font-size: .9rem; }
.board { display: grid; grid-auto-columns: minmax(230px, 1fr); grid-auto-flow: column; gap: 12px; align-items: start; overflow-x: auto; padding: 4px 0 24px; }
.lane { min-height: 280px; border-top: 3px solid var(--green); background: rgb(255 255 255 / 75%); }
.lane-heading { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.lane-heading h2 { overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; }
.lane-heading span { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.lane-body { min-height: 210px; padding: 9px; }
.chore { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; margin-bottom: 8px; padding: 12px; border: 1px solid var(--line); border-left: 3px solid var(--lime); border-radius: 4px; background: var(--surface); }
.chore strong { overflow-wrap: anywhere; font-size: .9rem; }
.chore > span { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.delete-assignment-form { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
.icon-button { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--line); border-radius: 3px; background: white; color: var(--coral); font-size: 1.2rem; line-height: 1; }
.icon-button:hover { border-color: var(--coral); background: #fff1ed; }
select, input { min-height: 39px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 3px; background: white; color: var(--ink); }
.add-assignment-form { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0 2px; }
.add-assignment-form select { min-width: 0; flex: 1 1 130px; }
.add-assignment-form button { flex: 0 0 auto; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 36px; padding-bottom: 40px; }
.admin-section { min-width: 0; padding-top: 18px; border-top: 1px solid var(--line); }
.admin-section h2 { margin-bottom: 18px; }
.inline-form { display: grid; grid-template-columns: repeat(3, minmax(110px, 1fr)) auto; align-items: end; gap: 10px; margin-bottom: 20px; }
.inline-form label, .stack-form label { display: grid; gap: 6px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.inline-form button, .stack-form button, .small-button { min-height: 39px; padding: 8px 14px; border: 0; border-radius: 3px; background: var(--green); color: white; font-weight: 700; }
.inline-form button:hover, .stack-form button:hover, .small-button:hover { background: var(--green-dark); }
.chore-form { grid-template-columns: minmax(120px, 1fr) 110px auto; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: .72rem; text-transform: uppercase; }
.row-form { display: flex; align-items: center; gap: 7px; }
.row-form select { min-height: 34px; padding: 5px; font-size: .8rem; }
.chore-row-form input:first-of-type { min-width: 110px; flex: 1; }
.chore-row-form input[type="number"] { width: 86px; }
.small-button { min-height: 39px; padding: 8px 12px; font-size: .82rem; }
.alert { margin: 18px 0; padding: 12px 14px; border-left: 3px solid var(--coral); background: #fff1ed; color: #783523; }
.success-message { margin: 18px 0; padding: 12px 14px; border-left: 3px solid var(--green); background: #edf5ef; color: var(--green-dark); }
.password-section { width: min(480px, 100%); padding: 20px 0 40px; border-top: 1px solid var(--line); }
.password-section .stack-form { gap: 14px; }
.field-note { margin: 0; color: var(--muted); font-size: .82rem; }
.password-reset-form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.password-reset-form input { min-width: 120px; flex: 1 1 140px; }
.password-reset-form button { flex: 0 0 auto; }
.login-panel { width: min(420px, 100%); margin: 10vh auto; padding: 34px; border-top: 4px solid var(--green); background: var(--surface); box-shadow: 0 15px 45px rgb(32 43 43 / 8%); }
.login-panel h1 { font-size: 2rem; }
.intro { margin: 12px 0 26px; color: var(--muted); }
.stack-form { display: grid; gap: 16px; }
.stack-form button { margin-top: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

@media (max-width: 760px) {
    .shell { width: min(100% - 28px, 600px); }
    .topbar { min-height: 64px; }
    .account-area { gap: 12px; }
    .signed-in { display: none; }
    .page-heading { align-items: flex-start; flex-direction: column; margin-top: 30px; }
    h1 { font-size: 2rem; }
    .board { grid-template-columns: minmax(0, 1fr); grid-auto-columns: auto; grid-auto-flow: row; overflow-x: visible; }
    .admin-grid { grid-template-columns: 1fr; gap: 30px; }
    .inline-form, .chore-form { grid-template-columns: 1fr 1fr; }
    .inline-form label:first-of-type { grid-column: 1 / -1; }
    .inline-form button { grid-column: 1 / -1; }
    .row-form { flex-wrap: wrap; }
    .login-panel { margin-top: 7vh; padding: 26px; }
}

@media (prefers-reduced-motion: no-preference) {
    .lane { animation: settle-in .35s ease-out both; }
    .lane:nth-child(2) { animation-delay: 45ms; }
    .lane:nth-child(3) { animation-delay: 90ms; }
    @keyframes settle-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
}