/* Club Ready Music on a phone, for a member: it looks and feels like an app.
   A compact top bar (the mark, the page's title, the songs left), a bottom tab bar in thumb reach, no site footer, a mini player above the
   tabs while a song plays. Everything here is for phones (760 px and under) and for signed-in pages (body.is-app); the computer layout and
   the signed-out pages are not touched. Colours are the site's own tokens, so day (the default) and night both work. */
.app-tabs,.mini-player,.app-hint,.app-toast,.app-more,.app-title,.app-mark{display:none}
.app-toast{position:fixed;left:50%;top:calc(64px + env(safe-area-inset-top));transform:translateX(-50%);z-index:60;max-width:min(92vw,420px);padding:12px 16px;border-radius:12px;background:var(--text);color:var(--bg);font-size:14px;font-weight:600;box-shadow:0 8px 24px rgba(0,0,0,.25)}
.app-toast:not([hidden]){display:block}
.app-toast a{color:inherit;text-decoration:underline;pointer-events:auto}
/* a message that comes and goes must never be in the way of a button under it: taps go through it (its own link still works) */
.app-toast{pointer-events:none}

@media (max-width:760px){
  body.is-app{--app-tabs-h:58px;--app-safe-b:env(safe-area-inset-bottom,0px);overscroll-behavior-y:none;-webkit-tap-highlight-color:transparent}
  html:has(body.is-app){overscroll-behavior-y:none}
  body.is-app *{-webkit-tap-highlight-color:transparent}
  /* top bar: the mark, the page's title, the songs left. The menu button and the wide logo are gone; their links are the tabs and Account. */
  body.is-app .topbar{position:sticky;top:0;z-index:30;grid-template-columns:auto minmax(0,1fr) auto;height:calc(52px + env(safe-area-inset-top));padding:env(safe-area-inset-top) 16px 0;background:var(--bg);border-bottom:1px solid var(--border2)}
  body.is-app .brand-logo{display:none !important}
  body.is-app .brand{min-width:44px;margin-right:-16px}   /* the mark is 28 px; the tap area is 44 and does not move the title */
  body.is-app .menu-btn{display:none}
  body.is-app .app-mark{display:block;width:28px;height:28px}
  html[data-theme="light"] body.is-app .app-mark--dark,html:not([data-theme="light"]) body.is-app .app-mark--light{display:none}
  body.is-app .app-title{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:17px;font-weight:700;color:var(--text)}
  body.is-app .site-foot{display:none}
  body.is-app main.page{padding-bottom:calc(var(--app-tabs-h) + var(--app-safe-b) + 16px);min-height:calc(100dvh - 52px)}
  body.is-app.has-mini main.page{padding-bottom:calc(var(--app-tabs-h) + var(--app-safe-b) + 76px)}

  /* the tab bar */
  body.is-app .app-tabs{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;position:fixed;left:0;right:0;bottom:0;z-index:40;height:calc(var(--app-tabs-h) + var(--app-safe-b));padding-bottom:var(--app-safe-b);background:var(--panel);border-top:1px solid var(--border2)}
  .app-tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:48px;color:var(--muted);text-decoration:none;font-size:11px;font-weight:600;line-height:1}
  .app-tab svg{display:block}
  .app-tab.is-on{color:var(--text)}
  .app-tab.is-on svg{color:var(--accent)}
  .app-tab.is-on span{font-weight:800}
  .app-tab:focus-visible{outline:2px solid var(--text);outline-offset:-4px}
  body.is-app[data-ps-phones="off"] .app-tab.ps-btn{display:none !important}

  /* the studio's own Back / Next bar sits above the tabs; nothing is hidden behind either */
  body.is-app .sm-bar{bottom:calc(var(--app-tabs-h) + var(--app-safe-b));padding-bottom:10px}
  body.is-app .studio-mobile{padding-bottom:calc(var(--app-tabs-h) + var(--app-safe-b) + 96px)}

  /* the mini player: above the tabs while a song plays */
  body.is-app .mini-player:not([hidden]){display:flex;align-items:center;gap:10px;position:fixed;left:8px;right:8px;bottom:calc(var(--app-tabs-h) + var(--app-safe-b) + 8px);z-index:39;height:56px;padding:0 8px 0 8px;border:1px solid var(--border2);border-radius:14px;background:var(--panel);box-shadow:0 6px 18px rgba(0,0,0,.18);overflow:hidden}
  .mini-cover{width:40px;height:40px;border-radius:8px;object-fit:cover}
  .mini-cover[hidden]{display:none}
  .mini-text{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:2px}
  .mini-play{flex:none}
  .mini-text b{font-size:14px;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .mini-text small{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .mini-play{display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:50%;background:var(--text);color:var(--bg);padding:0}
  .mini-play .mini-ico-play{display:none}
  .mini-player.is-paused .mini-ico-play{display:block}
  .mini-player.is-paused .mini-ico-pause{display:none}
  .mini-bar{position:absolute;left:0;right:0;bottom:0;height:3px;background:var(--border2)}
  .mini-bar i{display:block;height:100%;width:0;background:var(--accent)}
  /* while the studio's Back / Next bar is on screen the mini player stays out of its way */
  body.is-app.has-form-bar .mini-player{display:none !important}
  /* the "Link copied" pill of My songs and the share pages sits above the tab bar (and above the mini player when a song is playing), not on top of them */
  body.is-app .sh-toast{bottom:calc(var(--app-tabs-h) + var(--app-safe-b) + 14px)}
  body.is-app.has-mini .sh-toast{bottom:calc(var(--app-tabs-h) + var(--app-safe-b) + 78px)}

  /* "Add to your home screen": once, and it can be dismissed */
  body.is-app .app-hint:not([hidden]){display:flex;flex-wrap:wrap;align-items:center;gap:8px;position:fixed;left:8px;right:8px;top:calc(60px + env(safe-area-inset-top));z-index:45;padding:12px;border:1px solid var(--border2);border-radius:14px;background:var(--panel);color:var(--text);font-size:14px;box-shadow:0 6px 18px rgba(0,0,0,.18)}
  .app-hint span{flex:1 1 200px}
  .app-hint .btn{min-height:44px;padding:0 14px}

  /* under Account: what the menu used to hold */
  body.is-app .app-more{display:flex;flex-direction:column;margin:8px 16px 0;border:1px solid var(--border2);border-radius:14px;background:var(--panel);overflow:hidden}
  .app-more-item{display:flex;align-items:center;min-height:52px;padding:0 16px;border:0;border-bottom:1px solid var(--border2);background:transparent;color:var(--text);font:inherit;font-size:16px;font-weight:600;text-align:left;text-decoration:none;width:100%}
  .app-more-item:last-child{border-bottom:0}
  .app-wip{padding:10px 16px;border-bottom:1px solid var(--border2)}
  .app-wip[hidden]{display:none}
  .app-more-head{display:block;font-size:12px;color:var(--muted);margin-bottom:6px}
  .app-wip button{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;min-height:48px;padding:8px 0;border:0;background:transparent;color:var(--text);font:inherit;font-size:15px;font-weight:600;text-align:left}
  .app-wip button small{font-size:12px;font-weight:400;color:var(--muted)}

  /* the top bar already says "Make a song": the studio's own header keeps only its two actions */
  body.is-app .studio-mobile .sm-brand{display:none}
  body.is-app .studio-mobile .sm-head{justify-content:flex-end;padding-top:8px}
  /* the studio's own actions that lived in the menu */
  body.is-app .sm-head-acts{display:flex;gap:6px}
  .sm-head-acts button{min-height:44px;padding:0 10px;border:1px solid var(--border2);border-radius:10px;background:transparent;color:var(--text);font:inherit;font-size:13px;font-weight:600}

  /* steps slide in from the side they come from; sheets slide up */
  @media (prefers-reduced-motion:no-preference){
    body.is-app .studio-mobile .sm-step.is-active{animation:app-slide-fwd .22s ease-out}
    body.is-app .studio-mobile[data-dir="back"] .sm-step.is-active{animation-name:app-slide-back}
    body.is-app .sm-sheet:not([hidden]) .sm-sheet-card,body.is-app #sm-sheet:not([hidden])>*{animation:app-sheet-up .24s ease-out}
  }
}
.sm-head-acts{display:none}
@keyframes app-slide-fwd{from{transform:translateX(24px);opacity:.4}to{transform:none;opacity:1}}
@keyframes app-slide-back{from{transform:translateX(-24px);opacity:.4}to{transform:none;opacity:1}}
@keyframes app-sheet-up{from{transform:translateY(32px);opacity:.4}to{transform:none;opacity:1}}
/* opened from the home screen: no browser bars, so the top bar keeps clear of the status bar (the safe-area padding above does it) */
@media (display-mode:standalone){body.is-app .app-hint{display:none !important}}
