/* journal.css — the 2.0 Journal screens. Loaded after shell.css. Same rules
 * as shell.css: 2.0 token names only, no raw hex, no prefers-color-scheme,
 * no fixed phone-width px widths (OPEN-QUESTIONS #24), every selector rooted
 * in a v2- class. Accent comes from the skill scope ([data-skill="journal"]).
 */

/* ---- library + calendar ---- */

.v2-jlib {
  position: relative; /* the pull-to-refresh disc hangs above it */
}
.v2-jlib .ptr__disc {
  background: var(--s-card);
  border: 1px solid var(--raised-line);
  box-shadow: var(--sh-raised);
  color: var(--accent);
}
.v2-jlib .ptr__label {
  color: var(--accent-ink);
}

/* quiet states */
.v2-jlib__quiet {
  margin: 4px 2px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--t-muted);
}
.v2-jlib__retry {
  align-self: flex-start;
  min-height: var(--hit-min);
  padding: 0 18px;
  border-radius: var(--r2-round);
  border: 1px solid var(--raised-line);
  background: var(--s-card);
  box-shadow: var(--sh-raised);
  color: var(--accent-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 620;
}
.v2-jlib__empty {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 16px;
  border-radius: var(--r2-bigcard);
  background: var(--s-card);
  border: 1px solid var(--raised-line);
  box-shadow: var(--sh-raised);
}
.v2-jlib__emptyh {
  margin: 0;
  font-size: 16px;
  font-weight: 680;
  letter-spacing: -0.3px;
  color: var(--t-primary);
}
.v2-jlib__emptyp {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--t-muted);
}

/* toolbar: the filter popover hangs under the sort | filter pill */
.v2-jlib__bar {
  position: relative;
}
.v2-jlib__filter {
  position: relative;
}
.v2-jlib__filter.is-active {
  color: var(--accent-ink);
}
.v2-jlib__filter.is-active::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--s-card);
}
.v2-jlib__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: min(16rem, 80%);
  max-height: 60vh;
  overflow-y: auto;
  padding: 6px;
  /* surface + row text: .v2-pop (shell.css) */
  display: flex;
  flex-direction: column;
}
.v2-jlib__opt {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--hit-min);
  padding: 0 12px;
  border: 0;
  border-radius: var(--r2-well);
  background: none;
  color: var(--t-primary);
  font: inherit;
  text-align: left;
}
.v2-jlib__opt.is-on {
  background: var(--accent-tint);
  color: var(--accent-ink);
  font-weight: 620;
}
.v2-jlib__check {
  margin-left: auto;
  display: flex;
}
.v2-jlib__menurule {
  border: 0;
  height: 1px;
  margin: 4px 8px;
  background: var(--strip-line);
}
.v2-jlib__active {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -4px;
  font-size: 12.5px;
  color: var(--t-muted);
}
.v2-jlib__active[hidden] {
  display: none;
}
.v2-jlib__clear {
  margin-left: auto;
  min-height: var(--hit-min);
  padding: 0 2px 0 12px;
  border: 0;
  background: none;
  color: var(--accent-ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 620;
}

/* sections */
.v2-jlib__results {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.v2-jlib__section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.v2-jlib__cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* the entry card (board Journal) */
.v2-jcard {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--r2-bigcard);
  background: var(--s-card);
  border: 1px solid var(--raised-line);
  box-shadow: var(--sh-raised);
  color: var(--t-primary);
  text-decoration: none;
  min-width: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
.v2-jcard:active {
  opacity: 0.85;
}
.v2-jcard.is-unviewed {
  border-color: var(--accent-tint-line);
}
.v2-jcard__row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.v2-jcard__kind,
.v2-jcard__new {
  height: 23px;
  padding: 0 9px;
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  flex: none;
}
.v2-jcard__kind {
  background: var(--s-chip);
  color: var(--t-nav);
}
.v2-jcard__new {
  background: var(--accent);
  color: var(--on-accent);
}
.v2-jcard__tags {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}
.v2-jcard .v2-tag {
  height: 23px;
  padding: 0 10px;
  border-radius: 12px;
  background: var(--s-card);
  border: 1px solid var(--raised-line);
  box-shadow: var(--sh-raised);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 640;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v2-jcard .v2-jcard__moretags {
  flex: none;
  color: var(--t-muted);
}
.v2-jcard__stamp {
  margin-left: auto;
  padding-left: 4px;
  font-size: 12px;
  color: var(--t-label);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex: none;
}
/* Item 27: the time of day on its own line under the title. */
.v2-jcard__when {
  margin: -0.3em 0 0;
  font-size: 0.78rem;
  color: var(--t-label);
  font-variant-numeric: tabular-nums;
}
.v2-jcard__title {
  margin: 0;
  font-size: 17px;
  font-weight: 680;
  letter-spacing: -0.4px;
  line-height: 1.25;
  color: var(--t-primary);
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.v2-jcard__preview {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--t-muted);
  text-wrap: pretty;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* processing / held / failed / saving: the status line replaces the preview */
.v2-jcard__status {
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--accent-ink);
}
.v2-jcard.is-held .v2-jcard__status {
  color: var(--t-muted);
}
.v2-jcard.is-failed .v2-jcard__status {
  color: var(--danger);
}
.v2-jcard__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
  margin-top: 0.4em;
}
.v2-jcard__spin {
  flex: none;
  margin-top: 0.15em;
  color: var(--accent);
  animation: v2-jlib-spin 0.9s linear infinite;
}
.v2-jcard.is-processing .v2-jcard__title,
.v2-jcard.is-saving .v2-jcard__title {
  color: var(--t-body);
}

/* photo row: up to three square thumbs + a "+N" tile */
.v2-jcard__photos {
  display: flex;
  gap: 8px;
  padding-top: 2px;
}
.v2-jcard__thumb,
.v2-jcard__more {
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: var(--s-chip);
  border: 1px solid var(--raised-line);
  box-shadow: var(--sh-raised);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  box-sizing: border-box;
}
.v2-jcard__ph {
  display: flex;
  color: var(--t-dim);
}
.v2-jcard__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 160ms ease;
}
.v2-jcard__thumb.has-img .v2-jcard__img {
  opacity: 1;
}
.v2-jcard__thumb.has-img .v2-jcard__ph {
  visibility: hidden;
}
.v2-jcard__more {
  width: auto;
  padding: 0 9px;
  color: var(--t-muted);
  font-size: 12px;
  font-weight: 640;
  font-variant-numeric: tabular-nums;
}

/* calendar (board JournalCalendar) */
.v2-jcal__nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.v2-jcal__arrow {
  width: 40px;
  height: 40px;
  border-radius: var(--r2-round);
  background: var(--s-card);
  border: 1px solid var(--raised-line);
  box-shadow: var(--sh-raised);
  color: var(--t-nav);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex: none;
  position: relative;
}
.v2-jcal__arrow::after {
  content: "";
  position: absolute;
  inset: -2px;
}
.v2-jcal__title {
  margin: 0;
  flex: 1 1 auto;
  text-align: center;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--t-primary);
}
.v2-jcal__cal {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.v2-jcal__week,
.v2-jcal__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}
.v2-jcal__wd {
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--t-placeholder);
}
.v2-jcal__blank {
  height: 44px;
}
.v2-jcal__day {
  height: 44px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: none;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font: inherit;
  font-size: 14px;
  font-weight: 540;
  color: var(--t-placeholder);
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
}
.v2-jcal__dot {
  width: 5px;
  height: 5px;
  border-radius: 3px;
}
.v2-jcal__day.has-entries {
  color: var(--t-primary);
  font-weight: 700;
}
.v2-jcal__day.has-entries .v2-jcal__dot {
  background: var(--accent);
}
.v2-jcal__day.is-today {
  color: var(--accent-ink);
  font-weight: 700;
}
.v2-jcal__day.is-selected {
  background: var(--accent-tint);
  border-color: var(--accent-tint-line);
  box-shadow: var(--sh-raised);
  color: var(--accent-ink);
  font-weight: 680;
}
.v2-jcal__rule {
  border: 0;
  height: 1px;
  margin: 0;
  background: var(--strip-line);
}
.v2-jcal__day-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.v2-jcal__sum {
  display: flex;
  align-items: center;
  gap: 8px;
}
.v2-jcal__dayh,
.v2-jcal__dayn {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.1px;
  color: var(--t-label);
}
.v2-jcal__dayn {
  color: var(--t-dim);
}
.v2-jcal__month {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--t-nav-off);
}

@keyframes v2-jlib-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- write an entry (JournalWrite) + Settings → Journal ---- */
.v2-jw__body {
  min-height: 9rem;
}
.v2-jw__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.v2-jw__tag {
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 570;
}
.v2-jw__tag:not(.is-on) {
  background: var(--s-chip);
  border-color: var(--raised-line);
  color: var(--t-muted);
}
.v2-jw__add {
  width: 28px;
  height: 28px;
  padding: 0;
  justify-content: center;
  border-radius: var(--r2-round);
}
.v2-jw__picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
}
.v2-jw__pickchips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.v2-jw__none {
  font-size: 13px;
  color: var(--t-dim);
}
.v2-jw__newbtn {
  align-self: flex-start;
}
/* Thumbnails, then the shared Add a photo control (detail.css .v2-dph-add)
 * — the entry screen's 9px rhythm between them. */
.v2-jw__photoblock {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.v2-jw__photos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.v2-jw__ph {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: var(--r2-well);
  background: var(--s-card);
  border: 1px solid var(--raised-line);
  box-shadow: var(--sh-raised);
  color: var(--t-dim);
  overflow: hidden;
}
.v2-jw__ph img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.v2-jw__phx {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: var(--r2-round);
  background: var(--scrim);
  color: var(--on-accent);
  cursor: pointer;
}
.v2-jset__chips {
  align-items: center;
}
.v2-jset__edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.v2-jset__input {
  width: auto;
  max-width: 12rem;
  height: 32px;
  padding: 0 10px;
  font-size: 13.5px;
}
.v2-jset__icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--raised-line);
  border-radius: var(--r2-round);
  background: var(--s-chip);
  color: var(--accent-ink);
  cursor: pointer;
}
.v2-jset__icon.is-danger {
  color: var(--danger);
}
.v2-jset__seg .v2-seg {
  flex: 1 1 100%;
}

/* Batch 22 §4 (Randy 2026-10-17): the salvage sheet opened from the Journal
 * library (the "The app crashed or was closed while recording" card) is the Meetings
 * library's sheet (meetings/recovery.js) on <body>, carrying the section it
 * was opened from (ui.js openBottomSheet → data-skill). Its legacy buttons
 * read --pink, so the Journal library gives the panel this class and it
 * re-values --pink to the section token — the recording screen's and the
 * detail's precedent — so Save / Remove come out Journal blue; a Meetings
 * sheet is untouched. */
.v2-jlib__recover {
  --pink: var(--accent);
}
