/* SOLVLET — Lab / 少年団マネージャ
   Page-only additions. Colours come only from the tokens in /style.css,
   so dark mode follows by itself. No animation anywhere. */

.sd-block {
  max-width: var(--frame);
  margin: 0 0 clamp(2rem, 5vw, 2.75rem);
}

.sd-h {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.sd-h--sub {
  margin-top: 1.75rem;
  font-size: 1rem;
}

.sd-help {
  max-width: var(--measure);
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

/* ---- 月と活動日 ---- */

.sd-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  max-width: 48rem;
  margin: 0 0 1.5rem;
}

@media (min-width: 600px) {
  .sd-settings {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
  }
  .sd-weekdays { grid-column: 1 / -1; }
}

.sd-set { min-width: 0; }

.sd-label {
  display: block;
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-muted);
}

.sd-weekdays {
  margin: 0;
  padding: 0;
  border: 0;
}
.sd-weekdays legend { padding: 0; }

.sd-weekdays__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
}

.sd-wd {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  min-width: 3.2em;
  padding: 0 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
  cursor: pointer;
}
.sd-wd:has(input:checked) {
  border-color: var(--accent);
  background: var(--paper-alt);
}

.sd-wd input,
.sd-check input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--accent);
}

.sd-days {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.5rem 1.5rem;
  max-width: 48rem;
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
  font-variant-numeric: tabular-nums;
}

.sd-day {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sd-day__date {
  flex: 0 0 6.2em;
  white-space: nowrap;
}
.sd-day .field {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  max-width: 11em;
}

/* ---- 保護者 ---- */

.sd-scroll {
  position: relative; /* keeps the hidden .vh headers inside the scroll box */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 1rem;
}

.sd-table,
.sd-plan {
  border-collapse: collapse;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.sd-table { width: 100%; min-width: 42rem; max-width: 48rem; table-layout: auto; }

.sd-table th,
.sd-plan th {
  padding: 0.25rem 0.5rem 0.25rem 0;
  font-weight: 500;
  text-align: left;
  color: var(--ink-muted);
  white-space: nowrap;
}
.sd-table th {
  vertical-align: bottom;
  line-height: 1.4;
}

.sd-th-note {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  white-space: normal;
}

.sd-table td {
  padding: 0.25rem 0.5rem 0.25rem 0;
  vertical-align: middle;
}

/* Column widths live on the static <th>s: 名前 takes the rest, 人数,
   three checkbox columns, two carry-over counts, the delete column
   shrink-wrapped. */
.sd-table th:nth-child(2) { width: 7.5em; }
.sd-table th:nth-child(n+3):nth-child(-n+5) { width: 4.6em; }
.sd-table th:nth-child(6),
.sd-table th:nth-child(7) { width: 5.6em; }
.sd-table th:nth-child(8),
.sd-table td:nth-child(8) { width: 1%; white-space: nowrap; }

.sd-table .sd-c { text-align: center; padding-right: 0.5rem; }

.sd-table .field { width: 100%; min-width: 4.2em; padding-inline: 0.4rem; }
.sd-table [data-field="name"] { min-width: 7em; }
.sd-table select.field { min-width: 6.2em; }

.sd-check {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
}

/* ---- 操作 ---- */

.sd-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0 0 clamp(2rem, 5vw, 2.75rem);
}
.sd-actions .btn { white-space: nowrap; }

.sd-status {
  margin: 0;
  font-size: 0.9rem;
  color: var(--accent-ink);
}
.sd-status:empty { display: none; }

/* Off-screen box for the copy fallback. */
.sd-clip {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ---- 結果 ---- */

.sd-empty {
  max-width: var(--measure);
  color: var(--ink-muted);
}

.sd-plan { width: 100%; min-width: 30rem; max-width: 48rem; }
.sd-sum { width: auto; min-width: 24rem; }

.sd-plan th,
.sd-plan td {
  padding: 0.45rem 1rem 0.45rem 0;
  text-align: left;
  vertical-align: top;
}
.sd-plan thead th { padding-top: 0.25rem; }
.sd-plan tbody th,
.sd-plan td {
  border-top: 1px solid var(--rule);
}
.sd-plan tbody th {
  color: var(--ink);
  font-weight: 500;
}
.sd-plan td { white-space: nowrap; }

#sd-plan th:first-child { width: 6.8em; }
#sd-plan th:nth-child(2) { width: 6.5em; }

.sd-plan .is-trip td:nth-child(2) {
  color: var(--accent-ink);
  font-weight: 600;
}

.sd-sum td { text-align: right; padding-left: 1rem; }
.sd-sum thead th + th { text-align: right; padding-left: 1rem; }

.sd-warn {
  max-width: var(--measure);
  margin: 0 0 1rem;
  padding: 0 0 0 1.2em;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-ink);
}
.sd-warn li + li { margin-top: 0.15rem; }
