:root {
  --bg: #FFF7F0; --card: #FFFFFF; --line: #F3E1D3; --ink: #2B1D17; --muted: #6E5448;
  --accent: #C2255C; --accent-ink: #9D174D; --butter: #FFF1C9; --pink: #FCE7F3;
  --a-fg: #9A3412; --a-bg: #FFEDD5; --a-dot: #EA580C;
  --b-fg: #1E40AF; --b-bg: #DBEAFE; --b-dot: #2563EB;
  --both-fg: #5B21B6; --both-bg: #EDE9FE; --both-dot: #7C3AED;
  --radius: 22px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); font-weight: 700; text-decoration: none; }
a:hover { color: var(--accent-ink); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 28px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
.wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px calc(100px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.ic { width: 22px; height: 22px; flex: none; }

.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-top: 6px; }
.sub, .meta { color: var(--muted); font-size: 14px; }
.meta { margin: 0; }
.eyebrow { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 4px; }
.eyebrow .ic { width: 18px; height: 18px; }
.iconbtn { width: 44px; height: 44px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--ink); }
.back { font-size: 14px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; color: var(--ink); }
a.card { font-weight: 400; }
.card.butter { background: var(--butter); border-color: transparent; }
.card.pink { background: var(--pink); border-color: transparent; }
.card.soft { background: #FFFDFB; border-style: dashed; }
.card.row { flex-direction: row; align-items: center; gap: 16px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.strong { font-weight: 800; font-size: 14px; }
.t-a { color: var(--a-fg); } .t-b { color: var(--b-fg); }
.flash { background: var(--ink); color: #fff; border-radius: 16px; padding: 12px 14px; font-weight: 700; font-size: 15px; }
.warn { margin: 0; background: #FEF2F2; color: #991B1B; border-radius: 12px; padding: 8px 12px; font-size: 14px; }
.late { color: #B91C1C; font-weight: 800; }
.today { color: var(--accent-ink); font-weight: 800; }

.flash-back { padding: 0; overflow: hidden; gap: 0; }
.flash-back img { width: 100%; height: 200px; object-fit: cover; display: block; }
.flash-back .pad { padding: 14px 16px 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--accent); color: #fff; font: inherit; font-weight: 800; cursor: pointer; align-self: flex-start; }
.btn:hover { background: var(--accent-ink); color: #fff; }
.btn.ghost { background: var(--card); color: var(--ink); border: 2px solid #EAD7C8; }
.btn.danger { background: #fff; color: #B91C1C; border: 2px solid #FCA5A5; margin-top: 8px; }
.pill { min-height: 30px; padding: 0 10px; border-radius: 999px; border: 1px dashed #C9AE9C; background: var(--bg); color: #5C4337; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.x { width: 36px; height: 36px; border-radius: 12px; border: 0; background: #F6EEE7; color: #6E5448; font-size: 20px; line-height: 1; cursor: pointer; }
.inline { display: inline; margin: 0; }

.chip { font-size: 12px; font-weight: 800; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.chip.who-a { background: var(--a-bg); color: var(--a-fg); }
.chip.who-b { background: var(--b-bg); color: var(--b-fg); }
.chip.who-both { background: var(--both-bg); color: var(--both-fg); }
.chip.date { background: var(--pink); color: var(--accent-ink); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.who-a { background: var(--a-dot); } .dot.who-b { background: var(--b-dot); } .dot.who-both { background: var(--both-dot); }
.legend { display: flex; gap: 8px; }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.list.cards > li { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 10px 12px; }
.ev { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.ev .time { font-size: 14px; font-weight: 800; color: var(--muted); width: 54px; flex: none; }
.ev .ttl { flex: 1; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.chore { display: flex; align-items: center; gap: 12px; }
.chore .grow { flex: 1; min-width: 0; }
.chore .ttl { font-weight: 700; }
.chore .side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.check { width: 44px; height: 44px; border-radius: 50%; border: 2px solid #D9C2B2; background: #fff; color: #D9C2B2; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.check:hover { background: #16A34A; border-color: #16A34A; color: #fff; }

.day { display: flex; flex-direction: column; gap: 8px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.day.is-today h3 { color: var(--accent-ink); }
.day .empty { font-size: 13px; }
.pager { padding-top: 6px; }

.bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--line); }
.bar-a { background: var(--a-dot); } .bar-b { background: var(--b-dot); }

.ring { width: 84px; height: 84px; border-radius: 50%; background: #fff; border: 6px solid var(--accent); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; color: var(--accent-ink); }
.ring b { font-size: 26px; line-height: 1; }
.ring span { font-size: 11px; font-weight: 800; }
.slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.slot { border: 2px solid #EAD7C8; border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; color: var(--ink); background: #fff; min-height: 56px; }
.slot span { font-size: 13px; color: var(--muted); font-weight: 600; }
.slot.on, .slot:hover { border-color: var(--accent); background: var(--pink); color: var(--ink); }

.year { padding-top: 6px; color: var(--accent-ink); }
.mem-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mem { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; color: var(--ink); }
.mem img, .mem .noimg { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--pink); }
.mem .noimg { display: flex; align-items: center; justify-content: center; color: var(--accent-ink); }
.mem b { padding: 8px 10px 0; font-size: 15px; }
.mem span { padding: 0 10px 10px; font-size: 12px; color: var(--muted); font-weight: 600; }
.photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.photos figure { margin: 0; position: relative; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; display: block; }
.photos form { position: absolute; top: 6px; right: 6px; margin: 0; }
.photos .x { background: rgba(255, 255, 255, .9); }
.note { margin: 0; font-size: 16px; }

form.stack, .stack { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 800; color: var(--muted); }
label.tick { flex-direction: row; align-items: center; gap: 10px; font-size: 15px; color: var(--ink); font-weight: 700; }
input, select, textarea { font: inherit; font-size: 16px; font-weight: 400; color: var(--ink); background: var(--bg); border: 2px solid #EAD7C8; border-radius: 14px; padding: 10px 12px; min-height: 46px; width: 100%; }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); }
input[type=file] { background: #fff; }
input:focus, select:focus, textarea:focus { outline: 3px solid #F9A8D4; outline-offset: 1px; border-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
details > summary { font-weight: 800; cursor: pointer; min-height: 28px; list-style-position: inside; }
details[open] > summary { margin-bottom: 4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }

.login { padding-top: 40px; display: flex; flex-direction: column; gap: 14px; }
.brand { font-size: 44px; color: var(--accent-ink); }
.who-pick { border: 0; padding: 0; margin: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.who-pick legend { font-size: 13px; font-weight: 800; color: var(--muted); margin-bottom: 6px; }
.who-pick label { flex-direction: row; align-items: center; gap: 8px; border: 2px solid #EAD7C8; border-radius: 999px; padding: 8px 16px; font-size: 16px; color: var(--ink); }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: #fff; border-top: 1px solid var(--line); padding: 6px 6px calc(8px + env(safe-area-inset-bottom)); }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; justify-content: center; font-size: 12px; font-weight: 800; color: #7A5E52; }
.tabs a.on { color: var(--accent); }
@media (min-width: 600px) { .tabs { max-width: 560px; margin: 0 auto; border-radius: 22px 22px 0 0; border: 1px solid var(--line); } }

/* memories from earlier years: swipe sideways when there are several */
.fb-row { display: flex; flex-direction: column; gap: 10px; }
.fb-row.many { flex-direction: row; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
.fb-row.many::-webkit-scrollbar { display: none; }
.fb-row.many .flash-back { flex: 0 0 85%; scroll-snap-align: start; }
.fb-row.many .flash-back img { height: 170px; }

.install { background: var(--both-bg); border-color: transparent; }
.install p { margin: 0 0 10px; }
.linkbtn { align-self: flex-start; background: none; border: 0; padding: 6px 0; min-height: 36px; font: inherit; font-size: 14px; font-weight: 800; color: var(--both-fg); cursor: pointer; }

/* to-do's */
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; background: #F6E6D8; border-radius: 999px; padding: 4px; }
.seg a { min-height: 40px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #5C4337; }
.seg a.on { background: #fff; color: var(--accent-ink); }
.check.on { background: #16A34A; border-color: #16A34A; color: #fff; }
.is-done .ttl, .ttl.strike { text-decoration: line-through; color: var(--muted); }
.chip.filt { background: #fff; border: 2px solid #EAD7C8; color: var(--ink); padding: 6px 12px; min-height: 36px; display: inline-flex; align-items: center; }
.chip.filt.on { background: var(--pink); border-color: var(--accent); color: var(--accent-ink); }

/* suggested chores + editing */
.suggest { gap: 4px; background: var(--butter); border-color: transparent; }
.suggest b { font-size: 17px; }
.sug { gap: 4px; }
.sugrow { display: flex; align-items: center; gap: 10px; justify-content: space-between; min-height: 48px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.sugrow:last-child { border-bottom: 0; }
.sugrow .tick { flex: 1; min-width: 0; }
.sugrow select { width: 150px; min-height: 40px; padding: 4px 8px; font-size: 14px; flex: none; }
.sugrow.have { opacity: .6; }
.sugrow.have .chip { background: var(--line); color: var(--muted); }
.stickybar { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); padding: 8px 0; display: flex; justify-content: center; }
.stickybar .btn { box-shadow: 0 6px 20px rgba(43, 29, 23, .25); }
.manage { gap: 14px; }
.mrow { display: flex; flex-direction: column; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.mrow:last-child { border-bottom: 0; padding-bottom: 0; }
