/* DailyChoreList - site styles (mobile first; tuned for iPad as a home-screen web app)
   Replaces styles.css, menu.css and popupstyle.css. The older class names used by the pages are styled here too. */

:root {
  --brand: #2f7de1; --brand-dark: #1c5fb5; --brand-soft: #e8f1fd;
  --ink: #1f2d3d; --muted: #66727f; --line: #dbe3ec; --bg: #f3f6fa; --card: #ffffff;
  --ok: #23964a; --ok-soft: #e3f5e9; --warn: #e07a12; --warn-soft: #fff1e0; --danger: #cf3f3f; --danger-soft: #fdeaea;
  --parent: #fff6d6; --parent-line: #f0d77a;
  --teal: #1f4656; --aqua: #a6dcd6; --mustard: #f5dc87; --orange: #f5a65b;
  --radius: 14px; --shadow: 0 1px 3px rgba(20, 40, 70, .10), 0 4px 14px rgba(20, 40, 70, .06);
  --tap: 48px;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-bottom: var(--safe-bottom);
  -webkit-tap-highlight-color: transparent;
}
body.parent-mode { background: #fbf8ec; }
img { max-width: 100%; height: auto; }
a { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.2; margin: .6em 0 .4em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.1rem; }
input, select, textarea, button { font: inherit; font-size: 16px; }
input[type=text], input[type=email], input[type=password], input[type=number], input:not([type]), select, textarea {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47,125,225,.18); }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; min-width: 0 !important; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- top bar and menu ------------------------------------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 10px;
  padding: calc(8px + var(--safe-top)) 12px 8px; background: #fff; border-bottom: 1px solid var(--line);
}
.topbar .brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); min-width: 0; }
.topbar .brand img { width: 34px; height: 34px; flex: none; }
.topbar .brand .wordmark { font-weight: 800; font-size: 1.05rem; color: #3b45b8; white-space: nowrap; }
.topbar .pagetitle { font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar .spacer { flex: 1; }
.topnav { display: none; gap: 4px; }
.topnav a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); font-weight: 600; white-space: nowrap; }
.topnav a img { width: 20px; height: 20px; flex: none; }
.topnav a:hover, .topnav a.current { background: var(--brand-soft); color: var(--brand-dark); }
.iconbtn {
  width: var(--tap); height: var(--tap); border-radius: 12px; border: 1px solid var(--line); background: #fff;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; color: var(--ink); flex: none;
}
.iconbtn:active { transform: scale(.96); }
/* the free trial / subscription notice at the top of the page (_layout.php PrintPlanNotice) */
.plannotice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.plannotice span { flex: 1 1 260px; }
.chore:disabled, .cell:disabled { cursor: not-allowed; opacity: .75; } /* a read-only account */
/* "Guide me" in the header (shown only on pages with a tour): a round ? button, with the words on wide screens */
.guidebtn { border-radius: 50%; gap: 6px; color: var(--brand-dark); font-weight: 800; }
.guidebtn .q { font-size: 1.35rem; line-height: 1; }
.guidebtn .txt { display: none; font-size: .9rem; white-space: nowrap; }
@media (min-width: 1280px) { .guidebtn { width: auto; border-radius: 999px; padding: 0 14px 0 12px; } .guidebtn .txt { display: inline; } }
/* a phone header with the Parent pill and Guide me has no room for the full name: the logo alone */
@media (max-width: 480px) { .topbar:has(.parentpill):has(.guidebtn:not([style*="none"])) .brand .wordmark { display: none; } }
.burger { width: 22px; height: 16px; position: relative; }
.burger::before, .burger::after, .burger span { content: ""; position: absolute; left: 0; right: 0; height: 2.5px; border-radius: 2px; background: currentColor; }
.burger::before { top: 0; } .burger span { top: 7px; } .burger::after { bottom: 0; }
.parentpill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--parent); border: 1px solid var(--parent-line); font-weight: 700; font-size: .85rem; white-space: nowrap; }
.lockpill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--brand-soft); font-weight: 700; font-size: .85rem; white-space: nowrap; }

.drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 25, 40, .45); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 90; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(330px, 88vw); background: #fff; z-index: 100; transform: translateX(105%);
  transition: transform .22s ease; display: flex; flex-direction: column; padding: calc(12px + var(--safe-top)) 12px calc(12px + var(--safe-bottom));
  overflow-y: auto; box-shadow: -8px 0 30px rgba(0,0,0,.15);
}
body.menu-open .drawer { transform: none; }
body.menu-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
.drawer .drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.drawer .group { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 14px 8px 4px; }
.drawer a, .drawer button.menuitem {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px; border-radius: 12px; text-decoration: none;
  color: var(--ink); font-weight: 600; font-size: 1.05rem; background: none; border: 0; width: 100%; text-align: left; cursor: pointer;
}
.drawer a:hover, .drawer button.menuitem:hover, .drawer a.current { background: var(--brand-soft); }
.drawer a img, .drawer button.menuitem img { width: 26px; height: 26px; }
.drawer .divider { height: 1px; background: var(--line); margin: 8px 4px; }

.parent-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 14px; background: var(--parent);
  border-bottom: 1px solid var(--parent-line); font-weight: 600;
}
.parent-bar .spacer { flex: 1; }
#ParentClock.ending { color: var(--warn); }

/* ---- page frame ------------------------------------------------------------------------------------------------- */
main.page { max-width: 1120px; margin: 0 auto; padding: 14px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.page-head h1 { margin: 0; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 0 0 14px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.muted { color: var(--muted); }
.small, .smallnotes { font-size: .85rem; color: var(--muted); }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); margin: 0 0 12px; }
.notice.warn { background: var(--warn-soft); } .notice.ok { background: var(--ok-soft); } .notice.danger { background: var(--danger-soft); }
.subnav { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; white-space: nowrap; }
.subnav a.current { background: var(--brand); border-color: var(--brand); color: #fff; }
.subnav a img { width: 20px; height: 20px; }
.site-footer { max-width: 1120px; margin: 10px auto 30px; padding: 0 14px; display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .85rem; }
.site-footer a { color: var(--muted); }
.site-footer .spacer { flex: 1; }

/* ---- buttons (new and the site's older class names) ---------------------------------------------------------- */
.btn, .buttonFooter, .ButtonEditText, .ButtonEditTextSmall, .ButtonDelete, .ButtonTasks, input[type=submit], button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 16px;
  border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none;
  font-weight: 600; cursor: pointer; line-height: 1.2; text-align: center; vertical-align: middle; user-select: none;
}
.btn:active, .buttonFooter:active, .ButtonEditText:active, .ButtonEditTextSmall:active, .ButtonDelete:active, input[type=submit]:active { transform: scale(.97); }
.btn-primary, button.btn-primary, input[type=submit], .ButtonGrnNow.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover, button.btn-primary:hover, input[type=submit]:hover { background: var(--brand-dark); }
input[type=submit]:disabled { background: #a9c3e8; border-color: #a9c3e8; cursor: not-allowed; }
.ButtonEditText { background: var(--brand-soft); border-color: #c9dcf6; color: var(--brand-dark); }
.ButtonEditTextSmall, .btn-sm { min-height: 34px; padding: 4px 10px; font-size: .9rem; border-radius: 10px; }
.ButtonEditTextSmall { background: var(--brand-soft); border-color: #c9dcf6; color: var(--brand-dark); }
.ButtonDelete, .btn-danger, button.btn-danger { background: var(--danger-soft); border-color: #f3c3c3; color: var(--danger); min-height: 36px; min-width: 36px; padding: 4px 10px; }
.btn-ok, button.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-block { display: flex; width: 100%; }
/* chore state buttons used by the week grid and edit pages */
.ButtonGrnNow, .ButtonRedNow, .ButtonXtrNow, .ButtonGrnPast, .ButtonRedPast, .ButtonRedFuture {
  display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 4px 10px;
  border-radius: 10px; text-decoration: none; font-weight: 700; border: 2px solid transparent;
}
.ButtonGrnNow, .ButtonGrnPast { background: var(--ok-soft); color: var(--ok); border-color: #9ed6b1; }
.ButtonRedNow { background: #fff; color: var(--danger); border-color: #f0b4b4; }
.ButtonRedPast { background: var(--warn-soft); color: var(--warn); border-color: #f4c99a; }
.ButtonRedFuture { background: #f1f3f6; color: #a3acb7; }
.ButtonXtrNow { background: var(--brand-soft); color: var(--brand-dark); border-color: #c9dcf6; }
.buttonChore { display: inline-flex; align-items: center; min-height: 32px; padding: 2px 10px; margin: 2px; border-radius: 999px; color: #fff; font-weight: 700; text-decoration: none; font-size: .9rem; text-shadow: 0 1px 1px rgba(0,0,0,.25); touch-action: none; }
.buttonChore.selected { outline: 3px solid var(--ink); outline-offset: 2px; }

/* ---- the main page: children and chores ------------------------------------------------------------------------ */
.kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.kid-card { background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 10px; border: 4px solid var(--kid, var(--brand)); border-top-width: 8px; }
.kid-card .who { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.kid-card .who img, .kid-photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 3px solid var(--kid, var(--brand)); background: #fff; flex: none; }
.kid-card .who .name { font-size: 1.3rem; font-weight: 800; }
.kid-card .mini { display: flex; flex-wrap: wrap; gap: 6px; }
.kid-card .mini img { width: 34px; height: 34px; border-radius: 50%; opacity: .45; filter: grayscale(.4); }
.kid-card .mini img.done { opacity: 1; filter: none; box-shadow: 0 0 0 3px var(--ok); }
.kid-card .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.progress { height: 12px; border-radius: 999px; background: #e9eef4; overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #39b765, #23964a); border-radius: 999px; transition: width .3s; }
.progress-text { font-weight: 700; color: var(--muted); font-size: .95rem; }

.child-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.child-head .kid-photo { width: 76px; height: 76px; }
.child-head .hello { font-size: 1.6rem; font-weight: 800; margin: 0; }
.child-head .today { color: var(--muted); font-weight: 600; }
.child-head .grow { flex: 1; min-width: 180px; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 18px 2px 10px; font-size: 1.2rem; font-weight: 800; }
.section-title .count { font-size: .9rem; color: var(--muted); font-weight: 700; }

.chores { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.chore {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 150px;
  padding: 14px 10px 12px; border-radius: 20px; background: #fff; border: 3px solid #e3e9f0; box-shadow: var(--shadow);
  font: inherit; font-weight: 800; font-size: 1.05rem; color: var(--ink); text-align: center; cursor: pointer; touch-action: manipulation;
  transition: transform .08s, background-color .2s, border-color .2s;
}
.chore:active { transform: scale(.96); }
.chore img.icon { width: 76px; height: 76px; border-radius: 50%; }
.chore .noicon { width: 76px; height: 76px; border-radius: 50%; background: #eef2f6; display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.chore .label { line-height: 1.15; overflow-wrap: anywhere; }
.chore .tag { font-size: .75rem; font-weight: 800; color: var(--warn); text-transform: uppercase; letter-spacing: .04em; }
.chore .check {
  position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 3px solid #d5dde6;
  display: flex; align-items: center; justify-content: center; color: transparent; font-size: 20px; font-weight: 900;
}
.chore.done { background: var(--ok-soft); border-color: #7fcf9b; }
.chore.done .check { background: var(--ok); border-color: var(--ok); color: #fff; }
.chore.done img.icon { box-shadow: 0 0 0 4px #7fcf9b; }
.chore.overdue:not(.done) { border-color: #f4c48f; background: #fffaf3; }
.chore.extra:not(.done) { border-style: dashed; }
.chore.pop { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
.alldone { text-align: center; padding: 18px; border-radius: 18px; background: var(--ok-soft); font-size: 1.3rem; font-weight: 800; color: var(--ok); margin-top: 12px; }
.empty { padding: 16px; border-radius: 14px; background: #fff; color: var(--muted); box-shadow: var(--shadow); }

.weekwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); box-shadow: var(--shadow); background: #fff; }
table.week { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 640px; }
table.week th, table.week td { padding: 6px; text-align: center; border-bottom: 1px solid #eef2f6; }
table.week th { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: #fafbfd; }
table.week th.today, table.week td.today { background: var(--brand-soft); }
table.week td.task, table.week th.task { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; min-width: 170px; }
table.week td.task .t { display: flex; align-items: center; gap: 8px; font-weight: 700; }
table.week td.task img { width: 34px; height: 34px; border-radius: 50%; flex: none; }
table.week td.task .desc { display: none; font-weight: 400; font-size: .85rem; color: var(--muted); margin-top: 4px; }
table.week.showdesc td.task .desc { display: block; }
.cell { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; font-weight: 900; border: 2px solid transparent; background: none; padding: 0; font-size: 1.1rem; }
.cell.done { background: var(--ok-soft); color: var(--ok); border-color: #9ed6b1; }
.cell.missed { background: var(--warn-soft); color: var(--warn); border-color: #f4c99a; }
.cell.due { background: #fff; color: var(--danger); border-color: #f0b4b4; }
.cell.future { background: #f1f3f6; color: #b2bac4; }
button.cell { cursor: pointer; }

.sync-status { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-bottom)); background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: .85rem; font-weight: 600; z-index: 60; opacity: 0; transition: opacity .25s; pointer-events: none; }
.sync-status.show { opacity: .92; }

/* ---- PIN pad ---------------------------------------------------------------------------------------------------- */
.pin-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(15, 25, 40, .55); display: none; align-items: center; justify-content: center; padding: 16px; }
.pin-overlay.open { display: flex; }
/* ---- asking for a short answer (DCLAsk in app.js): at the top, so the on-screen keyboard never covers it ---------- */
.ask-overlay { position: fixed; left: 0; right: 0; top: 0; bottom: 0; z-index: 210; background: rgba(15, 25, 40, .45); display: flex; align-items: flex-start;
  justify-content: center; padding: calc(12px + var(--safe-top)) 12px 12px; overflow: auto; }
.askbox { background: #fff; border-radius: 18px; padding: 16px; width: min(460px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.3); margin-top: min(8vh, 60px); }
.askbox .q { display: block; font-weight: 600; margin-bottom: 10px; line-height: 1.35; }
.askbox .field { width: 100%; font-size: 18px; }
.askbox .row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.pinpad { background: #fff; border-radius: 22px; padding: 20px 18px 16px; width: min(360px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.3); text-align: center; }
.pinpad h2 { margin: 0 0 4px; font-size: 1.3rem; }
.pinpad .why { color: var(--muted); font-size: .95rem; margin: 0 0 12px; }
.pinpad .dots { display: flex; justify-content: center; gap: 12px; margin: 10px 0 14px; min-height: 22px; }
.pinpad .dots span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #b8c3cf; }
.pinpad .dots span.on { background: var(--ink); border-color: var(--ink); }
.pinpad .msg { min-height: 1.4em; color: var(--danger); font-weight: 600; margin-bottom: 6px; }
.pinpad.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pinpad .keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pinpad .keys button { height: 66px; border-radius: 16px; border: 1px solid var(--line); background: #f7f9fc; font-size: 1.6rem; font-weight: 700; cursor: pointer; color: var(--ink); touch-action: manipulation; }
.pinpad .keys button:active { background: var(--brand-soft); transform: scale(.96); }
.pinpad .keys button.fn { font-size: 1rem; background: #fff; }
.pinpad .alt { margin-top: 12px; font-size: .9rem; }

/* ---- cookie notice ---------------------------------------------------------------------------------------------- */
.consent { position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-bottom)); z-index: 150; display: none; max-width: 760px; margin: 0 auto;
  background: #fff; border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.22); padding: 16px; border: 1px solid var(--line); }
.consent.open { display: block; }
.consent p { margin: 0 0 10px; }
.consent .choices { display: flex; flex-wrap: wrap; gap: 8px; }
.consent label { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; }
.consent label input { margin-top: 4px; width: 20px; height: 20px; }

/* ---- pop-ups: tips (getpopup.php), image and icon choosers ---------------------------------------------------- */
.popupoverlay { position: fixed; inset: 0; background: rgba(15,25,40,.5); z-index: 120; display: flex; align-items: center; justify-content: center; padding: 16px; visibility: hidden; opacity: 0; transition: opacity .2s; }
.popupoverlay:target { visibility: visible; opacity: 1; }
.popup { background: #fff; border-radius: 18px; padding: 20px; width: min(560px, 100%); max-height: 85vh; overflow: auto; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.popup h2 { margin-top: 0; padding-right: 40px; }
.popup .closebutton { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; text-decoration: none; color: var(--muted); }
.modal { display: none; position: fixed; z-index: 130; inset: 0; background: rgba(15,25,40,.5); padding: 16px; overflow: auto; }
.modal-content { background: #fff; margin: 4vh auto; border-radius: 18px; width: min(720px, 100%); max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-content-goodbye { display: none; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-direction: row-reverse; }
.modal-body { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; }
.modal-body iframe { width: 100% !important; min-height: 60vh; border: 0; display: block; }
.close { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; cursor: pointer; color: var(--muted); background: #f1f4f8; }

/* ---- editing pages: sortable lists, tabs, tables --------------------------------------------------------------- */
#sortable { list-style: none; margin: 0; padding: 0; }
#sortable li { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 0 0 10px; box-shadow: var(--shadow); height: auto !important; font-size: 1rem !important; }
#sortable li span:first-child { position: static !important; margin: 0 !important; cursor: grab; }
/* the drag grip: rows are moved by this only (sortable handle), up and down only */
#sortable li .grip { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; min-height: 44px; align-self: stretch;
  cursor: grab; touch-action: none; border-radius: 8px; }
#sortable li .grip img { width: 12px; height: 20px; display: block; pointer-events: none; }
#sortable li .grip:hover { background: #f1f4f8; }
.ui-sortable-helper .grip, #sortable li .grip:active { cursor: grabbing; }
#sortable li img[src*="images/icons/"] { width: 44px !important; height: 44px !important; border-radius: 50%; }
.ui-sortable-helper { box-shadow: 0 10px 30px rgba(0,0,0,.2) !important; }
ul.tab { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 auto 10px; overflow-x: auto; width: 100% !important; scrollbar-width: none; }
ul.tab::-webkit-scrollbar { display: none; }
ul.tab li a { display: inline-flex; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--ink); font-weight: 600; white-space: nowrap; }
ul.tab li a.active, ul.tab li a:focus { background: var(--brand); border-color: var(--brand); color: #fff; }
.tabcontent { width: 100% !important; background: #fff; border: 0 !important; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px !important; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { border-collapse: collapse; width: 100%; background: #fff; }
table.data th, table.data td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; overflow-wrap: anywhere; }
.UserName { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; border-radius: 14px; text-decoration: none; color: var(--ink); font-weight: 700; background: #fff; box-shadow: var(--shadow); }

/* ---- forms ------------------------------------------------------------------------------------------------------ */
.form-card { max-width: 520px; margin: 10px auto; }
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; }
.checkline { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.checkline input { width: 20px; height: 20px; }

/* ---- the welcome page ------------------------------------------------------------------------------------------- */
.hero { display: grid; gap: 18px; align-items: center; grid-template-columns: 1fr; }
.hero .art { text-align: center; }
.hero .art img { width: min(260px, 60vw); }
.hero h1 { font-size: 2rem; }
.hero .cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.features { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.features img { border-radius: 12px; }

/* ---- wider screens: iPad portrait and up -------------------------------------------------------------------- */
@media (min-width: 700px) {
  main.page { padding: 20px; }
  .hero { grid-template-columns: 1fr 1.3fr; }
  .chores { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
  .chore { min-height: 170px; font-size: 1.15rem; }
  .chore img.icon, .chore .noicon { width: 90px; height: 90px; }
}
@media (min-width: 1000px) {
  .topnav { display: flex; }
  .topbar .pagetitle { display: none; }   /* the highlighted header link shows where you are */
  .topbar .brand { flex: none; }
}
@media (min-width: 1000px) and (max-width: 1279px) {
  .topbar.many .brand .wordmark { display: none; }   /* room for the parent links: the logo alone */
  .topbar.many .topnav { gap: 2px; }
  .topbar.many .topnav a { padding: 8px 8px; }
}
/* small phones */
@media (max-width: 600px) {
  /* the setup pages' form tables: one field per line */
  .tabcontent table:not(.data), .tabcontent table:not(.data) > tbody, .tabcontent table:not(.data) > tbody > tr, .tabcontent table:not(.data) > tbody > tr > td { display: block; width: auto !important; }
  .tabcontent input:not([type=checkbox]):not([type=radio]), .tabcontent select, .tabcontent textarea { max-width: 100%; }
}
@media (max-width: 560px) {
  table.week { min-width: 0; }
  table.week td.task, table.week th.task { min-width: 112px; max-width: 132px; font-size: .9rem; }
  table.week td.task img { width: 26px; height: 26px; }
  table.week th, table.week td { padding: 4px 2px; }
  .cell { width: 34px; height: 34px; }
}
@media (max-width: 420px) {
  .topbar .pagetitle { display: none; }
  .chores { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .chore { min-height: 136px; font-size: 1rem; }
  .chore img.icon, .chore .noicon { width: 64px; height: 64px; }
  .kids { grid-template-columns: 1fr; }
}
/* full-screen when launched from the home screen */
@media (display-mode: standalone) {
  .topbar { padding-top: calc(10px + var(--safe-top)); }
}
@media print {
  .topbar, .drawer, .drawer-backdrop, .parent-bar, .site-footer, .consent, .sync-status { display: none !important; }
}

/* ---- Tasks page: each task in fixed columns ------------------------------------------------------------------ */
.taskhead, #sortable li.taskrow {
  display: grid; align-items: center; gap: 8px;
  grid-template-columns: 28px 52px minmax(130px, 1fr) minmax(150px, 1.5fr) 160px 100px 40px;
  grid-template-areas: "handle pic name desc cat price del";
}
.taskhead { padding: 0 12px 6px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
#sortable li.taskrow { padding: 8px 12px; font-size: 1rem; min-height: 0; margin: 0 0 8px; }
.taskrow .t-handle { grid-area: handle; cursor: grab; }
.taskrow .t-pic { grid-area: pic; }
.taskrow .t-pic img { width: 44px !important; height: 44px !important; border-radius: 50%; display: block; }
.taskrow .t-pic.none img { opacity: .35; outline: 2px dashed #b8c3cf; outline-offset: 2px; }
.taskrow .t-name, .taskrow .t-desc { width: 100%; max-width: none !important; justify-content: flex-start; text-align: left; overflow-wrap: anywhere; margin: 0; }
.taskrow .t-name { grid-area: name; font-weight: 700; }
.taskrow .t-desc { grid-area: desc; font-weight: 400; }
.taskrow .t-cat { grid-area: cat; width: 100%; }
.taskrow .t-price { grid-area: price; display: flex; align-items: center; gap: 4px; }
.taskrow .t-price input { width: 100%; min-width: 0; text-align: right; }
.taskrow .t-del { grid-area: del; justify-self: end; float: none !important; }
@media (max-width: 800px) {
  .taskhead { display: none; }
  #sortable li.taskrow {
    grid-template-columns: 28px 52px 1fr 96px 40px;
    grid-template-areas: "handle pic name name del" "handle desc desc desc desc" "handle cat cat price price";
  }
}

/* ---- Chore schedule (editchores.php) ----------------------------------------------------------------------- */
/* the child buttons and the week menu stay on screen while scrolling down the chart */
.chorebar {
  position: sticky; top: var(--topbar-h, 58px); z-index: 30; background: #fff; border: 1px solid var(--line);
  border-radius: 14px 14px 0 0; padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 4px 10px rgba(20,40,70,.06);
}
.chorebar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chorebar [style*="float"] { float: none !important; }
.chorebar-row > span { display: inline-flex; flex-wrap: wrap; gap: 6px; order: -1; }
.chorebar .ButtonDelete { margin-left: auto; }
/* every child button is at least about six letters wide */
.chorebar .buttonChore, #ChoreGrid .buttonChore { min-width: calc(6ch + 22px); justify-content: center; margin: 2px; }
#ChoreGrid .buttonChore font { font-size: inherit; }
#ChoreGrid .buttonChore { font-size: .8rem; }
/* the day names stay under the toolbar (on wider screens; a phone scrolls the chart sideways instead) */
#ChoreGrid thead td { background: #fff; }
@media (min-width: 760px) {
  .chorewrap { overflow: visible; }
  #ChoreGrid thead td { position: sticky; top: calc(var(--topbar-h, 58px) + var(--chorebar-h, 90px)); z-index: 20; box-shadow: 0 2px 0 #000; }
}

/* ---- children's phones: the setup panel (pairdevice.php) and the phone's setup page (pair.php) ------------------- */
.pairpanel { padding: 14px 16px 20px; max-width: 680px; margin: 0 auto; }
.pairpanel section { border-bottom: 1px solid var(--line); padding: 4px 0 14px; margin-bottom: 12px; }
.pairpanel section:last-child { border-bottom: 0; }
.pairpanel h2 { font-size: 1.1rem; margin: 6px 0 10px; }
.pairqr { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.qrbox { width: 200px; height: 200px; flex: none; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-sizing: border-box; }
.qrbox svg { width: 100%; height: 100%; display: block; }
.steps { margin: 0; padding-left: 22px; line-height: 1.5; flex: 1 1 240px; }
.steps li { margin-bottom: 6px; }
label.check { display: flex; gap: 10px; align-items: center; margin: 0 0 14px; cursor: pointer; }
label.check input { width: 20px; height: 20px; flex: none; }
.pairsettings .field select { max-width: 220px; }
.phonerow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; }
.phonerow .what { flex: 1 1 200px; display: flex; flex-direction: column; }
.pad { padding: 16px; }
.pairpage .pairhead { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.pairpage .pairhead h1 { margin: 0; }
.pairpage .kid-photo { border-color: var(--kid, var(--brand)); }
.shareicon { display: inline-flex; vertical-align: -4px; color: #2f7fe0; }
.qrstatus { flex: 1 1 220px; }
.phonelogin ul { padding-left: 20px; line-height: 1.5; }
