:root {
  --bg: #f4f1ea;
  --surface: #fffefc;
  --line: #e6dfd2;
  --text: #2a2622;
  --muted: #8d8375;
  --faint: #a49a89;
  --accent: #b94337;
  --accent-dark: #99372f;
  --accent-soft: #fae8e4;
  --success: #397759;
  --success-soft: #e7f4eb;
  --neutral: #f1ece2;
  --shadow: 0 20px 60px rgba(68, 50, 33, .18);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { width: 100%; overflow-x: hidden; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { width: 100%; min-width: 0; overflow-x: clip; color: var(--text); font-family: "Nunito", system-ui, sans-serif; font-weight: 600; }
img { display: block; max-width: 100%; }
button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(185, 67, 55, .24); outline-offset: 2px; }

.app-shell { width: 100%; max-width: 480px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; padding-bottom: 104px; }
.app-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 16px 6px; }
.brand { min-width: 0; }
.brand h1 { margin: 0; font-size: 22px; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; }
.brand p { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; font-weight: 700; }
.identity { display: flex; flex: none; flex-direction: column; align-items: flex-end; gap: 3px; }
.eyebrow { color: var(--faint); font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.identity select { max-width: 174px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); padding: 6px 8px; font-size: 12px; font-weight: 800; }
.identity.signed-in { flex-direction: row; align-items: center; gap: 8px; text-align: right; }
.identity.signed-in span { display: flex; flex-direction: column; }
.identity.signed-in b { max-width: 145px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.identity.signed-in small { color: var(--accent); font-size: 9px; font-weight: 900; }
.identity.signed-in .btn { padding: 6px 7px; font-size: 11px; }
.round-wrap { padding: 0 16px 8px; }
.round-pill, .pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 10px; background: #ece7dd; color: var(--muted); font-size: 11px; font-weight: 800; }
.round-pill { max-width: 100%; line-height: 1.35; overflow-wrap: anywhere; }

.screen { display: flex; width: 100%; min-width: 0; flex-direction: column; gap: 12px; padding: 8px 16px; animation: fade .18s ease-out; }
.screen > *, .row-between > *, .person-row > *, .cake-row > *, .rank-row > * { min-width: 0; }
.admin-column { display: contents; }
.admin-card-1 { order: 1; }
.admin-card-2 { order: 2; }
.admin-card-3 { order: 3; }
.admin-card-4 { order: 4; }
.admin-card-5 { order: 5; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } }
.card { min-width: 0; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); padding: 14px 16px; }
.card-title { margin: 0 0 10px; color: var(--faint); font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.hero { border-radius: 20px; background: var(--accent); color: white; padding: 18px; }
.hero .eyebrow { color: rgba(255,255,255,.82); }
.hero-person { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.hero h2 { margin: 0; font-size: 21px; font-weight: 900; line-height: 1.15; }
.hero-meta { margin-top: 2px; font-size: 13px; font-weight: 700; opacity: .9; }
.hero-quip { margin-top: 12px; border-top: 1px solid rgba(255,255,255,.25); padding-top: 10px; font-size: 12.5px; opacity: .86; }
.avatar { display: grid; flex: none; width: 36px; height: 36px; place-items: center; border-radius: 50%; font-size: 12px; font-weight: 900; }
.avatar.large { width: 52px; height: 52px; background: rgba(255,255,255,.22) !important; color: white !important; font-size: 19px; }
.banner { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 1.5px solid #e9aca2; border-radius: 14px; background: var(--accent-soft); padding: 12px 14px; color: var(--accent-dark); text-align: left; font-size: 13px; font-weight: 800; }
.row-between { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.progress { height: 10px; overflow: hidden; margin-top: 10px; border-radius: 999px; background: #efe9de; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.supporting { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.empty { padding: 24px 8px; color: var(--muted); text-align: center; font-size: 13.5px; }

.cake-row, .rank-row, .person-row { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 0; text-align: left; }
.account-email { display: block; overflow: hidden; color: var(--accent-dark); text-overflow: ellipsis; white-space: nowrap; }
.password-sheet { max-width: 520px; }
.cake-row + .cake-row, .rank-row + .rank-row { margin-top: 10px; }
.cake-card { border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); padding: 12px 14px; }
.thumb { position: relative; overflow: hidden; flex: none; width: 52px; height: 52px; border-radius: 12px; background: repeating-linear-gradient(45deg,#f1ece2 0 10px,#faf7f0 10px 20px); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.grow { flex: 1; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.primary-text { font-size: 14.5px; font-weight: 900; }
.secondary-text { margin-top: 1px; color: var(--muted); font-size: 11.5px; font-weight: 650; overflow-wrap: anywhere; }
.score { flex: none; color: var(--accent-dark); font-size: 16px; font-weight: 900; }
.status { flex: none; border-radius: 999px; padding: 4px 9px; background: var(--neutral); color: var(--faint); font-size: 10.5px; font-weight: 900; white-space: nowrap; }
.status.success { background: var(--success-soft); color: var(--success); }
.status.accent { background: var(--accent-soft); color: var(--accent-dark); }
.rank { display: grid; flex: none; width: 27px; height: 27px; place-items: center; border-radius: 50%; background: var(--neutral); color: var(--muted); font-size: 12px; font-weight: 900; }
.rank.gold { background: #f4d976; color: #795c1f; }
.rank.silver { background: #e3dfd6; color: #6b6355; }
.rank.bronze { background: #e6c5aa; color: #7a5042; }
.cat-line { overflow: hidden; margin-top: 3px; color: var(--faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.schedule-card.next { border-color: #db8c80; }
.date-box { width: 48px; flex: none; text-align: center; }
.date-box b { display: block; font-size: 13.5px; font-weight: 900; }
.date-box small { display: block; margin-top: 1px; color: var(--muted); font-size: 9.5px; font-weight: 800; }
.manage-link { border: 0; background: none; padding: 4px 2px; color: var(--accent); font-size: 12px; font-weight: 900; }
.manage-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 12px; }
.hint { margin: 0 2px; color: var(--muted); font-size: 12px; }
.round-context { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; border-radius: 13px; background: var(--neutral); padding: 10px 12px; color: var(--muted); font-size: 11.5px; }
.round-context b { color: var(--text); }

.calendar-card { overflow: hidden; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.calendar-head b { display: block; margin-top: 2px; font-size: 15px; font-weight: 900; }
.calendar-nav { display: flex; gap: 2px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { margin-bottom: 4px; color: var(--faint); text-align: center; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.calendar-grid { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.calendar-day { min-width: 0; min-height: 48px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 3px; color: var(--muted); font-size: 10px; }
.calendar-day.outside { background: #faf7f1; color: #c4bcaf; }
.calendar-day.today > span { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; background: var(--text); color: white; }
.calendar-event { display: block; overflow: hidden; width: 100%; margin-top: 3px; border: 0; border-radius: 5px; background: var(--accent); padding: 3px 1px; color: white; font-size: 8.5px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event.done { background: var(--success); }
.calendar-event.selected { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent-dark); }
.calendar-details { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; margin-top: 12px; border-radius: 12px; background: var(--neutral); padding: 11px 12px; font-size: 12px; }
.calendar-details .eyebrow, .calendar-details b, .calendar-details > span:not(.status) { grid-column: 1; }
.calendar-details .status { grid-column: 2; grid-row: 2 / span 2; align-self: center; }
.theme-line { color: var(--accent-dark); font-size: 11.5px; font-weight: 800; }

.btn { border: 1.5px solid var(--line); border-radius: 11px; background: white; padding: 9px 12px; font-size: 12px; font-weight: 800; }
.btn.primary { width: 100%; border-color: var(--accent); border-radius: 14px; background: var(--accent); padding: 13px 14px; color: white; font-size: 14px; font-weight: 900; }
.btn.primary:disabled { border-color: #d8d1c5; background: #d8d1c5; cursor: not-allowed; }
.btn.danger { border-color: #e6b8b2; color: #a13b31; }
.btn.ghost { border: 0; background: transparent; color: var(--accent); }
.icon-btn { display: grid; width: 30px; height: 30px; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 18px; }

.announcement { position: relative; overflow: hidden; border-radius: 20px; background: var(--accent); padding: 20px; color: white; }
.announcement > *:not(.confetti) { position: relative; z-index: 1; }
.announcement h2 { margin: 8px 0 0; font-size: 23px; font-weight: 900; line-height: 1.2; }
.announcement p { margin: 4px 0 0; font-size: 14px; }
.podium-line { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; border-radius: 10px; background: rgba(255,255,255,.14); padding: 8px 12px; font-size: 12.5px; font-weight: 700; }
.award-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.award-pills span { border-radius: 999px; background: rgba(255,255,255,.2); padding: 5px 10px; font-size: 10.5px; font-weight: 800; }
.confetti span { position: absolute; top: -14px; width: 7px; height: 11px; border-radius: 2px; animation: fall var(--duration) linear var(--delay) infinite; opacity: 0; }
@keyframes fall { 0% { transform: translateY(-14px) rotate(0); opacity: 1; } 85% { opacity: 1; } 100% { transform: translateY(220px) rotate(560deg); opacity: 0; } }
.history-block + .history-block { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 16px; }
.history-list { margin: 10px 0 0; padding: 0; list-style: none; }
.history-list li { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; padding: 4px 0; font-size: 11.5px; }
.cakes-screen, .cakes-current-section, .cakes-archive-section { display: flex; min-width: 0; flex-direction: column; gap: 14px; }
.cakes-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.cakes-toolbar h2, .section-heading h2 { margin: 2px 0 0; font-size: 20px; }
.cakes-toolbar .btn.primary { width: auto; flex: none; padding-right: 20px; padding-left: 20px; }
.cakes-grid, .archive-grid { display: grid; min-width: 0; gap: 12px; }
.section-heading { margin: 14px 2px 0; }
.section-heading .supporting { margin-top: 4px; }
.archived-round { display: grid; min-width: 0; gap: 14px; padding-top: 14px; }
.archived-round-head { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; align-items: start; }
.archived-round-head h3 { margin: 2px 0 0; font-size: 14px; line-height: 1.3; }
.archived-winner { display: flex; grid-column: 1 / -1; flex-direction: column; gap: 1px; margin: 2px 0 0; color: var(--muted); font-size: 11px; line-height: 1.35; }
.archived-winner b { color: var(--text); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.archived-cakes { display: grid; min-width: 0; gap: 9px; }
.archived-cake-row { border-radius: 12px; padding: 4px; transition: background .15s ease; }
.archived-cake-row:hover { background: var(--neutral); }
.archived-summary { min-width: 0; }
.archived-summary .supporting { margin: 0; }
.archived-photo { cursor: default; }

.form-row { display: flex; gap: 8px; }
.field { display: flex; flex: 1; flex-direction: column; gap: 5px; }
.field label { color: var(--muted); font-size: 11px; font-weight: 900; }
.field input, .field select, .field textarea, .manage-panel select, .inline-input { width: 100%; border: 1.5px solid var(--line); border-radius: 10px; background: white; padding: 9px 10px; font-size: 13px; font-weight: 700; }
.field textarea { min-height: 76px; resize: vertical; }
.inline-form { display: flex; gap: 8px; margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 12px; }
.inline-form .inline-input { flex: 1; min-width: 0; }
.round-form { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 12px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-row + .settings-row { margin-top: 12px; }
.settings-row select { border: 1.5px solid var(--line); border-radius: 10px; background: white; padding: 7px; font-size: 12px; font-weight: 800; }
.role-select { max-width: 132px; border: 1.5px solid var(--line); border-radius: 10px; background: white; padding: 7px; font-size: 12px; font-weight: 800; }

.bottom-nav { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; display: flex; width: 100%; max-width: 480px; margin: auto; border-top: 1px solid var(--line); background: rgba(255,254,252,.95); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); backdrop-filter: blur(12px); }
.tab { position: relative; min-width: 0; flex: 1; overflow: hidden; border: 0; border-radius: 12px; background: transparent; padding: 9px 3px; color: var(--muted); font-size: 11px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.tab.active { background: var(--accent-soft); color: var(--accent-dark); }
.tab-dot { position: absolute; top: 5px; right: 20%; width: 7px; height: 7px; border: 2px solid var(--surface); border-radius: 50%; background: var(--accent); }

.backdrop { position: fixed; z-index: 50; inset: 0; display: flex; align-items: flex-end; justify-content: center; background: rgba(42,38,34,.46); padding-top: 32px; }
.sheet { width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow-y: auto; border-radius: 22px 22px 0 0; background: var(--surface); box-shadow: var(--shadow); animation: rise .22s ease-out; }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }
.sheet-head { position: sticky; z-index: 3; top: 0; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,254,252,.96); padding: 12px 16px; backdrop-filter: blur(10px); }
.sheet-head h2 { margin: 0; font-size: 17px; font-weight: 900; }
.sheet-body { padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
.photo-drop { position: relative; display: grid; min-height: 190px; overflow: hidden; place-items: center; border: 1.5px dashed #cfc4b4; border-radius: 16px; background: repeating-linear-gradient(45deg,#f1ece2 0 12px,#faf7f0 12px 24px); color: var(--muted); cursor: pointer; }
.photo-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-drop span { position: relative; z-index: 1; border-radius: 999px; background: rgba(255,254,252,.88); padding: 7px 11px; font-size: 12px; font-weight: 800; }
.photo-drop.static { cursor: default; }
.cake-title { margin: 16px 0 0; font-size: 23px; font-weight: 900; line-height: 1.15; }
.cake-byline { margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.description { margin: 12px 0 0; font-size: 14px; }
.notes { margin-top: 10px; border-radius: 12px; background: var(--neutral); padding: 10px 12px; color: var(--muted); font-size: 12px; }
.vote-section { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.criterion + .criterion { margin-top: 18px; }
.criterion-head { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; font-weight: 900; }
.score-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.score-btn { aspect-ratio: 1.25; border: 1.5px solid var(--line); border-radius: 10px; background: white; font-weight: 900; }
.score-btn.selected { border-color: var(--accent); background: var(--accent); color: white; }
.result-score { margin-top: 18px; color: var(--accent-dark); font-size: 30px; font-weight: 900; }
.bar-row { margin-top: 12px; }
.bar-label { display: flex; justify-content: space-between; font-size: 12px; font-weight: 800; }
.mini-bar { height: 7px; overflow: hidden; margin-top: 5px; border-radius: 99px; background: var(--neutral); }
.mini-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.message { margin-top: 16px; border-radius: 12px; background: var(--neutral); padding: 13px; color: var(--muted); font-size: 12.5px; }
.footnote { margin: 8px 0 0; color: var(--faint); text-align: center; font-size: 10.5px; }
.toast { position: fixed; z-index: 100; right: 16px; bottom: 92px; left: 16px; max-width: 430px; margin: auto; border-radius: 12px; background: #2a2622; padding: 11px 14px; color: white; text-align: center; font-size: 12px; font-weight: 800; animation: rise .2s ease-out; }
.sync-banner { margin: 0 16px 8px; border-radius: 10px; background: var(--neutral); padding: 7px 10px; color: var(--muted); text-align: center; font-size: 11px; font-weight: 800; }

.auth-page { display: grid; min-height: 100vh; place-items: center; padding: 24px 16px; background: radial-gradient(circle at top, #fffaf0 0, var(--bg) 52%); }
.auth-card { width: min(100%, 390px); border: 1px solid var(--line); border-radius: 24px; background: var(--surface); padding: 26px; box-shadow: var(--shadow); }
.auth-brand { border-bottom: 1px dashed var(--line); padding-bottom: 18px; }
.auth-card h2 { margin: 22px 0 6px; font-size: 23px; }
.auth-form { margin-top: 18px; }
.auth-message { margin-top: 14px; border-radius: 12px; background: var(--neutral); padding: 11px 13px; color: var(--muted); font-size: 12px; font-weight: 700; line-height: 1.45; }
.auth-switch { width: 100%; margin-top: 16px; border: 0; background: transparent; color: var(--accent); font-size: 12px; font-weight: 900; }
.loading-card { display: grid; justify-items: center; text-align: center; }
.loading-card .auth-brand { width: 100%; }
.spinner { width: 28px; height: 28px; margin-top: 24px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 560px) {
  body { background: linear-gradient(135deg, #eee8dd, #f8f5ef); }
  .app-shell { background: var(--bg); box-shadow: 0 0 60px rgba(74,58,40,.1); }
  .bottom-nav { box-shadow: 0 -8px 30px rgba(74,58,40,.05); }
  .sheet { border-radius: 22px; }
  .backdrop { align-items: center; padding: 24px; }
}

@media (min-width: 720px) {
  .app-shell { max-width: 860px; padding-bottom: 28px; }
  .app-header { padding: 26px 24px 8px; }
  .brand h1 { font-size: 27px; }
  .brand p { font-size: 12.5px; }
  .identity.signed-in b { max-width: 220px; font-size: 13px; }
  .round-wrap { padding: 0 24px 6px; }
  .round-pill, .pill { padding: 5px 11px; font-size: 11.5px; }
  .bottom-nav { position: sticky; top: 10px; right: auto; bottom: auto; left: auto; width: auto; max-width: none; margin: 8px 24px 10px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,254,252,.94); padding: 6px; box-shadow: 0 12px 30px rgba(74,58,40,.08); }
  .tab { padding: 10px 12px; font-size: 12px; }
  .tab-dot { top: 6px; right: 24%; }
  .screen { gap: 16px; padding: 8px 24px 36px; }
  .card { padding: 17px 18px; }
  .hero { padding: 22px; }
  .hero h2 { font-size: 25px; }
  .schedule-tab .screen, .results-tab .screen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .schedule-tab .screen > .round-context, .schedule-tab .screen > .hint { grid-column: 1 / -1; }
  .cakes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cakes-grid > .empty { grid-column: 1 / -1; }
  .archived-round { grid-template-columns: minmax(170px, 210px) minmax(0, 1fr); gap: 18px; align-items: start; }
  .archived-round-head { border-right: 1px dashed var(--line); padding-right: 18px; }
  .archived-cakes { grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); }
  .archived-summary { align-self: center; }
  .results-tab .screen > .announcement { grid-column: 1 / -1; }
  .admin-tab .admin-screen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
  .admin-column { display: flex; min-width: 0; flex-direction: column; gap: 18px; }
  .admin-column > .card { width: 100%; }
  .admin-card-1, .admin-card-2, .admin-card-3, .admin-card-4, .admin-card-5 { order: initial; }
  .calendar-day { min-height: 62px; padding: 6px 5px; font-size: 11px; }
  .calendar-event { padding: 4px 2px; font-size: 9px; }
  .sheet { width: min(720px, 100%); max-width: 720px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); }
  .sheet-head { padding: 15px 22px; }
  .sheet-head h2 { font-size: 19px; }
  .sheet-body { padding: 22px 24px 28px; }
  .photo-drop { min-height: 280px; }
  .score-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  .score-btn { aspect-ratio: 1; }
  .toast { right: 24px; bottom: 24px; left: auto; width: min(460px, calc(100% - 48px)); }
  .sync-banner { margin: 0 24px 8px; }
}

@media (min-width: 960px) {
  .app-shell { max-width: 1120px; }
  .app-header { padding: 30px 32px 10px; }
  .brand h1 { font-size: 30px; }
  .round-wrap { padding-right: 32px; padding-left: 32px; }
  .bottom-nav { margin-right: 32px; margin-left: 32px; }
  .screen { gap: 18px; padding: 10px 32px 44px; }
  .home-screen { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-areas: "hero hero hero hero hero hero hero progress progress progress progress progress" "calendar calendar calendar calendar calendar calendar calendar leaderboard leaderboard leaderboard leaderboard leaderboard" "calendar calendar calendar calendar calendar calendar calendar recent recent recent recent recent"; align-items: start; }
  .home-screen.has-banner { grid-template-areas: "banner banner banner banner banner banner banner banner banner banner banner banner" "hero hero hero hero hero hero hero progress progress progress progress progress" "calendar calendar calendar calendar calendar calendar calendar leaderboard leaderboard leaderboard leaderboard leaderboard" "calendar calendar calendar calendar calendar calendar calendar recent recent recent recent recent"; }
  .home-screen > .banner { grid-area: banner; }
  .home-screen > .hero { grid-area: hero; min-height: 196px; }
  .home-screen > .progress-card { grid-area: progress; min-height: 196px; }
  .home-screen > .calendar-card { grid-area: calendar; }
  .home-screen > .leaderboard-card { grid-area: leaderboard; }
  .home-screen > .recent-card { grid-area: recent; }
  .calendar-day { min-height: 72px; }
}

@media (max-width: 520px) {
  .identity.signed-in { max-width: 100%; }
  .cakes-toolbar { align-items: stretch; flex-direction: column; }
  .cakes-toolbar .btn.primary { width: 100%; }
  .form-row { flex-wrap: wrap; }
  .form-row > .field { flex-basis: 100%; }
  .settings-row { align-items: flex-start; }
  .account-row { flex-wrap: wrap; }
  .account-row .grow { flex-basis: calc(100% - 54px); }
  .account-row .status { margin-left: 54px; }
}

@media (max-width: 420px) {
  .app-header { align-items: stretch; flex-direction: column; }
  .identity.signed-in { width: 100%; justify-content: space-between; text-align: left; }
  .schedule-card .person-row { flex-wrap: wrap; }
  .schedule-card .grow { flex-basis: calc(100% - 104px); }
  .schedule-card .status { margin-left: 104px; }
  .schedule-card .manage-link { margin-left: auto; }
  .manage-panel > .btn { flex: 1 1 calc(50% - 8px); }
  .calendar-day { min-height: 43px; padding-right: 2px; padding-left: 2px; }
  .calendar-event { font-size: 7.5px; }
  .calendar-details { grid-template-columns: 1fr; }
  .calendar-details .status { grid-column: 1; grid-row: auto; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
