:root {
  color-scheme: light;
  --bg: #f7f6f9; --surface: #fff; --sidebar: #fdfcfe; --text: #28242d; --muted: #655f70;
  --line: #e9e5ed; --ink: #453752; --on-ink: #fff; --accent: #eee8f6;
  --wash: #e2d5f0; --glow: #f7e8e1; --hint: #735463; --shadow: 0 10px 32px #30213c07;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #201f23; --surface: #29272d; --sidebar: #242227; --text: #f6f0f7; --muted: #c5bacb;
  --line: #413b47; --ink: #e7d8ee; --on-ink: #2e2432; --accent: #40354a;
  --wash: #493952; --glow: #342e3b; --hint: #d8adc0; --shadow: 0 12px 32px #0002;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 3px;
}
a { color: var(--ink); }
svg { width: 19px; height: 19px; flex: none; vertical-align: middle; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.15; letter-spacing: -.06em; font-weight: 680; }
h2 { font-size: 18px; letter-spacing: -.03em; }
h3 { font-size: 15px; letter-spacing: -.015em; }
small, .muted { color: var(--muted); }
.loading { padding: 36px; font-size: 22px; font-weight: 650; }
.loading span { margin-left: 8px; font-size: 14px; color: var(--muted); }
.layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; padding: 30px 18px 21px; display: flex; flex-direction: column; gap: 44px; background: var(--sidebar); border-right: 1px solid var(--line); }
.brand { display: flex; gap: 11px; align-items: center; padding: 0 7px; white-space: nowrap; }
.brand-mark, .symbol { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; flex: none; background: var(--accent); color: var(--ink); }
.brand-mark { background: linear-gradient(145deg, var(--wash), var(--glow)); }
.brand-mark svg { width: 22px; height: 22px; }
.brand strong { display: block; font-size: 17px; letter-spacing: .04em; line-height: 1.25; }
.brand small { display: block; font-size: 11px; letter-spacing: .06em; }
.nav { display: grid; gap: 5px; }
.nav-button { display: flex; align-items: center; gap: 11px; border: 0; border-radius: 13px; padding: 0 12px; min-height: 46px; background: transparent; color: var(--muted); text-align: left; }
.nav-button:hover, .icon-button:hover { background: var(--accent); color: var(--ink); }
.nav-button[aria-current="page"] { background: var(--accent); color: var(--ink); font-weight: 650; }
.sidebar-footer { margin-top: auto; display: grid; gap: 4px; }
.sidebar-footer small { margin: 8px 12px 0; display: flex; gap: 8px; align-items: center; font-size: 11px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.mobile-header, .mobile-nav { display: none; }
.account-gate { display: grid; gap: 20px; width: min(100% - 36px, 420px); margin: 56px auto; }
.account-gate a, .family-account a { text-decoration: none; }
.email-gate { margin-top: clamp(42px, 14svh, 120px); }
.login-card { display: grid; gap: 10px; padding: 27px 24px; }
.login-card h1 { font-size: 29px; letter-spacing: -.035em; }
.login-card > p { font-size: 14px; }
.login-form { display: grid; gap: 12px; margin-top: 9px; }
.login-feedback { color: var(--hint); font-size: 13px; }
.login-options { justify-content: space-between; }
.login-footer { text-align: center; font-size: 13px; }
.login-footer a { padding: 10px; text-decoration: underline; text-underline-offset: 3px; }
.privacy-page { width: min(calc(100% - 36px), 660px); margin: 34px auto; }
.privacy-copy { display: grid; gap: 13px; margin-top: 14px; padding: clamp(18px, 5vw, 36px); }
.privacy-copy h1 { font-size: clamp(28px, 5vw, 36px); }
.privacy-copy h2 { margin-top: 8px; }
.family-account { display: flex; align-items: center; gap: 12px; }
.family-account h3, .family-row span { overflow-wrap: anywhere; }
.family-row > div { min-width: 0; }
.family-row > div small { display: block; }
.family-row .icon-button, .family-row button { flex: none; }
.reward-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 15px 17px; border-radius: 17px; background: linear-gradient(135deg, var(--wash), var(--accent)); }
.reward-summary strong { display: block; font-size: 28px; font-variant-numeric: tabular-nums; }
.reward-summary strong span { font-size: 14px; }
.reward-items { margin-top: -13px; }
.reward-items .actions { flex-wrap: nowrap; }
.nav-create { position: relative; align-self: center; justify-self: center; transform: translateY(-11px); }
.nav-add { display: grid; place-items: center; width: 49px; height: 49px; padding: 0; border: 1px solid var(--ink); border-radius: 17px; background: var(--ink); color: var(--on-ink); box-shadow: 0 4px 13px #24202929; }
.nav-add svg { width: 25px; height: 25px; stroke-width: 1.8; }
.first-task-hint {
  position: absolute; inset: auto auto calc(100% + 12px) 50%; transform: translateX(-50%);
  min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.first-task-hint::after {
  content: ""; position: absolute; top: 100%; left: 50%; width: 9px; height: 9px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--surface); transform: translate(-50%, -50%) rotate(45deg); pointer-events: none;
}
.first-task-hint:hover, .first-task-hint:hover::after { background: var(--accent); }
.workspace { width: min(100%, 1230px); margin-inline: auto; padding: 42px clamp(22px, 4.7vw, 69px) 58px; }
.page-header { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin: 0 0 23px; }
.page-header .eyebrow { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.primary, .secondary, .icon-button, .text-button { min-height: 44px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 590; }
.primary { background: var(--ink); color: var(--on-ink); border: 1px solid var(--ink); padding: 0 15px; }
.secondary { background: var(--surface); border: 1px solid var(--line); padding: 0 13px; }
.text-button, .icon-button { background: transparent; border: 0; }
.text-button { padding: 0 8px; color: var(--ink); }
.icon-button { width: 44px; padding: 0; }
.secondary:hover, .text-button:hover { background: var(--accent); }
.primary:hover { filter: brightness(1.07); }
.dashboard { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(230px, 1fr); align-items: start; gap: 18px; }
.column { display: grid; gap: 18px; min-width: 0; }
.hero {
  position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 23px 26px; min-height: 130px; border-radius: 26px;
  background: radial-gradient(ellipse at 96% -45%, var(--glow), transparent 80%), linear-gradient(132deg, var(--wash), var(--accent));
}
.hero::after { content: ""; position: absolute; z-index: -1; width: 290px; height: 190px; border-radius: 52%; inset: auto -78px -125px auto; border: 1px solid #ffffff56; box-shadow: 0 0 0 21px #ffffff14, 0 0 0 42px #ffffff0d; transform: rotate(-22deg); }
.hero strong { font-size: 35px; letter-spacing: -.065em; line-height: 1.12; font-variant-numeric: tabular-nums; }
.hero small { display: block; margin-bottom: 6px; }
.hero p { display: flex; align-items: baseline; gap: 7px; font-size: 12px; }
.ring { width: 72px; height: 72px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--ink) var(--turn), #ffffff55 0); }
.ring span { border-radius: inherit; width: 61px; height: 61px; background: var(--accent); display: grid; place-items: center; font-size: 13px; font-weight: 650; color: var(--ink); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); min-width: 0; }
.card-pad { padding: 16px 18px; }
.section-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.section-label small { font-size: 12px; }
.task-list { list-style: none; padding: 0 11px; margin: 0; }
.task { min-height: 57px; display: flex; align-items: center; gap: 7px; }
.task + .task { border-top: 1px solid var(--line); }
.task-check { border: 0; padding: 0; flex: none; width: 42px; height: 44px; display: grid; place-items: center; background: transparent; }
.task-check span { display: grid; place-items: center; border: 1.5px solid var(--muted); border-radius: 50%; width: 19px; height: 19px; }
.task-check:hover span { background: var(--accent); border-color: var(--ink); }
.task-check svg { width: 13px; height: 13px; }
.task-done .task-check span { background: var(--accent); color: var(--ink); border-color: transparent; }
.task-done .task-name { color: var(--muted); text-decoration: line-through; }
.task-content { display: grid; text-align: left; gap: 2px; min-width: 0; flex: 1; padding: 8px 0; border: 0; background: transparent; overflow-wrap: anywhere; }
.task-name { font-weight: 560; }
.task-content small, .task-end { font-size: 12px; color: var(--muted); }
.task-end { text-align: right; flex: none; padding-right: 5px; }
.task-end.overdue { color: var(--hint); }
.task .icon-button { width: 36px; }
.notice-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 4px 0; }
.notice-line svg { width: 16px; height: 16px; color: var(--ink); }
.compact-list { margin-top: 5px; display: grid; }
.compact-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; }
.compact-row + .compact-row { border-top: 1px solid var(--line); }
.compact-row small { font-size: 12px; flex: none; }
.empty { padding: 20px 15px; color: var(--muted); }
.empty-large { padding: 37px 24px; text-align: center; display: grid; justify-items: center; gap: 10px; }
.empty-large .symbol { width: 52px; height: 52px; margin-bottom: 3px; }
.empty-large p { color: var(--muted); font-size: 13px; }
.calendar { padding: 12px 14px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; text-align: center; }
.weekday { font-size: 12px; color: var(--muted); padding: 5px 0; }
.day { display: grid; gap: 2px; place-content: center; justify-items: center; min-height: clamp(42px, 6vw, 68px); border: 0; border-radius: 13px; background: transparent; }
.day:hover { background: var(--accent); }
.day[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.day[data-today] { font-weight: 750; }
.day i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.day i[data-empty] { opacity: 0; }
.room-grid, .recipes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); gap: 14px; }
.recipes-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 235px), 1fr)); }
.room-card { padding: 14px; }
.room-head { display: flex; align-items: center; gap: 10px; }
.room-head .icon-button { margin-left: auto; }
.room-head small { font-size: 12px; }
.room-card .task-list { padding: 5px 0 0; }
.room-card .task-check { width: 32px; }
.recipe-card { text-align: left; padding: 0; overflow: hidden; }
.recipe-card:hover h2 { text-decoration: underline; text-underline-offset: 3px; }
.recipe-image { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--accent); }
.recipe-placeholder { display: grid; place-items: center; color: var(--ink); background: linear-gradient(130deg, var(--wash), var(--glow)); }
.recipe-placeholder svg { width: 29px; height: 29px; }
.recipe-copy { padding: 13px 15px 16px; }
.recipe-copy p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; font-size: 13px; color: var(--muted); }
.recipe-content { white-space: pre-wrap; overflow-wrap: anywhere; margin: 14px 0 4px; }
.recipe-photo-preview { max-height: 210px; width: 100%; border-radius: 15px; object-fit: cover; }
.conflict { padding: 10px 14px; background: var(--accent); color: var(--ink); border-radius: 13px; margin-bottom: 14px; font-size: 13px; }
dialog { width: min(94vw, 510px); max-height: min(90dvh, 760px); border: 1px solid var(--line); border-radius: 25px; padding: 0; color: var(--text); background: var(--surface); box-shadow: 0 20px 70px #0003; }
dialog::backdrop { background: #17122166; backdrop-filter: blur(3px); }
.dialog-inner { padding: 17px 20px 21px; }
.dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.dialog-top h2 { font-size: 22px; overflow-wrap: anywhere; }
.dialog-content { display: grid; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 15px; }
.field { display: grid; align-content: start; gap: 5px; font-size: 13px; }
.field > input, .field > textarea, .field > select { min-width: 0; width: 100%; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 10px; min-height: 43px; padding: 8px 10px; font-size: 16px; }
.field textarea { resize: vertical; min-height: 80px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.choice { display: flex; align-items: flex-start; padding: 7px 0; gap: 7px; }
.choice input { accent-color: var(--ink); }
.choice small { display: block; }
.form-error { font-size: 13px; color: var(--hint); }
.toast { position: fixed; z-index: 5; bottom: 22px; left: 50%; transform: translateX(-50%); max-width: 92vw; padding: 4px 13px; min-height: 44px; border-radius: 13px; display: flex; gap: 10px; align-items: center; background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow); }
.toast button { border: 0; background: transparent; padding: 8px 5px; text-decoration: underline; }
@media (max-width: 940px) {
  .layout { grid-template-columns: 174px minmax(0, 1fr); }
  .sidebar { padding-inline: 13px; }
  .workspace { padding-inline: 24px; }
  .dashboard { grid-template-columns: minmax(0, 1fr) minmax(197px, .7fr); gap: 12px; }
}
@media (max-width: 700px) {
  .layout { display: block; }
  .sidebar { display: none; }
  .mobile-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: max(env(safe-area-inset-top), 9px) 14px 0; }
  .mobile-header .brand { padding: 0 3px; }
  .mobile-header .brand-mark { width: 35px; height: 35px; border-radius: 11px; }
  .mobile-header .brand strong { font-size: 15px; }
  .mobile-header .brand small { font-size: 10px; }
  .mobile-header .actions { gap: 1px; flex-wrap: nowrap; }
  .workspace { padding: 15px 17px calc(92px + env(safe-area-inset-bottom)); max-width: 560px; }
  .page-header { margin-bottom: 15px; align-items: end; }
  .page-header .eyebrow { font-size: 12px; margin-bottom: 4px; }
  .desktop-add { display: none; }
  .dashboard { grid-template-columns: 1fr; gap: 13px; }
  .column { gap: 13px; }
  .hero { min-height: 100px; padding: 15px 18px; border-radius: 23px; }
  .hero strong { font-size: 28px; }
  .ring { width: 58px; height: 58px; }
  .ring span { width: 49px; height: 49px; }
  .card { border-radius: 18px; }
  .mobile-nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; position: fixed; inset: auto 0 0; z-index: 3; padding: 7px 11px max(8px, env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
  .mobile-nav.has-add { grid-template-columns: 1fr 1fr 52px 1fr 1fr; }
  .mobile-nav .nav-button { display: grid; place-content: center; justify-items: center; gap: 2px; padding: 3px 0; font-size: 11px; }
  :root[data-theme="dark"] .mobile-nav { inset-inline: 10px; bottom: max(7px, env(safe-area-inset-bottom)); border: 1px solid var(--line); border-radius: 20px; padding: 4px; box-shadow: var(--shadow); }
  .toast { bottom: calc(73px + env(safe-area-inset-bottom)); }
}
@media (max-width: 365px) {
  .workspace { padding-inline: 12px; }
  .calendar { padding-inline: 5px; gap: 1px; }
  .primary, .secondary { padding-inline: 9px; }
  .task-end { display: none; }
}
