/* SOLVLET — Lab / 祭りの帳面
   Page-only additions. Colours come only from the tokens in /style.css,
   so dark mode follows by itself. No animation anywhere.
   @media print keeps only the 奉納金の一覧 (掲示用). */

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

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

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

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

/* ---- 祭りの日 + 前年をコピー ---- */

.mt-day__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0 0 0.75rem;
}
.mt-day__row .field {
  width: auto;
  min-width: 10em;
  padding-inline: 0.4rem;
}
.mt-day__row .btn { white-space: nowrap; }

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

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

.mt-table,
.mt-plan {
  border-collapse: collapse;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.mt-table { width: 100%; table-layout: auto; }
.mt-table--todos { min-width: 56rem; }
.mt-table--gifts { min-width: 36rem; max-width: 44rem; }

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

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

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

/* Date, who, tick and delete columns are shrink-wrapped; the text
   columns share the rest. */
.mt-table--todos th:nth-child(3),
.mt-table--todos td:nth-child(3),
.mt-table--todos th:nth-child(4),
.mt-table--todos td:nth-child(4) { width: 1%; }
.mt-table--todos th:nth-child(5),
.mt-table--todos td:nth-child(5),
.mt-table--todos th:nth-child(7),
.mt-table--todos td:nth-child(7) { width: 1%; white-space: nowrap; }

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

.mt-table .field { width: 100%; min-width: 4em; padding-inline: 0.4rem; }
.mt-table [data-field="name"] { min-width: 9em; }
.mt-table [data-field="qty"] { min-width: 8em; }
.mt-table [data-field="who"] { min-width: 5.5em; }
.mt-table [data-field="last"] { min-width: 10em; }
.mt-table [data-field="amount"] { min-width: 6.5em; text-align: right; }
.mt-table .field[type="date"] { min-width: 8.5em; }

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

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

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

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

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

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

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

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

.mt-plan { width: 100%; min-width: 30rem; max-width: 48rem; }
.mt-plan--todo { min-width: 44rem; max-width: var(--frame); }
.mt-plan--list { min-width: 20rem; max-width: 32rem; font-size: 1rem; }

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

/* 去年のメモ may be long: let it wrap instead of widening the table. */
.mt-plan .mt-note {
  min-width: 10em;
  white-space: normal;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.mt-plan tfoot th,
.mt-plan tfoot td {
  border-top: 2px solid var(--rule);
  font-weight: 600;
  color: var(--ink);
}

.mt-lead {
  max-width: var(--measure);
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--ink);
}

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

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

/* ---- 掲示用に印刷: only the 奉納金の一覧 is left on paper ---- */

@media print {
  .skip,
  .pagehead,
  .footer,
  .page__title,
  .page__meta,
  .lab-note,
  .mt-actions,
  .mt-block:not(.mt-result),
  .mt-noprint { display: none !important; }

  .section { padding: 0; }
  .mt-block,
  .mt-plan { max-width: none; }
  .mt-scroll { overflow: visible; }

  /* On paper the lead sentence is the title; the screen heading goes. */
  .mt-lead {
    max-width: none;
    margin: 0 0 1.5rem;
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
  }
  .mt-plan--list {
    width: 100%;
    font-size: 1.35rem;
  }
  .mt-plan--list th,
  .mt-plan--list td { padding: 0.6rem 1rem; }
}
