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

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

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

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

/* ---- 志望校 ---- */

.juken-rows {
  display: grid;
  gap: 1rem;
  margin: 0 0 0.5rem;
}

.juken-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
  max-width: 40rem;
}
.juken-row .btn { justify-self: start; }

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

/* ---- 模試の結果 ---- */

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

.juken-table,
.juken-summary-table {
  border-collapse: collapse;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.juken-table { width: 100%; min-width: 44rem; table-layout: auto; }
.juken-summary-table { min-width: 28rem; }

.juken-table th,
.juken-summary-table th {
  padding: 0.25rem 0.5rem 0.25rem 0;
  font-weight: 500;
  text-align: left;
  color: var(--ink-muted);
  white-space: nowrap;
}

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

/* Column widths live on the static <th>s: 日付, 模試 (takes the rest),
   4科 + 4 subjects, then the delete column shrink-wrapped. */
.juken-table th:nth-child(1) { width: 9.5em; }
.juken-table th:nth-child(n+3):nth-child(-n+7) { width: 4.8em; }
.juken-table th:nth-child(8),
.juken-table td:nth-child(8) { width: 1%; white-space: nowrap; }

.juken-table .field { width: 100%; min-width: 4.2em; padding-inline: 0.4rem; }
.juken-table .field[type="date"] { min-width: 8.5em; }
.juken-table .field[list] { min-width: 9em; }

.juken-summary-table td {
  padding: 0.4rem 1rem 0.4rem 0;
  border-top: 1px solid var(--rule);
  white-space: nowrap;
}

.juken-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin: 0 0 clamp(2rem, 5vw, 2.75rem);
}

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

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

.juken-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;
  font-variant-numeric: tabular-nums;
}
.juken-summary p,
.juken-dist { margin: 0; }
.juken-dist { padding-left: 1.2em; }
.juken-summary > * + * { margin-top: 0.5rem; }

.juken-chart { margin: 0 0 1.25rem; }
.juken-chart .juken-help { margin: 0.5rem 0 0; }
.juken-chart svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 52rem;
}
.juken-chart svg text { font-family: inherit; }
.juken-chart svg .grid { stroke: var(--rule); stroke-width: 1; }
.juken-chart svg .axis { fill: var(--ink-muted); }
.juken-chart svg .target { stroke: var(--ink-muted); stroke-width: 1.5; stroke-dasharray: 6 4; fill: none; }
.juken-chart svg .target-name { fill: var(--ink-muted); }
.juken-chart svg .series { stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; fill: none; }
.juken-chart svg .pt { fill: var(--accent); }
.juken-chart svg .lbl { fill: var(--ink); }

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