/* The Payroll Sheet: a work hour, played on the page. Load after lab.css and /lab/due-by-3/day.css, which hold the shared
   frame (the bar, messages, buttons, the note). Nothing here hides the readable version: every rule that hides anything
   sits under html.day-on, which payroll.js adds only after it has loaded. */

/* ── The readable version ────────────────────────────────── */
.ps-mail { background: #fff; border: 1px solid var(--tt-line-strong); border-radius: 12px; margin: 0 0 16px; box-shadow: 0 2px 8px rgba(12,35,80,.05); overflow: hidden; }
.ps-head { margin: 0; padding: 10px 14px; background: var(--tt-surface-2); border-bottom: 1px solid var(--tt-line); font-size: 14.5px; }
.ps-head > div { display: flex; gap: 8px; margin: 2px 0; }
.ps-head dt { flex: none; width: 4.6em; color: var(--tt-ink-muted); font-weight: 600; }
.ps-head dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--lab-ink); }
.ps-body { padding: 10px 14px 4px; font-size: 15.5px; line-height: 1.5; }
.ps-body p { margin: 0 0 10px; }
.ps-body ul { margin: 0 0 10px; padding-left: 20px; }
.ps-body li { margin-bottom: 5px; }
.ps-grid-wrap { overflow-x: auto; max-width: 100%; border: 1px solid var(--tt-line-strong); border-radius: 10px; background: #fff; margin: 0 0 10px; -webkit-overflow-scrolling: touch; }
.ps-grid-wrap:focus-visible { outline: 3px solid var(--tt-cyan); outline-offset: 2px; }
.ps-grid { border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; min-width: 640px; width: 100%; }
.ps-grid th, .ps-grid td { padding: 5px 8px; border-bottom: 1px solid var(--tt-line); text-align: right; white-space: nowrap; }
.ps-grid thead th { background: var(--tt-surface-2); color: var(--tt-ink-muted); font-weight: 700; font-size: 12.5px; position: sticky; top: 0; }
.ps-grid .ps-name, .ps-grid td:nth-child(3), .ps-grid thead th:nth-child(3) { text-align: left; }
.ps-grid .ps-rn, .ps-grid tbody th { width: 34px; text-align: center; color: var(--tt-ink-muted); background: var(--tt-surface-2); font-weight: 600; }
/* Row numbers stay put when the sheet scrolls sideways on a phone. */
.ps-grid tbody th, .ps-grid thead th.ps-rn { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--tt-line); }
.ps-grid thead th.ps-rn { z-index: 2; }
.ps-grid .ps-total td, .ps-grid .ps-total th { font-weight: 700; border-top: 2px solid var(--tt-line-strong); color: var(--tt-navy-deep); }
.ps-small { font-size: 14px; color: var(--tt-ink-soft); }
.ps-clock { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 2px 14px; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.ps-clock span { display: inline-block; min-width: 3em; font-family: var(--lab-mono); color: var(--tt-ink-muted); }

/* ── The answers ─────────────────────────────────────────── */
.ps-truth { display: grid; gap: 10px; margin: 0 0 18px; }
.ps-truth > div { background: #fff; border: 1px solid var(--tt-line); border-left: 4px solid var(--lab-right); border-radius: 12px; padding: 12px 14px 4px; box-shadow: var(--tt-shadow-card); }
.ps-truth > div.is-bad { border-left-color: var(--lab-wrong); }
.ps-truth h3 { font-family: var(--tt-font-display); font-size: 17.5px; font-weight: 700; color: var(--tt-navy-deep); margin: 0 0 6px; }
.ps-truth p { font-size: 15.5px; line-height: 1.5; margin: 0 0 10px; }
.ps-h3 { font-family: var(--tt-font-display); font-size: 19px; font-weight: 700; color: var(--tt-navy-deep); margin: 22px 0 8px; }
.ps-facts { padding-left: 20px; }
.ps-facts li { margin-bottom: 12px; font-size: 15.5px; line-height: 1.5; }
.ps-project { padding-left: 22px; }
.ps-project li { margin-bottom: 10px; font-size: 15.5px; line-height: 1.5; }
.ps-project-meta { font-size: 15px; color: var(--tt-ink-soft); background: var(--tt-surface-2); border-radius: 10px; padding: 10px 12px; }

/* ── Faces ───────────────────────────────────────────────── */
.day-face.is-jules { background: #0d7a6f; }
.day-face.is-ai { background: #3b2f8f; }
.day-face.is-parent { background: #a8450b; }
.day-face.is-friend { background: #23395f; }

/* ── The game ────────────────────────────────────────────── */
.ps-bar .day-clock { font-size: 15px; }
.ps-bar .day-time[hidden] { display: none; }   /* Monday has no Friday clock */
.ps-in { margin: 0 12px 12px; animation: dayIn .25s ease; }
.ps-tabs { grid-template-columns: repeat(3, 1fr); }
.ps-tabs .day-tab { font-size: 13.5px; min-height: 42px; padding: 4px 4px; line-height: 1.2; }
.ps-panel { padding-top: 10px; }
.ps-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.day-ping.is-in { max-height: 240px; }
.day-ping p { margin: 0; }
.day-ping p + p { margin-top: 4px; }
.day-btn.is-off, .day-btn.is-off:hover { background: var(--tt-surface-2); color: var(--lab-ink); border-color: var(--tt-line-strong); box-shadow: none; transform: none; cursor: not-allowed; }
.day-btn.is-wait { min-height: 42px; font-size: 14.5px; }
.ps-waits { display: flex; gap: 7px; }
.ps-waits .day-btn { flex: 1 1 0; }

/* The sheet */
.ps-rowbtn { font: inherit; font-weight: 700; min-width: 32px; min-height: 32px; border: 1px solid var(--tt-line-strong); border-radius: 7px; background: #fff; color: var(--tt-navy); cursor: pointer; transition: background .15s, border-color .15s; }
.ps-rowbtn:hover { background: #f3f7ff; border-color: var(--tt-navy); }
.ps-rowbtn:active { transform: scale(.97); }
.ps-rowbtn:focus-visible, .ps-back:focus-visible { outline: 3px solid var(--tt-cyan); outline-offset: 2px; }
.ps-back { display: inline-block; margin: 0 0 10px; padding: 6px 2px; min-height: 44px; background: none; border: 0; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--tt-navy); text-decoration: underline; cursor: pointer; }
.ps-back:hover { color: var(--tt-navy-deep); }
.ps-rowcard { background: #fff; border: 1px solid var(--tt-line-strong); border-radius: 12px; padding: 10px 14px; margin: 0 0 12px; }
.ps-rowcard-title { font-family: var(--tt-font-display); font-size: 17px; font-weight: 700; color: var(--tt-navy-deep); margin: 0 0 6px; }
.ps-dl { margin: 0; }
.ps-dl > div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--tt-line); font-size: 15px; font-variant-numeric: tabular-nums; }
.ps-dl dt { color: var(--tt-ink-muted); font-weight: 600; }
.ps-dl dd { margin: 0; }
.ps-tools { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 12px; }
.ps-tools:empty { display: none; }
.ps-tools .day-btn, .ps-fixes .day-btn, .ps-check .day-btn { flex: 1 1 210px; text-align: left; }

/* Checks and fixes */
.ps-check { background: #fff; border: 1px solid var(--tt-line-strong); border-radius: 12px; padding: 10px 12px; margin: 0 0 8px; }
.ps-check-name { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--lab-ink); line-height: 1.4; }
.ps-check .day-btn { width: 100%; }
.ps-found { background: #eef6ff; border-left: 4px solid var(--tt-navy); border-radius: 8px; padding: 8px 12px; margin: 0 0 10px; font-size: 14.5px; line-height: 1.45; animation: dayIn .2s ease; }
.ps-found p { margin: 0 0 6px; }
.ps-found p:last-child { margin-bottom: 0; }
.ps-fixes { display: flex; flex-wrap: wrap; gap: 7px; border-top: 1px solid var(--tt-line); padding-top: 10px; margin-top: 6px; }
.ps-fixes > .ps-found, .ps-fixes > .ps-pick { flex: 1 1 100%; }
.ps-fixes-head { flex: 1 1 100%; margin: 0; font-family: var(--tt-font-display); font-size: 14px; font-weight: 700; color: var(--tt-navy-deep); }
.ps-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.ps-pick-head { flex: 1 1 100%; margin: 0; font-size: 14.5px; font-weight: 600; }
.ps-pick .day-btn { flex: 1 1 130px; }

/* Ledgerline */
.ps-ledger { background: #fff; border: 1px solid var(--tt-line-strong); border-radius: 12px; padding: 12px 14px; margin: 0 0 12px; box-shadow: 0 2px 8px rgba(12,35,80,.05); }
.ps-ledger-name { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--tt-ink-muted); text-transform: uppercase; letter-spacing: .4px; }
.ps-ledger-note { margin: 0 0 8px; font-size: 14.5px; color: var(--tt-ink-soft); line-height: 1.45; }
.ps-ledger-done { margin: 0; font-size: 14.5px; font-weight: 700; color: #1e6b45; }

/* Avery's note, to read again on the Checks tab */
.ps-again { margin: 0 0 12px; border: 1px solid var(--tt-line-strong); border-radius: 12px; background: #fff; }
.ps-again > summary { cursor: pointer; padding: 10px 14px; min-height: 44px; box-sizing: border-box; font-weight: 700; color: var(--tt-navy); }
.ps-again > summary:hover { color: var(--tt-navy-deep); }
.ps-again > summary:focus-visible { outline: 3px solid var(--tt-cyan); outline-offset: 2px; border-radius: 10px; }
.ps-again .ps-mail { margin: 0; border: 0; border-top: 1px solid var(--tt-line); border-radius: 0 0 12px 12px; box-shadow: none; }

/* The note */
.ps-mark { font-weight: 700; }
.ps-note-line { margin: 12px 0 0; font-size: 14.5px; line-height: 1.45; color: var(--tt-ink-soft); }

/* A phone held sideways: let the actions scroll with the page, so the hour has room. */
@media (max-height: 480px) { .day-app .day-actions { position: static; } }
