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

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

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

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

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

/* ---- 任期: two year + month pairs ---- */

.rj-term__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
}
.rj-term__part {
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
}
.rj-term__name {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--ink-muted);
}
.rj-term__sep {
  padding-bottom: 0.6rem;
  color: var(--ink-muted);
}

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

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

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

.rj-table,
.rj-plan {
  border-collapse: collapse;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.rj-table { width: 100%; table-layout: auto; }
.rj-table--items { min-width: 60rem; }
.rj-table--meetings { min-width: 28rem; max-width: 40rem; }
.rj-table--repairs { min-width: 48rem; }

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

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

.rj-table .rj-r { text-align: right; }

/* Column widths live on the static <th>s; the free-text columns take the
   rest, the delete column is shrink-wrapped. */
.rj-table--items th:nth-child(1),
.rj-table--items th:nth-child(3),
.rj-table--items th:nth-child(4),
.rj-table--items th:nth-child(5) { width: 1%; }
.rj-table--items th:nth-child(7),
.rj-table--items td:nth-child(7) { width: 1%; white-space: nowrap; }

.rj-table--meetings th:nth-child(1),
.rj-table--meetings td:nth-child(1) { width: 1%; white-space: nowrap; }
.rj-table--meetings th:nth-child(2) { width: 9.5em; }
.rj-table--meetings th:nth-child(4),
.rj-table--meetings td:nth-child(4) { width: 1%; white-space: nowrap; }

.rj-table--repairs th:nth-child(1) { width: 9.5em; }
.rj-table--repairs th:nth-child(4) { width: 1%; }
.rj-table--repairs th:nth-child(6),
.rj-table--repairs td:nth-child(6) { width: 1%; white-space: nowrap; }

.rj-table .field { width: 100%; min-width: 4em; padding-inline: 0.4rem; }
.rj-table [data-field="mt"] { min-width: 7.5em; }
.rj-table [data-field="what"] { min-width: 14em; }
.rj-table [data-field="who"] { min-width: 7em; }
.rj-table [data-field="status"] { min-width: 6em; }
.rj-table [data-field="memo"] { min-width: 9em; }
.rj-table [data-field="place"] { min-width: 8em; }
.rj-table [data-field="cost"] { min-width: 7em; text-align: right; }
.rj-table [data-field="vendor"] { min-width: 8em; }
.rj-table .field[type="date"] { min-width: 8.5em; }

.rj-num {
  display: inline-block;
  padding-right: 0.25rem;
  color: var(--ink);
  white-space: nowrap;
}

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

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

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

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

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

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

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

.rj-plan { width: 100%; min-width: 40rem; max-width: 52rem; }
.rj-plan--hist { min-width: 36rem; max-width: 48rem; }

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

.rj-meets {
  max-width: 40rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
  color: var(--ink);
}
.rj-meets > li + li { margin-top: 0.9rem; }
.rj-meets__head {
  margin: 0 0 0.2rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.rj-meets__memo {
  font-weight: 400;
  color: var(--ink-muted);
}
.rj-meets ul {
  margin: 0;
  padding: 0 0 0 1.2em;
}
.rj-meets ul li + li { margin-top: 0.15rem; }
.rj-meets .rj-muted { color: var(--ink-muted); }

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

.rj-hand {
  max-width: 40rem;
  margin: 0 0 1rem;
  padding: clamp(1.25rem, 4vw, 1.75rem);
  background: var(--paper-alt);
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--ink);
  white-space: pre-wrap;
  font-variant-numeric: tabular-nums;
}

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

/* ---- 印刷: 引継ぎの文面だけを残す ---- */

@media print {
  .skip,
  .pagehead,
  .footer,
  #main > .section > *:not(.rj-result),
  .rj-result > .rj-h,
  .rj-result > .rj-empty,
  #rj-out > *:not(#rj-hand-wrap),
  #rj-hand-wrap > .rj-help { display: none !important; }

  .section { padding: 0; }
  .rj-block { max-width: none; margin: 0; }
  .rj-h--sub { margin-top: 0; }
  .rj-hand {
    max-width: none;
    padding: 0;
    background: none;
    border: 0;
  }
}
