/* Personal checklist (/checklist/). Builds on site.css tokens. */
.cl-main { min-height: 70vh; }
.cl { padding: 8px 0 64px; }
.cl .screen { display: none; }
.cl[data-screen="intro"] [data-for="intro"],
.cl[data-screen="email"] [data-for="email"],
.cl[data-screen="pin"] [data-for="pin"],
.cl[data-screen="unlock"] [data-for="unlock"],
.cl[data-screen="app"] [data-for="app"] { display: block; }

.proto {
  margin: 0 auto 8px; width: fit-content; max-width: 100%;
  font-family: var(--font-cond); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: .75rem;
  color: var(--paper); background: var(--muted); border-radius: 999px; padding: .2em .9em; text-align: center;
}
.proto-hint { font-size: .85rem; color: var(--muted); font-style: italic; }

/* ---------- buttons & inputs ---------- */
.cl button { font: inherit; cursor: pointer; }
.cl .button { font-family: var(--font-cond); }
.cl .button:not(.ghost) { border: 0; }
.cl section.screen { border-top: 0; }
.cl .button.big { font-size: 1.2rem; padding: .75em 1.8em; }
.cl .button.ghost.big { padding: calc(.75em - 2px) calc(1.8em - 2px); }
.cl .button.danger { background: var(--red-text); box-shadow: 4px 4px 0 rgba(29, 75, 90, .25); }
.link {
  background: none; border: 0; padding: 0; color: var(--red-text); font: inherit;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer;
}
.link.danger { color: var(--red-text); }
.cl input[type="email"], .cl input[type="password"], .cl input[type="search"], .cl input[name="title"],
.cl input.pin, .cl textarea, .cl select {
  font: inherit; color: var(--ink); width: 100%;
  background: #fffdf7; border: 2px solid rgba(29, 75, 90, .35); border-radius: 12px; padding: .65em .85em;
}
.cl input:focus, .cl textarea:focus, .cl select:focus { outline: 3px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.cl input.pin { font-family: var(--font-cond); font-size: 2rem; letter-spacing: .4em; text-align: center; max-width: 260px; }
.cl label { display: block; font-weight: 600; color: var(--teal); margin: 1em 0 .3em; }
.error { color: var(--red-text); font-weight: 600; margin: .5em 0 0; }
.warn { background: rgba(217, 67, 42, .1); border-left: 4px solid var(--red); padding: .5em .8em; border-radius: 0 8px 8px 0; font-size: .95rem; }
.small { font-size: .85rem; }

/* ---------- signed-out screens ---------- */
.intro { text-align: center; padding: 72px 0 40px; }
.intro h1 { font-size: clamp(2.4rem, 8vw, 4.2rem); }
.intro .lead { font-size: 1.35rem; margin: 0 0 1.6em; }
.intro .muted { margin-top: 2em; }
.intro .diy { margin-top: 3em; font-size: .95rem; }
.narrow { max-width: 440px; margin: 0 auto; padding: 72px 0 40px; text-align: center; }
.narrow input { margin: 1.2em 0 0; }
.narrow input.pin { margin: 1.2em auto 0; display: block; }
.narrow .button { margin-top: 1.2em; }

/* ---------- app bar ---------- */
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 20px; }
.seg { display: inline-flex; border: 2px solid var(--teal); border-radius: 999px; padding: 3px; background: #fffdf7; }
.seg button {
  border: 0; background: none; color: var(--teal); border-radius: 999px; padding: .35em 1em;
  font-family: var(--font-cond); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-size: .9rem;
}
.seg button[aria-pressed="true"] { background: var(--teal); color: var(--paper); }
.who {
  background: none; border: 0; color: var(--teal); font-family: var(--font-cond); font-weight: 600; letter-spacing: .03em;
  max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: .3em 0;
}
.who span[aria-hidden] { color: #33683f; font-size: .7em; vertical-align: .2em; }
.who:hover span:last-child { text-decoration: underline; text-decoration-color: var(--red); }

.progress { max-width: 640px; margin: 0 auto; text-align: center; }
.progress p { margin: .4em 0 0; color: var(--muted); font-size: .9rem; }
.track { height: 8px; border-radius: 999px; background: rgba(29, 75, 90, .14); overflow: hidden; }
.track span { display: block; height: 100%; width: 0; background: var(--teal); border-radius: 999px; transition: width .4s ease; }
.saved { color: #33683f; margin-left: .5em; opacity: 0; transition: opacity .3s; }
.saved.on { opacity: 1; }
.list ~ .progress, [data-mode-now="list"] .progress { max-width: none; }

/* ---------- simple mode ---------- */
.simple { max-width: 640px; margin: 0 auto; padding: 48px 0 0; }
.step { text-align: center; }
.step .kicker { font-size: .85rem; }
.step h2 { font-size: clamp(1.7rem, 5vw, 2.5rem); margin: .2em 0 .5em; }
.step .why { font-size: 1.2rem; margin: 0 0 1em; }
.step .new, .grid .new {
  display: inline-block; vertical-align: .1em; margin-left: .4em;
  font-size: .7rem; padding: .1em .55em; border-radius: 999px; background: #33683f; color: var(--paper); letter-spacing: .05em;
}
.chips { list-style: none; margin: 0 0 1.6em; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-family: var(--font-cond); font-weight: 500; font-size: .9rem; letter-spacing: .03em; color: var(--teal);
  border: 2px solid rgba(29, 75, 90, .25); border-radius: 999px; padding: .1em .75em;
}
.how { text-align: left; max-width: 520px; margin: 0 auto 2em; }
.how summary, .note-wrap summary {
  cursor: pointer; text-align: center; color: var(--red-text); font-weight: 600; list-style: none;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.how summary::-webkit-details-marker, .note-wrap summary::-webkit-details-marker { display: none; }
.how[open] summary { margin-bottom: .8em; }
.how ol { background: var(--card); border-radius: 14px; padding: 14px 18px 14px 2.2em; margin: 0; }
.how ol:empty { display: none; }
.how li { margin: .3em 0; }
.how li::marker { color: var(--red); font-family: var(--font-cond); font-weight: 700; }
.links { text-align: center; margin: .9em 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; font-size: .95rem; }
.actions { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin: 0 0 2.2em; }
.actions .button { margin: 0; min-width: 9em; }
.note-wrap { max-width: 520px; margin: 0 auto; }
.note-wrap summary { color: var(--muted); font-weight: 500; font-size: .95rem; }
.note-wrap textarea { margin-top: .8em; resize: vertical; }
.step.leaving { animation: leave .22s ease forwards; }
.step.entering { animation: enter .28s ease; }
@keyframes leave { to { opacity: 0; transform: translateX(-24px); } }
@keyframes enter { from { opacity: 0; transform: translateX(24px); } }

.all-done { text-align: center; padding: 24px 0; }
.big-emoji { font-size: 3.5rem; margin: 0; }

/* ---------- list mode ---------- */
.list { padding-top: 28px; }
.tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.tools input[type="search"] { flex: 1 1 200px; width: auto; }
.tools select { flex: 1 1 150px; width: auto; max-width: 220px; }
.tools .button { margin: 0; }
.grid { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.grid th { text-align: left; font-family: var(--font-cond); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-size: .8rem; color: var(--muted); padding: 0 10px; }
.grid th button { background: none; border: 0; padding: 0; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.grid th button::after { content: ""; margin-left: .3em; }
.grid th[aria-sort="ascending"] button::after { content: "▲"; font-size: .8em; }
.grid th[aria-sort="descending"] button::after { content: "▼"; font-size: .8em; }
.grid th[aria-sort] button { color: var(--teal); }
.grid td { background: var(--card); padding: 12px 10px; vertical-align: top; }
.grid td:first-child { border-radius: 12px 0 0 12px; padding-left: 14px; }
.grid td:last-child { border-radius: 0 12px 12px 0; padding-right: 14px; }
.grid .c-check { width: 44px; }
.grid .c-area { width: 120px; }
.grid .c-pri { width: 96px; }
.grid .c-effort { width: 170px; }
.grid .c-note { width: 26%; }
.grid .c-act { width: 84px; text-align: right; }
.grid input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--teal); margin: 2px 0 0; cursor: pointer; }
.grid .t { font-weight: 600; color: var(--ink); }
.grid .w { display: block; color: var(--muted); font-size: .88rem; line-height: 1.35; margin-top: .15em; }
.grid .meta { font-size: .88rem; color: var(--muted); line-height: 1.3; }
.grid .meta b { display: block; color: var(--teal); font-weight: 600; }
.grid textarea { font-size: .9rem; padding: .35em .55em; border-radius: 8px; min-height: 2.2em; resize: vertical; }
.grid tr.is-done .t { text-decoration: line-through; text-decoration-color: rgba(29, 75, 90, .45); color: var(--muted); }
.grid tr.is-pass td { background: rgba(255, 252, 244, .35); }
.grid tr.is-pass .t { color: var(--muted); }
.pri { font-family: var(--font-cond); font-weight: 600; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; }
.pri.high { color: var(--red-text); }
.pri.med { color: var(--teal); }
.pri.low { color: var(--muted); }
.grid .mine { font-size: .7rem; font-family: var(--font-cond); text-transform: uppercase; letter-spacing: .05em; color: var(--paper); background: var(--muted); border-radius: 999px; padding: .1em .5em; margin-left: .4em; vertical-align: .1em; }
.grid .act { font-size: .9rem; }
.empty { text-align: center; padding: 32px 0; }
.list-foot { text-align: center; margin-top: 28px; }

@media (max-width: 760px) {
  .grid thead { display: none; }
  .grid, .grid tbody { display: block; }
  .grid tr {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
    background: var(--card); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px;
  }
  .grid td, .grid td:first-child, .grid td:last-child { background: none; padding: 0; border-radius: 0; width: auto; }
  .grid td.c-check { order: 1; flex: 0 0 26px; align-self: flex-start; }
  .grid td.c-item { order: 2; flex: 1 1 calc(100% - 110px); min-width: 0; }
  .grid td.c-act { order: 3; flex: 0 0 auto; align-self: flex-start; }
  .grid td.c-area { order: 4; margin-left: 36px; }
  .grid td.c-pri { order: 5; }
  .grid td.c-effort { order: 6; }
  .grid td.c-area .meta b { display: inline; }
  .grid td.c-note { order: 7; flex: 1 1 100%; padding-left: 36px; margin-top: 6px; }
  .grid tr.is-pass { background: rgba(255, 252, 244, .35); }
  .grid tr.is-pass td { background: none; }
}

/* ---------- dialogs ---------- */
dialog.sheet {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto;
  border: 3px solid var(--teal); border-radius: 18px; padding: 28px 26px 26px;
  background: var(--paper); color: var(--ink); box-shadow: 8px 8px 0 rgba(29, 75, 90, .2);
}
dialog.sheet::backdrop { background: rgba(27, 52, 64, .45); }
dialog .x { position: absolute; top: 10px; right: 12px; margin: 0; }
dialog .x button { background: none; border: 0; font-size: 1.8rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; }
dialog h2 { font-size: 1.5rem; padding-right: 32px; }
dialog h2.email { font-family: var(--font-body); text-transform: none; font-weight: 700; font-size: 1.25rem; text-shadow: none; word-break: break-all; margin-top: 0; }
dialog .box { background: var(--card); border-radius: 14px; padding: 14px 18px; margin: 16px 0; }
dialog .box h3 { margin: 0 0 .4em; font-size: 1rem; }
dialog .box p { margin: .35em 0; }
dialog .box .button { margin-top: .6em; }
dialog .code { font-family: ui-monospace, Menlo, monospace; font-size: .9rem; background: rgba(29, 75, 90, .08); border-radius: 8px; padding: .4em .7em; word-break: break-all; color: var(--teal); }
dialog .row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 1.2em; }
dialog .row form { margin: 0; }
dialog .row .button { margin: 0; }
.account-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 24px; padding-top: 18px; border-top: 2px dashed rgba(29, 75, 90, .2); }
.account-foot .button { margin: 0; }
.plain { padding-left: 1.1em; }
.plain li { margin: .5em 0; }
.plain li::marker { color: var(--red); }
fieldset.pick { border: 0; padding: 0; margin: 1em 0 0; }
fieldset.pick legend { font-weight: 600; color: var(--teal); padding: 0; margin-bottom: .3em; }
fieldset.pick label { display: inline-flex; align-items: center; gap: .35em; margin: 0 1em 0 0; font-weight: 400; color: var(--ink); }
fieldset.pick input { accent-color: var(--teal); width: 18px; height: 18px; }
dialog form[data-form] .button { margin-top: 1.2em; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20;
  background: var(--ink); color: var(--paper); border-radius: 999px; padding: .6em 1.3em;
  box-shadow: 4px 4px 0 rgba(217, 67, 42, .4); display: flex; gap: 1em; align-items: center; white-space: nowrap;
}
.toast .link { color: #f7c9bf; }

/* list: expandable item */
.grid details.more summary { cursor: pointer; list-style: none; }
.grid details.more summary::-webkit-details-marker { display: none; }
.grid details.more summary .t::after { content: " ▸"; color: var(--red); font-size: .8em; }
.grid details.more[open] summary .t::after { content: " ▾"; }
.grid details.more ol { margin: .5em 0 .3em; padding-left: 1.3em; font-size: .9rem; }
.grid details.more li::marker { color: var(--red); }
.grid .links-inline { margin: .3em 0; font-size: .9rem; }
