/* SOLVLET — Lab / シッター報告書
   Page-only additions. Colours come only from the tokens in /style.css,
   so dark mode follows by itself. No animation anywhere. */

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

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

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

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

.ps-sitter { max-width: 22rem; }

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

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

.ps-table,
.ps-plan {
  border-collapse: collapse;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.ps-table { width: 100%; max-width: 58rem; table-layout: auto; }
.ps-table--visits { min-width: 56rem; }
.ps-table--pets { min-width: 40rem; max-width: 48rem; }

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

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

.ps-table .ps-c { text-align: center; }

/* One visit = one tbody of two rows; a rule between visits. */
.ps-table--visits tbody + tbody tr:first-child td { border-top: 1px solid var(--rule); padding-top: 0.6rem; }
.ps-table--visits tbody tr:last-child td { padding-bottom: 0.6rem; }
.ps-table--visits td.ps-del { vertical-align: top; width: 1%; white-space: nowrap; }
.ps-table--visits td.ps-wide { vertical-align: top; }

.ps-sub {
  display: block;
  margin: 0 0 0.15rem;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--ink-muted);
}

.ps-table--pets th:nth-child(2),
.ps-table--pets td:nth-child(2) { width: 1%; }
.ps-table--pets th:nth-child(5),
.ps-table--pets td:nth-child(5) { width: 1%; white-space: nowrap; }

.ps-table .field { width: 100%; min-width: 4em; padding-inline: 0.4rem; }
.ps-table [data-field="pet"] { min-width: 6em; }
.ps-table [data-field="start"],
.ps-table [data-field="end"] { min-width: 3.9em; max-width: 4.6em; text-align: center; }
.ps-table [data-field="food"] { min-width: 5.5em; }
.ps-table [data-field="excr"] { min-width: 6.5em; }
.ps-table [data-field="stool"] { min-width: 6.5em; }
.ps-table [data-field="walk"] { min-width: 4em; max-width: 5em; text-align: right; }
.ps-table [data-field="medName"] { min-width: 6em; }
.ps-table [data-field="name"] { min-width: 6em; }
.ps-table [data-field="kind"] { min-width: 5em; }
.ps-table [data-field="owner"] { min-width: 6em; }
.ps-table [data-field="care"] { min-width: 10em; }
.ps-table .field[type="date"] { min-width: 8.5em; }
.ps-table textarea.field { resize: vertical; min-height: 4.4em; }

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

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

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

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

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

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

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

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

.ps-pickrow { max-width: 22rem; margin: 0 0 0.5rem; }

/* The one sheet the owner reads. */
.ps-report {
  max-width: 36rem;
  margin: 0 0 1rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.ps-report p { margin: 0; }
.ps-report__to {
  font-size: 0.95rem;
  color: var(--ink-muted);
}
.ps-report__title {
  margin: 0.25rem 0 0.25rem;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
}
.ps-report__when {
  font-size: 0.95rem;
  color: var(--ink-muted);
}
.ps-report__table {
  width: 100%;
  margin: 1rem 0 0;
  border-collapse: collapse;
  font-size: 0.97rem;
}
.ps-report__table th,
.ps-report__table td {
  padding: 0.5rem 0;
  border-top: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
.ps-report__table tr:last-child th,
.ps-report__table tr:last-child td { border-bottom: 1px solid var(--rule); }
.ps-report__table th {
  width: 5.5em;
  padding-right: 1rem;
  font-weight: 500;
  color: var(--ink-muted);
  white-space: nowrap;
}
.ps-report__table td { color: var(--ink); }
.ps-report .ps-report__next { margin-top: 1rem; }
.ps-report__next strong { display: block; font-weight: 600; }
.ps-report .ps-report__sign {
  margin-top: 1.25rem;
  text-align: right;
  color: var(--ink);
}
.ps-report .ps-muted { color: var(--ink-muted); }

.ps-report-actions { margin: 0 0 0.5rem; }
.ps-report-actions .btn { white-space: nowrap; }

.ps-plan { width: 100%; min-width: 30rem; max-width: 48rem; }
.ps-plan--prev { min-width: 36rem; }
.ps-plan--visits { min-width: 36rem; }

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

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

.ps-plan .is-over,
.is-over { color: var(--accent-ink); font-weight: 600; }
.ps-plan .is-pick th,
.ps-plan .is-pick td { font-weight: 600; }

/* ---- 印刷: 報告書の一枚だけを残す ---- */

@media print {
  .skip,
  .pagehead,
  .footer,
  main .section > :not(.ps-result),
  .ps-result > :not(#ps-out),
  #ps-out > :not(.ps-report) { display: none !important; }

  .section { padding: 0; }
  .ps-block { margin: 0; }
  .ps-report {
    max-width: none;
    margin: 0;
    border: 0;
    padding: 0;
  }
}
