/* Installed-app feel + install guide. Theme tokens only (ibpg.css). Normal browser tabs are untouched:
   everything under html.app-mode applies only when the site runs as the installed app (see components/app-boot.ts). */
:root{--ib-apptop-h:52px;--ib-appbar-h:62px}

/* Bars and sheet exist in the markup but are off by default. */
.ib-apptop,.ib-appbar{display:none}
.ib-install-link{display:none;color:inherit;text-decoration:underline;text-underline-offset:3px;cursor:pointer;min-height:44px;align-items:center}
@media (pointer:coarse){.ib-install-link{display:inline-flex}}
.ib-install-link--block{display:none;margin-top:6px}
@media (pointer:coarse){.ib-install-link--block{display:flex}}
.ib-auth__logo,.ib-phero__app{display:none}

/* Mobile number row (phone-input.tsx): on phones the number takes its own line so the prefix is readable. */
.ib-phone{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,.8fr) minmax(0,1.6fr);gap:8px}
@media (max-width:480px){.ib-phone{grid-template-columns:minmax(0,1.3fr) minmax(0,1fr)}.ib-phone>:last-child{grid-column:1/-1}.ib-phone>select{padding-left:14px;padding-right:8px}}

/* ---------- Install bottom sheet (phones only, never desktop) ---------- */
.ib-isheet{position:fixed;left:0;right:0;bottom:0;z-index:95;max-width:560px;margin:0 auto;background:#fff;color:var(--ink);border:1px solid var(--line);border-bottom:0;border-radius:20px 20px 0 0;box-shadow:0 -10px 30px -12px rgba(18,49,43,.28);padding:14px 16px calc(12px + env(safe-area-inset-bottom));display:grid;gap:10px}
/* Out of the way: not yet due, or a primary action of the page is where the banner would sit. */
.ib-isheet.is-away{visibility:hidden;transform:translateY(100%);box-shadow:none}
@media (hover:hover) and (pointer:fine){.ib-isheet{display:none}}
html.app-mode .ib-isheet{display:none}
.ib-isheet:focus{outline:none}
.ib-isheet__txt{display:grid;gap:2px;line-height:1.35}
.ib-isheet__txt span{font-size:14px;color:var(--muted)}
.ib-isheet__body{display:grid;gap:10px;font-size:14.5px;max-height:50svh;overflow:auto}
.ib-isheet__body ol{margin:0;padding-left:20px;display:grid;gap:6px;list-style:decimal}
.ib-isheet__body p{margin:0}
.ib-isheet__btns{display:flex;gap:10px;flex-wrap:wrap}
.ib-isheet__btn{min-height:44px;padding:0 18px;border-radius:999px;border:1px solid var(--line);background:#fff;color:var(--ink);font:inherit;font-weight:600;cursor:pointer}
.ib-isheet__btn--go{background:var(--ink);color:#fff;border-color:var(--ink)}
.ib-isheet__btn:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
/* Small phones: the banner keeps to the title and the buttons. */
@media (max-width:360px){.ib-isheet[data-install-view=banner]{padding-top:10px;padding-bottom:calc(8px + env(safe-area-inset-bottom));gap:6px}.ib-isheet[data-install-view=banner] .ib-isheet__txt span{display:none}}
html.ib-install-on{scroll-padding-bottom:calc(var(--ib-install-h,0px) + 12px)}
html.ib-install-on body{padding-bottom:var(--ib-install-h,0px)}
@media (prefers-reduced-motion:no-preference){.ib-isheet{transition:transform .35s var(--ease),visibility .35s}}

/* ---------- Installed app ---------- */
/* Slim top bar: page title and, on inner pages, a back button (iOS has none). */
.ib-apptop{position:fixed;top:0;left:0;right:0;z-index:90;align-items:center;gap:4px;min-height:calc(var(--ib-apptop-h) + env(safe-area-inset-top));padding:env(safe-area-inset-top) max(8px,env(safe-area-inset-right)) 0 max(8px,env(safe-area-inset-left));background:var(--ink);color:#fff}
.ib-apptop__back{flex:0 0 auto;display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:50%;background:transparent;color:#fff;cursor:pointer}
.ib-apptop__back:focus-visible{outline:2px solid var(--mint);outline-offset:-2px}
.ib-apptop__back .ib-ic{width:24px;height:24px}
.ib-apptop__title{margin:0;padding:0 8px;min-width:0;flex:1;font-size:17px;font-weight:600;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Bottom bar: five places, 44px+ targets, home-indicator safe. Sits below the content (body padding), never over it. */
.ib-appbar{position:fixed;left:0;right:0;bottom:0;z-index:90;grid-template-columns:repeat(5,minmax(0,1fr));background:#fff;border-top:1px solid var(--line);padding:0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);box-shadow:0 -6px 20px -14px rgba(18,49,43,.3)}
.ib-appbar__item{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:var(--ib-appbar-h);min-width:44px;padding:6px 2px;color:var(--muted);font-size:11.5px;font-weight:500;line-height:1.1;text-align:center}
.ib-appbar__item .ib-ic{width:24px;height:24px}
.ib-appbar__item.is-active{color:var(--ink);font-weight:700}
.ib-appbar__item.is-active::before{content:"";position:absolute;top:0;left:22%;right:22%;height:3px;border-radius:0 0 3px 3px;background:var(--ink)}
.ib-appbar__item:focus-visible{outline:2px solid var(--ink);outline-offset:-4px}

/* The page hero repeats the title the top bar already shows: kept for screen readers only, without its breadcrumb
   links. Pages whose hero holds unique information (ib-phero--info) show it as a compact block instead. */
html.app-mode .ib-header,html.app-mode .ib-footer,html.app-mode .ib-install-link{display:none}
html.app-mode{--ib-sat:env(safe-area-inset-top);--ib-sab:env(safe-area-inset-bottom)}
html.app-mode body{padding:var(--ib-sat) env(safe-area-inset-right) var(--ib-sab) env(safe-area-inset-left);overscroll-behavior-y:none;-webkit-tap-highlight-color:transparent}
html.app-mode:not(.app-notop) body{padding-top:calc(var(--ib-apptop-h) + var(--ib-sat))}
html.app-mode:not(.app-nobottom) body{padding-bottom:calc(var(--ib-appbar-h) + var(--ib-sab))}
html.app-mode:not(.app-notop){scroll-padding-top:calc(var(--ib-apptop-h) + var(--ib-sat) + 12px)}
html.app-mode:not(.app-nobottom){scroll-padding-bottom:calc(var(--ib-appbar-h) + var(--ib-sab) + 12px)}
html.app-mode:not(.app-notop) .ib-apptop{display:flex}
html.app-mode:not(.app-nobottom) .ib-appbar{display:grid}
html.app-mode .ib-phero{position:absolute;width:1px;height:1px;min-height:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
html.app-mode .ib-phero__img,html.app-mode .ib-crumbs{display:none}
html.app-mode .ib-phero--info{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal;background:var(--sage);color:var(--ink);border-bottom:1px solid var(--line)}
html.app-mode .ib-phero--info::before,html.app-mode .ib-phero--info::after{display:none}
html.app-mode .ib-phero--info .ib-phero__inner{padding-top:14px;padding-bottom:14px}
html.app-mode .ib-phero--info h1{max-width:none;font-size:20px;line-height:1.25;letter-spacing:-.01em;color:var(--ink);overflow-wrap:anywhere}
html.app-mode .ib-phero--info h1 em{color:var(--ink)}
html.app-mode .ib-phero--info{font-family:system-ui,-apple-system,"Segoe UI",Arial,sans-serif}
html.app-mode .ib-phero--info p{display:block;max-width:none;margin:4px 0 0;font-size:14.5px;line-height:1.45;color:var(--muted)}
html.app-mode .ib-page{padding-top:24px;padding-bottom:40px}
html.app-mode .ib-hero{min-height:calc(100svh - var(--ib-apptop-h) - var(--ib-appbar-h))}
html.app-mode .ib-auth__logo{display:block;height:64px;width:auto;margin:0 auto 18px}
html.app-mode .ib-auth{border:0;box-shadow:none;padding:8px 0}
html.app-mode .ib-mtabs{margin-bottom:20px}

/* Same rules when the boot script has not run (no JavaScript). Keep the two blocks in step. */
@media (display-mode:standalone){
  html:not(.app-boot) .ib-header,html:not(.app-boot) .ib-footer,html:not(.app-boot) .ib-install-link{display:none}
  html:not(.app-boot){--ib-sat:env(safe-area-inset-top);--ib-sab:env(safe-area-inset-bottom)}
  html:not(.app-boot) body{padding:var(--ib-sat) env(safe-area-inset-right) var(--ib-sab) env(safe-area-inset-left);overscroll-behavior-y:none;-webkit-tap-highlight-color:transparent}
  html:not(.app-boot):has(.ib-apptop:not([data-off])) body{padding-top:calc(var(--ib-apptop-h) + var(--ib-sat))}
  html:not(.app-boot):has(.ib-appbar:not([data-off])) body{padding-bottom:calc(var(--ib-appbar-h) + var(--ib-sab))}
  html:not(.app-boot):has(.ib-apptop:not([data-off])){scroll-padding-top:calc(var(--ib-apptop-h) + var(--ib-sat) + 12px)}
  html:not(.app-boot):has(.ib-appbar:not([data-off])){scroll-padding-bottom:calc(var(--ib-appbar-h) + var(--ib-sab) + 12px)}
  html:not(.app-boot):has(.ib-apptop:not([data-off])) .ib-apptop{display:flex}
  html:not(.app-boot):has(.ib-appbar:not([data-off])) .ib-appbar{display:grid}
  html:not(.app-boot) .ib-phero{position:absolute;width:1px;height:1px;min-height:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  html:not(.app-boot) .ib-phero__img,html:not(.app-boot) .ib-crumbs{display:none}
  html:not(.app-boot) .ib-phero--info{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal;background:var(--sage);color:var(--ink);border-bottom:1px solid var(--line)}
  html:not(.app-boot) .ib-phero--info::before,html:not(.app-boot) .ib-phero--info::after{display:none}
  html:not(.app-boot) .ib-phero--info .ib-phero__inner{padding-top:14px;padding-bottom:14px}
  html:not(.app-boot) .ib-phero--info h1{max-width:none;font-size:20px;line-height:1.25;letter-spacing:-.01em;color:var(--ink);overflow-wrap:anywhere}
  html:not(.app-boot) .ib-phero--info h1 em{color:var(--ink)}
  html:not(.app-boot) .ib-phero--info{font-family:system-ui,-apple-system,"Segoe UI",Arial,sans-serif}
  html:not(.app-boot) .ib-phero--info p{display:block;max-width:none;margin:4px 0 0;font-size:14.5px;line-height:1.45;color:var(--muted)}
  html:not(.app-boot) .ib-page{padding-top:24px;padding-bottom:40px}
  html:not(.app-boot) .ib-hero{min-height:calc(100svh - var(--ib-apptop-h) - var(--ib-appbar-h))}
  html:not(.app-boot) .ib-auth__logo{display:block;height:64px;width:auto;margin:0 auto 18px}
  html:not(.app-boot) .ib-auth{border:0;box-shadow:none;padding:8px 0}
  html:not(.app-boot) .ib-mtabs{margin-bottom:20px}
}

/* Home: corporate members ticker, smaller than the sponsors strip above it (27 Nov) */
.ib-sponsors:has(+ .ib-sponsors--corp){border-bottom:0}
.ib-sponsors--corp{padding-top:0}
.ib-sponsors .sx-logo--corp{width:140px;height:56px;padding:0 14px;opacity:.72}
.ib-sponsors .sx-logo--corp:hover{opacity:1}
.ib-sponsors .sx-logo--corp img{max-height:34px;width:auto;max-width:100%;object-fit:contain}
.ib-sponsors__more{margin-top:clamp(10px,1vw,16px);text-align:center;font-size:14px}
.ib-sponsors__more a{display:inline-flex;align-items:center;gap:6px;color:var(--muted)}
.ib-sponsors__more a:hover{color:var(--ink)}
.ib-sponsors__more .ib-ic{width:14px;height:14px}
@media (max-width:575px){.ib-sponsors .sx-logo--corp{width:110px;height:48px;padding:0 10px}.ib-sponsors .sx-logo--corp img{max-height:28px}}

@media print{
  .ib-apptop,.ib-appbar,.ib-isheet{display:none!important}
  html.app-mode body,html:not(.app-boot) body{padding:0!important}
}
