/* PDA Compass: phrase flipper (A03, reworked by X2 for fewer clicks). One-handed on a phone: the situation chips are
   one tap each and stay in view (a sticky side panel on desktop, a one-row scroll strip on phones), every flip is
   open, Copy and Save are one tap. Components come from css/site.css; this file is layout only. */

.h-info { display: inline-flex; vertical-align: middle; margin-left: var(--space-2, 8px); }
.small { font-size: 0.9em; }
.page-hero--flipper { padding-block: var(--space-6, 32px) var(--space-4, 16px); }
.page-hero--flipper .lede { margin-bottom: 0; }

/* ---------- the flipper: picker + flips */
.flipper { padding-block: var(--space-4, 16px) var(--space-7, 48px); }
.flipper__grid { display: grid; gap: var(--space-4, 16px); align-items: start; }
.flipper__main { min-width: 0; }
.picker { display: grid; gap: var(--space-3, 12px); min-width: 0; }
.picker__title { font-size: 1.1rem; margin: 0; display: inline-flex; align-items: center; min-height: 44px; }
.sit-scroll { min-width: 0; max-width: 100%; }
.sit-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2, 8px); }
.sit-chip { min-height: 44px; gap: 8px; white-space: nowrap; padding-inline: 12px 14px; }
.sit-chip__icon { display: inline-flex; color: var(--accent, #2f6f6a); flex: none; }
.sit-chip[aria-pressed="true"] .sit-chip__icon { color: inherit; }
.sit-chip__icon svg { width: 22px; height: 22px; }
.sit-chip__label { line-height: 1.2; }
.sit-chip__n { font-weight: 400; font-size: 0.8em; opacity: 0.8; font-variant-numeric: tabular-nums; }
.sit-chip.is-zero { opacity: 0.6; }
.sit-chip:focus-visible { outline: 3px solid var(--focus, #ffbf47); outline-offset: 2px; }
#flip-h, .flip-card { scroll-margin-top: calc(var(--header-h, 72px) + 12px); }

/* phones and tablets: one scrolling strip, bled to the screen edges, so the chips never push the flips down */
@media (max-width: 1079px) {
  .sit-scroll { overflow-x: auto; overflow-y: hidden; margin-inline: calc(-1 * var(--space-4, 16px)); padding-inline: var(--space-4, 16px); padding-bottom: 4px; scroll-snap-type: x proximity; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .sit-chips { flex-wrap: nowrap; width: max-content; }
  .sit-chip { scroll-snap-align: start; }
}
@media (min-width: 720px) and (max-width: 1079px) { .sit-scroll { margin-inline: calc(-1 * var(--space-6, 32px)); padding-inline: var(--space-6, 32px); } }
/* desktop: a side panel that floats under the site header, all 18 moments visible, flips beside it */
@media (min-width: 1080px) {
  .flipper__grid { grid-template-columns: 420px minmax(0, 1fr); gap: var(--space-6, 32px); }
  /* compact enough to fit an 800px-tall screen under the 112px header; overflow-y is the safety net on shorter ones */
  .picker { position: sticky; top: calc(var(--header-h, 72px) + var(--space-2, 8px)); max-height: calc(100vh - var(--header-h, 72px) - var(--space-4, 16px)); overflow-y: auto; gap: var(--space-2, 8px); background: var(--surface, #fff); border: 1px solid var(--line, #d9d4cc); border-radius: var(--radius-l, 16px); padding: var(--space-3, 12px); box-shadow: var(--shadow-1, 0 2px 8px rgba(0,0,0,.06)); }
  .picker__title { font-size: 1rem; min-height: 36px; }
  .sit-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .sit-chip { width: 100%; min-height: 40px; white-space: normal; text-align: left; justify-content: flex-start; padding: 4px 8px; font-size: 0.8125rem; gap: 6px; }
  .sit-chip__icon svg { width: 18px; height: 18px; }
  .sit-chip__label { flex: 1; line-height: 1.15; }
  .sit-chip__n { display: none; } /* the count is in each chip's "i" and in the status line; dropping it keeps labels on two lines */
  .age-row { gap: 6px 10px; }
}

/* ---------- age stepper */
.age-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2, 8px) var(--space-3, 12px); }
.age-row__title { font-weight: 700; display: inline-flex; align-items: center; }
.stepper { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2, 8px); }
.stepper__btn { width: 44px; height: 44px; border: 1px solid var(--line-strong, #c9c3ba); border-radius: var(--radius-s, 8px); background: var(--surface, #fff); color: var(--ink, #1f1d1a); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.stepper__btn:hover { background: var(--surface-2, #f6f3ee); }
.stepper__btn:focus-visible, #age-input:focus-visible { outline: 3px solid var(--focus, #ffbf47); outline-offset: 2px; }
.stepper__value input { width: 4.5rem; height: 44px; text-align: center; font: inherit; font-size: 1.15rem; border: 1px solid var(--line-strong, #c9c3ba); border-radius: var(--radius-s, 8px); background: var(--surface, #fff); color: var(--ink, #1f1d1a); }
.stepper__out { font-weight: 600; }
.btn { min-height: 44px; }

/* ---------- the flips: every one for the moment, stacked */
.flips__head { margin-bottom: var(--space-4, 16px); }
.flips__head h2 { margin-bottom: var(--space-1, 4px); }
.flips__head p { margin: 0; }
.default-note { margin-top: var(--space-1, 4px) !important; }
.flip-list > * + * { margin-top: var(--space-5, 24px); }
.flip-card__body { gap: var(--space-3, 12px); }
.flip-card .card__meta { align-items: center; gap: var(--space-2, 8px); }
.flip-card__instead { font-size: 1.25rem; font-weight: 700; }
.flip-card__instead q { font-style: normal; }
.flip-card__options { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3, 12px); }
.option { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "head actions" "text actions" "note actions"; gap: 4px var(--space-3, 12px); align-items: start; padding: var(--space-3, 12px); border: 1px solid var(--line, #d9d4cc); border-radius: var(--radius-m, 12px); background: var(--surface-2, #f6f3ee); }
.option__head { grid-area: head; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.option__text { grid-area: text; margin: 0; font-size: 1.15rem; }
.option__text q { font-style: normal; }
.option__note { grid-area: note; margin: 0; }
.option__actions { grid-area: actions; align-self: center; }
.copy-btn { min-width: 76px; min-height: 44px; }
.copy-btn.is-copied { background: var(--ok, #2e7d32); color: #fff; border-color: var(--ok, #2e7d32); }
.badge--style { background: var(--accent-soft, #e4f0ee); color: var(--accent, #2f6f6a); }
.badge--do { background: var(--warm-soft, #fbeedd); color: var(--ink, #1f1d1a); }
.option--action { background: var(--surface, #fff); border-style: dashed; }
.option__text--action { font-style: italic; }
.option__text--action em { font-style: italic; font-weight: 700; }
.flip-card__why { font-size: 0.95rem; }
.flip-card__actions { justify-content: flex-start; gap: var(--space-2, 8px); }
.flip-card__actions .save, .flip-card__actions .btn { min-height: 44px; }
.save-btn[aria-pressed="true"] { background: var(--accent-soft, #e4f0ee); border-color: var(--accent, #2f6f6a); }
.age-more { margin-top: var(--space-4, 16px); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2, 8px); }
.honest-note { margin-top: var(--space-5, 24px); }
.honest-note #honesty p { margin: var(--space-3, 12px) 0 0; }
.empty-state { display: grid; gap: var(--space-3, 12px); justify-items: start; text-align: left; }

/* ---------- styles (secondary: one closed summary) */
.styles-details { margin: 0; }
.styles-details > summary { font-size: 1.15rem; min-height: 56px; }
.styles-details .lede { margin-top: 0; }
.styles { list-style: none; padding: 0; margin: var(--space-4, 16px) 0; }
.style-card { padding: var(--space-4, 16px); display: grid; gap: var(--space-2, 8px); }
.style-card .card__title { display: flex; align-items: center; gap: 6px; font-size: 1.1rem; }
.style-card p { margin: 0; }

@media (max-width: 480px) {
  .option { grid-template-columns: 1fr; grid-template-areas: "head" "text" "note" "actions"; }
  .option__actions { justify-self: end; }
  .flip-card__instead { font-size: 1.15rem; }
}
@media (prefers-reduced-motion: reduce) { .sit-scroll { scroll-behavior: auto; } }
@media print { .picker, .flip-card__actions, .option__actions, .it-btn { display: none !important; } }
