/* Chore chart maker: editor + printable sheets */

.maker-hero { padding: 48px 0 24px; }
.maker-hero p.lead { font-size: 1.08rem; color: var(--ink-2); max-width: 640px; margin: 0; }
.maker-hero .checks { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; font-size: .88rem; color: var(--ink-2); padding: 0; list-style: none; }
.maker-hero .checks li::before { content: "✓"; color: var(--sage-dark); font-weight: 700; margin-right: 7px; }

.maker { display: grid; grid-template-columns: minmax(0, 470px) minmax(0, 1fr); gap: 28px; align-items: start; padding-bottom: 56px; }
@media (max-width: 960px) { .maker { grid-template-columns: 1fr; } }

/* Editor panel */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.step { padding: 22px 24px; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.step-num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--sage-soft); color: var(--sage-dark); font-weight: 700; font-size: .85rem; display: grid; place-items: center; }
.step-head h2 { font-size: 1.15rem; margin: 0; }
.step-head .hint { margin-left: auto; font-size: .78rem; color: var(--ink-3); }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg button {
  text-align: left; border: 1.5px solid var(--line); background: var(--cream); border-radius: 14px;
  padding: 12px 14px; cursor: pointer; font: inherit; color: var(--ink); transition: border-color .15s, background .15s;
}
.seg button strong { display: block; font-size: .92rem; }
.seg button span { display: block; font-size: .78rem; color: var(--ink-3); line-height: 1.4; margin-top: 2px; }
.seg button[aria-pressed="true"] { border-color: var(--sage-dark); background: var(--sage-soft); }

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
input[type="text"], select {
  width: 100%; font: inherit; font-size: .95rem; color: var(--ink); background: var(--cream);
  border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 12px; outline: none; transition: border-color .15s, background .15s;
}
input[type="text"]:focus, select:focus { border-color: var(--sage); background: #fff; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238C877C' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* People */
.person { display: grid; grid-template-columns: 30px 1fr 128px 30px; gap: 8px; align-items: center; margin-bottom: 8px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255,255,255,.7), 0 0 0 1px var(--line); }
.icon-btn { width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--cream-2); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }
.add-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.link-btn { border: 1.5px dashed var(--line); background: transparent; border-radius: 10px; padding: 8px 14px; font: 600 .84rem var(--sans); color: var(--sage-dark); cursor: pointer; }
.link-btn:hover { border-color: var(--sage); background: var(--cream); }

/* Chores */
.chore { border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 10px 10px 10px; margin-bottom: 10px; background: var(--cream); }
.chore-top { display: grid; grid-template-columns: 40px 1fr 30px; gap: 8px; align-items: center; }
.chore-icon { width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #4a4a44; }
.chore-icon svg { width: 22px; height: 22px; }
.chore-icon.none { background: var(--cream-2) !important; color: var(--ink-3); }
.chore input[type="text"] { background: #fff; }
.chore-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 9px; padding-left: 48px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  border: 1.5px solid var(--line); background: #fff; border-radius: 99px; padding: 3px 10px 3px 4px; font: 600 .76rem var(--sans);
  color: var(--ink-3); cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
.chip i { width: 16px; height: 16px; border-radius: 50%; display: inline-block; opacity: .35; }
.chip[aria-pressed="true"] { color: var(--ink); border-color: var(--ink-3); }
.chip[aria-pressed="true"] i { opacity: 1; }
.days { display: flex; gap: 3px; }
.day {
  width: 25px; height: 25px; border-radius: 7px; border: 1.5px solid var(--line); background: #fff; font: 600 .7rem var(--sans);
  color: var(--ink-3); cursor: pointer; padding: 0;
}
.day[aria-pressed="true"] { background: var(--sage-dark); border-color: var(--sage-dark); color: #fff; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--ink-2); cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--sage-dark); width: 15px; height: 15px; margin: 0; }
.meta-label { font-size: .68rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }

/* Popovers */
.pop { position: fixed; z-index: 50; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 48px rgba(43,42,38,.18); padding: 12px; }
.pop[hidden] { display: none; }
.icon-grid { display: grid; grid-template-columns: repeat(6, 38px); gap: 6px; }
.icon-grid button { width: 38px; height: 38px; border-radius: 10px; border: 0; background: var(--cream); cursor: pointer; display: grid; place-items: center; color: #4a4a44; }
.icon-grid button:hover { background: var(--sage-soft); }
.icon-grid svg { width: 22px; height: 22px; }
.color-grid { display: grid; grid-template-columns: repeat(4, 30px); gap: 8px; }
.color-grid button { width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: 0 0 0 1px var(--line); }

.library { margin-top: 12px; border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; background: var(--cream); }
.library[hidden] { display: none; }
.library-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.library-tabs button { border: 1.5px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 12px; font: 600 .76rem var(--sans); color: var(--ink-2); cursor: pointer; }
.library-tabs button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.library-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.library-list button { display: flex; align-items: center; gap: 8px; text-align: left; border: 0; background: #fff; border-radius: 10px; padding: 7px 9px; font: 500 .82rem var(--sans); color: var(--ink); cursor: pointer; }
.library-list button:hover { background: var(--sage-soft); }
.library-list button:disabled { opacity: .4; cursor: default; background: #fff; }
.library-list .ic { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.library-list .ic svg { width: 16px; height: 16px; }

.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.themes { display: flex; gap: 8px; flex-wrap: wrap; }
.theme-btn { border: 1.5px solid var(--line); background: #fff; border-radius: 99px; padding: 4px 12px 4px 4px; font: 600 .78rem var(--sans); color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.theme-btn i { width: 20px; height: 20px; border-radius: 50%; display: inline-block; }
.theme-btn[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); }

.panel-foot { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 18px 24px; background: var(--cream-2); border-radius: 0 0 var(--radius) var(--radius); }
.panel-foot small { color: var(--ink-3); font-size: .76rem; }

/* Preview */
.preview-col { position: sticky; top: 84px; }
@media (max-width: 960px) { .preview-col { position: static; } }
.preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.preview-bar .eyebrow { margin: 0; }
.preview-stage { background: #E9E2D3; border-radius: var(--radius); padding: 22px; max-height: calc(100vh - 170px); overflow-y: auto; }
@media (max-width: 960px) { .preview-stage { max-height: none; padding: 14px; } }
.sheet-holder { margin: 0 auto 18px; position: relative; }
.sheet-holder:last-child { margin-bottom: 0; }
.sheet-holder .sheet { position: absolute; top: 0; left: 0; transform-origin: 0 0; box-shadow: 0 6px 22px rgba(43,42,38,.14); }

.mobile-bar { display: none; }
@media (max-width: 960px) {
  .mobile-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(251,247,238,.96); border-top: 1px solid var(--line); backdrop-filter: blur(8px); }
  .mobile-bar .btn { flex: 1; }
  body.has-mobile-bar { padding-bottom: 76px; }
}

/* ---------- Printable sheet ---------- */
.sheet {
  --t-border: #9DB8AA; --t-head: #DCEBE1; --t-accent: #7F9E8F;
  width: 210mm; height: 297mm; background: #fff; color: #2B2A26; overflow: hidden;
  padding: 16mm 13mm 11mm; display: flex; flex-direction: column;
  font-family: var(--sans);
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.sheet.letter { width: 8.5in; height: 11in; }
.sheet.theme-sage { --t-border: #9DB8AA; --t-head: #DCEBE1; --t-accent: #7F9E8F; }
.sheet.theme-peach { --t-border: #9DB8AA; --t-head: #F8DCCB; --t-accent: #7F9E8F; }
.sheet.theme-blush { --t-border: #D4A7A4; --t-head: #F6DFDC; --t-accent: #B98A8A; }
.sheet.theme-beige { --t-border: #C4A882; --t-head: #F0E7D2; --t-accent: #A8957F; }
.sheet.theme-sky { --t-border: #9BB3C6; --t-head: #DCE6EF; --t-accent: #7E98AD; }

.s-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10mm; }
.s-title { font-family: var(--serif); font-weight: 700; font-size: 30pt; line-height: 1.05; margin: 0; word-break: break-word; }
.s-namebox { min-width: 50mm; text-align: right; }
.s-label { font-size: 7pt; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--t-accent); }
.s-name { border-bottom: 1px solid #E3E0DA; min-height: 9mm; font-family: var(--serif); font-weight: 700; font-size: 14pt; text-align: right; padding-top: 2mm; }
.s-rule { display: flex; align-items: center; gap: 4mm; margin: 3.5mm 0 4mm; }
.s-rule::before, .s-rule::after { content: ""; flex: 1; height: 1.2px; background: var(--t-border); }
.s-rule svg { width: 4.4mm; height: 4mm; color: #E3B3B1; }
.s-sub { display: flex; align-items: center; gap: 3mm; font-size: 7pt; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--t-accent); margin-bottom: 5mm; }
.s-sub .blank { display: inline-block; width: 45mm; border-bottom: 1px solid #E3E0DA; height: 3mm; }
.s-legend { display: flex; flex-wrap: wrap; gap: 2mm 5mm; margin-bottom: 4.5mm; }
.s-legend span { display: inline-flex; align-items: center; gap: 1.8mm; font-size: 8.5pt; font-weight: 600; }
.s-legend i { width: 5mm; height: 5mm; border-radius: 50%; display: inline-grid; place-items: center; font-style: normal; font-size: 6.5pt; font-weight: 700; color: #2B2A26; }

.s-table { flex: 1; min-height: 0; border: 1.2px solid var(--t-border); border-radius: 4mm; overflow: hidden; display: grid; }
.s-row { display: contents; }
.s-cell { border-right: 1px solid #E6E3DD; border-bottom: 1px solid #E6E3DD; display: flex; align-items: center; justify-content: center; min-height: 0; min-width: 0; }
.s-cell.last-col { border-right: 0; }
.s-row.last .s-cell { border-bottom: 0; }
.s-th { background: var(--t-head); font-size: 6.8pt; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #4A4A44; padding: 2.6mm 1mm; border-bottom: 1.2px solid var(--t-border); }
.s-th.first { justify-content: flex-start; padding-left: 5mm; }
.s-th.person { flex-direction: column; gap: 1mm; letter-spacing: .06em; text-transform: none; font-size: 8pt; }
.s-job { justify-content: flex-start; gap: 3.2mm; padding: 1.5mm 3mm 1.5mm 4mm; }
.s-job .ic { flex: none; width: var(--ic, 13mm); height: var(--ic, 13mm); border-radius: 50%; display: grid; place-items: center; color: #55554E; }
.s-job .ic svg { width: 62%; height: 62%; }
.s-job .tx { font-family: var(--serif); font-weight: 700; font-size: var(--fs, 12pt); line-height: 1.2; }
.s-job .tx small { display: block; font-family: var(--sans); font-weight: 500; font-size: 6.8pt; color: #9A958B; letter-spacing: .04em; margin-top: .6mm; }
.s-mark { width: var(--mk, 9mm); height: var(--mk, 9mm); display: grid; place-items: center; }
.s-mark svg { width: 100%; height: 100%; }
.mk-star { color: var(--star, #DDB052); }
.mk-box { border: 1.3px solid var(--t-border); border-radius: 1.6mm; width: calc(var(--mk, 9mm) * .62); height: calc(var(--mk, 9mm) * .62); }
.mk-circle { border: 1.3px solid var(--t-border); border-radius: 50%; width: calc(var(--mk, 9mm) * .7); height: calc(var(--mk, 9mm) * .7); }
.mk-off { width: 1.4mm; height: 1.4mm; border-radius: 50%; background: #E6E3DD; }
.mk-who { display: inline-flex; flex-direction: column; align-items: center; gap: .8mm; }
.mk-who .who { min-width: 6.4mm; height: 6.4mm; border-radius: 99px; display: grid; place-items: center; font-size: 6.6pt; font-weight: 700; padding: 0 1.4mm; }
.mk-who .who-row { display: flex; gap: .8mm; }

.s-reward { margin-top: 4.5mm; border: 1.2px solid var(--t-border); border-radius: 3mm; overflow: hidden; flex: none; }
.s-reward .hd { background: var(--t-head); padding: 2mm 4.5mm; font-size: 6.8pt; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: #4A4A44; display: flex; justify-content: space-between; align-items: center; border-bottom: 1.2px solid var(--t-border); }
.s-reward .hd svg { width: 4mm; height: 4mm; color: #DDB052; }
.s-reward .bd { min-height: 15mm; padding: 3mm 4.5mm; font-family: var(--serif); font-weight: 700; font-size: 13pt; display: flex; align-items: center; }
.s-foot { text-align: center; margin-top: 4mm; font-size: 6.5pt; color: #A39E94; letter-spacing: .04em; flex: none; }
.s-foot img { width: 2.6mm; margin: 0 auto 1mm; opacity: .8; }
.s-empty { flex: 1; display: grid; place-items: center; text-align: center; color: #A39E94; font-size: 10pt; border: 1.2px dashed var(--t-border); border-radius: 4mm; padding: 10mm; }

/* Print */
#print-root { display: none; }
@media print {
  body > *:not(#print-root) { display: none !important; }
  body { background: #fff; padding: 0 !important; }
  #print-root { display: block; }
  html, body { margin: 0 !important; }
  /* Fill whatever page area the print dialog gives us, so a sheet never spills onto a second page */
  #print-root .sheet { width: 100%; height: 99vh; box-shadow: none; break-inside: avoid; page-break-inside: avoid; }
  #print-root .sheet + .sheet { break-before: page; page-break-before: always; }
}
