/* SOLVLET — Lab / 卒対ノート
   Page-only additions. Colours come only from the tokens in /style.css,
   so dark mode follows by itself. No animation anywhere. */

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

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

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

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

/* ---- 式の日と集金額 ---- */

.st-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}
.st-field .field { width: auto; min-width: 0; padding-inline: 0.4rem; }
.st-field .field[type="date"] { min-width: 9.5em; }
.st-field .st-num { width: 8em; text-align: right; }

/* ---- 入力の表 ---- */

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

.st-table,
.st-plan {
  border-collapse: collapse;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.st-table { width: 100%; max-width: 52rem; table-layout: auto; }
.st-table--events { min-width: 46rem; }
.st-table--homes { min-width: 34rem; max-width: 42rem; }

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

.st-table td {
  padding: 0.25rem 0.5rem 0.25rem 0;
  vertical-align: middle;
}
.st-table th:last-child,
.st-table td:last-child { padding-right: 0; }

.st-table .st-r { text-align: right; }
.st-table .st-c { text-align: center; }

/* Date, checkbox and delete columns are shrink-wrapped; the free-text
   columns take the rest. */
.st-table--events th:nth-child(2) { width: 9.5em; }
.st-table--events th:nth-child(4),
.st-table--events td:nth-child(4),
.st-table--events th:nth-child(6),
.st-table--events td:nth-child(6) { width: 1%; white-space: nowrap; }

.st-table--homes th:nth-child(2),
.st-table--homes td:nth-child(2),
.st-table--homes th:nth-child(3),
.st-table--homes td:nth-child(3),
.st-table--homes th:nth-child(5),
.st-table--homes td:nth-child(5) { width: 1%; white-space: nowrap; }

.st-table .field { width: 100%; min-width: 4em; padding-inline: 0.4rem; }
.st-table [data-field="name"] { min-width: 7em; }
.st-table--events [data-field="name"] { min-width: 13em; }
.st-table [data-field="who"] { min-width: 5em; }
.st-table [data-field="memo"] { min-width: 8em; }
.st-table [data-field="adv"] { min-width: 6.5em; text-align: right; }
.st-table .field[type="date"] { min-width: 8.5em; }

.st-check {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
}
.st-check input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--accent);
}

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

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

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

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

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

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

.st-summary {
  max-width: 40rem;
  margin: 0 0 1.25rem;
  padding: clamp(1.25rem, 4vw, 1.75rem);
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.st-summary p { margin: 0; }
.st-summary > * + * { margin-top: 0.5rem; }
.st-summary__total { font-weight: 600; }

.st-plan { width: 100%; min-width: 30rem; max-width: 52rem; }
.st-plan--events { min-width: 40rem; }
.st-plan--adv { max-width: 40rem; }

.st-plan th,
.st-plan td {
  padding: 0.45rem 1rem 0.45rem 0;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
.st-plan thead th { padding-top: 0.25rem; vertical-align: bottom; line-height: 1.4; }
.st-plan tbody th,
.st-plan td { border-top: 1px solid var(--rule); }
.st-plan tbody th { color: var(--ink); font-weight: 500; }
.st-plan td { color: var(--ink); }
.st-plan .st-r { text-align: right; }
.st-plan .st-muted { color: var(--ink-muted); }
.st-plan th:last-child,
.st-plan td:last-child { padding-right: 0; }

.st-line {
  max-width: var(--measure);
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.st-names {
  max-width: var(--measure);
  margin: 0 0 1rem;
  padding: 0 0 0 1.2em;
  font-size: 0.95rem;
  color: var(--ink);
}
.st-names li + li { margin-top: 0.15rem; }
.st-names .st-muted { color: var(--ink-muted); }

/* ---- 文面 ---- */

.st-text {
  max-width: 40rem;
  margin: 0 0 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
}
.st-text__title {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-muted);
}
.st-text__body {
  font-size: 0.95rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.st-text__body p { margin: 0; }
.st-text__body p + p { margin-top: 0.25rem; }

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

.st-plan .is-over,
.is-over { color: var(--accent-ink); font-weight: 600; }
