/* SOLVLET — Lab / 習い事手帳
   Page-only additions. Colours come only from the tokens in /style.css,
   so dark mode follows by itself. No animation anywhere. */

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

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

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

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

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

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

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

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

.ng-table,
.ng-plan {
  border-collapse: collapse;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.ng-table { width: 100%; max-width: 48rem; table-layout: auto; }
.ng-table--kids { min-width: 16rem; max-width: 22rem; }
.ng-table--classes { min-width: 47rem; }
.ng-table--tickets { min-width: 34rem; max-width: 40rem; }

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

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

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

/* Column widths live on the static <th>s; the free-text column takes the
   rest, the checkbox and delete columns are shrink-wrapped. */
.ng-table--kids th:nth-child(2),
.ng-table--kids td:nth-child(2) { width: 1%; white-space: nowrap; }

.ng-table--classes th:nth-child(-n+5),
.ng-table--classes td:nth-child(-n+5) { width: 1%; }
.ng-table--classes th:nth-child(7),
.ng-table--classes td:nth-child(7) { width: 1%; white-space: nowrap; }

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

.ng-table .field { width: 100%; min-width: 4em; padding-inline: 0.4rem; }
.ng-table [data-field="name"] { min-width: 7em; }
.ng-table--classes [data-field="name"] { min-width: 7.5em; }
.ng-table [data-field="kid"] { min-width: 5em; }
.ng-table [data-field="fee"] { min-width: 5.5em; text-align: right; }
.ng-table [data-field="pay"] { min-width: 9em; }
.ng-table [data-field="day"] { min-width: 4.75em; }
.ng-table [data-field="items"] { min-width: 9em; }
.ng-table [data-field="cls"] { min-width: 9.5em; }
.ng-table .field[type="date"] { min-width: 8.5em; }

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

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

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

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

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

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

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

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

.ng-plan { width: 100%; min-width: 30rem; max-width: 48rem; }
.ng-plan--fees { min-width: 36rem; }

.ng-plan th,
.ng-plan td {
  padding: 0.45rem 1rem 0.45rem 0;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
.ng-plan thead th { padding-top: 0.25rem; vertical-align: bottom; line-height: 1.4; }
.ng-plan tbody th,
.ng-plan td { border-top: 1px solid var(--rule); }
.ng-plan tbody th { color: var(--ink); font-weight: 500; }
.ng-plan td { color: var(--ink); }
.ng-plan .ng-r { text-align: right; }
.ng-plan .ng-c { text-align: center; width: 1%; }
.ng-plan .ng-muted { color: var(--ink-muted); }
.ng-plan th:last-child,
.ng-plan td:last-child { padding-right: 0; }
/* Rows with a checkbox are taller; keep the tick area tight. */
.ng-plan td .ng-check { min-height: 44px; margin: -0.45rem 0; }

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

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

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