/* 🧽 Cleaning (web/cleaning.js): ✨ Overall Cleanliness, then each place and its areas, a countdown bar
   per task. 🧴 Hygiene & Health (web/hygiene.js, .cl.hy) is drawn with the same classes: ✨ Overall Health &
   Hygiene, then each type (.hy-type) and its tasks. Uses choreboy.css's tokens (light and dark) and its .tick; phone first (no sideways
   scroll at 320 px). The bars' widths come from --cl-fill (cleaning.js paint). */

/* On a wide screen: the page at a reading width (a row's "Not cleaning" stays by its title), the rows in columns. */
.cl { max-width: 1000px; margin: 0 auto; }
.cl .list-sub { margin: .2rem 0 0; }
.cl-k { margin: 0; font-size: 1.02rem; font-weight: 700; color: var(--text); overflow-wrap: anywhere; }

/* ✨ Overall Cleanliness */
.cl-overall { display: flex; align-items: center; gap: .9rem; margin: 0 0 1rem; padding: .8rem .9rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.cl-ring-wrap { position: relative; flex: 0 0 auto; width: 4.2rem; height: 4.2rem; }
.cl-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.cl-ring circle { fill: none; stroke-width: 5; }
.cl-ring-bg { stroke: var(--surface-2); }
.cl-ring-fg { stroke: var(--good); stroke-linecap: round; transition: stroke-dasharray .5s ease; }
.cl-ring.warn .cl-ring-fg { stroke: var(--warn); }
.cl-ring.bad .cl-ring-fg { stroke: var(--bad); }
.cl-ring.none .cl-ring-fg { stroke: transparent; }
.cl-ring-n { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 750; font-size: .95rem; color: var(--text); }
.cl-overall-text { min-width: 0; }
.cl-overall-text p { margin: .15rem 0 0; overflow-wrap: anywhere; }
.cl-all-score { font-size: 1rem; color: var(--text); }
.cl-all-sum { font-size: .9rem; color: var(--text-2); }

/* A place and its areas */
.cl-place { margin: 0 0 1.2rem; }
.cl-place-head { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.cl-place-head .cl-k { margin-right: auto; min-width: 0; }
.cl-place-sum { margin: .3rem 0 .5rem; font-size: .88rem; color: var(--text-2); overflow-wrap: anywhere; }
.cl-place-bar { margin-top: .45rem; }
.cl-area { margin: .6rem 0 0; }
.cl-area-h { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin: 0 0 .35rem; font-size: .92rem; font-weight: 650; color: var(--text-2); }
.cl-area-name { min-width: 0; overflow-wrap: anywhere; }
.cl-score b { font-weight: 750; }
.cl-score.good { color: var(--good); }
.cl-score.warn { color: var(--warn); }
.cl-score.bad { color: var(--bad); }
.cl-score.none { color: var(--text-3); }

/* A task */
.cl-list, .cl-hid-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.cl-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.cl-row { display: flex; align-items: flex-start; gap: .6rem; min-width: 0; padding: .6rem .7rem; background: var(--surface);
  border: 1px solid var(--border); border-left: 3px solid var(--good); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.cl-row.warn { border-left-color: var(--warn); }
.cl-row.bad { border-left-color: var(--bad); }
.cl-row.none { border-left-color: var(--border-strong); }
.cl-row .tick { margin-top: .1rem; }
.cl-row .tick[aria-disabled="true"] { opacity: .55; cursor: progress; } /* (ticked: waiting for the reply) */
.cl-body { flex: 1 1 auto; min-width: 0; }
.cl-title { display: block; max-width: 100%; padding: 0; border: 0; background: none; color: var(--text); font: 600 .95rem var(--font); text-align: left;
  cursor: pointer; overflow-wrap: anywhere; }
.cl-title:hover { color: var(--accent-text); text-decoration: underline; }
.cl-title:focus-visible, .cl-hidden > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.cl-meter { display: flex; align-items: center; gap: .5rem; margin-top: .3rem; min-width: 0; }
.cl-bar { position: relative; flex: 1 1 auto; min-width: 3rem; max-width: 16rem; height: .5rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.cl-place-bar { display: block; max-width: none; }
.cl-fill { position: absolute; inset: 0 auto 0 0; width: var(--cl-fill, 0%); border-radius: inherit; background: var(--good); transition: width .5s ease; }
.cl-fill.warn { background: var(--warn); }
.cl-fill.bad { background: var(--bad); }
.cl-words { flex: 0 1 auto; font-size: .84rem; color: var(--text-2); white-space: nowrap; }
.cl-words.warn { color: var(--warn); font-weight: 600; }
.cl-words.bad { color: var(--bad); font-weight: 650; }
.cl-foot { display: flex; align-items: center; gap: .3rem .5rem; flex-wrap: wrap; margin-top: .3rem; min-width: 0; }
.cl-sub { margin: 0; min-width: 0; font-size: .8rem; color: var(--text-3); overflow-wrap: anywhere; }
.cl-go { margin-left: auto; } /* 📅 Go to day, at the row's end */

/* Not cleaning · N */
.cl-hidden { margin-top: .4rem; }
.cl-hidden > summary { cursor: pointer; padding: .3rem 0; list-style-position: inside; }
.cl-hidden p { margin: .2rem 0 .5rem; }
.cl-hid-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .45rem .7rem; background: var(--surface-2); border-radius: var(--radius); }
.cl-hid-row .cl-title { font-weight: 500; color: var(--text-2); }
.cl-empty p { margin: .2rem 0; }
.cl-empty .btn-row { margin-top: .5rem; }

/* The task editor's 🗺️ Areas (toggle chips, any number) and Shows on: Auto · 🧽 Cleaning · 🧴 Hygiene & Health · Neither (app.js zoneFieldsHtml) */
.ed-zones, .ed-clean { margin-top: .7rem; }
.ed-zone-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .25rem; }
.ed-zone { cursor: pointer; white-space: normal; text-align: left; overflow-wrap: anywhere; }
.ed-zone:hover { border-color: var(--accent); }
.ed-zone.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.ed-zone.on::before { content: '✓'; }
.ed-zone:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ed-clean-seg { margin-top: .25rem; }

@media (max-width: 520px) {
  .cl-go, .cl-add { min-height: 2.25rem; }
  .cl-row .tick { width: 28px; height: 28px; }
  .cl-bar { max-width: none; }
  .cl-words { white-space: normal; }
  /* (Shows on's four choices: two rows on a phone, each filling its share, square-cornered when they wrap.) */
  .ed-clean-seg { display: flex; width: 100%; border-radius: var(--radius); }
  .ed-clean-seg button { flex: 1 1 auto; padding-left: .4rem; padding-right: .4rem; border-radius: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .cl-fill, .cl-ring-fg { transition: none; }
}
:root[data-fx="off"] .cl-fill, :root[data-fx="off"] .cl-ring-fg { transition: none; }
