/* What a phone shows of the paid views (app-phone.js), and the shell around them, below 640px wide. Loaded after the
   views' own styles so it can narrow them. On View A's tokens; the few hard-coded colours are restated for the light
   theme at the foot. No style attributes.

   On a phone: one row of views that scrolls sideways, the unlock in a dock at the foot of the screen once its bar has
   scrolled away, the chat as a round button in the corner, stat cards two to a row, the comparison tables one figure
   at a time (columnPicker), other wide tables with their names held while the figures scroll, and a few long parts
   folded behind a button that says what they hold (phoneMore, phoneFold). */

/* The helpers' buttons, the pickers and the dock exist on a phone only. */
.pd-phmore,.pd-phfold-go,.pd-colpick,.pd-lockdock{display:none}

@media (max-width:640px){
  /* A narrower margin: the page's 24px edges were a tenth of the screen. */
  .wrap{padding:0 16px}

  /* The page clears the round chat button, and the dock while it shows. */
  .pd{padding-bottom:96px}
  .pd-h1{font-size:1.65rem;max-width:none}
  .pd-sec{margin-top:24px}
  .pd-list{margin-top:24px}

  /* The views' nav: one row that scrolls sideways, the open view scrolled into sight (app-paid-nav.js revealCurrent).
     The "Analysis" menu drops down across the nav: the row's scrolling would clip it beside its button, so the
     menu is placed from the nav itself. "Your searches" is its clock alone. */
  .pd-nav{position:relative;margin-bottom:12px}
  .pd-nav-list{flex-wrap:nowrap;gap:2px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;padding-bottom:8px}
  /* The row's right edge fades, so a view cut off there reads as "there's more this way". A layer over the nav, not a
     mask on the row: a mask would cut off the open menu too. */
  .pd-nav::after{content:"";position:absolute;top:0;right:0;bottom:9px;width:28px;pointer-events:none;z-index:1;
    background:linear-gradient(to right,transparent,var(--bg))}
  .pd-nav-list::-webkit-scrollbar{display:none}
  .pd-nav-list>li{flex:none}
  /* Each link holds its own screen-reader words: placed from the nav, they'd sit past the screen's edge when the row
     is scrolled, and widen the page. (The menu's list is the link's sibling, so it still drops from the nav.) */
  .pd-nav-list>li>.pd-nav-link{position:relative}
  .pd-nav-group{position:static}
  .pd-nav-link{padding:6px 13px;white-space:nowrap}
  .pd-nav-menu{left:0;right:0;top:calc(100% - 2px);min-width:0}
  .pd-nav-link--history{min-width:44px;justify-content:center;padding:6px 10px}
  .pd-nav-link--history::before{margin-right:0}
  .pd-nav-link--history .pd-nav-label{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}

  /* Stat cards two to a row, a size down; the dashboard's cards a little tighter. */
  .pd-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .pd-stat{padding:12px 14px;border-radius:12px}
  .pd-stat-big{font-size:1.3rem}
  .pd-stat-small{font-size:.84rem}
  .pd-card{padding:14px 16px}
  .pd-card-big{font-size:1.7rem}
  .pd-next{padding:14px 16px}

  /* phoneMore: the first few of a list, then "Show N more". phoneFold: a part behind one button. */
  .pd-phmore{display:block;margin:12px 0 0}
  .pd-phmore[hidden]{display:none}
  .pd-phmore-list:not(.is-open)>.pd-ph-extra{display:none}
  .pd-phfold-go{display:block;margin:10px 0 0}
  .pd-phfold:not(.is-open)>.pd-phfold-body{display:none}
  .pd-phfold.is-open>.pd-phfold-go{display:none}

  /* columnPicker: the comparison tables show one figure beside the names, picked above them, and fit the screen. */
  .pd-colpick{display:flex;align-items:center;gap:10px;margin:0 0 10px}
  .pd-colpick-l{flex:none;color:var(--dim);font-size:.9rem;font-weight:600}
  .pd-colpick-select{flex:1;min-width:0;min-height:44px;padding:8px 40px 8px 12px;border:1px solid var(--line2);border-radius:10px;
    background-color:var(--card);color:var(--fg);font:inherit;font-weight:600;appearance:none;-webkit-appearance:none;
    /* A chevron, drawn: two half-squares meeting in a point. */
    background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);
    background-position:calc(100% - 22px) 52%,calc(100% - 16px) 52%;background-size:6px 6px;background-repeat:no-repeat}
  .pd-colpick-select:focus-visible{outline:2px solid var(--yellow);outline-offset:2px}
  .pd-table.has-colpick :is(.pd-col-off,[data-col-wide]){display:none}
  .pd-table.has-colpick tbody th[scope="row"]{min-width:0}
  .pd-table.has-colpick td.num{width:1%}
  .pd-table.has-colpick td.pd-unread{text-align:right}
  .pd-table.has-colpick td.pd-unread .pd-analyse{display:block;margin:6px 0 0 auto}

  /* Other wide tables (a profile's years, Improve's levers): the first column
     stays put while the figures scroll under it, and a shadow at the right edge says there's more. */
  .pd-tablewrap{--pd-tw:#0A1E36;
    background:linear-gradient(to left,var(--pd-tw) 40%,transparent) 100% 0/32px 100% no-repeat local,
      linear-gradient(to left,rgba(0,0,0,.32),transparent) 100% 0/16px 100% no-repeat scroll,var(--pd-tw)}
  .pd-tablewrap>.pd-table:not(.has-colpick) :is(thead th:first-child,tbody th[scope="row"]){position:sticky;left:0;z-index:1;background:var(--pd-tw)}
  .pd-tablewrap>.pd-table:not(.has-colpick) tbody th[scope="row"]{min-width:8em;max-width:11em}
  .pd-tablewrap>.pd-table:not(.has-colpick) tr.is-you th[scope="row"]{background:linear-gradient(rgba(255,245,91,.08),rgba(255,245,91,.08)),var(--pd-tw)}
  .pd-tablewrap>.pd-table:not(.has-colpick) tr.pd-group th{position:static}
  .pd-table{font-size:.9rem}
  .pd-co-meta{font-size:.8rem}

  /* The unlock bar stays where it is at the top of the view rather than over the page; once it has scrolled away the
     dock (app-paid-lock.js) carries the price and the button along the foot of the screen, clear of the home bar. */
  .pd-lockbar{position:static;box-shadow:none}
  .pd-lockbar-wallet{color:var(--dim);font-size:.8rem;margin-top:2px}
  .pd-lockdock{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:190;align-items:center;gap:12px;margin:0;
    padding:10px 16px calc(10px + env(safe-area-inset-bottom,0px));border-top:1px solid rgba(255,245,91,.5);
    background:#0B2039;box-shadow:0 -10px 30px rgba(0,0,0,.32);transform:translateY(110%);visibility:hidden;
    transition:transform .2s ease-out,visibility 0s linear .2s}
  .pd-lockdock.is-shown{transform:none;visibility:visible;transition:transform .2s ease-out}
  .pd-lockdock-text{flex:1;min-width:0;margin:0;display:flex;flex-direction:column;line-height:1.3}
  .pd-lockdock-price{font-weight:700}
  .pd-lockdock-wallet{color:var(--dim);font-size:.8rem}
  .pd-lockdock-wallet[hidden]{display:none}
  .pd-lockdock-btn{flex:none;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:10px 22px}
  .pd-lockdock-btn .pd-lock-i{width:15px;height:15px}

  /* "Ask about your analysis": the bubble alone, in the corner. While locked the dock is the way in, so it goes. */
  .pd-chat-launch{width:56px;height:56px;min-height:0;padding:0;justify-content:center;border-radius:50%}
  .pd-chat-launch-t{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
  .pd-chat.is-locked{display:none}

  /* The free example's banner, a size down. */
  .pd-samplebar-line{font-size:.9rem}
  .pd-samplebar-note{font-size:.84rem}
}
@media (max-width:640px) and (prefers-reduced-motion:reduce){
  .pd-lockdock,.pd-lockdock.is-shown{transition:none}
}
@media print{.pd-lockdock,.pd-phmore,.pd-phfold-go,.pd-colpick{display:none!important}}

@media (max-width:640px){
  html[data-pf-theme="light"] .pd-tablewrap{--pd-tw:var(--card)}
  html[data-pf-theme="light"] .pd-tablewrap>.pd-table:not(.has-colpick) tr.is-you th[scope="row"]{background:linear-gradient(rgba(245,196,0,.14),rgba(245,196,0,.14)),var(--pd-tw)}
  html[data-pf-theme="light"] .pd-lockdock{background:#FFFFFF;border-top-color:rgba(176,134,0,.55);box-shadow:0 -10px 30px rgba(11,32,57,.14)}
  html[data-pf-theme="light"] .pd-tablewrap{background:linear-gradient(to left,var(--pd-tw) 40%,transparent) 100% 0/32px 100% no-repeat local,
    linear-gradient(to left,rgba(11,32,57,.16),transparent) 100% 0/16px 100% no-repeat scroll,var(--pd-tw)}
}
