/* The web phone layout: a browser window under 640 px, following mobile.html.
   It applies when .app has data-phone="true" (docked mode on the web); the desktop's docked window is unchanged.
   Tokens only, as in frame.css: no color-mix, no gradients, full outlines. */

/* ---------- frame: app bar on top, page, tab bar at the foot */
.app[data-phone="true"] { position: relative; }
.app[data-phone="true"] .page { padding: 12px 12px 96px; }
.app[data-phone="true"] #tabbar-host { position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; }

.hdr-phone { position: relative; border-bottom: 1px solid var(--line); background: var(--bg); }
.pbar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 56px; }
.pb-logo { width: 28px; height: 28px; border-radius: var(--r-sm); flex: none; }
.pt { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; text-align: left; color: var(--text); }
button.pt { cursor: pointer; }
button.pt > svg { flex: none; color: var(--dim); }
.pt-t { min-width: 0; display: block; }
.pt-t b { display: block; font-size: var(--fs-lead); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-t small { display: block; font-size: var(--fs-caption); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-back { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line2); border-radius: var(--r); background: var(--panel); color: var(--text); cursor: pointer; }
.hdr-phone .live { flex: none; }
.hdr-phone .live .live-text { display: none; }
.pb-search { flex: none; border: 1px solid var(--line2); }

/* the board switcher under the app bar */
.pb-menu { position: absolute; left: 12px; right: 12px; top: calc(100% + 4px); z-index: 30; max-height: 60vh; overflow: auto; padding: 4px; border: 1px solid var(--line2); border-radius: var(--r-lg); background: var(--panel); }
.pb-row { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: var(--r); color: var(--text); text-decoration: none; }
.pb-row + .pb-row { border-top: 1px solid var(--line); }
.pb-row span { min-width: 0; }
.pb-row b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-row small { display: block; font-size: var(--fs-caption); color: var(--dim); }
.pb-row.is-on b { color: var(--acc); }
.pb-none { margin: 10px; color: var(--dim); font-size: var(--fs-caption); }

/* tab bar and add button */
.tabbar { display: flex; border-top: 1px solid var(--line); background: var(--panel); padding: 6px 6px calc(8px + env(safe-area-inset-bottom)); }
.tb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; font-size: var(--fs-caption); color: var(--dim); text-decoration: none; }
.tb.is-on { color: var(--acc); }
.tb[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.fab { position: absolute; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid var(--acc); border-radius: var(--r-lg); background: var(--acc); color: var(--on-acc); cursor: pointer; }

/* ---------- Home: totals two by two, one board card per row */
.app[data-phone="true"] .home-wide .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.app[data-phone="true"] .home-wide .bgrid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.app[data-phone="true"] .home-wide .hrow { display: none; }
.app[data-phone="true"] .home-wide .bc-cats { display: none; }

/* ---------- Board: chips on top, one column at a time, swiped sideways */
.app[data-phone="true"] .work-columns .switcher { padding-bottom: 6px; scrollbar-width: none; }
.app[data-phone="true"] .work-columns .switcher::-webkit-scrollbar { display: none; }
.app[data-phone="true"] .work-columns .columns { scroll-snap-type: x mandatory; gap: 10px; min-height: 0; padding: 0 0 8px; scrollbar-width: none; }
.app[data-phone="true"] .work-columns .columns::-webkit-scrollbar { display: none; }
.app[data-phone="true"] .work-columns .wcol { flex: 0 0 calc(100% - 22px); min-width: 0; scroll-snap-align: center; }
.app[data-phone="true"] .work-columns .wcol-body { grid-template-columns: minmax(0, 1fr); overflow-y: visible; }
.app[data-phone="true"] .work-columns .wcol-foot { display: none; }

/* ---------- Coming up */
.upcoming { max-width: 720px; }
.up-h { display: flex; margin: 16px 2px 8px; font-size: var(--fs-caption); font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--dim); }
.up-h:first-child { margin-top: 4px; }
.up-h span { margin-left: auto; letter-spacing: 0; font-weight: 400; font-family: var(--mono); }
.up-h.is-over { color: var(--bad); }
.up-box { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); padding: 0 12px; }
.up-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; color: var(--text); text-decoration: none; }
.up-row + .up-row { border-top: 1px solid var(--line); }
.up-tx { flex: 1; min-width: 0; }
.up-tx b { display: block; font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-tx small { display: block; font-size: var(--fs-caption); color: var(--dim); }
.up-row .pill { flex: none; }
.up-none { margin: 24px 0; padding: 24px 0; text-align: center; color: var(--dim); border: 1px dashed var(--line2); border-radius: var(--r-lg); }

/* Board: the view switch, and attention as one line until opened */
.seg-phone { display: flex; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 2px; }
.seg-phone button { flex: 1; background: none; border: 0; border-radius: var(--r-sm); padding: 6px 8px; color: var(--mute); font-size: var(--fs-body); cursor: pointer; }
.seg-phone button.is-on { background: var(--panel3); color: var(--text); outline: 1px solid var(--line2); }
.wattn-line { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 1px solid var(--warn); border-radius: var(--r); background: var(--panel); color: var(--text); text-align: left; cursor: pointer; }
.wattn-line span { flex: 1; min-width: 0; }
.wattn-line > svg:last-child { color: var(--dim); }

/* Task page: the app bar has the way back, so the page drops its own back row and trail */
.app[data-phone="true"] .insp-page .back-row { justify-content: flex-end; border-bottom: 0; padding: 0; }
.app[data-phone="true"] .insp-page .back-btn, .app[data-phone="true"] .insp-page .trail { display: none; }

/* On the phone the page scrolls, not the lane: the columns take the height of their cards */
.app[data-phone="true"] .page:has(> .work-columns) { display: block; padding-bottom: 96px; }
.app[data-phone="true"] .page > .work-columns { min-height: 0; }
.app[data-phone="true"] .work > .seg-phone, .app[data-phone="true"] .work > .wattn-line { flex: none; }
.app[data-phone="true"] .work-columns .columns { flex: none; overflow-y: visible; align-items: flex-start; }
.app[data-phone="true"] .work-columns .wcol { min-height: 0; }

/* This board's views at the top of the phone board switcher (moderators) */
.pb-views { display: flex; gap: 6px; padding: 6px 4px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.pb-view { flex: 1; padding: 7px 4px; border: 1px solid var(--line2); border-radius: var(--r); background: var(--panel2); color: var(--mute); font-size: var(--fs-body); cursor: pointer; }
.pb-view.is-on { border-color: var(--acc); color: var(--text); font-weight: 600; }
