/* ============================================================
   Main checklist container
   ============================================================ */
.rcx-checklist {
  border-radius: 10px;
  padding: 12px;
  max-width: 493px;
  width: 100%;
  box-sizing: border-box;
  background-color: black;
  transition: opacity 0.25s ease;
}

.rcx-checklist .rcx-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* ============================================================
   Decision group: disabled branch styling
   ============================================================ */
.rcx-checklist.rcx-branch-disabled {
  opacity: 0.38;
  pointer-events: none;
  user-select: none;
}

/* ============================================================
   Location heading (no checkbox) -- one checklist can contain
   several Locations, each wrapping its own list of Tasks.
   ============================================================ */
.rcx-checklist .rcx-locations {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.rcx-location {
  list-style: none;
  margin: 0.9rem 0 0.4rem;
}

.rcx-location:first-child {
  margin-top: 0;
}

.rcx-location-row {
  font-weight: 600;
  padding-bottom: 4px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.rcx-location-label {
  opacity: 0.95;
}

/* ============================================================
   List structure (Tasks within a Location)
   ============================================================ */
.rcx-checklist .rcx-list {
  list-style: none;
  margin: 0;
  padding-left: 0.25rem;
}

.rcx-item {
  margin: 0.35rem 0;
  list-style: none;
}

.rcx-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.rcx-label {
  flex: 1;
  min-width: 0;
  white-space: pre-wrap;
}

/* Checked task items */
.rcx-item.is-checked > .rcx-row .rcx-label {
  text-decoration: line-through;
  opacity: 0.7;
}

/* Checkbox accent colour */
.rcx-item input[type="checkbox"],
.rcx-subtask-item input[type="checkbox"] {
  accent-color: var(--rcx-accent, initial);
  flex-shrink: 0;
}

/* ============================================================
   Sub-task toggle button
   ============================================================ */
.rcx-subtask-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 20px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  opacity: 0.6;
  font-size: 0.75em;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s, background 0.15s;
  flex-shrink: 0;
}

.rcx-subtask-toggle:hover,
.rcx-subtask-toggle:focus {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
}

.rcx-subtask-toggle.is-open {
  opacity: 0.85;
}

/* Alert-style coloring: signals that expanding will reveal spoilers */
.rcx-subtask-toggle.is-spoiler {
  border-color: #D08770;
  color: #D08770;
  background: rgba(239, 68, 68, 0.12);
  opacity: 0.9;
}

.rcx-subtask-toggle.is-spoiler:hover,
.rcx-subtask-toggle.is-spoiler:focus {
  opacity: 1;
  background: rgba(239, 68, 68, 0.22);
}

.rcx-chevron {
  display: block;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.rcx-subtask-toggle.is-open .rcx-chevron {
  transform: rotate(180deg);
}

/* ============================================================
   Sub-task list
   ============================================================ */
.rcx-checklist .rcx-subtask-list {
  list-style: none;
  margin: 0.3rem 0 0.3rem 1.6rem;
  padding-left: 0;
}

.rcx-subtask-list[hidden] {
  display: none;
}

.rcx-subtask-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.2rem 0;
  flex-wrap: wrap;
  list-style: none;
}

.rcx-subtask-item input[type="checkbox"] {
  margin-top: 3px;
}

.rcx-subtask-label {
  flex: 1;
  min-width: 0;
  font-size: 0.9em;
  opacity: 0.85;
  white-space: pre-wrap;
}

/* Locked subtask list (parent task is checked) */
.rcx-subtask-list.rcx-subtasks-locked {
  opacity: 0.4;
  pointer-events: none;
}

/* Checked subtask */
.rcx-subtask-item.is-checked .rcx-subtask-label {
  text-decoration: line-through;
  opacity: 0.5;
}

/* ============================================================
   Spoiler obfuscation (colon-triggered reveal)
   The class carries the hidden look itself (not just the inline style
   the importer/admin also writes) so it survives even if WordPress's
   content filtering strips inline style attributes on a given install.
   ============================================================ */
.rcx-spoiler {
  color: transparent;
  background: #555;
  border-radius: 3px;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.rcx-spoiler.is-revealed {
  color: inherit !important;
  background: transparent !important;
  cursor: text !important;
  user-select: text !important;
}

/* ============================================================
   Responsive: narrow viewports
   ============================================================ */
@media (max-width: 380px) {
  .rcx-row {
    flex-wrap: wrap;
  }
  .rcx-subtask-toggle {
    margin-left: 1.6rem;
    flex-basis: 100%;
    justify-content: flex-start;
  }
  .rcx-checklist .rcx-subtask-list {
    margin-left: 1rem;
    padding-left: 0;
  }
}

/* ============================================================
   Global progress + reset-all bar
   ============================================================ */
.rcx-reset-all-wrap {
  max-width: 250px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
  box-sizing: border-box;
}

.rcx-reset-all-wrap .rcx-progress {
  white-space: nowrap;
}

.rcx-reset-all {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

.rcx-reset-all:hover,
.rcx-reset-all:focus {
  opacity: 1;
}

.rcx-reset-icon {
  width: 20px;
  height: 20px;
  display: block;
  fill: currentColor;
}

/* ============================================================
   Error state
   ============================================================ */
.rcx-error {
  color: #b91c1c;
  background: #fef2f2;
  border-radius: 6px;
  padding: 8px;
  max-width: 493px;
  margin: 0 auto;
}
