/*
  ChoreBoy's 📌 Upcoming list and Today's "Next up" strip (web/upcoming.js, up- classes), and the
  🏡 Household pieces (web/household.js, hh- classes): the Settings section, the owner chip on a
  shared task, "✓ by Celeste", the owner's notice on Today, the 🔒 badge and the share banner.
  They use choreboy.css's tokens and components (chip, btn, input, group-head, task-list,
  empty-state, link-btn, seg, switch-row, muted), so light and dark follow the device. Phones from
  320 px.
*/

/* ---------- colors: each Upcoming type, and each person ---------- */

.up-k-appointment { --up: #026aa2; }
.up-k-birthday { --up: #c11574; }
.up-k-holiday { --up: #067647; }
.up-k-sports { --up: #3538cd; }
.up-k-event { --up: #6941c6; }
.up-k-bill { --up: #b54708; }
.up-k-deadline { --up: #c01048; }

/* A person's color (ChoreHousehold.colorIndex: the same person, the same color everywhere). */
.hh-c0 { --hh: #2563eb; }
.hh-c1 { --hh: #7c3aed; }
.hh-c2 { --hh: #db2777; }
.hh-c3 { --hh: #c2410c; }
.hh-c4 { --hh: #0f766e; }
.hh-c5 { --hh: #a16207; }
.hh-c6 { --hh: #4338ca; }
.hh-c7 { --hh: #be123c; }

@media (prefers-color-scheme: dark) {
  .up-k-appointment { --up: #7cd4fd; }
  .up-k-birthday { --up: #f670c7; }
  .up-k-holiday { --up: #47cd89; }
  .up-k-sports { --up: #8098f9; }
  .up-k-event { --up: #b692f6; }
  .up-k-bill { --up: #fdb022; }
  .up-k-deadline { --up: #fd6f8e; }
  .hh-c0 { --hh: #60a5fa; }
  .hh-c1 { --hh: #a78bfa; }
  .hh-c2 { --hh: #f472b6; }
  .hh-c3 { --hh: #fb923c; }
  .hh-c4 { --hh: #2dd4bf; }
  .hh-c5 { --hh: #facc15; }
  .hh-c6 { --hh: #818cf8; }
  .hh-c7 { --hh: #fb7185; }
}

/* ---------- 📌 Upcoming: the type chips ---------- */

.up-view { min-width: 0; }
.up-kinds { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0 0 .4rem; }
.up-kind { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .4rem .3rem .65rem; border-radius: 999px; border: 1px dashed var(--border-strong); background: transparent; color: var(--text-3); font: 600 .84rem var(--font); cursor: pointer; white-space: nowrap; }
.up-kind:hover { color: var(--text); border-color: var(--up, var(--accent)); }
.up-kind .up-kind-ico { filter: grayscale(1); opacity: .55; }
.up-kind.on { border-style: solid; border-color: color-mix(in srgb, var(--up, var(--accent)) 40%, transparent); background: color-mix(in srgb, var(--up, var(--accent)) 11%, var(--surface)); color: var(--text); }
.up-kind.on .up-kind-ico { filter: none; opacity: 1; }
.up-kind-n { min-width: 1.45rem; padding: .05rem .4rem; border-radius: 999px; background: var(--surface-2); color: var(--text-3); font-size: .74rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.up-kind.on .up-kind-n { background: color-mix(in srgb, var(--up, var(--accent)) 20%, transparent); color: var(--up, var(--accent-text)); }
.up-all { font-size: .84rem; font-weight: 600; margin-left: .2rem; }
.up-msg { margin: .2rem .2rem .4rem; font-size: .86rem; color: var(--bad); }
.up-msg:empty { display: none; }
.up-foot { margin: 1rem .2rem 0; }

/* ---------- 📌 Upcoming: the list ---------- */

.up-month .group-head { margin-top: 1.2rem; }
.up-month:first-of-type .group-head { margin-top: .5rem; }
.up-row { display: grid; grid-template-columns: 3.1rem minmax(0, 1fr); gap: .75rem; align-items: start; padding: .65rem .8rem; border-top: 1px solid var(--border); }
.up-row:first-child { border-top: 0; }
.up-row:hover { background: var(--surface-2); }
.up-date { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: .3rem 0 .35rem; border-radius: var(--radius); background: color-mix(in srgb, var(--up, var(--accent)) 12%, var(--surface)); line-height: 1.05; }
.up-dow { font-size: .66rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--up, var(--accent-text)); }
.up-dnum { font-size: 1.25rem; font-weight: 750; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.up-row.is-today .up-date { background: var(--up, var(--accent)); }
.up-row.is-today .up-dow, .up-row.is-today .up-dnum { color: var(--surface); }
.up-main { min-width: 0; display: flex; flex-direction: column; gap: .3rem; cursor: pointer; border-radius: 6px; }
.up-head { display: flex; align-items: baseline; justify-content: space-between; gap: .2rem .7rem; flex-wrap: wrap; }
.up-title { min-width: 0; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.up-main:hover .up-title { color: var(--accent-text); }
.up-count { flex-shrink: 0; padding: .1rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: .78rem; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.up-row.is-today .up-count { background: var(--accent); color: var(--accent-contrast); }
.up-row.is-tomorrow .up-count { background: var(--accent-soft); color: var(--accent-text); }
.up-row.is-soon .up-count { color: var(--text); background: color-mix(in srgb, var(--up, var(--accent)) 12%, var(--surface-2)); }
.chip.up-kind-chip { color: var(--up, var(--text-2)); background: color-mix(in srgb, var(--up, var(--accent)) 9%, transparent); border-color: transparent; font-weight: 600; }
.up-note { font-size: .8rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-empty p { margin: 0 auto .5rem; max-width: 34rem; color: var(--text-2); }
.up-empty p:last-child { margin-bottom: 0; }
.up-empty b { color: var(--text); }
.up-empty-big { font-size: 2.2rem; line-height: 1; margin-bottom: .6rem !important; }

/* ---------- 📌 Next up, at the top of Today ---------- */

.up-next { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem .7rem; margin: 0 0 .9rem; padding: .55rem .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.up-next-k { font-size: .74rem; font-weight: 750; color: var(--text-2); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.up-next-items { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.up-next-item { display: inline-flex; align-items: center; gap: .35rem; max-width: 100%; min-width: 0; padding: .3rem .7rem .3rem .55rem; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--up, var(--accent)) 30%, var(--border)); background: color-mix(in srgb, var(--up, var(--accent)) 8%, var(--surface)); color: var(--text); font: 550 .86rem var(--font); cursor: pointer; text-align: left; }
.up-next-item:hover { border-color: var(--up, var(--accent)); }
.up-next-ico { flex-shrink: 0; }
.up-next-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-next-when { flex-shrink: 0; color: var(--text-2); white-space: nowrap; }
.up-next-all { flex-shrink: 0; font-size: .84rem; font-weight: 650; }

/* ---------- 🏡 people: avatar, owner chip, "✓ by", 🔒 ---------- */

.hh-av { display: inline-grid; place-items: center; flex-shrink: 0; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: var(--hh, var(--text-3)); color: #fff; font: 750 .66rem/1 var(--font); text-transform: uppercase; }
.hh-av.big { width: 2rem; height: 2rem; font-size: .9rem; }
.hh-owner { display: inline-flex; align-items: center; gap: .28rem; max-width: 9.5rem; margin-left: .4rem; padding: .08rem .5rem .08rem .14rem; border-radius: 999px; background: color-mix(in srgb, var(--hh, var(--text-3)) 13%, transparent); color: var(--hh, var(--text-2)); font: 650 .74rem/1.3 var(--font); white-space: nowrap; vertical-align: .08em; }
.hh-owner .hh-av { width: 1.05rem; height: 1.05rem; font-size: .6rem; }
.hh-owner-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chip.hh-by { color: var(--hh, var(--text-2)); background: color-mix(in srgb, var(--hh, var(--text-3)) 12%, transparent); border-color: transparent; font-weight: 650; padding-left: .14rem; }
.chip.hh-by .hh-av { width: 1.05rem; height: 1.05rem; font-size: .6rem; }
.chip.hh-private { color: var(--text-3); background: transparent; margin-left: .35rem; vertical-align: .08em; }
.task-chips .chip.hh-private { margin-left: 0; }

/* ---------- 🏡 the owner's notice on Today ---------- */

.hh-notice { margin: 0 0 1rem; background: color-mix(in srgb, var(--accent) 5%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border)); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.hh-notice > summary { display: flex; align-items: center; gap: .65rem; padding: .6rem .85rem; cursor: pointer; list-style: none; border-radius: var(--radius-lg); font-size: .92rem; }
.hh-notice > summary::-webkit-details-marker { display: none; }
.hh-notice > summary::after { content: '▸'; margin-left: auto; color: var(--text-3); transition: transform .15s; }
.hh-notice[open] > summary::after { transform: rotate(90deg); }
.hh-notice-avs { display: inline-flex; flex-shrink: 0; padding-left: .3rem; }
.hh-notice-avs .hh-av { width: 1.6rem; height: 1.6rem; font-size: .78rem; margin-left: -.3rem; box-shadow: 0 0 0 2px var(--surface); }
.hh-notice-head { min-width: 0; overflow-wrap: anywhere; }
.hh-notice-head b { font-weight: 700; }
.hh-notice-list { list-style: none; margin: 0; padding: 0 .85rem; }
/* Title, then who and when under it; Undo on the right of both. */
.hh-notice-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .1rem .7rem; padding: .45rem 0; border-top: 1px solid var(--border); }
.hh-notice-title { grid-column: 1; font-weight: 550; overflow-wrap: anywhere; }
.hh-notice-when { grid-column: 1; grid-row: 2; display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hh-notice-when:empty { display: none; }
.hh-notice-item > .btn { grid-column: 2; grid-row: 1 / span 2; }
.hh-notice-foot { margin: 0; padding: .2rem .85rem .65rem; }

/* ---------- 🏡 "wants to share with you" ---------- */

.hh-banner { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .8rem; margin: 0 0 1rem; padding: .65rem .9rem; border-radius: var(--radius-lg); background: var(--accent-soft); color: var(--text); font-size: .92rem; }
.hh-banner > .hh-av { width: 2rem; height: 2rem; font-size: .9rem; }
.hh-banner-text { flex: 1; min-width: min(100%, 14rem); overflow-wrap: anywhere; }
.hh-filter { flex-shrink: 0; }

/* ---------- 🏡 Settings → Household ---------- */

.hh-set { min-width: 0; }
.hh-h { margin: 1.2rem 0 .5rem; padding-top: .95rem; border-top: 1px solid var(--border); font-size: .95rem; font-weight: 700; }
.hh-set > .hh-h:first-of-type { margin-top: .9rem; padding-top: 0; border-top: 0; }
.hh-share-row { display: flex; gap: .5rem; align-items: center; }
.hh-share-row .input { flex: 1; }
.hh-share-row + .small-muted { margin: .4rem 0 0; }
.hh-msg { margin: .55rem 0 0; font-size: .88rem; font-weight: 600; }
.hh-msg:empty { display: none; }
.hh-msg.ok { color: var(--good); }
.hh-msg.bad { color: var(--bad); }
.hh-invite-box { margin: .6rem 0 0; padding: .7rem .85rem; border-radius: var(--radius); background: var(--info-soft); color: var(--text); font-size: .9rem; overflow-wrap: anywhere; }
.hh-invite-box p { margin: 0 0 .6rem; }
.hh-people { list-style: none; margin: .75rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.hh-person { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .7rem; padding: .6rem .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.hh-person.is-pending { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.hh-person > .hh-av { width: 2rem; height: 2rem; font-size: .9rem; }
.hh-person .hh-who { flex: 1; min-width: min(100%, 11rem); display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; font-size: .92rem; overflow-wrap: anywhere; }
.hh-person .hh-who b { font-weight: 650; }
.hh-email { font-size: .8rem; color: var(--text-3); }
.hh-acts { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; margin-left: auto; }
.hh-ask { font-size: .84rem; font-weight: 600; color: var(--text-2); }
.hh-none { margin: .65rem 0 0; }
.hh-explain { margin: 1rem 0 0; padding: .75rem .9rem; border-radius: var(--radius); background: var(--surface-2); color: var(--text-2); font-size: .88rem; line-height: 1.5; }
.hh-explain p { margin: 0 0 .5rem; }
.hh-explain p:last-child { margin-bottom: 0; }
.hh-explain b { color: var(--text); }
.hh-private-default { margin-top: .8rem; }
.hh-set > .small-muted:last-child { margin: .5rem 0 0; }

/* ---------- small screens ---------- */

@media (max-width: 600px) {
  .up-kind { font-size: .8rem; padding: .26rem .35rem .26rem .55rem; gap: .3rem; }
  .up-row { grid-template-columns: 2.7rem minmax(0, 1fr); gap: .6rem; padding: .6rem .6rem; }
  .up-dnum { font-size: 1.1rem; }
  .up-next { padding: .55rem .65rem; }
  .up-next-items { flex-basis: 100%; flex-direction: column; }
  .up-next-item { width: 100%; }
  .up-next-title { flex: 1; }
  .hh-person { padding: .55rem .6rem; }
  .hh-acts { margin-left: 2.7rem; }
  .hh-banner .btn-row { width: 100%; }
  .hh-banner .btn-row .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .hh-notice > summary::after { transition: none; }
}
