/* AirForge Pro: the shared top strip (#pro-frame, classes pro-*). Contract G.1 and G.2.
   Light only. The strip brings its own colours, so it looks the same above the AirForge console,
   above a site's WebForge console and on Pro's own pages. */

html.pro{
  --pro-h:46px;                       /* frame.js keeps this at the real height (0px on phones, where the strip scrolls away) */
  --pro-bg:#ffffff; --pro-bg2:#faf8f3; --pro-bg3:#f4f1ea;
  --pro-ink:#16203a; --pro-dim:#5b6480; --pro-line:#e2dcd0; --pro-line2:#cfc7b6;
  --pro-accent:#e8a33d; --pro-accent-ink:#8a5500; --pro-accent-soft:#fdf0d9;
  --pro-ok:#237a45; --pro-ok-soft:#e3f5ea; --pro-warn:#8a5e00; --pro-warn-soft:#fdf3d6; --pro-bad:#c22f35; --pro-bad-soft:#fde6e6;
  --pro-font:"Hanken Grotesk","Segoe UI",system-ui,-apple-system,sans-serif;
  --pro-font-d:"Bricolage Grotesque","Segoe UI",system-ui,sans-serif;
}
/* the y where page content starts under both bars */
html.pro-ctx-airforge{--pro-top:calc(var(--pro-h,0px) + var(--af-topbar-h,48px))}
html.pro-ctx-webforge{--pro-top:calc(var(--pro-h,0px) + var(--pro-wftop-h,50px) + var(--pro-wftabs-h,0px))}
html.pro-ctx-sites{--pro-top:var(--pro-h,0px)}

#pro-frame{
  position:sticky; top:0; z-index:60;
  display:flex; align-items:center; gap:10px; flex-wrap:nowrap;
  box-sizing:border-box; min-height:46px; padding:6px 16px;
  padding-left:max(16px,env(safe-area-inset-left,0px)); padding-right:max(16px,env(safe-area-inset-right,0px));
  background:var(--pro-bg); color:var(--pro-ink);
  border-bottom:1px solid var(--pro-line);
  font:600 13px/1.25 var(--pro-font); letter-spacing:0; text-transform:none; text-align:left;
}
#pro-frame *{box-sizing:border-box}
#pro-frame a{text-decoration:none; color:inherit}
#pro-frame button{font:inherit; color:inherit; margin:0; min-width:0; min-height:0; letter-spacing:0; text-transform:none; box-shadow:none}
#pro-frame :focus-visible{outline:2px solid var(--pro-accent); outline-offset:2px}
#pro-frame audio{display:none}
/* above a WebForge editor that slides in (its backdrop is z-index 100) the strip stays under the backdrop */
html.pro-ctx-webforge #pro-frame{z-index:60}

/* ---- product name ---- */
.pro-brand{display:inline-flex; align-items:center; gap:8px; flex:none; white-space:nowrap;
  font-family:var(--pro-font-d); font-weight:700; font-size:16px; letter-spacing:-.01em; color:var(--pro-ink); border-radius:6px; padding:2px 4px 2px 0}
.pro-logo{width:18px; height:18px; border-radius:50%; display:inline-block; flex:none;
  background:var(--pro-accent); box-shadow:inset 0 0 0 5px var(--pro-accent), inset 0 0 0 9px #ffffff}

/* ---- station buttons (frame_stations.js) ---- */
.pro-stations{display:flex; align-items:center; gap:6px; flex:0 1 auto; min-width:0; overflow-x:auto; overflow-y:hidden;
  scrollbar-width:thin; scrollbar-color:var(--pro-line2) transparent; padding:2px 0; margin:-2px 0}
.pro-stations::-webkit-scrollbar{height:4px}
.pro-stations::-webkit-scrollbar-thumb{background:var(--pro-line2); border-radius:9px}
.pro-stations:empty{display:none}
.pro-st{display:inline-flex; align-items:stretch; flex:0 1 auto; min-width:104px; height:32px; border:1px solid var(--pro-line); border-radius:999px;
  background:var(--pro-bg2); color:var(--pro-ink); overflow:hidden}
.pro-st:hover{border-color:var(--pro-line2)}
.pro-st[aria-current="true"]{background:var(--pro-accent-soft); border-color:var(--pro-accent)}
#pro-frame .pro-st-go{display:inline-flex; align-items:center; gap:7px; border:0; background:transparent; cursor:pointer; flex:1 1 auto; min-width:0;
  padding:0 8px 0 11px; font-weight:700; font-size:13px; white-space:nowrap; border-radius:0}
#pro-frame .pro-st-go:hover{background:rgba(22,32,58,.05)}
.pro-st-dot{width:9px; height:9px; border-radius:50%; flex:none; display:inline-block; box-shadow:0 0 0 1px rgba(22,32,58,.12)}
.pro-st-name{max-width:17ch; min-width:0; overflow:hidden; text-overflow:ellipsis}
.pro-st-air{flex:none}
/* up to 6 stations: the names shorten before anything scrolls. More than 6: full buttons, the group scrolls sideways */
.pro-stations.pro-many .pro-st{flex:none}
.pro-st-air{font-style:normal; font-size:9.5px; font-weight:800; letter-spacing:.06em; line-height:15px; padding:0 5px; border-radius:4px;
  background:var(--pro-bad-soft); color:var(--pro-bad)}
#pro-frame .pro-st-play, #pro-frame .pro-st-more{display:inline-flex; align-items:center; justify-content:center; border:0; cursor:pointer;
  background:transparent; color:var(--pro-ink); border-left:1px solid var(--pro-line); border-radius:0; padding:0}
#pro-frame .pro-st-play{width:32px; flex:none}
#pro-frame .pro-st-more{width:22px; flex:none; color:var(--pro-dim)}
#pro-frame .pro-st-play:hover, #pro-frame .pro-st-more:hover{background:rgba(22,32,58,.07)}
#pro-frame .pro-st-play[disabled]{cursor:not-allowed; color:#a9a394; background:transparent}
#pro-frame .pro-st-play.pro-playing{background:var(--pro-accent); color:var(--pro-ink)}
.pro-st[aria-current="true"] .pro-st-play, .pro-st[aria-current="true"] .pro-st-more{border-left-color:var(--pro-accent)}
.pro-st.pro-playing{border-color:var(--pro-accent); box-shadow:0 0 0 2px var(--pro-accent-soft)}

/* ---- main switch ---- */
.pro-switch{display:flex; align-items:center; gap:2px; flex:none; margin-left:4px; padding-left:10px; border-left:1px solid var(--pro-line)}
.pro-switch:empty{display:none}
#pro-frame .pro-sw{display:inline-flex; align-items:center; height:32px; padding:0 10px; border-radius:7px; white-space:nowrap;
  color:var(--pro-dim); font-weight:600; font-size:13px}
#pro-frame .pro-sw:hover{background:var(--pro-bg3); color:var(--pro-ink)}
#pro-frame .pro-sw[aria-current="page"]{background:var(--pro-accent-soft); color:var(--pro-ink); font-weight:700; box-shadow:inset 0 -2px 0 var(--pro-accent)}

.pro-sp{flex:1 1 0; min-width:0}

/* ---- live status chips ---- */
.pro-chips{display:flex; align-items:center; gap:6px; flex:none}
.pro-chips:empty{display:none}
#pro-frame .pro-chip{display:inline-flex; align-items:center; gap:6px; height:26px; padding:0 10px; border-radius:999px; white-space:nowrap;
  font-size:12.5px; font-weight:600; background:var(--pro-ok-soft); color:var(--pro-ok)}
.pro-chip i{width:7px; height:7px; border-radius:50%; background:currentColor; display:inline-block; flex:none}
.pro-chip b{font-weight:800; font-variant-numeric:tabular-nums}
.pro-chip b:empty{display:none}
#pro-frame .pro-chip-warn{background:var(--pro-warn-soft); color:var(--pro-warn)}
#pro-frame .pro-chip-bad{background:var(--pro-bad-soft); color:var(--pro-bad)}
#pro-frame .pro-chip:hover{box-shadow:inset 0 0 0 1px currentColor}
.pro-chip-s{display:none}

/* ---- website sync dot ---- */
.pro-syncslot:empty{display:none}
#pro-frame .pro-sync{display:inline-flex; align-items:center; gap:5px; height:26px; min-width:26px; justify-content:center; padding:0 7px; border-radius:999px;
  border:1px solid var(--pro-line); background:var(--pro-bg); font-size:12px; font-weight:800}
.pro-sync i{width:9px; height:9px; border-radius:50%; display:inline-block; background:#2f9e5b}
#pro-frame .pro-sync-warn{border-color:var(--pro-accent); background:var(--pro-accent-soft); color:var(--pro-warn)}
.pro-sync-warn i{background:var(--pro-accent)}

/* ---- who is signed in (not shown in the AirForge console, which has its own account menu) ---- */
.pro-user{display:inline-flex; align-items:center; gap:8px; flex:none}
.pro-user:empty{display:none}
.pro-who{color:var(--pro-dim); font-weight:600; max-width:18ch; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
#pro-frame .pro-btn{display:inline-flex; align-items:center; height:30px; padding:0 12px; border-radius:8px; cursor:pointer; white-space:nowrap;
  border:1px solid var(--pro-line2); background:var(--pro-bg); color:var(--pro-ink); font-weight:600; font-size:13px}
#pro-frame .pro-btn:hover{border-color:var(--pro-dim)}
#pro-frame .pro-signin{background:var(--pro-accent); border-color:var(--pro-accent)}

/* ---- stream menu and toast (both live outside the strip) ---- */
.pro-menu{position:fixed; z-index:2000; min-width:220px; max-width:calc(100vw - 16px); max-height:70vh; overflow:auto; padding:6px;
  background:#ffffff; color:#16203a; border:1px solid #e2dcd0; border-radius:10px; box-shadow:0 12px 40px rgba(22,32,58,.18);
  font:500 13.5px/1.3 "Hanken Grotesk","Segoe UI",system-ui,sans-serif}
.pro-menu-h{font-size:11px; text-transform:uppercase; letter-spacing:.08em; color:#5b6480; font-weight:700; padding:6px 10px 4px}
.pro-menu button{display:flex; width:100%; gap:8px; align-items:center; border:0; background:none; padding:8px 10px; border-radius:7px;
  text-align:left; cursor:pointer; font:inherit; color:#16203a; min-height:0; min-width:0}
.pro-menu button:hover, .pro-menu button:focus-visible{background:#faf8f3; outline:none}
.pro-menu-tick{width:14px; flex:none; color:#8a5500; font-weight:800}
.pro-toast{position:fixed; left:50%; transform:translateX(-50%); bottom:calc(24px + env(safe-area-inset-bottom,0px)); z-index:2100;
  max-width:min(560px,calc(100% - 32px)); padding:10px 16px; border-radius:9px;
  background:#ffffff; color:#16203a; border:1px solid #16203a; box-shadow:0 8px 24px rgba(22,32,58,.18);
  font:600 13.5px/1.35 "Hanken Grotesk","Segoe UI",system-ui,sans-serif}
.pro-toast.pro-err{background:#fde6e6; border-color:#c22f35; color:#7d1418}

/* ---- narrower desktops: shorter chip texts, tighter switch ---- */
@media (max-width:1500px){
  .pro-chip-l{display:none}
  .pro-chip-s{display:inline}
}
@media (max-width:1280px){
  #pro-frame{gap:8px}
  #pro-frame .pro-sw{padding:0 7px; font-size:12.5px}
  .pro-st-name{max-width:12ch}
  .pro-who{display:none}
}
@media (max-width:1020px){
  .pro-brand span{display:none}
  .pro-chip-s{display:none}
  #pro-frame .pro-chip{padding:0 8px}
}
/* ---- phones: the strip is part of the page (not sticky) and may use more than one row ---- */
@media (max-width:720px){
  #pro-frame{position:static; flex-wrap:wrap; row-gap:6px; padding-top:8px; padding-bottom:8px}
  .pro-brand span{display:inline}
  .pro-stations{order:5; flex:1 1 100%}
  .pro-switch{order:6; flex:1 1 100%; overflow-x:auto; margin-left:0; padding-left:0; border-left:0}
  .pro-sp{order:1}
  .pro-chips{order:2}
  .pro-syncslot{order:3}
  .pro-user{order:4}
}
@media (prefers-reduced-motion:reduce){#pro-frame *{transition:none!important; animation:none!important}}
@media print{#pro-frame, .pro-menu, .pro-toast{display:none!important}}
