/* checklist.css */

body.checklist-modal-open {
  overflow: hidden;
}

.checklist-modal-backdrop[hidden] {
  display: none !important;
}

.checklist-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(15, 23, 42, 0.55);
}

.checklist-modal {
  width: min(1100px, 96vw);
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
}

.checklist-modal-header,
.checklist-modal-footer {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e7edf5;
  background: #f8fbff;
}

.checklist-modal-footer {
  border-bottom: 0;
  border-top: 1px solid #e7edf5;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.checklist-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.checklist-modal-header h2 {
  margin: 0 0 0.35rem;
  font-size: 1.4rem;
  color: #10233f;
}

.checklist-modal-subtitle {
  margin: 0;
  color: #5a6f87;
  font-size: 0.96rem;
}

.checklist-action-btn {
  display: inline-block;              
  max-width: 480px;                  
  width: auto;                       
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  cursor: pointer;
  transition: all 0.15s ease;
}

.checklist-action-btn:hover {
  background: #e2e8f0;
  border-color: #6366f1;
}

.checklist-action-btn--aspects {
  border-left: 4px solid #2563eb;
  background: linear-gradient(90deg, #e8f0ff  0%, #f1f5f9  100%);
}

.checklist-action-btn--aspects:hover {
  background: linear-gradient(90deg, #dbeafe  0%, #e2e8f0  100%);
}

.checklist-action-btn .action-title {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: #0f172a;
}

.checklist-action-btn .action-subtitle {
  display: block;
  font-size: 0.8rem;
  color: #475569;
  margin-top: 0.2rem;
}

.checklist-close-btn {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 1.8rem;
  line-height: 1;
  color: #37506c;
  cursor: pointer;
  padding: 0.1rem 0.35rem;
  border-radius: 10px;
}

.checklist-close-btn:hover {
  background: rgba(44, 95, 166, 0.08);
}

.checklist-modal-body {
  padding: 1.1rem 1.25rem 1.25rem;
  overflow: auto;
  background: #ffffff;
}

.checklist-callout {
  background: #f4f9ff;
  border: 1px solid #d5e7fb;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}

.checklist-callout ul {
  margin: 0;
  padding-left: 1.25rem;
}

.checklist-callout li {
  margin: 0.3rem 0;
  line-height: 1.45;
}

.checklist-summary {
  border: 1px solid #dde6f2;
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #fbfdff;
}

.checklist-summary-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
  font-size: 0.98rem;
}

.checklist-summary-status.pass {
  background: #e9f8ef;
  color: #106337;
}

.checklist-summary-status.warn {
  background: #fff5df;
  color: #8a5a00;
}

.checklist-summary-status.fail {
  background: #fde9ea;
  color: #9e1d23;
}

.checklist-summary-status.neutral {
  background: #eef3f8;
  color: #4d6279;
}

.checklist-summary-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.checklist-summary-columns h4 {
  margin: 0 0 0.45rem;
  color: #143253;
}

.checklist-summary-list {
  margin: 0;
  padding-left: 1.15rem;
}

.checklist-summary-list li {
  margin: 0.28rem 0;
  line-height: 1.42;
}

.checklist-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.checklist-section {
  border: 1px solid #dde6f2;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.checklist-section-head {
  padding: 0.95rem 1rem;
  background: #f9fbfe;
  border-bottom: 1px solid #edf2f8;
}

.checklist-section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.checklist-section-head h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #143253;
}

.checklist-section-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.checklist-section-btn {
  appearance: none;
  border: 1px solid #cdd9e8;
  background: #fff;
  color: #21476d;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.checklist-section-btn:hover {
  background: #f1f7ff;
}

.checklist-section-description {
  margin: 0.55rem 0 0;
  color: #536b84;
  font-size: 0.94rem;
  line-height: 1.42;
}

.checklist-section-body {
  padding: 0.7rem 1rem 1rem;
}

.checklist-item {
  border-bottom: 1px solid #eef3f8;
  padding: 0.85rem 0;
}

.checklist-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.checklist-item-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.checklist-item-text-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.checklist-item-text {
  color: #10233f;
  line-height: 1.45;
  font-size: 0.98rem;
}

.checklist-item-help {
  margin-top: 0.35rem;
  color: #5f7388;
  font-size: 0.9rem;
  line-height: 1.4;
}

.checklist-choice-group {
  display: inline-flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.checklist-choice {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.checklist-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checklist-choice span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  border: 1px solid #cdd9e8;
  background: #fff;
  color: #21476d;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.checklist-choice input:checked + span {
  box-shadow: inset 0 0 0 1px transparent;
}

.checklist-choice.yes input:checked + span {
  background: #e9f8ef;
  color: #106337;
  border-color: #8fd1a8;
}

.checklist-choice.no input:checked + span {
  background: #fde9ea;
  color: #9e1d23;
  border-color: #efb3b7;
}

.checklist-choice.na input:checked + span {
  background: #eef3f8;
  color: #4d6279;
  border-color: #cdd9e8;
}

.checklist-children {
  margin-top: 0.75rem;
  margin-left: 1.1rem;
  padding-left: 0.95rem;
  border-left: 3px solid #e8eff7;
}

.checklist-item.depth-1 .checklist-item-text,
.checklist-item.depth-2 .checklist-item-text,
.checklist-item.depth-3 .checklist-item-text {
  font-size: 0.95rem;
}

.checklist-btn {
  appearance: none;
  border: 1px solid #cdd9e8;
  background: #fff;
  color: #21476d;
  border-radius: 12px;
  padding: 0.55rem 0.9rem;
  font-weight: 600;
  font-size: 0.94rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.checklist-btn:hover {
  background: #f4f8fd;
}

.checklist-btn-primary {
  background: #1f5fae;
  border-color: #1f5fae;
  color: #fff;
}

.checklist-btn-primary:hover {
  background: #184f93;
  border-color: #184f93;
}

.checklist-btn-secondary {
  background: #fff;
  color: #21476d;
}

.checklist-media-block {
  margin-bottom: 1rem;
  padding: 0.85rem;
  border: 1px solid #e2ebf5;
  border-radius: 14px;
  background: #fbfdff;
}

.checklist-image-toggle-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.checklist-image-toggle-btn.is-active {
  background: #e8f1ff;
  border-color: #8eb4ea;
  color: #143f73;
}

.checklist-image-frame {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.checklist-reference-image {
  display: block;
  width: 100%;
  max-width: 760px;
  height: auto;
  margin: 0 auto;
  border: 1px solid #dbe5f0;
  border-radius: 14px;
  background: #fff;
}

.checklist-image-caption {
  margin: 0;
  text-align: center;
  color: #5a6f87;
  font-size: 0.92rem;
}

.caret {
  display: inline-block;
  transition: transform 0.15s ease;
  margin-right: 0.35rem;
}

.caret.collapsed {
  transform: rotate(-90deg);
}

@media (max-width: 820px) {
  .checklist-modal {
    width: min(100vw, 100vw);
    max-height: 100vh;
    border-radius: 0;
  }

  .checklist-modal-backdrop {
    padding: 0;
  }

  .checklist-summary-columns {
    grid-template-columns: 1fr;
  }

  .checklist-item-main {
    flex-direction: column;
  }

  .checklist-choice-group {
    width: 100%;
  }

  .checklist-modal-footer {
    justify-content: stretch;
  }

  .checklist-modal-footer .checklist-btn {
    flex: 1 1 140px;
  }
}