/* SOLVLET — Lab / 講師の出講台帳
   Page-only additions. Colours come only from the tokens in /style.css,
   so dark mode follows by itself. No animation anywhere. */

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

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

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

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

/* Small caption above each table inside 今月の売上と未入金. */
.ks-sub {
  margin: 0.75rem 0 0.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-muted);
}

/* ---- 見る月: year + month selects side by side ---- */

.ks-ym {
  display: inline-flex;
  gap: 0.25rem;
}
.ks-ym .field {
  width: auto;
  min-width: 0;
  padding-inline: 0.4rem;
}

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

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

.ks-table,
.ks-plan {
  border-collapse: collapse;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.ks-table { width: 100%; table-layout: auto; }
.ks-table--cases { min-width: 58rem; }
.ks-table--hosts { min-width: 40rem; max-width: 46rem; }

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

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

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

/* The free-text column (件名 / 名前) takes the rest; the others are
   shrink-wrapped to their fields. */
.ks-table--cases th:nth-child(-n+2),
.ks-table--cases td:nth-child(-n+2),
.ks-table--cases th:nth-child(n+4),
.ks-table--cases td:nth-child(n+4) { width: 1%; }
.ks-table--cases th:nth-child(8),
.ks-table--cases td:nth-child(8) { white-space: nowrap; }

.ks-table--hosts th:nth-child(n+2),
.ks-table--hosts td:nth-child(n+2) { width: 1%; white-space: nowrap; }

.ks-table .field { width: 100%; min-width: 4em; padding-inline: 0.4rem; }
.ks-table [data-field="name"] { min-width: 9em; }
.ks-table [data-field="host"] { min-width: 8.5em; }
.ks-table [data-field="title"] { min-width: 8em; }
.ks-table [data-field="fee"],
.ks-table [data-field="paidAmt"] { min-width: 6em; text-align: right; }
.ks-table [data-field="travel"] { min-width: 5em; text-align: right; }
.ks-table [data-field="close"] { min-width: 5.5em; }
.ks-table [data-field="pay"] { min-width: 7.5em; }
.ks-table .field[type="date"] { min-width: 8.5em; }

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

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

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

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

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

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

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

.ks-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;
}
.ks-summary p { margin: 0; }
.ks-summary > * + * { margin-top: 0.5rem; }
.ks-summary__total { font-weight: 600; }

/* Result tables stay inside 48rem with no min-width: names and titles wrap,
   the other columns keep to one line. */
.ks-plan { width: 100%; max-width: 48rem; }

.ks-plan th,
.ks-plan td {
  padding: 0.45rem 1rem 0.45rem 0;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
.ks-plan thead th { padding-top: 0.25rem; vertical-align: bottom; line-height: 1.4; }
.ks-plan tbody th,
.ks-plan td { border-top: 1px solid var(--rule); }
.ks-plan tbody th { color: var(--ink); font-weight: 500; }
.ks-plan td { color: var(--ink); }
.ks-plan .ks-r { text-align: right; }
.ks-plan .ks-c { text-align: center; width: 1%; }
.ks-plan .ks-muted { color: var(--ink-muted); }
.ks-plan th:last-child,
.ks-plan td:last-child { padding-right: 0; }
.ks-plan .ks-wrap { white-space: normal; min-width: 5em; }
.ks-diff {
  display: block;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--ink-muted);
}

.ks-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);
}
.ks-warn li + li { margin-top: 0.15rem; }

.ks-note { margin-top: 1.25rem; }

.ks-ask { color: var(--accent-ink); }

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