/* Chores and Routines screen styles (see js/chores.js). */

/* header */
.ch-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 560px) {
  .ch-page-head h1 { width: 100%; }
  .ch-page-head .week-nav { flex: 1 1 100%; }
  .ch-page-head .wk-label { flex: 1; min-width: 0; }
  .ch-actions { flex: 1; justify-content: flex-end; }
}

/* person tabs */
/* Tabs wrap onto a second line instead of scrolling sideways (a sideways-scrolling strip
   bounced on iPhones and left a tab half cut off at the edge). */
.ch-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 10px; margin: 0 0 6px; }
.ch-tab { max-width: 100%; }
.ch-tab-name { overflow: hidden; text-overflow: ellipsis; }
.ch-tab {
  font: inherit; font-weight: 700; font-size: .95rem; color: var(--text); flex: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 12px 6px 7px; min-height: 44px; display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; white-space: nowrap;
}
.ch-tab:hover { background: var(--surface-2); }
.ch-tab.on { background: color-mix(in srgb, var(--c) 18%, var(--surface)); border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.ch-badge {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 999px; background: var(--c); color: #fff; font-size: .78rem; font-weight: 800; line-height: 1;
}
.ch-badge.done { background: var(--good); }
.ch-hint { margin: 0 0 12px; }

/* person header card and sections */
.ch-person { margin-bottom: 14px; }
.ch-person .chore-head { margin-bottom: 6px; }
.ch-sections { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); align-items: start; }
.ch-section { --sec: var(--accent); padding: 12px 14px 8px; border-top: 4px solid var(--sec); }
.ch-sec-morning { --sec: #e0a21a; }
.ch-sec-afternoon { --sec: #2f8fc9; }
.ch-sec-evening { --sec: #6a5acd; }
.ch-sec-chore { --sec: var(--good); }
.ch-sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.ch-sec-head h2 { margin: 0; font-size: 1.05rem; flex: 1; min-width: 0; }
.ch-sec-icon {
  width: 38px; height: 38px; border-radius: 11px; flex: none; display: grid; place-items: center;
  font-size: 1.3rem; line-height: 1; background: color-mix(in srgb, var(--sec) 18%, var(--surface));
}
.ch-sec-head .btn.icon.small { width: 44px; min-height: 44px; }
.ch-tip { margin: 14px 2px 0; }
.ch-empty p { margin: 0 0 12px; }
.ch-empty .row { margin-top: 4px; }

/* rows */
.chore-emoji { flex: none; width: 30px; text-align: center; font-size: 1.35rem; line-height: 1; }
.chore .x { width: 44px; height: 44px; }
.chore-title:not([data-title-edit]) { cursor: default; }
.chore-title[data-title-edit] { cursor: text; }
.chore.done .chore-emoji { opacity: .55; }
.ch-section .chore-list .chore { border-radius: 10px; }

/* week chart */
.chart tr.ch-grp th {
  text-align: left; font-size: .76rem; font-weight: 800; color: var(--muted); text-transform: uppercase;
  letter-spacing: .05em; padding: 12px 0 4px;
}
.chart tbody tr:first-child.ch-grp th { border-top: 0; padding-top: 2px; }
.chart tbody th .chore-emoji { display: inline-block; width: auto; font-size: 1.1rem; margin-right: 6px; vertical-align: -2px; }
.chart thead th.old, .chart td.old { opacity: .45; }

/* editor */
.ch-seg { display: flex; width: 100%; }
.ch-seg .seg-btn { flex: 1; min-height: 44px; white-space: nowrap; }
@media (max-width: 400px) { #cf-tod .seg-btn { font-size: .8rem; padding: 6px 4px; } }
.ch-emoji-row { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.ch-emoji-row input { width: 6.5em; flex: none; font-size: 1.3rem; text-align: center; padding: 6px 8px; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; margin-top: 8px; }
.emoji-btn {
  font: inherit; font-size: 1.35rem; line-height: 1; min-height: 44px; padding: 0; cursor: pointer;
  background: var(--surface-2); border: 1px solid transparent; border-radius: 10px;
}
.emoji-btn:hover { border-color: var(--border); }
.emoji-btn.on { background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* Task Chest */
.tc-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 4px; }
.tc-tools input { flex: 1 1 200px; width: auto; }
.tc-tools .btn { margin-left: auto; }
.tc-group h3 { display: flex; align-items: center; gap: 6px; margin: 16px 0 4px; font-size: .95rem; }
.tc-list { list-style: none; margin: 0; padding: 0; }
.tc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.tc-row:first-child { border-top: 0; }
.tc-main { flex: 1 1 150px; min-width: 0; display: flex; flex-direction: column; overflow-wrap: break-word; }
.tc-actions { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.tc-actions .btn.small { min-height: 44px; }
.tc-actions .btn.icon.small { width: 44px; }

/* Today / wall display */
.hp-label {
  display: flex; align-items: center; gap: 6px; margin: 8px 0 0;
  font-size: .76rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
}
.hp-label + .chore-list .chore:first-child { border-top: 0; }
.hp-none { margin: 6px 0 0; }
body.wall .hp-label { font-size: .85rem; }
body.wall .chore-emoji { font-size: 1.6rem; width: 36px; }

/* ===== No accidental text selection on checklists =====
   On iPhones a double-tap or press-and-hold on a checklist starts selecting text (magnifier / copy
   menu) and the tap is lost. Checklists, progress bars and the wall display have nothing to copy.
   Text boxes (including tap-to-fix-a-typo boxes) stay selectable. */
.chore, .chore-list, .ch-person, .ch-section, .progress, .home-person, body.wall #home {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.chore input, body.wall #home input { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
