/*
 * Checklists (views/checklistsView.js): the list, one checklist, and a job's
 * checklist in its side panel. Every colour is a variable from theme.css.
 * Nothing has a fixed height that holds words: text wraps and boxes grow.
 */

.checklists {
  display: grid;
  gap: var(--gap-3);
  max-width: 1040px;
}

.checklists .page__head,
.checklists > .notice,
.checklists > .clients-back,
.checklists > .clients-numbers,
.checklists > .clients-tools {
  margin-bottom: 0;
}

.checklists > .clients-back {
  justify-self: start;
}

.cl-table .card__head {
  padding-bottom: 8px;
}

/* The properties: a heading with the coverage line beside it. */
.cl-coverage {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px var(--gap-2);
  margin-bottom: calc(var(--gap-2) * -1);
}

.cl-coverage__title {
  font-size: var(--size-body);
  font-weight: 700;
}

.cl-coverage__line {
  color: var(--ink-2);
}

/* One checklist: its name, how many properties carry it, and what it does. */
.cl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px var(--gap-3);
}

.cl-head__names {
  display: grid;
  gap: 4px;
}

.cl-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cl-danger {
  color: var(--red);
}

.cl-ask {
  padding: 14px var(--gap-2);
  border-radius: var(--radius);
  background: var(--chip);
}

.cl-section .cl-ask,
.cl-props .cl-ask {
  margin: 0 20px 12px;
}

/* An empty checklist: the one question, the box, what it becomes. */
.cl-first {
  display: grid;
  gap: 12px;
  padding: var(--gap-2) 20px 20px;
}

.cl-first__q {
  font-size: var(--size-title);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cl-first .field-area {
  min-height: 140px;
}

.cl-first .drawer__actions {
  margin-top: 0;
  padding: 0;
}

/* The attach panel's facts sit in the panel's own padding. */
.cl-attach .facts {
  padding: 0 0 16px;
}

.cl-preview .set-heading {
  margin-top: 0;
}

.cl-preview__rows {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.cl-preview__rows li {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.cl-preview__rows li:first-child {
  border-top: 0;
}

/* A section: its name, the photo it expects, its steps, a box for one more. */
.cl-section__names {
  display: grid;
  gap: 2px;
  flex: 1 1 280px;
  min-width: 0;
}

.cl-section__photo {
  color: var(--ink-2);
  font-size: var(--size-small);
  overflow-wrap: anywhere;
}

.cl-section .card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cl-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.cl-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  counter-increment: step;
}

.cl-step::before {
  content: counter(step);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.cl-step__label {
  overflow-wrap: anywhere;
}

.cl-step__actions {
  display: flex;
  gap: 8px;
}

.cl-step .cl-ask {
  grid-column: 2 / -1;
  margin: 0;
}

.cl-section > .tbl-empty {
  padding: 10px 20px;
  border-top: 1px solid var(--line);
}

.cl-add-step {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
}

.cl-add-step .field-input {
  flex: 1 1 260px;
  min-width: 0;
}

.cl-foot {
  display: flex;
}

.cl-add-section svg,
.cl-add-step svg,
.cl-head svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* The properties a checklist is on. */
.cl-props {
  display: grid;
}

.cl-prop {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-top: 1px solid var(--line);
}

.cl-prop .cl-ask {
  grid-column: 1 / -1;
  margin: 0;
}

.cl-prop__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.cl-prop__address {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.cl-prop__client {
  color: var(--ink-2);
  font-size: var(--size-small);
  overflow-wrap: anywhere;
}

.cl-props-card > .tbl-empty {
  padding: 0 20px 16px;
}

/* The pick panel: properties to tick, by client. */
.cl-pick {
  display: grid;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.cl-pick__row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.cl-pick > :first-child,
.cl-pick > :first-child .cl-pick__row {
  border-top: 0;
}

.cl-pick__row input {
  margin-top: 3px;
}

.cl-pick__in .cl-pick__row {
  padding-left: 36px;
}

.cl-pick__text {
  display: grid;
  gap: 2px;
}

.cl-panel-back {
  margin-bottom: 12px;
}

/* A job's checklist, in its side panel. */
.cl-job {
  margin-top: 4px;
  padding: var(--gap-2) 20px 24px;
  border-top: 1px solid var(--line);
}

.cl-job .set-heading {
  margin-top: 0;
}

.cl-job__on {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.cl-job__name {
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.cl-job__sum {
  margin: 0 0 8px;
  color: var(--ink-2);
}

.cl-job__section {
  margin-top: 12px;
}

.cl-job__title {
  font-size: var(--size-small);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}

.cl-job__photo {
  margin-top: 2px;
  color: var(--ink-2);
  font-size: var(--size-small);
}

.cl-job__items {
  display: grid;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.cl-job__item {
  display: grid;
  gap: 2px;
  justify-items: start;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
}

.cl-job__item:first-child {
  border-top: 0;
}

.cl-job__item .cl-ask {
  margin-top: 6px;
}

.cl-tick {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.cl-tick--still {
  cursor: default;
}

.cl-box {
  display: inline-grid;
  place-items: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  background: var(--card);
}

.cl-tick.is-done .cl-box {
  border-color: var(--green);
  background: var(--green);
}

.cl-box svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--on-fill);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cl-tick.is-done .cl-tick__label {
  text-decoration: line-through;
  color: var(--ink-2);
}

.cl-tick__label {
  overflow-wrap: anywhere;
}

.cl-tick__meta {
  padding-left: 30px;
  color: var(--ink-2);
  font-size: var(--size-small);
}

.cl-job .cl-add-step {
  padding: 8px 0 0;
  border-top: 0;
}
