/* ============================================================
   PURE Window Bar — browser-style strip of open "windows" (sections)
   that sits flush on the top edge of the white workspace window.
   window.PureWindowBar.mount(el, opts) -> controller
   All classes namespaced .pwb-*. Light surface only (lives on white).
   Active window = solid Gold 500 tab; unselected = white, gold bottom rule (the
   window's gold top edge) — no outline.
   When windows overflow (desktop: no width left · mobile: >5) a narrower
   "See all extra windows" button collects the rest into a dropdown.
   ============================================================ */
.pwb,*[class^="pwb-"],*[class*=" pwb-"]{box-sizing:border-box}

.pwb{
  --pwb-gold:#dccaaf;
  --pwb-gold-200:#f1eadf;
  --pwb-navy:#172e55;
  --pwb-gray:#8e8e8e;
  --pwb-hair:#e3ddd2;
  --pwb-shadow:5px 5px 10px rgba(0,0,0,.10);
  --pwb-ease:cubic-bezier(.2,.7,.2,1);
  position:relative;
  display:flex;align-items:flex-end;gap:10px;
  font-family:"Open Sans",system-ui,sans-serif;
}

/* the scrollable / clipping row of tabs */
.pwb-strip{
  flex:1 1 auto;min-width:0;
  display:flex;align-items:flex-end;gap:10px;
}
.pwb[data-display="desktop"] .pwb-strip{overflow:hidden}
.pwb[data-display="mobile"] .pwb-strip{
  overflow-x:auto;overflow-y:visible;-webkit-overflow-scrolling:touch;
  scrollbar-width:none;padding-bottom:1px;
}
.pwb[data-display="mobile"] .pwb-strip::-webkit-scrollbar{height:0;display:none}

/* ---- a window tab ---- */
.pwb-tab{
  position:relative;flex:0 0 auto;
  display:flex;align-items:center;gap:9px;
  height:47px;max-width:200px;padding:0 13px;
  border:0;
  border-radius:8px 8px 0 0;
  background:#fff;
  box-shadow:var(--pwb-shadow);
  margin-bottom:-2px;            /* sit flush over the window's 2px gold top rule */
  font:inherit;color:var(--pwb-navy);cursor:pointer;
  transition:background .14s var(--pwb-ease);
}
.pwb-tab .pwb-ic{flex:none;width:20px;height:20px;color:var(--pwb-navy)}
.pwb-tab .pwb-ic svg{width:100%;height:100%;display:block;stroke:currentColor}
.pwb-tab .pwb-ttl{
  font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.pwb-tab .pwb-x{
  flex:none;width:18px;height:18px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;color:var(--pwb-gray);
  transition:background .12s,color .12s;
}
.pwb-tab .pwb-x svg{width:11px;height:11px;display:block}
.pwb-tab .pwb-x:hover{background:rgba(23,46,85,.12);color:var(--pwb-navy)}
.pwb-tab:not(.is-active):hover{background:var(--pwb-gold-200)}
.pwb-tab.is-active{background:var(--pwb-gold)}

/* ---- See all extra windows ---- */
.pwb-seeall{
  flex:0 0 auto;display:none;align-items:center;gap:8px;
  height:47px;padding:0 13px;border:0;border-radius:8px 8px 0 0;
  background:#fff;
  box-shadow:var(--pwb-shadow);margin-bottom:-2px;
  font:inherit;color:var(--pwb-navy);cursor:pointer;
  transition:background .14s var(--pwb-ease);
}
.pwb-seeall:hover,.pwb-seeall.is-open{background:var(--pwb-gold)}
.pwb-seeall .pwb-lbl{font-size:12px;font-weight:600;white-space:nowrap}
.pwb-seeall .pwb-count{
  font-size:11px;font-weight:700;color:var(--pwb-navy);
  background:rgba(23,46,85,.10);border-radius:360px;padding:1px 7px;
}
.pwb-seeall .pwb-chev{flex:none;width:15px;height:15px;color:var(--pwb-gray)}
.pwb-seeall .pwb-chev svg{width:100%;height:100%;display:block}

/* ---- dropdown of hidden windows ---- */
.pwb-menu{
  position:absolute;top:calc(100% + 5px);right:0;z-index:60;
  width:248px;background:#fff;border:1px solid var(--pwb-hair);
  border-radius:8px;box-shadow:var(--pwb-shadow);overflow:hidden;display:none;
}
.pwb-menu.is-open{display:block}
.pwb-menu .pwb-mhd{
  padding:8px 13px;font-size:8.5px;letter-spacing:.12em;text-transform:uppercase;
  color:var(--pwb-gray);border-bottom:1px solid var(--pwb-hair);
}
.pwb-mrow{
  display:flex;align-items:center;gap:10px;padding:9px 13px;cursor:pointer;
  border-bottom:1px solid #f1efea;
}
.pwb-mrow:last-child{border-bottom:0}
.pwb-mrow:hover{background:#f8f4ef}
.pwb-mrow .pwb-ic{flex:none;width:18px;height:18px;color:var(--pwb-navy)}
.pwb-mrow .pwb-ic svg{width:100%;height:100%;display:block;stroke:currentColor}
.pwb-mrow .pwb-ttl{flex:1;min-width:0;font-size:13px;font-weight:600;color:var(--pwb-navy);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pwb-mrow .pwb-x{flex:none;width:18px;height:18px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--pwb-gray)}
.pwb-mrow .pwb-x svg{width:11px;height:11px;display:block}
.pwb-mrow .pwb-x:hover{background:rgba(23,46,85,.12);color:var(--pwb-navy)}

/* ---- mobile sizing (tab 91×44 · radius 5) ---- */
.pwb[data-display="mobile"] .pwb-tab{
  height:44px;border-radius:5px 5px 0 0;max-width:160px;padding:0 11px;gap:7px;
}
.pwb[data-display="mobile"] .pwb-tab .pwb-ic{width:18px;height:18px}
.pwb[data-display="mobile"] .pwb-seeall{height:44px;border-radius:5px 5px 0 0;padding:0 11px}

@media (prefers-reduced-motion: reduce){.pwb *{transition:none !important}}
