/* Client portal on a phone (2026-12-01, mockup https://claude.ai/artifact/QgePM4buEv3Nxc6VcMrYpa).
   A bar at the bottom with four tabs (client.js "phone layout" sets #app[data-tab] and
   [data-sub]): Home, My mortgages, Calculators, Messages. Up to 820px wide only; on a
   computer none of this shows and the page is as it was. */

@media (min-width: 821px) {
  .pbar, .ph-view, .acct-btn, #account { display: none !important; }
}

@media (max-width: 820px) {
  /* ── shell ── */
  .page { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  #btn-contact, #btn-logout { display: none; }
  .acct-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: #fff;
    font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; }
  .acct-btn:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

  .pbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(15,34,54,.06);
    padding: 4px max(4px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px)); }
  #app[hidden] .pbar { display: none; }
  .pbar__t { position: relative; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    background: none; border: 0; padding: 0; font: inherit; color: #5f6b76; cursor: pointer; }
  .pbar__t span { font-size: 11.5px; font-weight: 500; }
  .pbar__t.on { color: #c2410c; }
  .pbar__t.on span { font-weight: 700; }
  .pbar__t:focus-visible { outline: 2px solid var(--orange); outline-offset: -3px; border-radius: 10px; }
  .pbar__n { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
    border-radius: 9px; border: 2px solid #fff; background: var(--orange); color: #fff; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; }
  .pbar__t[data-tab=messages] .pbar__n { background: var(--err); }

  /* ── which tab shows what ── */
  #app[data-tab] #home-greeting { display: none; }
  #app[data-tab=home] #home-grid .main,
  #app[data-tab=home] #home-grid .aside > section:not(#meetings-panel) { display: none; }
  #app[data-tab=home][data-sub=need] #home-grid, #app[data-tab=home][data-sub=item] #home-grid { display: none; }
  #app[data-tab=files] .aside { display: none; }
  #app[data-tab=files] .tabs2__t--phone { display: none; }
  #app[data-tab=calc] #home-grid .main,
  #app[data-tab=calc] #home-grid .aside > section:not(#calc-panel) { display: none; }
  #app[data-tab=messages] .aside,
  #app[data-tab=messages] .ftabs, #app[data-tab=messages] .need, #app[data-tab=messages] .past,
  #app[data-tab=messages] .deal2__main, #app[data-tab=messages] .welcome { display: none; }
  #app[data-tab=messages] .deal2 .msgs2 { display: flex; }
  #app[data-tab=messages] .msgs2 .msgs__list { max-height: none; }
  #app.calc-on .ph-view { display: none !important; }
  #app .cview .cbar:not([hidden]) { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

  /* ── shared bits ── */
  .ph-view { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
  .ph-view[hidden] { display: none; }
  .ph-view h1 { font-size: 24px; }
  .ph-head { display: flex; align-items: center; gap: 6px; margin: -6px 0 0 -10px; }
  .ph-back { width: 44px; height: 44px; flex: 0 0 auto; border: 0; background: none; color: var(--blue); font: inherit; font-size: 32px; line-height: 1; cursor: pointer; }
  .ph-head__t h1 { font-size: 21px; margin: 0; }
  .ph-head__s { font-size: 13px; color: #5a5a5a; }
  .ph-card { background: #fff; border-radius: 16px; padding: 14px 16px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
  .ph-card h2 { font-size: 16px; margin: 0 0 8px; }
  .ph-count { background: var(--orange); color: #fff; font-size: 13px; font-weight: 700; border-radius: 12px; padding: 3px 10px; }
  .ph-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--orange); flex: 0 0 auto; }

  /* a to-do row: whole row is the button */
  .ph-row { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 0; background: none; border: 0;
    border-top: 1px solid #eef1f4; font: inherit; color: inherit; text-align: left; cursor: pointer; }
  .ph-list .ph-rowwrap:first-child .ph-row, .ph-list > .ph-row:first-child { border-top: 0; }
  .ph-row__ic { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px; background: #eef2f5; color: var(--blue);
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; }
  .ph-row__ic--warn { background: #fff3e2; color: var(--warn); }
  .ph-row__t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .ph-row__n { font-size: 15px; font-weight: 600; }
  .ph-row__s { font-size: 12.5px; color: #6a6a6a; }
  .ph-row__s--warn { color: var(--warn); font-weight: 600; }
  .ph-row__go { color: var(--grey); font-size: 20px; }
  .ph-rowwrap .status { margin: 0 0 8px 50px; }

  /* ── Home ── */
  .ph-hi h1 { margin: 0; font-size: 26px; }
  .ph-hi .lead { margin: 2px 0 0; }
  .ph-need { background: #fff; border-radius: 16px; border-top: 5px solid var(--orange); box-shadow: 0 6px 20px rgba(0,40,70,.10); padding: 14px 16px 8px; }
  .ph-need--ok { border-top-color: var(--ok); }
  .ph-need__hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .ph-need__hd h2 { font-size: 18px; margin: 0; }
  .ph-need > .small { margin: 2px 0 6px; }
  .ph-see { display: block; margin: 6px 0 6px; font-size: 14px; font-weight: 600; text-decoration: none; min-height: 36px; }
  .ph-file { width: 100%; display: flex; flex-direction: column; gap: 8px; text-align: left; background: #fff; border: 0; border-radius: 16px;
    padding: 14px 16px; box-shadow: 0 1px 4px rgba(0,0,0,.05); font: inherit; color: inherit; cursor: pointer; }
  .ph-file__top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
  .ph-file__top strong { color: var(--blue); font-size: 15px; }
  .ph-file__top span { font-size: 12.5px; color: var(--grey); text-align: right; }
  .ph-file__s { font-size: 13.5px; }
  .ph-steps { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
  .ph-steps i { height: 6px; border-radius: 3px; background: #dfe5ea; }
  .ph-steps i.done { background: var(--blue); }
  .ph-steps i.now { background: var(--orange); }
  .ph-msg { width: 100%; display: flex; align-items: center; gap: 12px; background: #fff; border: 0; border-radius: 16px; padding: 12px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.05); font: inherit; color: inherit; text-align: left; cursor: pointer; }
  .ph-msg .avatar { flex: 0 0 auto; }
  .ph-msg__t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .ph-msg__who { font-size: 13px; color: var(--grey); }
  .ph-msg__b { font-size: 14px; color: #3a3a3a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* ── What we need ── */
  .ph-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
  .ph-chips::-webkit-scrollbar { display: none; }
  .ph-chip { flex: 0 0 auto; min-height: 38px; padding: 0 14px; border-radius: 19px; border: 1px solid #c8d1d9; background: #fff;
    color: var(--blue); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
  .ph-chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
  .ph-prog { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 16px; padding: 14px 16px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
  .ph-prog strong { display: block; color: var(--blue); font-size: 15px; }
  .ph-ring { width: 56px; height: 56px; flex: 0 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
  .ph-ring span { width: 44px; height: 44px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 13.5px; font-weight: 700; color: var(--blue); }
  .ph-grp h2 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: #5f6b76; margin: 0 0 6px; }
  .ph-grp--todo h2 { color: #c2410c; }
  .ph-grp--ok h2 { color: var(--ok); }
  .ph-grp .ph-list, .ph-done .ph-list { background: #fff; border-radius: 16px; padding: 0 14px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
  .ph-grp .batch { margin-top: 10px; }
  .ph-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 48px; padding: 6px 0;
    border-top: 1px solid #eef1f4; font-size: 14.5px; }
  .ph-list > .ph-line:first-child { border-top: 0; }
  .ph-line__n { display: block; }
  .ph-line__s { display: block; font-size: 12px; color: var(--grey); }
  .ph-line__st { font-size: 12.5px; color: #5a5a5a; text-align: right; }
  .ph-tag { font-size: 12px; font-weight: 600; color: #0b5577; background: #e8f1f7; border-radius: 10px; padding: 3px 9px; white-space: nowrap; }
  .ph-done summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--blue); min-height: 40px; display: flex; align-items: center; }
  .ph-other { background: #fff; border-radius: 16px; padding: 12px 14px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }

  /* ── one item ── */
  .ph-note { background: #fff3e2; border-radius: 16px; padding: 14px 16px; color: #4a3300; }
  .ph-note strong { display: block; font-size: 13px; color: #7a4200; }
  .ph-note p { margin: 4px 0 0; font-size: 14.5px; line-height: 1.45; }
  .ph-act { margin: 0; padding: 0; list-style: none; }
  .ph-act .item { border: 0; padding: 0; flex-wrap: wrap; }
  .ph-act .item > .name { flex: 1 1 auto; }
  .ph-act .item > span:has(> .btn), .ph-act .item > .btn { flex: 1 0 100%; order: 5; }
  .ph-act .item .btn { width: 100%; min-height: 50px; margin-top: 12px; border-radius: 25px; font-size: 16px;
    background: var(--blue); color: #fff; border: 0; }
  .ph-act .item .note { display: none; }   /* the note is shown above, in .ph-note */
  .ph-tips .tips { margin: 0; padding-left: 18px; font-size: 13.5px; color: #4a4a4a; line-height: 1.5; }

  /* ── your account ── */
  #account .acct { display: flex; flex-direction: column; gap: 10px; }
  #account .acct h2 { margin: 0; }
  #account .acct .office { margin: 0; }
  #account .acct__app:not([hidden]) { background: #f6f8fa; border-radius: 12px; padding: 12px; }
}
