/* SOLVLET — Lab / 自治会の役員引継ぎ庫
   Page-only additions. Colours come only from the tokens in /style.css,
   so dark mode follows by itself. No animation anywhere. */

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

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

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

/* ---- 役職・年度・年会費・見る月 ---- */

.jc-rows {
  display: grid;
  gap: 1rem;
  max-width: 40rem;
}

.jc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.35rem;
}

@media (min-width: 600px) {
  .jc-rows { gap: 0.75rem; }
  .jc-row {
    grid-template-columns: 11em minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
  }
}

.jc-label {
  font-size: 0.95rem;
  color: var(--ink);
}

.jc-ctrl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  min-width: 0;
}

.jc-role.field { max-width: 16rem; }
.jc-fee.field {
  max-width: 10rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.jc-select.field {
  width: auto;
  padding-inline: 0.5rem;
}

/* Year + month selects side by side. */
.jc-ym {
  display: inline-flex;
  gap: 0.25rem;
}
.jc-ym .field {
  width: auto;
  min-width: 0;
  padding-inline: 0.4rem;
}

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

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

.jc-table,
.jc-plan {
  border-collapse: collapse;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.jc-table { width: 100%; max-width: 48rem; table-layout: auto; }
.jc-table--events { min-width: 38rem; }
.jc-table--homes { min-width: 34rem; }
.jc-table--items { min-width: 28rem; }

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

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

.jc-table .jc-c { text-align: center; }

/* Column widths live on the static <th>s; the text columns take the
   rest, the checkbox and delete columns are shrink-wrapped. */
.jc-table--events th:nth-child(1) { width: 5.5em; }
.jc-table--events th:nth-child(2) { width: 5.5em; }
.jc-table--events th:nth-child(3) { width: 10em; }
.jc-table--events th:nth-child(5),
.jc-table--events td:nth-child(5) { width: 1%; white-space: nowrap; }

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

.jc-table--items th:nth-child(1) { width: 14.5em; }
.jc-table--items th:nth-child(3),
.jc-table--items td:nth-child(3) { width: 1%; white-space: nowrap; }

.jc-table .field { width: 100%; min-width: 4.2em; padding-inline: 0.4rem; }
.jc-table select.field { min-width: 4.8em; }
.jc-table [data-field="name"] { min-width: 7em; }
.jc-table [data-field="prep"] { min-width: 10em; }
.jc-table [data-field="note"] { min-width: 7em; }
.jc-table [data-field="what"] { min-width: 11.5em; }
.jc-table [data-field="where"] { min-width: 12em; }
.jc-table .field[type="date"] { min-width: 8.5em; }

.jc-check {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 44px;
  min-width: 44px;
  padding-inline: 0.25rem;
  white-space: nowrap;
  cursor: pointer;
}
.jc-check input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--accent);
}

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

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

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

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

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

.jc-empty,
.jc-none,
.jc-unpaid {
  max-width: var(--measure);
}
.jc-empty,
.jc-none { color: var(--ink-muted); }
.jc-unpaid { margin: 0 0 1rem; color: var(--ink); }
.jc-unpaid.is-clear { color: var(--ink-muted); }

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

.jc-plan { width: 100%; min-width: 20rem; max-width: 48rem; }

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

.jc-plan .is-past th,
.jc-plan .is-past td { color: var(--ink-muted); }

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