:root {
  --ink: #18342e;
  --ink-soft: #49605b;
  --cream: #f7f1e6;
  --paper: #fffdf8;
  --sun: #f3b83f;
  --sun-pale: #f9e8b5;
  --coral: #ec8068;
  --line: #d9d1c3;
  --shadow: 0 16px 50px rgba(30, 53, 47, 0.09);
}

* { box-sizing: border-box; }
html { background: var(--cream); }
body { margin: 0; background: radial-gradient(circle at 5% 2%, rgba(243,184,63,.2), transparent 24rem), var(--cream); color: var(--ink); font-family: "Avenir Next", Avenir, "Trebuchet MS", sans-serif; min-height: 100vh; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(243,184,63,.7); outline-offset: 2px; }
.app-shell { max-width: 1480px; margin: 0 auto; padding: 0 58px; }
.topbar { height: 88px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(24,52,46,.16); }
.brand { display: flex; align-items: center; gap: 11px; border: 0; background: none; font-weight: 800; font-size: 20px; cursor: pointer; letter-spacing: -.5px; }
.brand-mark { width: 35px; height: 35px; border-radius: 50%; display: grid; place-items: center; background: var(--sun); transform: rotate(-8deg); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.local-pill { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.52); border: 1px solid rgba(24,52,46,.12); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #74a059; box-shadow: 0 0 0 3px rgba(116,160,89,.16); }
.button, .icon-button { border: 0; cursor: pointer; font-weight: 800; border-radius: 12px; min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .18s ease, box-shadow .18s ease; }
.button:hover, .icon-button:hover { transform: translateY(-2px); }
.icon-button { background: transparent; }
.button-dark { color: white; background: var(--ink); box-shadow: 0 7px 16px rgba(24,52,46,.17); }
.button-sun { background: var(--sun); box-shadow: 0 7px 0 #d89b27; }
.button-ghost { border: 1px solid var(--line); background: transparent; }
.hero { min-height: 390px; padding: 58px 2px 50px; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 90px; }
.eyebrow { margin: 0 0 12px; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; font-weight: 900; color: var(--coral); }
.hero h1 { font-family: Georgia, serif; font-weight: 500; letter-spacing: -3.5px; line-height: .93; font-size: clamp(60px,6.3vw,92px); margin: 0; }
.hero h1 em { color: var(--coral); font-weight: 500; }
.hero-copy { font-family: Georgia, serif; font-size: 17px; line-height: 1.6; color: var(--ink-soft); max-width: 520px; margin: 25px 0 0; }
.week-card { background: var(--paper); border: 1px solid rgba(24,52,46,.16); border-radius: 20px; box-shadow: var(--shadow); padding: 27px 29px 23px; transform: rotate(.4deg); position: relative; }
.week-card::after { content: ""; position: absolute; width: 72px; height: 20px; background: rgba(243,184,63,.5); top: -9px; left: 50%; transform: translateX(-50%) rotate(-2deg); }
.week-card-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.week-card-top > div:first-child { display: grid; gap: 4px; }
.mini-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 900; color: var(--ink-soft); }
.week-card-top strong { font-family: Georgia, serif; font-size: 22px; font-weight: 500; }
.week-controls { display: flex; align-items: center; background: var(--cream); border-radius: 9px; padding: 3px; }
.week-controls button { border: 0; background: transparent; min-height: 30px; min-width: 32px; cursor: pointer; font-weight: 800; border-radius: 7px; }
.week-controls .today-button { font-size: 11px; text-transform: uppercase; padding: 0 8px; }
.week-controls button:hover { background: white; }
.progress-track { height: 9px; border-radius: 99px; background: #e8e2d7; overflow: hidden; margin: 25px 0 22px; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: repeating-linear-gradient(135deg,var(--sun) 0 9px,#edae30 9px 15px); transition: width .35s ease; }
.week-stats { display: grid; grid-template-columns: repeat(3,1fr); }
.week-stats div { padding: 0 18px; border-left: 1px solid var(--line); display: grid; gap: 3px; }
.week-stats div:first-child { padding-left: 0; border-left: 0; }
.week-stats strong { font-size: 22px; letter-spacing: -.7px; }
.week-stats strong small { font-size: 13px; color: var(--ink-soft); }
.week-stats span { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; font-weight: 800; color: var(--ink-soft); }
.board-section { padding: 35px 0 55px; }
.board-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 25px; }
.board-heading h2, .modal h2 { font-family: Georgia, serif; font-size: 38px; line-height: 1; font-weight: 500; letter-spacing: -1.5px; margin: 0; }
.child-tabs { display: flex; align-items: stretch; gap: 10px; margin-bottom: 12px; overflow-x: auto; padding: 2px 2px 6px; }
.child-tab, .add-child-tab { min-width: 175px; min-height: 64px; border: 1px solid rgba(24,52,46,.14); background: rgba(255,255,255,.5); border-radius: 14px; display: flex; align-items: center; gap: 10px; padding: 9px 12px; font-weight: 800; cursor: pointer; transition: .18s ease; }
.child-tab:hover { background: white; }
.child-tab.active { background: var(--paper); border-color: var(--ink); box-shadow: 0 4px 0 var(--ink); transform: translateY(-3px); }
.avatar { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); font-weight: 900; background: var(--child-color,var(--sun)); border: 2px solid rgba(24,52,46,.5); }
.child-tab small { margin-left: auto; padding: 4px 7px; border-radius: 99px; background: var(--cream); color: var(--ink-soft); font-size: 10px; }
.add-child-tab { min-width: 130px; justify-content: center; border-style: dashed; color: var(--ink-soft); background: transparent; }
.matrix-card { border: 1px solid rgba(24,52,46,.22); background: var(--paper); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.matrix-scroll { overflow-x: auto; }
table { width: 100%; min-width: 980px; border-collapse: collapse; table-layout: fixed; }
th, td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
th:last-child, td:last-child { border-right: 0; }
thead th { height: 68px; background: #eee8dc; text-align: center; }
thead th > span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
thead th > small { font-family: Georgia, serif; display: block; margin-top: 4px; color: var(--ink-soft); font-size: 16px; font-weight: 500; }
thead .task-head { width: 31%; background: var(--ink); color: white; text-align: left; padding: 0 24px; }
thead .task-head small { color: rgba(255,255,255,.65); font-family: inherit; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
thead .earned-head { width: 10%; background: var(--sun-pale); }
thead .earned-head small { font-family: inherit; font-size: 9px; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody td { height: 82px; }
.task-cell { padding: 0; background: #fffdf8; }
.task-cell-inner { width: 100%; height: 100%; display: flex; align-items: stretch; }
.drag-handle { flex: 0 0 42px; display: grid; place-items: center; color: #8c887e; border-right: 1px solid var(--line); cursor: grab; touch-action: none; user-select: none; font-size: 22px; letter-spacing: -5px; transition: color .16s ease, background .16s ease; }
.drag-handle:hover, .drag-handle:focus-visible { color: var(--ink); background: var(--sun-pale); }
.drag-handle:active { cursor: grabbing; }
.task-edit { flex: 1; min-width: 0; height: 100%; padding: 14px 18px; border: 0; background: transparent; text-align: left; cursor: pointer; display: flex; justify-content: center; flex-direction: column; }
.task-edit:hover { background: #fff8e7; }
.task-edit:disabled { cursor: default; }
.task-edit span { font-family: Georgia, serif; font-weight: 600; font-size: 17px; }
.task-edit small { margin-top: 6px; color: var(--ink-soft); font-size: 10px; text-transform: uppercase; letter-spacing: .55px; font-weight: 800; }
tbody tr.dragging { opacity: .42; }
tbody tr.drag-over td { box-shadow: inset 0 4px 0 var(--sun); }
.check-cell { text-align: center; background: white; }
.check-cell.inactive { background: #f1ede6; }
.not-scheduled { color: #c4bcae; font-size: 20px; }
.check { width: 30px; height: 30px; margin: auto; border: 2px solid #bcb5a8; border-radius: 8px; display: grid; place-items: center; cursor: pointer; transition: .16s ease; }
.check:hover { transform: rotate(-4deg) scale(1.08); border-color: var(--ink); }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check span { color: transparent; font-size: 21px; font-weight: 900; line-height: 1; }
.check.checked { border-color: var(--ink); background: var(--child-color); box-shadow: 2px 2px 0 var(--ink); transform: rotate(-3deg); }
.check.checked span { color: var(--ink); }
.earned-cell { text-align: center; background: #fffae9; }
.earned-cell strong { font-size: 13px; }
.earned-cell span { color: #b8ae9c; }
.matrix-total { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 26px; background: var(--ink); color: white; }
.matrix-total > span { font-family: Georgia, serif; font-style: italic; display: flex; align-items: center; gap: 10px; }
.matrix-total i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--child-color); box-shadow: 0 0 0 4px rgba(255,255,255,.12); }
.matrix-total strong { font-size: 21px; }
.matrix-total small { font-size: 9px; text-transform: uppercase; letter-spacing: .7px; opacity: .65; margin-left: 5px; }
.print-boards, .print-kid-title, .print-weekly-note { display: none; }
.weekly-note-editor { display: grid; gap: 8px; margin-top: 16px; padding: 18px 20px; border: 1px solid rgba(24,52,46,.2); border-radius: 14px; background: rgba(255,253,248,.7); }
.weekly-note-editor > span { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 900; }
.weekly-note-editor > span small { color: var(--ink-soft); font-weight: 600; letter-spacing: 0; text-transform: none; }
.weekly-note-editor textarea { width: 100%; min-height: 82px; resize: vertical; border: 1px solid #b9b1a4; border-radius: 10px; background: white; color: var(--ink); padding: 12px 13px; font: 15px/1.45 Georgia,serif; }
.weekly-note-editor > small { color: var(--ink-soft); font-size: 10px; }
.empty-board { min-height: 330px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed var(--ink-soft); border-radius: 18px; background: rgba(255,255,255,.45); text-align: center; }
.empty-board > span { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--sun-pale); font-size: 28px; }
.empty-board h3 { font-family: Georgia, serif; font-size: 26px; margin: 15px 0 5px; }
.empty-board p { color: var(--ink-soft); margin: 0 0 20px; }
footer { min-height: 90px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid rgba(24,52,46,.16); font-size: 12px; color: var(--ink-soft); }
footer p span { color: var(--coral); }
footer button { border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.celebration { display: none; position: fixed; z-index: 30; left: 50%; top: 25px; transform: translateX(-50%); background: var(--sun); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); border-radius: 999px; padding: 11px 20px; font-weight: 900; }
.celebration.show { display: block; animation: celebrate 1.3s ease both; }
@keyframes celebrate { 0% { opacity: 0; transform: translate(-50%,-18px) rotate(-3deg); } 18%,75% { opacity: 1; transform: translate(-50%,0) rotate(1deg); } 100% { opacity: 0; transform: translate(-50%,-8px); } }
.modal { width: min(600px,calc(100% - 32px)); max-height: calc(100vh - 48px); overflow-y: auto; border-radius: 20px; background: var(--paper); color: var(--ink); border: 1px solid var(--ink); box-shadow: 10px 12px 0 rgba(15,32,29,.42); padding: 30px; }
.modal.wide { width: min(900px,calc(100% - 32px)); }
.modal::backdrop { background: rgba(17,37,33,.64); backdrop-filter: blur(5px); }
.modal-header { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 23px; border-bottom: 1px solid var(--line); }
.modal-header h2 { font-size: 34px; }
.modal-header p:last-child { margin: 10px 0 0; color: var(--ink-soft); font-family: Georgia,serif; }
.modal-close { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 25px; }
.chore-form { display: grid; gap: 23px; padding-top: 24px; }
.field { display: grid; gap: 8px; }
.field > span, fieldset legend { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 900; }
.field input, .manage-row input, .inline-add input, .money-field input { min-height: 48px; border-radius: 10px; border: 1px solid #b9b1a4; background: white; padding: 0 13px; color: var(--ink); width: 100%; }
fieldset { border: 0; padding: 0; margin: 0; }
fieldset legend { margin-bottom: 11px; }
fieldset legend small { color: var(--ink-soft); font-weight: 600; text-transform: none; letter-spacing: 0; }
.choice-row { display: flex; gap: 8px; flex-wrap: wrap; }
.choice-chip { min-height: 45px; display: flex; align-items: center; gap: 8px; padding: 4px 13px 4px 5px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 800; }
.choice-chip.selected { background: var(--sun-pale); border-color: var(--ink); }
.choice-chip input, .day-picker input, .segmented input { position: absolute; opacity: 0; }
.choice-chip .avatar { width: 34px; height: 34px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
.segmented label { border-radius: 7px; min-height: 38px; display: grid; place-items: center; cursor: pointer; font-weight: 800; }
.segmented label:has(input:checked) { background: var(--ink); color: white; }
.day-picker { display: grid; grid-template-columns: repeat(7,1fr); gap: 6px; margin-top: 10px; }
.day-picker label { height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-weight: 900; }
.day-picker label.selected { background: var(--sun); border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.day-picker.disabled { opacity: .35; pointer-events: none; }
.reward-toggle { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); cursor: pointer; }
.reward-toggle input { width: 18px; height: 18px; accent-color: var(--ink); }
.money-field { display: grid; grid-template-columns: 36px 120px auto; align-items: center; margin-top: 12px; width: fit-content; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: white; }
.money-field.hidden { display: none; }
.money-field > span { text-align: center; font-weight: 900; }
.money-field input { border-width: 0 1px; border-radius: 0; }
.money-field small { padding: 0 12px; color: var(--ink-soft); }
.form-error { min-height: 18px; margin: -8px 0 0; color: #a63f2e; font-weight: 700; font-size: 13px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; }
.manager-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 34px; padding-top: 25px; }
.manager-grid h3 { font-family: Georgia,serif; margin: 0 0 12px; }
.manage-list { display: grid; gap: 8px; }
.manage-row { display: flex; align-items: center; gap: 9px; min-height: 55px; border-bottom: 1px solid var(--line); padding: 5px 0 10px; }
.manage-row .avatar { width: 36px; height: 36px; }
.manage-row input { min-height: 40px; }
.trash-button { flex: 0 0 auto; width: 31px; height: 31px; border-radius: 50%; border: 0; background: #f4e7e2; color: #9d3e2e; cursor: pointer; }
.inline-add { display: grid; grid-template-columns: 1fr auto; gap: 7px; margin-top: 13px; }
.inline-add input { min-height: 44px; }
.chore-list { max-height: 390px; overflow-y: auto; }
.chore-manage-row > button:first-child { flex: 1; display: grid; gap: 3px; text-align: left; border: 0; background: transparent; cursor: pointer; }
.chore-manage-row small { color: var(--ink-soft); }

@media (max-width:900px) {
  .app-shell { padding: 0 24px; }
  .hero { grid-template-columns: 1fr; gap: 35px; padding-top: 42px; }
  .hero h1 { font-size: 68px; }
  .week-card { transform: none; }
  .manager-grid { grid-template-columns: 1fr; }
}

@media (max-width:620px) {
  .app-shell { padding: 0 15px; }
  .topbar { height: 74px; }
  .brand { font-size: 17px; }
  .brand-mark { width: 31px; height: 31px; }
  .local-pill, .desktop-label { display: none; }
  .button { padding: 0 14px; }
  .hero { min-height: auto; padding: 42px 0; }
  .hero h1 { font-size: 55px; letter-spacing: -2.5px; }
  .hero-copy { font-size: 16px; }
  .week-card { padding: 24px 18px 20px; }
  .week-card-top { align-items: flex-start; flex-direction: column; }
  .week-stats div { padding: 0 10px; }
  .week-stats strong { font-size: 18px; }
  .board-heading { align-items: flex-start; gap: 15px; }
  .board-heading h2 { font-size: 31px; }
  .board-heading .button { font-size: 12px; }
  .child-tab { min-width: 155px; }
  .matrix-card { margin-left: -15px; margin-right: -15px; border-radius: 0; }
  .matrix-total { padding: 0 16px; }
  .matrix-total small { display: none; }
  footer { gap: 20px; }
  .modal { padding: 22px 18px; max-height: calc(100vh - 20px); }
  .modal-header h2 { font-size: 29px; }
}

@media print {
  @page { size: landscape; margin: 10mm; }
  body { background: white; color: #111; }
  .app-shell { max-width: none; padding: 0; }
  .topbar, .hero, .board-heading, .child-tabs, .screen-board, footer, .modal, .celebration { display: none !important; }
  .board-section { padding: 0; }
  .print-boards { display: block; }
  .print-boards .matrix-card { break-after: page; box-shadow: none; border: 1.5px solid #222; border-radius: 0; overflow: visible; }
  .print-boards .matrix-card:last-child { break-after: auto; }
  .print-kid-title { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 7px 16px; border-bottom: 1px solid #222; }
  .print-kid-title .avatar { width: 40px; height: 40px; }
  .print-kid-title p { margin: 0; font-size: 8px; text-transform: uppercase; letter-spacing: 1px; }
  .print-kid-title h2 { margin: 1px 0 0; font-family: Georgia,serif; font-size: 24px; }
  .print-weekly-note:not(.empty) { display: block; min-height: 58px; padding: 10px 15px; border-top: 1px solid #222; background: white; }
  .print-weekly-note strong { display: block; margin-bottom: 4px; font-size: 8px; text-transform: uppercase; letter-spacing: 1px; }
  .print-weekly-note p { margin: 0; white-space: pre-wrap; font: 12px/1.35 Georgia,serif; }
  .matrix-scroll { overflow: visible; }
  table { min-width: 0; font-size: 10px; }
  thead th { height: 48px; print-color-adjust: exact; }
  tbody td { height: 57px; }
  .task-edit { padding: 8px 13px; }
  .drag-handle { display: none; }
  .task-edit span { font-size: 13px; }
  .task-edit small { font-size: 7px; margin-top: 3px; }
  .check { width: 25px; height: 25px; print-color-adjust: exact; }
  .matrix-total { height: 46px; padding: 0 15px; print-color-adjust: exact; }
}
