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

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

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

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

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

/* ---- 年 ---- */

.ak-year {
  max-width: 12rem;
  margin: 0 0 clamp(2rem, 5vw, 2.75rem);
}

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

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

.ak-table,
.ak-plan {
  border-collapse: collapse;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.ak-table { width: 100%; max-width: 48rem; table-layout: auto; }
.ak-table--people { min-width: 18rem; max-width: 30rem; }
.ak-table--fixed { min-width: 34rem; }
.ak-table--rows { min-width: 44rem; }

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

.ak-th-note {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  white-space: normal;
}

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

.ak-table .ak-r { text-align: right; }
.ak-table .ak-c { text-align: center; padding-right: 0.5rem; }

/* Column widths live on the static <th>s; the name / item column takes
   the rest, the delete column is shrink-wrapped. */
.ak-table--people th:nth-child(2) { width: 7.5em; }
.ak-table--people th:nth-child(3),
.ak-table--people td:nth-child(3) { width: 1%; white-space: nowrap; }

.ak-table--fixed th:nth-child(2) { width: 8.5em; }
.ak-table--fixed th:nth-child(3) { width: 9em; }
.ak-table--fixed th:nth-child(4),
.ak-table--fixed td:nth-child(4) { width: 1%; white-space: nowrap; }

.ak-table--rows th:nth-child(1) { width: 9.5em; }
.ak-table--rows th:nth-child(3) { width: 7.5em; }
.ak-table--rows th:nth-child(4) { width: 8.5em; }
.ak-table--rows th:nth-child(5) { width: 4em; }
.ak-table--rows th:nth-child(6),
.ak-table--rows td:nth-child(6) { width: 1%; white-space: nowrap; }

.ak-table .field { width: 100%; min-width: 4.2em; padding-inline: 0.4rem; }
.ak-table [data-field="name"] { min-width: 7em; }
.ak-table [data-field="item"] { min-width: 9em; }
.ak-table [data-field="amount"] { min-width: 6.5em; text-align: right; }
.ak-table .field[type="date"] { min-width: 8.5em; }
.ak-table select.field { min-width: 5.5em; }

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

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

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

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

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

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

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

.ak-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;
}
.ak-summary p { margin: 0; }
.ak-summary > * + * { margin-top: 0.5rem; }
.ak-summary__total { font-weight: 600; }
.ak-summary__sub { color: var(--ink-muted); font-weight: 400; }

.ak-plan { width: 100%; min-width: 30rem; max-width: 48rem; }

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

.ak-transfers {
  max-width: var(--measure);
  margin: 0 0 1rem;
  padding: 0 0 0 1.2em;
  font-variant-numeric: tabular-nums;
}
.ak-transfers:empty { display: none; }
.ak-transfers li + li { margin-top: 0.15rem; }

.ak-balanced {
  max-width: var(--measure);
  margin: 0 0 1rem;
}

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

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