/* Portal v4, stage B2 (17 Nov 2026): the owner's phone opens into Holly (phone4.js).
   Apple finish per ~/holly/design/portal-desk/10-80-10-plan-v4.md: translucent bars, large
   titles on list screens, grouped inset lists (white, radius 10, on the page grey) with
   inset separators, circular monograms, iOS type sizes (17 / 15 / 13), 44 px targets, one
   prominent button, no uppercase labels, rails, pills or gradients. Only while html.p4-on
   (PORTAL_V4 'owner', the owner as himself, the iPhone look); off, none of this applies. */
html.p4-on {
  --p4-ink: #111; --p4-mute: #6E6E68; --p4-bg: #F4F4EF; --p4-card: #fff; --p4-fill: #E9E9E3; --p4-sep: #DADAD3;
  --p4-y: #F5C500; --p4-link: #8A6D00; --p4-red: #D6362B; --p4-mono: #E3E3DC; --p4-bar: rgba(244,244,239,.85);
  --p4-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

/* no tab bar and no centre button; the thread fills the screen to the home indicator */
html.p4-on #mobile-bottom-nav, html.p4-on #mobile-more-sheet { display: none !important; }
html.p4-on.tp-ios-app #view-holly .hc { height: calc(100dvh - env(safe-area-inset-top) - var(--kbd-inset, 0px)); }
html.p4-on #holly-chat.p4-thread .hc-composer { padding: 6px 12px max(8px, calc(env(safe-area-inset-bottom) - var(--kbd-inset, 0px))); }

/* the Holly header: ‹ Chats (n) · Holly + thread ⌄ · Files, on a translucent bar */
html.p4-on #holly-chat .p4-nav { position: sticky; top: 0; z-index: 4; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
  min-height: 52px; padding: 2px 6px; background: var(--p4-bar); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); font-family: var(--p4-font); }
html.p4-on #holly-chat .p4-holly-nav { min-height: 58px; flex: none; }
html.p4-on #holly-chat .p4-nb { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; gap: 1px; padding: 0 8px; background: none; border: 0;
  color: var(--p4-link); font: 17px/1.2 var(--p4-font); cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
html.p4-on #holly-chat .p4-nb.is-left { justify-self: start; padding-left: 4px; }
html.p4-on #holly-chat .p4-nb.is-right { justify-self: end; }
html.p4-on #holly-chat .p4-nb.is-icon { justify-content: center; }
html.p4-on #holly-chat .p4-nb .p4-i { width: 24px; height: 24px; stroke-width: 2.1; }
html.p4-on #holly-chat .p4-nb.is-icon .p4-i { width: 26px; height: 26px; stroke-width: 1.9; }
html.p4-on #holly-chat .p4-nb span { overflow: hidden; text-overflow: ellipsis; }
html.p4-on #holly-chat .p4-tt { display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 44px; max-width: 190px; padding: 2px 4px; background: none; border: 0;
  color: var(--p4-ink); font-family: var(--p4-font); cursor: pointer; }
html.p4-on #holly-chat .p4-tt1 { display: flex; align-items: center; gap: 7px; }
html.p4-on #holly-chat .p4-tt1 b { font-size: 17px; font-weight: 600; }
html.p4-on #holly-chat .p4-hav { width: 26px; height: 26px; border-radius: 50%; background: var(--p4-y); color: var(--p4-ink); display: grid; place-items: center; }
html.p4-on #holly-chat .p4-hav .p4-i { width: 15px; height: 15px; stroke-width: 1.9; }
html.p4-on #holly-chat .p4-tt2 { display: flex; align-items: center; gap: 2px; max-width: 100%; font-size: 13px; color: var(--p4-mute); }
html.p4-on #holly-chat .p4-tt2 span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.p4-on #holly-chat .p4-tt2 .p4-i { width: 14px; height: 14px; flex: none; }
html.p4-on #holly-chat .p4-nt { justify-self: center; font-size: 17px; font-weight: 600; color: var(--p4-ink); white-space: nowrap; }
html.p4-on #holly-chat .p4-i { flex: none; width: 20px; height: 20px; }
html.p4-on #holly-chat.p4-thread .ck-strip { padding-left: 18px; }

/* the screens over the thread: Threads, Go through them, Job, Chats, Files, File under */
html.p4-on #holly-chat .p4-layer { position: fixed; inset: 0; z-index: 70; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: env(safe-area-inset-top) 0 0; background: var(--p4-bg); color: var(--p4-ink); font-family: var(--p4-font); font-size: 17px; line-height: 1.3; text-align: left; }
html.p4-on #holly-chat.p4-covered > :not(.p4-layer) { visibility: hidden; }
html.p4-on #holly-chat .p4-screen { min-height: 100%; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); box-sizing: border-box; }
html.p4-on #holly-chat .p4-nav.is-large { background: var(--p4-bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
html.p4-on #holly-chat .p4-lt { margin: 0 16px 10px; font-size: 34px; line-height: 1.15; font-weight: 700; letter-spacing: -0.4px; }
html.p4-on #holly-chat .p4-search { display: flex; align-items: center; gap: 6px; height: 38px; margin: 0 16px 18px; padding: 0 10px; border-radius: 10px; background: rgba(118,118,128,.12); color: var(--p4-mute); }
html.p4-on #holly-chat .p4-search .p4-i { width: 18px; height: 18px; }
html.p4-on #holly-chat .p4-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--p4-ink); font: 17px var(--p4-font); -webkit-appearance: none; appearance: none; }
html.p4-on #holly-chat .p4-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
html.p4-on #holly-chat .p4-search input:focus, html.p4-on #holly-chat .p4-search input:focus-visible, html.p4-on #holly-chat .p4-row.is-input input:focus, html.p4-on #holly-chat .p4-row.is-input input:focus-visible { outline: 0; box-shadow: none; border: 0; }
html.p4-on #holly-chat .p4-body { padding: 0 16px 28px; }
html.p4-on #holly-chat .p4-sec { margin: 0 0 24px; }
html.p4-on #holly-chat .p4-sh { margin: 0 16px 7px; font-size: 13px; font-weight: 400; color: var(--p4-mute); }
html.p4-on #holly-chat .p4-group { background: var(--p4-card); border-radius: 10px; overflow: hidden; }
html.p4-on #holly-chat .p4-sf { margin: 7px 16px 0; font-size: 13px; line-height: 1.35; color: var(--p4-mute); }
html.p4-on #holly-chat .p4-sf.is-solo { margin: 0 16px 24px; }
html.p4-on #holly-chat .p4-empty { margin: 24px 16px; font-size: 15px; color: var(--p4-mute); text-align: center; }
html.p4-on #holly-chat .p4-empty.is-in { margin: 0; padding: 14px 16px; text-align: left; }
html.p4-on #holly-chat .p4-lead { margin: 4px 32px 18px; font-size: 15px; color: var(--p4-mute); }
html.p4-on #holly-chat .p4-lead span { color: var(--p4-mute); }

/* rows: avatar, two lines, time; separators inset after the avatar, like iOS */
html.p4-on #holly-chat .p4-row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; margin: 0; padding: 11px 16px; box-sizing: border-box;
  background: none; border: 0; border-radius: 0; color: var(--p4-ink); font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
html.p4-on #holly-chat .p4-row:active { background: #EDEDE8; }
html.p4-on #holly-chat .p4-row + .p4-row::before { content: ''; position: absolute; top: 0; left: 68px; right: 0; height: 1px; transform: scaleY(.5); transform-origin: top; background: var(--p4-sep); }
html.p4-on #holly-chat .p4-row.is-nav + .p4-row.is-nav::before { left: 52px; }
html.p4-on #holly-chat .p4-row.is-step + .p4-row.is-step::before { left: 52px; }
html.p4-on #holly-chat .p4-row.is-more + .p4-row::before, html.p4-on #holly-chat .p4-row + .p4-row.is-more::before { left: 16px; }
html.p4-on #holly-chat .p4-av { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--p4-mono); color: var(--p4-mute);
  font-size: 15px; font-weight: 600; }
html.p4-on #holly-chat .p4-av .p4-i { width: 20px; height: 20px; }
html.p4-on #holly-chat .p4-av.is-holly { background: var(--p4-y); color: var(--p4-ink); }
html.p4-on #holly-chat .p4-dot { position: absolute; left: 4px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--p4-y); }
html.p4-on #holly-chat .p4-rm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
html.p4-on #holly-chat .p4-r1 { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
html.p4-on #holly-chat .p4-r1 b { min-width: 0; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.p4-on #holly-chat .p4-tag { flex: none; font-size: 15px; color: var(--p4-mute); }
html.p4-on #holly-chat .p4-rt { flex: none; margin-left: auto; padding-left: 6px; font-size: 15px; color: var(--p4-mute); font-variant-numeric: tabular-nums; }
html.p4-on #holly-chat .p4-r2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
html.p4-on #holly-chat .p4-rs { flex: 1; min-width: 0; font-size: 15px; color: var(--p4-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.p4-on #holly-chat .p4-row.is-cur .p4-rs, html.p4-on #holly-chat .p4-dot ~ .p4-rm .p4-rs { color: #3C3C38; }
html.p4-on #holly-chat .p4-cnt { flex: none; font-size: 15px; color: var(--p4-mute); font-variant-numeric: tabular-nums; }
html.p4-on #holly-chat .p4-cnt.is-red { min-width: 22px; height: 22px; padding: 0 6px; box-sizing: border-box; border-radius: 11px; display: grid; place-items: center; background: var(--p4-red); color: #fff; font-size: 13px; font-weight: 600; }
html.p4-on #holly-chat .p4-chev { width: 14px; height: 14px; color: #BDBDB5; stroke-width: 2.2; }
html.p4-on #holly-chat .p4-tick { width: 20px; height: 20px; color: var(--p4-link); stroke-width: 2.2; }
html.p4-on #holly-chat .p4-ic { flex: none; width: 24px; display: grid; place-items: center; color: #3C3C38; }
html.p4-on #holly-chat .p4-ic .p4-i { width: 22px; height: 22px; stroke-width: 1.6; }
html.p4-on #holly-chat .p4-row.is-nav b { font-weight: 400; }
html.p4-on #holly-chat .p4-row.is-pick b { font-weight: 400; }
html.p4-on #holly-chat .p4-row.is-more { min-height: 44px; }
html.p4-on #holly-chat .p4-link { color: var(--p4-link); font-size: 15px; }
html.p4-on #holly-chat .p4-row.is-input { cursor: default; }
html.p4-on #holly-chat .p4-row.is-input input { flex: 1; min-width: 0; height: 40px; border: 0; outline: 0; background: transparent; font: 17px var(--p4-font); color: var(--p4-ink); }
html.p4-on #holly-chat .p4-mute { color: var(--p4-mute); font-weight: 400; }

/* the needs-you items with no card: one quiet row under "N waiting", scrolling with the thread */
html.p4-on #holly-chat .ck-waitwrap { display: flex; flex-direction: column; gap: 0; }
html.p4-on #holly-chat .ck-also { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 44px; margin: -4px 0 0; padding: 0 4px; background: none; border: 0;
  color: var(--p4-mute); font: 15px/1.3 var(--p4-font); text-align: left; cursor: pointer; }
html.p4-on #holly-chat .ck-also span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.p4-on #holly-chat .ck-also .p4-i { width: 14px; height: 14px; color: #BDBDB5; stroke-width: 2.2; }
html.p4-on #holly-chat .p4-need .ck-eb svg { width: 14px; height: 14px; }

/* Go through them: 1 of 3, the card large, its actions at the foot */
html.p4-on #holly-chat .p4-bars { display: flex; gap: 4px; padding: 0 16px 12px; }
html.p4-on #holly-chat .p4-bars i { flex: 1; height: 3px; border-radius: 2px; background: #D9D9D2; }
html.p4-on #holly-chat .p4-bars i.on { background: var(--p4-ink); }
html.p4-on #holly-chat .p4-body.is-step { flex: 1; padding-bottom: 16px; }
html.p4-on #holly-chat .p4-body.is-step .ck-card { padding: 16px 16px 18px; gap: 4px; }
html.p4-on #holly-chat .p4-body.is-step .ck-ct { font-size: 22px; line-height: 1.25; font-weight: 600; margin: 4px 0 6px; }
html.p4-on #holly-chat .p4-body.is-step .ck-cd { font-size: 17px; color: var(--p4-ink); line-height: 1.35; }
html.p4-on #holly-chat .p4-body.is-step .ck-facts { font-size: 15px; gap: 4px; margin-top: 8px; }
html.p4-on #holly-chat .p4-body.is-step .ck-q { max-width: none; align-self: stretch; border-radius: 14px; padding: 16px; }
html.p4-on #holly-chat .p4-body.is-step .ck-qt { font-size: 20px; font-weight: 600; }
html.p4-on #holly-chat .p4-nextline { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0 0; min-height: 44px; }
html.p4-on #holly-chat .p4-nextline .p4-nb { padding-left: 0; font-size: 15px; }
html.p4-on #holly-chat .p4-nextline .p4-nb .p4-i { width: 18px; height: 18px; }
html.p4-on #holly-chat .p4-nx { flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 0 0 0 8px; background: none; border: 0;
  color: var(--p4-ink); font: 15px var(--p4-font); cursor: pointer; text-align: right; }
html.p4-on #holly-chat .p4-nx b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
html.p4-on #holly-chat .p4-nxn { flex: none; margin-left: 8px; }
html.p4-on #holly-chat .p4-foot { position: sticky; bottom: 0; padding: 10px 16px max(12px, env(safe-area-inset-bottom)); background: var(--p4-bg); }
html.p4-on #holly-chat .p4-foot .ck-acts { flex-wrap: wrap; gap: 10px; margin: 0; }
html.p4-on #holly-chat .p4-foot .ck-acts .ck-btn { flex: 1 1 0; height: 50px; border-radius: 25px; font-size: 17px; font-weight: 600; }
html.p4-on #holly-chat .p4-foot .ck-acts .ck-btn.is-p { flex: 1 1 100%; background: var(--p4-y); color: var(--p4-ink); }
html.p4-on #holly-chat .p4-foot .ck-acts .ck-btn.is-plain { background: var(--p4-fill); color: var(--p4-ink); }
html.p4-on #holly-chat .p4-foot .ck-foot { text-align: center; margin-top: 8px; }
html.p4-on #holly-chat .p4-foot .ck-btn.is-block { width: 100%; height: 50px; border-radius: 25px; font-size: 17px; background: var(--p4-y); color: var(--p4-ink); }
html.p4-on #holly-chat .p4-done { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 32px; text-align: center; }
html.p4-on #holly-chat .p4-done h2 { margin: 14px 0 6px; font-size: 22px; font-weight: 600; }
html.p4-on #holly-chat .p4-done p { margin: 0; font-size: 15px; color: var(--p4-mute); }
html.p4-on #holly-chat .p4-bigtick { width: 54px; height: 54px; padding: 12px; border-radius: 50%; background: var(--p4-fill); color: var(--p4-ink); box-sizing: border-box; stroke-width: 2.2; }

/* the Job view: done / now / next and the action log */
html.p4-on #holly-chat .p4-jt { margin: 4px 0 6px; font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -0.4px; }
html.p4-on #holly-chat .p4-jl { position: relative; display: flex; align-items: center; gap: 8px; margin: 0 0 22px; font-size: 15px; color: var(--p4-mute); }
html.p4-on #holly-chat .p4-jl .p4-dot, html.p4-on #holly-chat .p4-lk .p4-dot { position: static; margin: 0; flex: none; }
html.p4-on #holly-chat .p4-jp { margin: -12px 0 22px; font-size: 15px; color: var(--p4-mute); }
html.p4-on #holly-chat .p4-row.is-step { cursor: default; align-items: flex-start; }
html.p4-on #holly-chat .p4-row.is-step:active { background: none; }
html.p4-on #holly-chat .p4-sg { flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; box-sizing: border-box; border: 1.5px solid #C9C9C1; display: grid; place-items: center; font-size: 13px; }
html.p4-on #holly-chat .p4-sg .p4-i { width: 14px; height: 14px; stroke-width: 2.4; }
html.p4-on #holly-chat .p4-sg.is-done { background: var(--p4-ink); border-color: var(--p4-ink); color: #fff; }
html.p4-on #holly-chat .p4-sg.is-now { background: var(--p4-y); border-color: var(--p4-y); }
html.p4-on #holly-chat .p4-sg.is-failed { border-color: var(--p4-red); color: var(--p4-red); font-weight: 600; }
html.p4-on #holly-chat .p4-st { min-width: 0; font-size: 17px; }
html.p4-on #holly-chat .p4-row.is-next .p4-st, html.p4-on #holly-chat .p4-row.is-skipped .p4-st { color: var(--p4-mute); }
html.p4-on #holly-chat .p4-row.is-step .p4-rs { white-space: normal; }
html.p4-on #holly-chat .p4-logs { list-style: none; margin: 0; padding: 0 16px; }
html.p4-on #holly-chat .p4-log { margin: 0 0 14px; }
html.p4-on #holly-chat .p4-lk { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--p4-mute); margin-bottom: 2px; }
html.p4-on #holly-chat .p4-lt2 { font-size: 17px; line-height: 1.35; }

/* Files */
html.p4-on #holly-chat .p4-files { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
html.p4-on #holly-chat .p4-file { display: flex; flex-direction: column; gap: 4px; }
html.p4-on #holly-chat .p4-file .ck-file { max-width: none; box-shadow: none; }
html.p4-on #holly-chat .p4-fat { font-size: 13px; color: var(--p4-mute); padding-left: 4px; }

/* every other screen: a plain way back to Chats at its top (the tab bar is gone). Below the
   level pushed pages use (the tab bar's 50), so a page with its own back covers it. */
html:not(.p4-on.p4-away) .p4-backbar { display: none !important; }
html.p4-on.p4-away .p4-backbar { position: fixed; top: 0; left: 0; right: 0; z-index: 45; display: flex; align-items: center; padding: env(safe-area-inset-top) 6px 0;
  background: var(--p4-bar); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
html.p4-on.p4-away .p4-backbar[hidden] { display: none; }
@media (max-width: 768px) {
  html.p4-on.tp-ios-app .app-main { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  html.p4-on.p4-away.tp-ios-app .app-main { padding-top: calc(52px + env(safe-area-inset-top)); }
  /* Holly edge to edge, like Messages */
  html.p4-on.p4-in-holly.tp-ios-app .app-main { padding: env(safe-area-inset-top) 0 0; }
}
html.p4-on .p4-backbtn { min-height: 44px; display: inline-flex; align-items: center; gap: 1px; padding: 0 8px 0 4px; background: none; border: 0; color: var(--p4-link);
  font: 17px var(--p4-font); cursor: pointer; }
html.p4-on .p4-backbtn .p4-i { width: 24px; height: 24px; stroke-width: 2.1; }
