:root {
  color-scheme: light;
  --bg: #f3f5f9;
  --card: #ffffff;
  --text: #121826;
  --muted: #5b6475;
  --line: #d6dbe6;
  --accent: #1d8cff;
  --danger: #df3c4b;
  --shadow: 0 10px 28px rgba(17, 26, 41, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: linear-gradient(180deg, #eef4ff 0%, var(--bg) 40%);
  color: var(--text);
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 12px 110px;
}

.header {
  margin-bottom: 10px;
}

.header h1 {
  margin: 0;
  font-size: 24px;
}

.muted {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.status {
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-size: 14px;
}

.hidden {
  display: none;
}

.date-picker {
  margin: 10px 0 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.date-picker-buttons {
  display: flex;
  gap: 8px;
}

.date-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
}

.date-chip.active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.date-value {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.sections {
  display: grid;
  gap: 8px;
}

.section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.section-header {
  width: 100%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 10px;
  text-align: left;
}

.section-title-wrap {
  display: grid;
  gap: 4px;
}

.section-title {
  font-size: 16px;
  margin: 0;
  font-weight: 700;
}

.section-summary {
  font-size: 12px;
  color: var(--muted);
}

.section-chevron {
  font-size: 14px;
  color: var(--muted);
  transition: transform 0.2s ease;
}

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

.section-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.25s ease;
}

.section.collapsed .section-body {
  grid-template-rows: 0fr;
}

.section-body-inner {
  min-height: 0;
  overflow: hidden;
  padding: 0 12px 12px;
}

.item {
  border-top: 1px solid #edf1f7;
  padding-top: 9px;
  margin-top: 9px;
}

.item:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.item-title-block {
  min-width: 0;
}

.item-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.item-name {
  font-size: 14px;
  font-weight: 700;
}

.progress {
  font-size: 12px;
  color: var(--muted);
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.help-button,
.note-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  width: 24px;
  height: 24px;
  border-radius: 999px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.note-button.active {
  border-color: var(--accent);
  color: var(--accent);
  background: #e9f3ff;
}

.item-caption {
  display: none;
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.item-caption.open {
  display: block;
}

.control {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  background: #fff;
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.toggle-track {
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #cfd7e5;
  position: relative;
  transition: background 0.2s ease;
}

.toggle-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.toggle-input:checked + .toggle-track {
  background: var(--accent);
}

.toggle-input:checked + .toggle-track .toggle-thumb {
  transform: translateX(18px);
}

.toggle-label {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}

.note-wrap {
  margin-top: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.24s ease, opacity 0.18s ease, margin-top 0.18s ease;
}

.note-wrap.open {
  margin-top: 8px;
  max-height: 56px;
  opacity: 1;
}

.note-input {
  font-size: 13px;
}

.submit-bar {
  position: sticky;
  bottom: 0;
  margin-top: 12px;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(214, 219, 230, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.submit-count {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}

.submit {
  width: 100%;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 16px;
}

.submit:disabled {
  opacity: 0.6;
}

.error {
  color: var(--danger);
}

.success-check {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #11b56f;
  color: #fff;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  font-weight: 700;
  animation: check-pop 1s ease;
}

@keyframes check-pop {
  0% {
    transform: scale(0.4);
    opacity: 0.2;
  }
  35% {
    transform: scale(1.15);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
