/* ============================================================================
   css/journal.css — the Journal page and the Report Studio (design §4.4, §10).
   Owner unit: P05 (prp/2026-09-26-pocket-web-v2/units/P05.md).

   Rendered through tokens.css / css/kit.css custom properties only — no inline styles, no inline
   scripts (CSP, design §11). Everything is scoped under `.pk-j-page`, so this file never restyles
   another page's `.pk-btn`/`.pk-input`; the modifiers it needs (`sm`, `chip`, `danger`, `on`) are
   restated here for the same reason instead of leaning on css/project.css being loaded.
   ============================================================================ */

.pk-j-page { max-width: 900px; margin: 0 auto; padding: 20px 20px 48px; min-width: 0; }
.pk-j-page .pk-h1 {
  font-family: var(--serif); font-variation-settings: "SOFT" 100, "opsz" 60;
  font-weight: 350; font-size: 32px; line-height: 1.15; color: var(--ink); margin: 6px 0 0;
}
.pk-j-page .pk-lede { font-size: 15px; line-height: 1.5; color: var(--ink2); margin: 10px 0 0; }
.pk-j-page .pk-sh { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 28px 0 8px; padding: 0; }
.pk-j-page .pk-sh h2 {
  font-family: var(--serif); font-variation-settings: "SOFT" 100; font-weight: 350;
  font-size: 19px; color: var(--ink); margin: 0;
}
.pk-j-page .pk-absence { color: var(--ink3); font-size: 13px; font-style: italic; padding: 8px 0; margin: 0; }
.pk-j-page .pk-hint { font-size: 13px; color: var(--ink3); margin: 6px 0 0; }

/* ---- buttons this page uses (kit.css's .pk-btn is the base) ------------------------------------ */
.pk-j-page .pk-btn.sm { height: 32px; padding: 0 12px; font-size: 13px; flex: none; }
.pk-j-page .pk-btn.chip { height: 28px; padding: 0 12px; font-size: 12.5px; border-radius: 999px; flex: none; }
.pk-j-page .pk-btn.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pk-j-page .pk-btn.danger { color: var(--you); border-color: var(--you); }
.pk-j-page .pk-input {
  height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  padding: 0 12px; font-size: 14.5px; color: var(--ink); outline: 0; flex: 1 1 160px; min-width: 0;
  font-family: var(--sans);
}
.pk-j-page textarea.pk-input { height: auto; padding: 8px 12px; line-height: 1.4; resize: vertical; }
.pk-j-page .pk-input:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

/* ---- the stat row (design v14 "Journal → Activity" summary tiles) — house `.tile` (kit.css)
   restated in ITS OWN grid rather than leaning on settings.css's `.kpis`, for the reason this
   file's header already states: no page here restyles another page's class. The number sits
   above the label (`<b>` before `<span>` in journal.js), matching the prototype's own `.measure`
   markup byte for byte, not this app's one `.tile` caller (views/s-spend.js), which writes the
   label first — the two disagree and this row follows the design it was asked to reproduce.
   THREE tiles, not the prototype's four — finished today · decided by me · parked; the STOPPED
   tile was cut (journal.js's own comment above `renderStatRow` names the missing engine signal),
   so a fixed 3-column grid is both viewports' layout — three cards read comfortably at 390px, no
   narrower breakpoint needed. */
.pk-j-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 24px 0 0; }
.pk-j-stats .tile { min-width: 0; }
.pk-j-stats .tile.absent b { color: var(--ink3); }

/* ---- the tab strip ------------------------------------------------------------------------------ */
.pk-j-tabs {
  display: flex; gap: 2px; background: var(--sunk); padding: 3px; border-radius: 12px; margin-top: 24px;
  overflow-x: auto; scrollbar-width: none; max-width: 100%;
}
.pk-j-tabs::-webkit-scrollbar { display: none; }
/* the strip scrolls with no bar, so on a phone its edge fades to say there is more */
@media (max-width: 640px) {
  .pk-j-tabs { -webkit-mask-image: linear-gradient(to right, #000 80%, transparent); mask-image: linear-gradient(to right, #000 80%, transparent); }
}
.pk-j-tab.pk-btn {
  height: 32px; padding: 0 12px; font-size: 13px; border: 0; background: none; flex: none;
  color: var(--ink3); white-space: nowrap;
}
.pk-j-tab.pk-btn.on { background: var(--card); color: var(--ink); box-shadow: var(--sh); }
.pk-j-body { margin-top: 6px; min-width: 0; }

/* ---- filters ------------------------------------------------------------------------------------ */
.pk-j-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 14px 0 6px; }
.pk-j-select {
  height: 28px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); font-size: 12.5px; padding: 0 10px; font-family: var(--sans); max-width: 100%;
}
.pk-j-counts { font-size: 13px; color: var(--ink2); margin: 14px 0 0; }
.pk-j-note { font-size: 14px; line-height: 1.5; color: var(--ink2); margin: 18px 0 0; }
.pk-j-sub { font-size: 13px; line-height: 1.45; color: var(--ink3); margin: 6px 0 0; overflow-wrap: anywhere; }
.pk-j-warn { font-size: 13px; line-height: 1.45; color: var(--you); margin: 6px 0 0; overflow-wrap: anywhere; }

/* ---- days and rows ------------------------------------------------------------------------------ */
.pk-j-day { margin-top: 20px; }
.pk-j-dayh { font-size: 12.5px; color: var(--ink3); text-transform: uppercase; letter-spacing: .03em; margin: 18px 0 4px; }
.pk-j-day > .pk-j-dayh { margin-top: 0; }
.pk-j-rows { display: flex; flex-direction: column; min-width: 0; }
.pk-j-row {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line);
  min-width: 0; flex-wrap: wrap;
}
.pk-j-tm { flex: 0 0 44px; font-size: 12.5px; color: var(--ink3); padding-top: 2px; font-variant-numeric: tabular-nums; }
.pk-j-k { flex: 0 0 16px; text-align: center; color: var(--ink3); font-size: 13px; padding-top: 1px; }
.pk-j-k.tone-ok { color: var(--done); }
.pk-j-k.tone-warn, .pk-j-k.tone-err { color: var(--you); }
.pk-j-tx { flex: 1 1 200px; min-width: 0; font-size: 14.5px; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.pk-j-tx small { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.4; color: var(--ink3); }
.pk-j-ac { display: flex; gap: 4px; flex-wrap: wrap; flex: 0 1 auto; margin-left: auto; }
.pk-j-run {
  flex: 1 1 100%; margin: 2px 0 6px 26px; padding: 10px 14px; background: var(--sunk); border-radius: 12px;
  min-width: 0;
}
.pk-j-run .pk-actions { margin-top: 10px; }
.pk-j-ev { font-size: 13px; line-height: 1.45; color: var(--ink2); padding: 6px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.pk-j-ev.tone-err { color: var(--you); }

/* ---- the Report Studio -------------------------------------------------------------------------- */
.pk-rs-card { margin-top: 22px; padding: 18px 20px; background: var(--card); border-radius: 16px; box-shadow: var(--sh); min-width: 0; }
.pk-rs-q {
  font-family: var(--serif); font-variation-settings: "SOFT" 100; font-weight: 350;
  font-size: 19px; line-height: 1.3; color: var(--ink); margin: 8px 0; overflow-wrap: anywhere;
}
.pk-rs-headline.pk-btn {
  display: block; width: 100%; height: auto; text-align: left; white-space: normal; padding: 6px 0;
  font-family: var(--serif); font-size: 19px; line-height: 1.3; color: var(--ink); background: none; border: 0;
}
.pk-rs-compose { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; flex-wrap: wrap; }
.pk-rs .pk-btn { margin-top: 6px; }
.pk-rs .pk-actions .pk-btn { margin-top: 0; }

@container pk-page (min-width: 900px) {
  .pk-j-page { padding-top: 28px; }
}
@media (max-width: 480px) {
  .pk-j-page { padding: 16px 16px 40px; }
  .pk-j-tm { flex-basis: 40px; }
  .pk-j-ac { margin-left: 26px; }
}
