/* Shared parts every screen uses: page head, eyebrow, initials avatar, phone mock-up, wide layout.
   Tokens come from app.css. Macros that draw them are in templates/_kit.html. */

/* ---- page head: eyebrow, one-line headline, lede, actions on the right ---- */
.eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.phead { display: flex; flex-direction: column; gap: 14px; padding: 18px 4px 18px; }
.phead h1 { margin: 0 0 6px; text-wrap: balance; }
.phead .lede { margin: 0; max-width: 40em; color: var(--muted); text-wrap: pretty; }
.phead-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (min-width: 1024px) {
  .phead { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 32px; padding: 6px 0 22px; }
  .phead-acts { flex: none; justify-content: flex-end; }
}

/* ---- initials avatar (tone picked from the name, so a person keeps their colour everywhere) ---- */
.av { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  font-size: 12.5px; font-weight: 700; letter-spacing: .02em; color: #2B2F38; background: #ECE8DF; }
.av.sm { width: 28px; height: 28px; font-size: 11px; }
.av.lg { width: 44px; height: 44px; font-size: 15px; }
.av.t0 { background: #E3E9FF; color: #1D3BB8; }
.av.t1 { background: #FFE7D6; color: #9A3D00; }
.av.t2 { background: #DDF2E6; color: #145C38; }
.av.t3 { background: #F1E4FA; color: #6A2C91; }
.av.t4 { background: #FDF0C7; color: #7A5600; }
.av.t5 { background: #DDEFF5; color: #135B70; }

/* ---- phone mock-up: a real message thread, drawn as a phone ---- */
.phone { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.phone-frame { width: 272px; max-width: 100%; border-radius: 38px; background: #15171C; padding: 10px;
  box-shadow: 0 18px 40px rgba(21, 23, 28, .18); }
.phone-screen { background: #F2F2F7; border-radius: 29px; overflow: hidden; display: flex; flex-direction: column; min-height: 360px; }
.phone-head { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 12px 10px;
  background: rgba(249, 249, 251, .96); border-bottom: 1px solid #E1E1E6; text-align: center; }
.phone-head b { display: block; font-size: 12.5px; color: #111; }
.phone-head small { display: block; font-size: 11px; color: #6E6E73; }
.phone-body { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 12px 10px 14px; }
.phone-time { align-self: center; margin: 2px 0 4px; font-size: 10.5px; color: #8E8E93; }
.phone-msg { max-width: 82%; margin: 0; padding: 8px 11px; border-radius: 17px; font-size: 12.5px; line-height: 1.38;
  white-space: pre-line; overflow-wrap: anywhere; }
.phone-msg.in { align-self: flex-start; background: #E5E5EA; color: #111; border-bottom-left-radius: 5px; }
.phone-msg.out { align-self: flex-end; background: #2F7BF6; color: #fff; border-bottom-right-radius: 5px; }
.phone-msg.next { background: transparent; color: #3A3A3C; border: 1.5px dashed #9AA3B5; }
.phone-msg.out.next { color: #1D3BB8; border-color: #8FA6F5; }
.phone-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; padding: 0 10px 12px; }
.phone-chips > * { border: 1px solid #C7CDE0; background: #fff; color: #1D3BB8; border-radius: 999px; padding: 5px 10px;
  font-weight: 600; font-size: 11.5px; line-height: 1.2; font-family: inherit; }
.phone-chips button { cursor: pointer; }
.phone figcaption { max-width: 300px; text-align: center; font-size: 12.5px; color: var(--muted); }
.phone .sample-tag { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #9A3D00; }

/* ---- wide screens: a page opts in with {% block bodyclass %}wide{% endblock %} ---- */
@media (min-width: 1200px) {
  body.with-side.wide main { max-width: 1320px; }
  body.with-side.wide .flash, body.with-side.wide .testbar { max-width: 1240px; }
}

/* ---- (i) hints: a quiet icon, a small panel beside it (a bottom sheet on a phone) ---- */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hint { position: relative; display: inline; }
.hint-i { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; vertical-align: 0.1em;
  border-radius: 50%; color: #9A9DA6; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
h1 .hint-i { width: 26px; height: 26px; vertical-align: 0.18em; }
.hint-i svg { width: 18px; height: 18px; }
h1 .hint-i svg { width: 21px; height: 21px; }
.hint-i-sm { width: 20px; height: 20px; margin-left: 4px; }
.hint-i-sm svg { width: 16px; height: 16px; }
.hint-i:hover, .hint-i[aria-expanded="true"] { color: var(--blue); background: var(--blue-wash); }
.hint-i:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
/* where a phone tap needs more room than the icon (44px), the touch target grows without moving anything */
@media (pointer: coarse) { .hint-i { position: relative; } .hint-i::after { content: ""; position: absolute; inset: -10px; } }
.hint-pop { position: fixed; z-index: 60; display: block; width: 340px; max-width: calc(100vw - 16px); max-height: 70vh;
  overflow-y: auto; padding: 14px 16px 14px; background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 16px 40px rgba(21, 23, 28, .18); text-align: left;
  font: 400 14.5px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  letter-spacing: normal; text-transform: none; white-space: normal; overflow-wrap: anywhere; }
.hint-pop[hidden] { display: none; }
.hint-pop:focus { outline: none; }
.hint-pop-page { width: 420px; }
.hint-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin: 0 0 6px; }
.hint-k { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); padding-top: 2px; }
.hint-x { flex: none; margin: -6px -8px 0 0; width: 32px; height: 32px; border: 0; border-radius: 50%; background: none;
  color: var(--muted); font-weight: 400; font-size: 24px; line-height: 1; font-family: inherit; cursor: pointer; }
.hint-x:hover { background: var(--bg); color: var(--ink); }
.hint-what { display: block; color: var(--ink); }
.hint-h { display: block; margin: 12px 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.hint-do, .hint-tips { display: block; }
.hint-li { display: block; position: relative; padding: 6px 0 6px 14px; border-top: 1px solid var(--line); }
.hint-li:first-child { border-top: 0; }
.hint-li::before { content: ""; position: absolute; left: 0; top: 14px; width: 5px; height: 5px; border-radius: 50%; background: var(--blue); }
.hint-tips .hint-li::before { background: var(--tip); }
.hint-do b { display: block; font-weight: 650; }
.hint-do b + span { display: block; color: #3F434B; }
.hint-more { display: inline-block; margin-top: 10px; font-size: 13.5px; font-weight: 600; }
/* phone: a sheet from the bottom, above the tab bar */
.hint-pop.sheet { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: auto; max-width: none; max-height: 72vh;
  border-radius: 18px 18px 0 0; padding: 16px 18px calc(18px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -12px 40px rgba(21, 23, 28, .22); }
html.hint-sheet-open body::after { content: ""; position: fixed; inset: 0; z-index: 59; background: rgba(21, 23, 28, .28); }
