/* Checklista (aplikacja platformy, kod checklist): moje listy, formularz listy, ekran odhaczania. Telefon pierwszy: wiersze co najmniej 56 px,
   dotykalne calym wierszem, wiersze nie zmieniaja miejsca po odhaczeniu. Tokeny kolorow z app.css (jasny, ciemny i sepia). Bez inline stylow (CSP). */

.app-checklist .page { max-width: 42rem; }
.cl-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin: .2rem 0 .9rem; }
.cl-head h1 { margin: 0; overflow-wrap: anywhere; }
.cl-title { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; min-width: 0; flex: 1 1 12rem; }
.cl-badge { display: inline-block; padding: .08rem .6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--muted); font-size: .78rem; font-weight: 600; line-height: 1.5; white-space: nowrap; }
.cl-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .8rem 0 0; }
.cl-actions form { margin: 0; }
.cl-more { margin-top: 1rem; }

/* Moje listy */
.cl-run-list, .cl-lists { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.cl-run-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.cl-run-item:first-child { border-top: 0; padding-top: 0; }
.cl-run-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 12rem; overflow-wrap: anywhere; }
.cl-run-actions { display: flex; gap: .5rem; align-items: center; }
.cl-run-actions form { margin: 0; }
.cl-card { display: flex; align-items: stretch; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.cl-card-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .25rem; justify-content: center; min-height: 64px; padding: .7rem 1rem; color: var(--fg); text-decoration: none; border-radius: var(--radius) 0 0 var(--radius); }
.cl-card-main:hover, .cl-card-main:focus-visible { background: color-mix(in srgb, var(--accent-soft) 60%, var(--card)); color: var(--fg); }
.cl-card-title { font-weight: 600; font-size: 1.08rem; overflow-wrap: anywhere; }
.cl-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .6rem; }
.cl-edit { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-width: 48px; min-height: 48px; padding: .3rem .8rem; color: var(--muted); font-size: .9rem; text-decoration: none; border-radius: var(--radius-s); }
.cl-card .cl-edit { border-left: 1px solid var(--line); border-radius: 0 var(--radius) var(--radius) 0; }
.cl-edit:hover, .cl-edit:focus-visible { color: var(--accent); background: var(--bg-2); }
.cl-empty .cl-actions { margin-top: .6rem; }
@media (max-width: 30rem) {
  .cl-edit-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* na wąskim ekranie sama ikona */
  .app-checklist .page { padding-left: .75rem; padding-right: .75rem; }
}

/* Formularz */
.cl-form fieldset { border: 0; margin: 0; padding: 0; }
.cl-form legend { padding: 0; margin: 0 0 .3rem; font-size: .92rem; font-weight: 600; }
.cl-mode-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.cl-mode { position: relative; display: block; font-weight: 600; }
.cl-mode input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cl-mode span { display: flex; align-items: center; justify-content: center; min-height: 52px; padding: .4rem .8rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); text-align: center; }
.cl-mode input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.cl-mode input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.cl-form textarea { min-height: 12rem; }

/* Ekran odhaczania */
.cl-bar { margin: 0 0 .5rem; }
.cl-meter { display: block; width: 100%; height: 10px; border: 0; border-radius: 5px; overflow: hidden; background: var(--bg-2); -webkit-appearance: none; appearance: none; }
.cl-meter::-webkit-progress-bar { background: var(--bg-2); border-radius: 5px; }
.cl-meter::-webkit-progress-value { background: var(--ok); border-radius: 5px; }
.cl-meter::-moz-progress-bar { background: var(--ok); border-radius: 5px; }
.cl-count { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .8rem; margin: .35rem 0 0; font-size: 1rem; }
.cl-unsaved { display: inline-flex; align-items: center; gap: .35rem; color: var(--warn); font-size: .85rem; font-weight: 500; }
.cl-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--warn); }
.cl-since { display: flex; align-items: center; gap: .3rem; min-height: 2.2rem; margin: 0 0 .5rem; }
.cl-since.is-off { visibility: hidden; }
.cl-since .link { background: none; border: 0; padding: .3rem .2rem; min-height: 36px; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; }
/* podpowiedz trybu po kolei: unosi sie nad trescia (position: fixed), zeby nie przesuwac wierszy */
.cl-hint { position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 30; max-width: 36rem; margin: 0 auto; padding: .7rem 1rem; border-radius: var(--radius-s); background: var(--card); border: 1px solid color-mix(in srgb, var(--warn) 55%, var(--line)); box-shadow: var(--shadow-lg); font-size: .95rem; }

.cl-items { list-style: none; margin: .4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.cl-item { display: flex; align-items: stretch; gap: .5rem; }
.cl-row {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: .85rem; min-height: 56px; padding: .55rem .9rem; text-align: left;
  background: var(--card); color: var(--fg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  font-size: 1.05rem; line-height: 1.35; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.cl-row:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.cl-row:active { transform: translateY(1px); }
.cl-box {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--muted) 55%, var(--line)); background: var(--card); color: transparent;
}
.cl-box .ic { width: 18px; height: 18px; stroke-width: 3; }
.cl-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.cl-tag { padding: .05rem .5rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .78rem; font-weight: 600; text-align: center; }
/* tryb po kolei: po prawej kazdego wiersza stale miejsce na "Pomin" (aktywny) albo "pominiete" (pominiety) - oba w jednej komorce, widoczny najwyzej jeden */
.cl-slot { flex: none; display: grid; place-items: center; min-width: 4.6rem; }
.cl-slot > * { grid-area: 1 / 1; }
.cl-skip { width: 100%; padding-left: .4rem; padding-right: .4rem; }
.cl-skip.is-off, .cl-tag.is-off { visibility: hidden; }

.cl-item.is-done .cl-box { background: var(--ok); border-color: var(--ok); color: var(--ok-fg); }
.cl-item.is-done .cl-text { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.cl-item.is-skip .cl-box { border-style: dashed; }
.cl-item.is-skip .cl-text { color: var(--muted); font-style: italic; }
/* po kolei: aktywny punkt wyrozniony tlem i ramka (ta sama czcionka i rozmiar co inne wiersze - wiersze nie skacza), reszta szara */
.cl-item.is-active .cl-row { background: var(--accent-soft); border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 24%, transparent); }
.cl-item.is-active .cl-box { border-color: var(--accent); }
.cl-item.is-locked .cl-row { opacity: .55; cursor: not-allowed; box-shadow: none; background: var(--bg-2); }
.cl-bottom { margin-top: 1rem; justify-content: space-between; }
.cl-bottom .btn { min-height: 52px; }

.cl-summary { text-align: center; padding: 1.6rem 1.2rem; }
.cl-summary-ic { width: 4rem; height: 4rem; padding: .9rem; border-radius: 50%; background: var(--ok); color: var(--ok-fg); fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.cl-done-msg { margin: .8rem 0 .2rem; font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.cl-summary .cl-actions { justify-content: center; margin-top: 1.2rem; }

@media (prefers-reduced-motion: no-preference) {
  .cl-box { transition: background-color .12s, border-color .12s, color .12s; }
  .cl-meter::-webkit-progress-value { transition: width .2s; }
  .cl-item.shake .cl-row { animation: cl-shake .35s; }
}
@keyframes cl-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
