.day-loop-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 14px 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(28, 64, 128, 0.12);
  border-radius: 16px;
  background: rgba(247, 250, 255, 0.92);
}

.day-loop-status > div {
  display: grid;
  gap: 4px;
}

.day-loop-status strong {
  font-size: 0.98rem;
  color: var(--ink, #12213f);
}

.day-loop-status small {
  color: var(--muted, #65718a);
  line-height: 1.4;
}

.day-loop-next {
  flex: 0 0 auto;
  border: 1px solid rgba(31, 75, 153, 0.2);
  border-radius: 12px;
  padding: 10px 13px;
  background: #fff;
  color: #173b78;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.task-title-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.prepared-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #edf5ff;
  color: #1f4f94;
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.task-sheet[hidden] {
  display: none;
}

.task-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 28px;
  background: rgba(7, 18, 42, 0.54);
  backdrop-filter: blur(6px);
}

.task-sheet-card {
  width: min(820px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 26px 90px rgba(5, 20, 52, 0.28);
}

.task-sheet-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #e9eef7;
  background: rgba(255, 255, 255, 0.97);
}

.task-sheet-head h2 {
  margin: 5px 0 0;
  color: #102142;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

.sheet-close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #f1f4f9;
  color: #26395d;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.task-sheet-body {
  padding: 24px;
}

.material-grid {
  display: grid;
  gap: 14px;
}

.material-grid section,
.sheet-result-intro,
.sheet-safety {
  padding: 16px 18px;
  border: 1px solid #e4eaf4;
  border-radius: 16px;
  background: #fbfcff;
}

.material-grid section > span,
.sheet-safety strong {
  display: block;
  margin-bottom: 6px;
  color: #61708d;
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.material-grid strong,
.sheet-result-intro strong {
  color: #14294d;
  line-height: 1.45;
}

.material-grid p,
.material-grid ol,
.sheet-result-intro p,
.sheet-safety span {
  margin: 7px 0 0;
  color: #596985;
  line-height: 1.55;
}

.material-grid ol {
  padding-left: 20px;
}

.material-grid li + li {
  margin-top: 6px;
}

.material-quote {
  padding: 12px 14px;
  border-left: 3px solid #2e65b5;
  border-radius: 8px;
  background: #f2f7ff;
  color: #213b68 !important;
}

.material-boundary {
  border-color: #f0dfb9 !important;
  background: #fffaf0 !important;
}

.sheet-result-button {
  width: 100%;
  margin-top: 18px;
}

.outcome-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.outcome-grid button {
  min-height: 78px;
  padding: 14px 16px;
  border: 1px solid #dce4f0;
  border-radius: 14px;
  background: #fff;
  color: #15284a;
  text-align: left;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.outcome-grid button:hover,
.outcome-grid button:focus-visible {
  transform: translateY(-1px);
  border-color: #4d78bc;
  box-shadow: 0 8px 22px rgba(29, 69, 129, 0.11);
  outline: none;
}

.outcome-grid strong,
.outcome-grid span {
  display: block;
}

.outcome-grid strong {
  line-height: 1.35;
}

.outcome-grid span {
  margin-top: 5px;
  color: #71809a;
  font-size: 0.875rem;
}

.sheet-safety {
  display: grid;
  gap: 3px;
  margin-top: 16px;
  border-color: #cae3d5;
  background: #f5fbf7;
}

.sheet-safety strong {
  margin: 0;
  color: #2a6a49;
}

@media (max-width: 620px) {
  .day-loop-status {
    align-items: stretch;
    flex-direction: column;
  }

  .day-loop-next {
    width: 100%;
  }

  .task-card {
    grid-template-columns: 34px minmax(0, 1fr);
    min-width: 0;
  }

  .task-copy,
  .task-actions {
    min-width: 0;
  }

  .task-actions {
    flex-wrap: wrap;
  }

  .task-button {
    max-width: 100%;
    white-space: normal;
  }

  .task-sheet {
    padding: 0;
    align-items: flex-end;
  }

  .task-sheet-card {
    width: 100%;
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
  }

  .task-sheet-head,
  .task-sheet-body {
    padding-left: 18px;
    padding-right: 18px;
  }

  .outcome-grid {
    grid-template-columns: 1fr;
  }
}
