:root {
    color-scheme: light;
    --ink: #111318;
    --muted: #66707f;
    --soft: #eef1f6;
    --line: #dde3eb;
    --panel: #ffffff;
    --canvas: #f3f5f8;
    --accent: #00a0b0;
    --accent-strong: #006c78;
    --hot: #ff5a70;
    --violet: #7b61ff;
    --sun: #f2b84b;
    --green: #21a67a;
    --rose: #d9516f;
    --blue: #3478d4;
    --amber: #c7801d;
    --shadow: 0 18px 42px rgba(17, 19, 24, 0.14);
    --shadow-soft: 0 10px 26px rgba(17, 19, 24, 0.09);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--canvas);
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    background:
        linear-gradient(180deg, rgba(17, 19, 24, 0.96) 0, rgba(17, 19, 24, 0.96) 170px, rgba(17, 19, 24, 0) 171px),
        linear-gradient(135deg, rgba(0, 160, 176, 0.14), rgba(255, 90, 112, 0.09) 45%, rgba(123, 97, 255, 0.1)),
        var(--canvas);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
    touch-action: manipulation;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(2rem, 4vw, 3.35rem);
    line-height: 1;
    letter-spacing: 0;
    text-wrap: balance;
}

h2 {
    margin-bottom: 6px;
    font-size: 1.45rem;
    letter-spacing: 0;
}

h3 {
    margin-bottom: 12px;
}

.topbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: calc(26px + var(--safe-top)) clamp(18px, 5vw, 64px) 22px;
    color: #fff;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.brand-crest {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.32);
}

.topbar::after {
    content: "";
    position: absolute;
    right: clamp(18px, 5vw, 64px);
    bottom: 12px;
    width: 118px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), var(--hot), var(--sun));
}

.eyebrow {
    margin: 0 0 6px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0;
    text-transform: uppercase;
}

.person-picker {
    display: grid;
    gap: 7px;
    min-width: 250px;
}

.person-picker label {
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.82rem;
    font-weight: 750;
}

.account-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-row select {
    min-width: 0;
}

.account-row a {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 11px 12px;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 800;
}

.account-row select:disabled {
    opacity: 1;
    color: var(--ink);
    -webkit-text-fill-color: var(--ink);
}

select,
input,
textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink);
    padding: 12px 13px;
    outline: none;
    font-size: 16px;
}

textarea {
    line-height: 1.45;
}

select:focus,
input:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 160, 176, 0.16);
}

.shell {
    display: grid;
    gap: 18px;
    padding: 0 clamp(14px, 4vw, 64px) 48px;
}

.week-strip {
    display: grid;
    grid-template-columns: repeat(7, minmax(118px, 1fr));
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 3px;
}

.day-card {
    min-height: 104px;
    border: 1px solid rgba(17, 19, 24, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 13px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset;
}

.day-card.today {
    border-color: transparent;
    background:
        linear-gradient(135deg, rgba(0, 160, 176, 0.96), rgba(123, 97, 255, 0.92)),
        #111318;
    color: #fff;
    box-shadow: 0 14px 30px rgba(0, 111, 128, 0.24);
}

.day-card.today .day-name,
.day-card.today .day-event {
    color: rgba(255, 255, 255, 0.84);
}

.day-name {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
}

.day-number {
    margin: 2px 0 8px;
    font-size: 1.58rem;
    font-weight: 900;
}

.day-event {
    display: block;
    overflow: hidden;
    max-width: 100%;
    color: var(--ink);
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace {
    display: grid;
    grid-template-columns: 198px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.tabs {
    position: sticky;
    top: 12px;
    display: grid;
    gap: 7px;
    border: 1px solid rgba(17, 19, 24, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    padding: 8px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.tab {
    position: relative;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    padding: 12px 13px;
    text-align: left;
    font-weight: 820;
}

.tab::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 10px;
    border: 2px solid currentColor;
    border-radius: 5px;
    vertical-align: -4px;
    opacity: 0.9;
}

.tab[data-icon="cal"]::before {
    border-top-width: 5px;
}

.tab[data-icon="home"]::before {
    border-radius: 4px 4px 7px 7px;
    transform: translateY(1px) rotate(45deg);
}

.tab[data-icon="school"]::before {
    border-radius: 4px 4px 2px 2px;
    transform: skewY(-8deg);
}

.tab[data-icon="shop"]::before {
    border-radius: 3px 3px 7px 7px;
    border-top-width: 6px;
}

.tab[data-icon="task"]::before {
    border-radius: 50%;
    box-shadow: inset 4px -4px 0 -2px currentColor;
}

.tab[data-icon="meal"]::before {
    width: 14px;
    border-radius: 999px 999px 5px 5px;
}

.tab[data-icon="weekend"]::before {
    border-radius: 999px;
}

.tab[data-icon="note"]::before {
    border-radius: 4px;
    box-shadow: inset 0 -5px 0 -3px currentColor;
}

.tab.active {
    border-color: transparent;
    background: var(--ink);
    color: #fff;
    box-shadow: 0 11px 24px rgba(17, 19, 24, 0.16);
}

.tab.active::before {
    color: var(--accent);
}

.panel {
    display: none;
    min-height: 560px;
    border: 1px solid rgba(17, 19, 24, 0.08);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow);
    padding: clamp(16px, 3vw, 28px);
}

.panel::before {
    content: "";
    display: block;
    height: 4px;
    margin: calc(-1 * clamp(16px, 3vw, 28px)) calc(-1 * clamp(16px, 3vw, 28px)) 18px;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(90deg, var(--accent), var(--hot), var(--sun), var(--violet));
}

.panel.active {
    display: block;
}

.panel-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.panel-nav button {
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-weight: 850;
    cursor: pointer;
}

.back-button::before {
    content: "‹";
    margin-right: 6px;
    font-size: 1.45rem;
    line-height: 0;
    vertical-align: -2px;
}

.home-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.home-button::before {
    content: "⌂";
    font-size: 1.2rem;
}

.home-panel {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

.home-panel::before {
    display: none;
}

.hero-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 18px;
    align-items: center;
    overflow: hidden;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(17, 19, 24, 0.48), rgba(17, 19, 24, 0.2) 52%, rgba(17, 19, 24, 0.44)),
        url('/images/IMG_3256.JPG?v=1.8.3') center 42% / cover no-repeat;
    color: #fff;
    padding: clamp(18px, 4vw, 28px);
    box-shadow: 0 18px 40px rgba(0, 88, 112, 0.24);
}

.hero-card .eyebrow {
    color: rgba(255, 255, 255, 0.76);
}

.hero-card h2 {
    max-width: 520px;
    margin-bottom: 16px;
    font-size: clamp(1.6rem, 4vw, 2.25rem);
    line-height: 1.05;
}

.avatar-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    background: var(--avatar-color);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(17, 19, 24, 0.18);
}

.hero-art {
    display: grid;
    place-items: center;
    min-height: 145px;
}

.hero-crest {
    width: min(178px, 32vw);
    height: auto;
    border-radius: 8px;
    filter: drop-shadow(0 18px 28px rgba(17, 19, 24, 0.28));
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.dashboard-card {
    display: grid;
    position: relative;
    min-height: 132px;
    border: 1px solid rgba(17, 19, 24, 0.08);
    border-radius: 8px;
    background-image:
        linear-gradient(120deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.78) 56%, rgba(255, 255, 255, 0.3) 100%),
        var(--card-image);
    background-position: center;
    background-size: cover;
    color: var(--ink);
    padding: 14px;
    text-align: left;
    box-shadow: var(--shadow-soft);
}

.dashboard-card strong {
    align-self: end;
    margin-top: 18px;
    font-size: 1.05rem;
}

.dashboard-value,
.dashboard-meta {
    display: block;
    overflow: hidden;
    max-width: 100%;
    color: var(--muted);
    font-size: 0.84rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-value {
    color: var(--ink);
    font-weight: 850;
}

.dashboard-icon {
    display: block;
    width: 32px;
    height: 32px;
    justify-self: end;
    border: 3px solid var(--card-color, var(--accent));
    border-radius: 8px;
}

.dashboard-cal { --card-color: var(--green); }
.dashboard-school { --card-color: var(--hot); }
.dashboard-shop { --card-color: var(--accent); }
.dashboard-task { --card-color: var(--violet); }
.dashboard-meal { --card-color: var(--blue); }
.dashboard-weekend { --card-color: var(--sun); }
.dashboard-note { --card-color: var(--amber); }
.dashboard-bell { --card-color: var(--rose); }
.dashboard-budget { --card-color: var(--green); }

.month-card {
    border: 1px solid rgba(17, 19, 24, 0.08);
    border-radius: 8px;
    background: #fff;
    padding: 14px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 16px;
}

.household-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.household-form .field-label:nth-child(5),
.household-form .field-label:nth-child(6),
.household-form button {
    grid-column: 1 / -1;
}

.household-form button {
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--green), var(--accent));
    color: #fff;
    padding: 12px 14px;
    font-weight: 850;
}

.expense-summary {
    margin-bottom: 12px;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    padding: 14px;
    font-weight: 850;
}

.receipt-text {
    grid-column: 1 / -1;
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.8rem;
}

.receipt-text summary {
    cursor: pointer;
    color: var(--accent-strong);
    font-weight: 850;
}

.receipt-text pre {
    overflow-x: auto;
    margin: 8px 0 0;
    white-space: pre-wrap;
    font: inherit;
}

.media-upload {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
}

.media-upload button {
    border: 0;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    padding: 12px 16px;
    font-weight: 850;
}

.media-usage {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 0.84rem;
}

.usage-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--soft);
}

.usage-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--violet));
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.media-card {
    display: grid;
    gap: 7px;
    min-width: 0;
    border: 1px solid rgba(17, 19, 24, 0.08);
    border-radius: 8px;
    background: #fff;
    padding: 10px;
}

.media-card > strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-preview {
    width: 100%;
    border: 0;
    padding: 0;
    cursor: pointer;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 6px;
    background: var(--soft);
}

.media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-viewer {
    width: min(94vw, 900px);
    max-width: 900px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: #111318;
    color: #fff;
}

.media-viewer::backdrop {
    background: rgba(0, 0, 0, 0.82);
}

.media-viewer-card {
    display: grid;
    gap: 14px;
    padding: 14px;
}

.media-viewer-head,
.media-viewer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.media-viewer-head strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-viewer-stage {
    display: grid;
    place-items: center;
    min-height: min(62vh, 620px);
    border-radius: 8px;
    background: #050608;
}

.media-viewer-stage img,
.media-viewer-stage video {
    display: block;
    max-width: 100%;
    max-height: 68vh;
    object-fit: contain;
}

.media-viewer .icon-button {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.12);
}

.media-viewer .secondary,
.media-viewer .small-button {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
}

.video-mark {
    color: var(--accent-strong);
    font-size: 0.8rem;
    font-weight: 900;
}

.media-card .entry-actions {
    flex-wrap: wrap;
}

.media-card .entry-actions a {
    text-decoration: none;
}

.month-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.month-head h3 {
    margin: 0;
    text-transform: capitalize;
}

.month-head span {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
}

.month-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.month-weekday {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-align: center;
}

.month-day {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    background: #f3f5f8;
    color: var(--ink);
    font-weight: 850;
}

.month-day.muted {
    color: #a9b1bd;
}

.month-day.today {
    background: linear-gradient(135deg, var(--accent), var(--violet));
    color: #fff;
}

.month-day i {
    position: absolute;
    right: 5px;
    bottom: 5px;
    display: grid;
    place-items: center;
    min-width: 15px;
    height: 15px;
    border-radius: 999px;
    background: var(--hot);
    color: #fff;
    font-size: 0.62rem;
    font-style: normal;
    line-height: 1;
}

.panel-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-head p {
    margin-bottom: 0;
    color: var(--muted);
}

.icon-button {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--hot), var(--violet));
    color: #fff;
    font-size: 1.45rem;
    font-weight: 750;
    box-shadow: 0 12px 24px rgba(255, 90, 112, 0.28);
}

.timeline,
.list,
.meal-grid {
    display: grid;
    gap: 10px;
}

.entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    border: 1px solid rgba(17, 19, 24, 0.08);
    border-radius: 8px;
    background: #fff;
    padding: 14px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 8px 22px rgba(17, 19, 24, 0.05);
}

.entry.done {
    opacity: 0.58;
}

.entry.done .entry-title {
    text-decoration: line-through;
}

.entry-title {
    overflow-wrap: anywhere;
    font-weight: 850;
}

.entry-badge {
    display: inline-block;
    margin-left: 8px;
    border-radius: 999px;
    background: rgba(255, 90, 112, 0.12);
    color: #a93247;
    padding: 3px 8px;
    font-size: 0.76rem;
    font-weight: 900;
    vertical-align: 1px;
}

.entry-meta {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.86rem;
}

.category-heading {
    margin: 14px 0 0;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 900;
    text-transform: uppercase;
}

.person-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: -1px;
}

.entry-actions {
    display: flex;
    gap: 8px;
}

.small-button,
.entry-actions button,
.inline-form button,
.save-note,
menu button {
    border: 0;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    padding: 10px 13px;
    font-weight: 820;
}

.entry-actions button {
    min-width: 39px;
    padding: 9px 10px;
}

.entry-actions button.secondary,
menu button[value="cancel"] {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
}

.entry-actions button.vote {
    background: linear-gradient(135deg, var(--accent), var(--green));
}

.entry-actions button.complete-task {
    background: linear-gradient(135deg, var(--green), #16815d);
}

.inline-form {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(120px, 0.8fr) minmax(130px, 0.8fr) auto;
    gap: 10px;
    margin-bottom: 18px;
}

#choreForm {
    grid-template-columns: minmax(180px, 1.3fr) minmax(130px, 0.8fr) minmax(130px, 0.8fr) minmax(130px, 0.8fr) auto;
}

#mealForm {
    grid-template-columns: minmax(130px, 0.6fr) minmax(190px, 1.2fr) minmax(160px, 1fr) auto;
}

#weekendForm {
    grid-template-columns: minmax(180px, 1.2fr) minmax(120px, 0.7fr) minmax(160px, 1fr) auto;
}

.child-switch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    margin: 0 0 16px;
}

.child-switch button {
    display: grid;
    min-height: 108px;
    justify-items: start;
    align-content: center;
    gap: 5px;
    border: 1px solid rgba(17, 19, 24, 0.08);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    padding: 14px;
    font-weight: 850;
    text-align: left;
    box-shadow: var(--shadow-soft);
}

.child-switch button.active {
    border-color: var(--person-color);
    background: var(--soft);
    color: var(--ink);
    box-shadow: inset 0 0 0 2px var(--person-color), var(--shadow-soft);
}

.schedule-avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--person-color);
    color: #fff;
    font-size: 0.78rem;
}

.schedule-person-meta {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(150px, 1fr));
    gap: 10px;
    overflow-x: auto;
}

.schedule-day {
    min-width: 150px;
    border: 1px solid rgba(17, 19, 24, 0.08);
    border-radius: 8px;
    background: #fbfcfd;
    padding: 12px;
}

.schedule-day h3 {
    margin-bottom: 10px;
    font-size: 0.98rem;
}

.lesson {
    position: relative;
    margin-bottom: 9px;
    border-left: 4px solid var(--accent);
    border-radius: 7px;
    background: #fff;
    padding: 10px 30px 10px 10px;
    box-shadow: 0 8px 18px rgba(17, 19, 24, 0.05);
}

.lesson.dotted {
    background:
        linear-gradient(90deg, rgba(123, 97, 255, 0.12), rgba(255, 255, 255, 0)),
        #fff;
}

.lesson button {
    position: absolute;
    top: 7px;
    right: 7px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-weight: 900;
}

.meal-card {
    border: 1px solid rgba(17, 19, 24, 0.08);
    border-radius: 8px;
    background: #fff;
    padding: 14px;
}

.meal-actions {
    justify-content: flex-end;
    margin-top: 12px;
}

textarea#notesInput {
    min-height: 300px;
    resize: vertical;
}

.save-note {
    margin-top: 12px;
    background: linear-gradient(135deg, var(--accent), var(--violet));
}

dialog {
    width: min(520px, calc(100vw - 28px));
    border: 0;
    border-radius: 8px;
    padding: 0;
    box-shadow: var(--shadow);
}

dialog::backdrop {
    background: rgba(17, 19, 24, 0.44);
}

.dialog-card {
    display: grid;
    gap: 10px;
    padding: 22px;
}

.field-label {
    display: grid;
    gap: 5px;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 850;
}

.two {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

menu {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin: 8px 0 0;
    padding: 0;
}

.empty {
    border: 1px dashed #c7ced6;
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.62);
    padding: 18px;
    text-align: center;
}

.login-page {
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
    place-items: center;
    padding: 18px;
    overflow-x: hidden;
    background:
        linear-gradient(180deg, #111318 0, #111318 38%, rgba(17, 19, 24, 0) 38%),
        linear-gradient(135deg, rgba(0, 160, 176, 0.18), rgba(255, 90, 112, 0.12) 52%, rgba(123, 97, 255, 0.15)),
        var(--canvas);
}

.login-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 420px;
    min-width: 0;
    border: 1px solid rgba(17, 19, 24, 0.08);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
    padding: 28px;
}

.login-card::before {
    content: "";
    display: block;
    height: 5px;
    margin: -28px -28px 22px;
    background: linear-gradient(90deg, var(--accent), var(--hot), var(--sun), var(--violet));
}

.login-crest {
    display: block;
    width: 82px;
    height: 82px;
    margin: 0 0 16px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 12px 24px rgba(17, 19, 24, 0.18);
}

.login-card h1 {
    margin-bottom: 22px;
}

.login-card form {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.login-card button {
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--violet));
    color: #fff;
    padding: 12px 14px;
    font-weight: 850;
}

.login-error {
    margin: 0;
    color: #a33b45;
    font-weight: 750;
}

@media (max-width: 860px) {
    body {
        background:
            linear-gradient(180deg, rgba(17, 19, 24, 0.98) 0, rgba(17, 19, 24, 0.98) 146px, rgba(17, 19, 24, 0) 147px),
            linear-gradient(135deg, rgba(0, 160, 176, 0.16), rgba(255, 90, 112, 0.11) 52%, rgba(123, 97, 255, 0.12)),
            var(--canvas);
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 20;
        align-items: center;
        flex-direction: row;
        gap: 12px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.09);
        background: rgba(17, 19, 24, 0.92);
        padding: calc(13px + var(--safe-top)) 14px 13px;
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .topbar::after {
        right: 14px;
        bottom: 0;
        width: 96px;
        height: 3px;
    }

    .topbar h1 {
        font-size: 1.35rem;
    }

    .brand-lockup {
        gap: 9px;
    }

    .brand-crest {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .eyebrow {
        display: none;
    }

    .person-picker {
        min-width: 178px;
    }

    .person-picker label {
        display: none;
    }

    .person-picker select {
        min-height: 42px;
        border-radius: 8px;
        border-color: rgba(255, 255, 255, 0.16);
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
        -webkit-text-fill-color: #fff;
        padding: 9px 12px;
    }

    .account-row {
        gap: 6px;
    }

    .account-row a {
        border-color: rgba(255, 255, 255, 0.16);
        padding: 10px 9px;
        font-size: 0.76rem;
    }

    .account-row select:disabled {
        color: #fff;
        -webkit-text-fill-color: #fff;
    }

    .shell {
        gap: 12px;
        padding: 12px 12px calc(96px + var(--safe-bottom));
    }

    .hero-card {
        grid-template-columns: 1fr;
        min-height: 236px;
        padding: 20px;
    }

    .hero-card h2 {
        max-width: 280px;
        font-size: 1.58rem;
    }

    .hero-art {
        position: absolute;
        right: 18px;
        bottom: 18px;
        min-height: 0;
        opacity: 0.92;
    }

    .hero-crest {
        width: 126px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-top: 10px;
    }

    .dashboard-card {
        min-height: 126px;
        padding: 12px;
    }

    .dashboard-card strong {
        font-size: 1rem;
    }

    .dashboard-icon {
        width: 30px;
        height: 30px;
    }

    .week-strip {
        grid-template-columns: repeat(7, 78px);
        gap: 8px;
        margin: 0 -12px;
        padding: 0 12px 2px;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .week-strip::-webkit-scrollbar {
        display: none;
    }

    .day-card {
        min-height: 88px;
        scroll-snap-align: start;
        padding: 10px;
    }

    .day-number {
        font-size: 1.35rem;
    }

    .day-event {
        font-size: 0.76rem;
    }

    .workspace {
        display: block;
    }

    .tabs {
        display: none;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab {
        flex: 0 0 auto;
        min-width: 72px;
        min-height: 52px;
        border: 1px solid transparent;
        border-radius: 8px;
        padding: 8px 10px;
        color: rgba(255, 255, 255, 0.62);
        font-size: 0;
        text-align: center;
        white-space: nowrap;
    }

    .tab::before {
        display: block;
        width: 18px;
        height: 18px;
        margin: 0 auto 4px;
        font-size: 0;
        line-height: 1;
        vertical-align: 0;
    }

    .tab::after {
        content: attr(data-short);
        display: block;
        font-size: 0.7rem;
        font-weight: 850;
        line-height: 1.1;
    }

    .tab.active {
        border-color: rgba(255, 255, 255, 0.12);
        background: rgba(255, 255, 255, 0.12);
        box-shadow: none;
        color: #fff;
    }

    .panel {
        min-height: auto;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        padding: 4px 0 calc(12px + var(--safe-bottom));
    }

    .panel::before {
        display: none;
    }

    .panel-head {
        margin-bottom: 14px;
    }

    .month-card {
        padding: 12px;
        margin-bottom: 12px;
    }

    .month-day {
        min-height: 40px;
        font-size: 0.9rem;
    }

    .panel-head h2 {
        font-size: 1.25rem;
    }

    .panel-head p {
        font-size: 0.88rem;
    }

    .icon-button {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
    }

    .entry,
    .meal-card,
    .schedule-day,
    .empty {
        box-shadow: var(--shadow-soft);
    }

    .entry-actions button,
    .inline-form button,
    .child-switch button,
    .save-note,
    menu button {
        min-height: 44px;
    }

    .child-switch {
        grid-template-columns: repeat(3, minmax(132px, 1fr));
        margin: 0 -12px 12px;
        width: auto;
        padding: 0 12px 4px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .child-switch::-webkit-scrollbar {
        display: none;
    }

    .child-switch button {
        min-height: 100px;
    }

    .schedule-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .schedule-day {
        min-width: 0;
    }

    .inline-form,
    #choreForm,
    #mealForm,
    #weekendForm,
    .household-form {
        grid-template-columns: 1fr;
    }

    .household-form .field-label:nth-child(5),
    .household-form .field-label:nth-child(6),
    .household-form button {
        grid-column: auto;
    }

    dialog {
        width: 100vw;
        max-width: none;
        margin: auto 0 0;
        border-radius: 8px 8px 0 0;
    }

    .dialog-card {
        padding: 20px 16px calc(20px + var(--safe-bottom));
    }
}

@media (max-width: 560px) {
    .panel-head {
        align-items: stretch;
        flex-direction: column;
    }

    .entry {
        grid-template-columns: 1fr;
    }

    .entry-actions {
        justify-content: flex-end;
    }
}

@media (max-width: 560px) {
    .media-upload {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}
