/* app-layer.css - the installable-app layer of WSU Transparent (2026-10-09): pop-up shell shared by the Get-the-app and Share windows,
   the "new version" bar, the arrival banner, the phone top bar + drawer menu (<= 760 px only; desktop untouched), the info-row buttons.
   Colours follow the site tokens (beige page, white cards, gold accent, burgundy). Safe-area insets are applied ONCE, on the phone bar. */
.al-btn{ display:inline-block; padding:9px 18px; border:1px solid var(--line,#dcd8c9); border-radius:999px; background:var(--surface,#fff); color:var(--ink,#1b1c16); font:inherit; font-weight:700; cursor:pointer; text-decoration:none; text-align:center; }
.al-btn.gold{ background:linear-gradient(90deg,#b6862c,#d4a63f); color:#1b1c16; border-color:#8b6a1c; }
.al-btn[disabled]{ opacity:.55; cursor:wait; }

/* ---- pop-up shell (Get the app, Share) ---- */
.ap-backdrop{ position:fixed; inset:0; background:rgba(27,28,22,.55); z-index:120; display:flex; align-items:flex-start; justify-content:center; padding:30px 16px; overflow:auto; }
.ap-backdrop[hidden]{ display:none; }
.ap{ background:var(--bg,#f1f0e9); border:1px solid var(--line,#dcd8c9); border-radius:14px; width:min(100%, 720px); box-shadow:0 20px 50px rgba(27,28,22,.3); padding:18px 22px 22px; color:var(--ink,#1b1c16); font-family:'IBM Plex Sans',system-ui,sans-serif; }
.ap-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.ap-head h2{ margin:0; font-family:Newsreader,Georgia,serif; font-size:24px; color:var(--up,#7a3b2e); } .ap-head .sub{ color:var(--ink-muted,#66645a); font-size:14px; margin-top:2px; }
.ap-btns{ display:flex; gap:8px; flex-shrink:0; }
.ap-close{ background:var(--surface,#fff); color:var(--ink,#1b1c16); border:1px solid var(--line,#dcd8c9); border-radius:999px; padding:7px 14px; cursor:pointer; font:inherit; font-weight:700; }
.ap-close:hover{ border-color:var(--guf,#b6862c); }
.al-err{ margin-top:12px; padding:9px 12px; border:1px solid var(--up,#7a3b2e); border-radius:8px; color:var(--up,#7a3b2e); font-weight:700; background:var(--surface,#fff); } .al-err[hidden]{ display:none; }
.al-priv{ font-size:12.5px; color:var(--ink-faint,#9c988a); margin:10px 0 0; line-height:1.45; }
.al-ok{ color:#3f6b4a; font-weight:700; }
.al-h{ margin:18px 0 8px; color:var(--up,#7a3b2e); font-size:15px; font-weight:800; }

/* ---- Get-the-app window ---- */
.ga-grid{ display:grid; grid-template-columns:204px 1fr; gap:22px; margin-top:14px; align-items:start; } .ga-grid.one{ grid-template-columns:1fr; }
.ga-qr{ background:#fff; color:#1b1c16; border:1px solid var(--line,#dcd8c9); border-radius:12px; padding:14px; text-align:center; } .ga-qr svg{ display:block; width:176px; height:176px; margin:0 auto; } .ga-qr p{ margin:8px 0 0; font-weight:700; font-size:13px; }
.ga-side{ display:flex; flex-direction:column; gap:12px; min-width:0; }
.ga-row{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.in-steps{ margin:10px 0 6px; padding-left:22px; font-size:15.5px; line-height:1.55; } .in-steps li{ margin:0 0 8px; } .in-steps b{ color:var(--up,#7a3b2e); }

/* ---- Share window ---- */
.sh-prev{ margin:14px 0 0; background:var(--surface,#fff); border:1px solid var(--line,#dcd8c9); border-radius:10px; padding:8px; min-height:110px; display:flex; align-items:center; justify-content:center; color:var(--ink-faint,#9c988a); font-size:14px; }
.sh-prev img{ display:block; max-width:100%; max-height:min(44vh,360px); border-radius:6px; }
.sh-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:8px; } .sh-grid.two{ grid-template-columns:1fr 1fr; }
.sh-chan::before{ content:''; display:inline-block; width:10px; height:10px; border-radius:50%; background:var(--c); margin-right:9px; vertical-align:1px; box-shadow:0 0 0 1.5px rgba(27,28,22,.25); }

/* ---- info-row buttons added by the layer (Share, Get the app, Update the app) ---- */
.info-btns.al-row{ display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; margin:6px 0 4px; }
.info-btns.al-row .info-btn{ font:700 13px/1 'IBM Plex Sans',system-ui,sans-serif; padding:8px 14px; border-radius:999px; border:1px solid var(--line,#dcd8c9); background:var(--surface,#fff); color:var(--ink,#1b1c16); cursor:pointer; }
.info-btns.al-row .info-btn:hover{ border-color:var(--guf,#b6862c); }
.info-btn.al-share, .info-btn.al-getapp, .info-btn.al-update{ display:inline-flex; align-items:center; gap:6px; }
.info-btn.al-getapp[hidden], .info-btn.al-update[hidden]{ display:none; }
html.app-mode .al-getapp{ display:none !important; }

/* ---- "A new version is ready" bar ---- */
.upd-bar{ position:fixed; left:50%; transform:translateX(-50%); top:max(10px, env(safe-area-inset-top)); width:min(560px, calc(100% - 20px)); z-index:130; display:flex; align-items:center; gap:10px; padding:10px 8px 10px 14px; background:var(--surface,#fff); border:1.5px solid var(--guf,#b6862c); border-radius:14px; box-shadow:0 10px 30px rgba(27,28,22,.25); font-family:'IBM Plex Sans',system-ui,sans-serif; }
.upd-bar b{ display:block; font-size:15px; color:var(--ink,#1b1c16); } .upd-bar span{ display:block; font-size:12.5px; color:var(--ink-muted,#66645a); line-height:1.3; }
.upd-bar .al-btn{ flex:none; padding:9px 14px; font-size:14px; }
.in-no{ flex:none; padding:6px 10px; background:none; border:0; color:var(--ink-faint,#9c988a); font-size:20px; line-height:1; cursor:pointer; }
@media print{ .upd-bar, .in-banner, .m-bar, .m-drawer{ display:none !important; } }

/* ---- arrival banner on a phone that is not the installed app ---- */
.in-banner{ position:fixed; left:10px; right:10px; bottom:max(10px, env(safe-area-inset-bottom)); z-index:110; display:flex; align-items:center; gap:10px; padding:10px 8px 10px 12px; background:var(--surface,#fff); border:1.5px solid var(--guf,#b6862c); border-radius:14px; box-shadow:0 10px 30px rgba(27,28,22,.3); font-family:'IBM Plex Sans',system-ui,sans-serif; }
.in-banner img{ flex:none; width:44px; height:44px; border-radius:10px; }
.in-txt{ flex:1; min-width:0; font-size:12.5px; line-height:1.3; color:var(--ink-muted,#66645a); } .in-txt > b{ display:block; margin-bottom:1px; font-size:15px; color:var(--ink,#1b1c16); } .in-txt span b{ color:var(--ink,#1b1c16); }
.in-banner .al-btn{ flex:none; padding:9px 14px; font-size:14px; }

/* ---- phone top bar + drawer menu (hidden above 760 px) ---- */
.m-bar, .m-drawer{ display:none; }
@media (max-width:760px){
  .m-bar{ display:flex; align-items:center; gap:10px; position:sticky; top:0; z-index:64; /* below every pop-up (70+), above the sticky section bars (60); was 100 and covered the windows' close buttons (design review 2026-10-17) */ margin:0; padding:max(6px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left)); background:var(--bg,#f1f0e9); border-bottom:1px solid var(--line,#dcd8c9); box-shadow:0 8px 10px -8px rgba(27,28,22,.3); font-family:'IBM Plex Sans',system-ui,sans-serif; }
  .m-burger{ flex:none; display:flex; flex-direction:column; justify-content:center; gap:5px; width:46px; height:42px; padding:0 12px; background:var(--guf,#b6862c); border:1px solid #8b6a1c; border-radius:10px; cursor:pointer; }
  .m-burger span{ display:block; height:3px; border-radius:2px; background:#1b1c16; }
  .m-logo{ flex:none; display:block; } .m-logo img{ display:block; height:30px; width:auto; }
  .m-title{ flex:1; min-width:0; text-align:right; color:var(--up,#7a3b2e); font-weight:800; font-size:14px; line-height:1.15; overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
  .m-drawer{ display:block; position:fixed; inset:0; z-index:125; visibility:hidden; pointer-events:none; font-family:'IBM Plex Sans',system-ui,sans-serif; }
  .m-drawer.open{ visibility:visible; pointer-events:auto; }
  .m-scrim{ position:absolute; inset:0; background:rgba(27,28,22,.55); opacity:0; transition:opacity .2s; } .m-drawer.open .m-scrim{ opacity:1; }
  .m-panel{ position:absolute; left:0; top:0; bottom:0; width:min(86vw,340px); display:flex; flex-direction:column; gap:2px; padding:max(14px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); background:var(--surface,#fff); border-right:1px solid var(--line,#dcd8c9); box-shadow:10px 0 30px rgba(27,28,22,.25); overflow-y:auto; transform:translateX(-102%); transition:transform .22s ease; }
  .m-drawer.open .m-panel{ transform:none; }
  .m-top{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:8px; } .m-top img{ height:34px; width:auto; }
  .m-close{ background:transparent; color:var(--ink,#1b1c16); border:1px solid var(--line,#dcd8c9); border-radius:8px; padding:8px 12px; font:inherit; font-size:14px; font-weight:700; cursor:pointer; }
  .m-sec{ margin:14px 4px 4px; color:var(--ink-faint,#9c988a); font-size:11.5px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
  .m-link{ display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; min-height:46px; padding:9px 14px; background:transparent; color:var(--ink,#1b1c16); border:0; border-radius:10px; font:inherit; font-size:16px; font-weight:700; text-align:left; text-decoration:none; cursor:pointer; }
  .m-link:active, .m-link:hover{ background:color-mix(in srgb, var(--guf,#b6862c) 16%, transparent); }
  .m-link.active{ background:var(--guf,#b6862c); color:#1b1c16; }
  body.m-menu-open{ overflow:hidden; }
  /* pop-ups on a phone: the dialog starts below the clock, Close is pinned top-right so it is always reachable */
  .ap-backdrop{ padding:calc(8px + env(safe-area-inset-top)) 8px calc(8px + env(safe-area-inset-bottom)); }
  .ap-backdrop::before{ content:''; position:fixed; top:0; left:0; right:0; height:env(safe-area-inset-top); background:var(--bg,#f1f0e9); z-index:9; pointer-events:none; }
  .ap-backdrop .ap-close{ position:fixed; top:calc(8px + env(safe-area-inset-top)); right:12px; z-index:10; padding:8px 16px; background:var(--surface,#fff); border:1.5px solid var(--guf,#b6862c); font-size:14px; font-weight:800; box-shadow:0 4px 14px rgba(27,28,22,.3); }
  .ap-backdrop .ap-head{ padding-right:92px; }
  .ap{ padding:12px 12px 16px; } .ap-head h2{ font-size:20px; } .ap-head .sub{ font-size:13px; }
  .ga-grid{ grid-template-columns:1fr; } .sh-grid{ grid-template-columns:1fr 1fr; } .sh-grid.two{ grid-template-columns:1fr; }
  /* app feel: no grey tap flash, no double-tap zoom delay, no pull-to-refresh bounce */
  html{ -webkit-tap-highlight-color:transparent; overscroll-behavior-y:none; }
  .m-link, .al-btn, .in-banner{ -webkit-user-select:none; user-select:none; touch-action:manipulation; }
  /* the fixed "Top" pill sits under the sticky bar: move it below */
  .wsu-top{ top:calc(56px + env(safe-area-inset-top)) !important; }
  /* no sideways page scroll on phones (found 2026-10-09 at 375 px: the Key trends peers table was 439 px wide): tables in cards shrink and wrap, and the card scrolls inside itself as a last resort */
  .fd-card{ overflow-x:auto; }
  .fd-card .fd-table{ font-size:12px !important; width:100%; }
  .fd-card .fd-table th, .fd-card .fd-table td{ padding:5px 5px !important; white-space:normal; }
  .fd-card .fd-table th{ font-size:11px !important; }
}

/* phones (design review 2026-10-17): the utility buttons are one "More" menu that never overlaps the heading */
.info-btns .al-more{ display:none; }
@media (max-width:760px){
  .info-btns.info-btns.info-btns:has(.al-more){ position:relative !important; top:auto !important; right:auto !important; left:auto !important; width:100% !important; align-self:stretch; display:flex !important; flex-direction:column; align-items:flex-end; gap:6px !important; margin:2px 0 10px !important; z-index:20; }
  .info-btns:has(.al-more):not(.al-open) > *:not(.al-more){ display:none !important; }
  .info-btns .al-more{ display:inline-flex !important; align-items:center; gap:6px; }
  .wrap > .info-btns.al-row:has(.al-more){ order:-1; } /* home: its own line between the top bar and the heading */
  .info-btns.al-open > *:not(.al-more){ display:block !important; min-width:200px; text-align:left; }
}

/* bottom tab bar, installed app only (owner 2026-12-05, session-scripts/fix_1205/patch_app_tabbar.js) */
.m-tabs{ display:none; }
@media (max-width: 760px){
  html.has-tabs .m-tabs{ display:grid; grid-template-columns:repeat(5, 1fr); position:fixed; left:0; right:0; bottom:0; z-index:63; padding:6px 6px calc(6px + env(safe-area-inset-bottom)); background:rgba(255,255,255,.96); -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px); border-top:1px solid var(--line,#dcd8c9); box-shadow:0 -2px 14px rgba(27,28,22,.07); }
  .m-tab{ display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; min-height:50px; padding:2px; border:0; background:none; color:var(--ink-muted,#66645a); font:600 11px/1.1 'IBM Plex Sans', system-ui, sans-serif; text-decoration:none; cursor:pointer; -webkit-tap-highlight-color:transparent; }
  .m-tab svg{ width:24px; height:24px; padding:3px 16px; box-sizing:content-box; border-radius:16px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; transition:background .15s; }
  .m-tab[data-tab="more"] svg{ fill:currentColor; stroke:none; }
  .m-tab.on{ color:#0b5f78; } .m-tab.on svg{ background:#dcebf1; stroke-width:2.1; }
  .m-tab:active svg{ background:#e9f1f4; }
  .m-tab:focus-visible{ outline:2px solid #0b5f78; outline-offset:-2px; border-radius:12px; }
  html.has-tabs body{ padding-bottom:calc(70px + env(safe-area-inset-bottom)) !important; }
  html.has-tabs .wsu-kt{ display:none !important; }
  html.has-tabs .wsu-reset{ bottom:calc(78px + env(safe-area-inset-bottom)) !important; }
}
@media print{ .m-tabs{ display:none !important; } }

/* app-style top bar, installed app only (owner 2026-12-05, session-scripts/fix_1205/patch_app_topbar.js) */
.m-back, .m-more, .m-menu{ display:none; }
@media (max-width: 760px){
  html.app-top body{ padding-top:0 !important; }
  html.app-top .m-bar{ display:grid; grid-template-columns:44px minmax(0, 1fr) 44px; gap:6px; align-items:center; min-height:52px; padding-top:max(4px, env(safe-area-inset-top)); padding-bottom:4px; border-bottom-color:transparent; box-shadow:none; transition:box-shadow .2s, border-color .2s; }
  html.app-top .m-bar.m-scrolled{ border-bottom-color:var(--line,#dcd8c9); box-shadow:0 6px 12px -10px rgba(27,28,22,.45); }
  html.app-top .m-burger, html.app-top .m-logo{ display:none; }
  html.app-top .m-title{ grid-column:2; grid-row:1; text-align:center; color:var(--ink,#1b1c16); font-size:16px; font-weight:700; line-height:1.25; -webkit-line-clamp:1; opacity:0; transform:translateY(4px); transition:opacity .18s, transform .18s; }
  html.app-top .m-bar.m-titled .m-title{ opacity:1; transform:none; }
  html.app-top .m-back, html.app-top .m-more{ display:flex; grid-row:1; align-items:center; justify-content:center; width:44px; height:44px; padding:0; border:0; border-radius:22px; background:transparent; color:#0b5f78; cursor:pointer; -webkit-tap-highlight-color:transparent; }
  html.app-top .m-back{ grid-column:1; } html.app-top .m-more{ grid-column:3; }
  .m-back svg, .m-more svg{ width:26px; height:26px; }
  .m-back svg{ fill:none; stroke:currentColor; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round; }
  .m-more svg{ fill:currentColor; }
  html.app-top .m-back:active, html.app-top .m-more:active, html.app-top .m-more[aria-expanded="true"]{ background:#dcebf1; }
  .m-back:focus-visible, .m-more:focus-visible{ outline:2px solid #0b5f78; outline-offset:-2px; }
  html.app-home .m-back, html.app-home .m-title{ display:none; }
  html.app-home .m-logo{ display:block; grid-column:1 / 3; grid-row:1; justify-self:start; padding-left:6px; } html.app-home .m-logo img{ height:28px; }
  html.app-top .ds-top, html.app-top .info-btns.info-btns.info-btns:has(> .al-more){ display:none !important; }
  html.app-top .m-menu:not([hidden]){ display:flex; flex-direction:column; position:fixed; right:max(8px, env(safe-area-inset-right)); z-index:66; min-width:230px; max-width:calc(100vw - 16px); padding:6px; background:#fff; border:1px solid var(--line,#dcd8c9); border-radius:14px; box-shadow:0 12px 32px rgba(27,28,22,.22); font-family:'IBM Plex Sans', system-ui, sans-serif; transform-origin:top right; animation:mMenuIn .14s ease-out; }
  .m-menu button{ display:block; width:100%; min-height:44px; padding:10px 14px; border:0; border-radius:10px; background:none; color:var(--ink,#1b1c16); font:inherit; font-size:15.5px; font-weight:600; text-align:left; cursor:pointer; }
  .m-menu button:hover, .m-menu button:active, .m-menu button:focus-visible{ background:#e9f1f4; outline:none; }
  @keyframes mMenuIn{ from{ opacity:0; transform:scale(.96); } to{ opacity:1; transform:none; } }
}
@media (prefers-reduced-motion: reduce){ .m-title, .m-bar, .m-menu{ transition:none !important; animation:none !important; } }
@media print{ .m-menu, .m-back, .m-more{ display:none !important; } }
@media (max-width: 760px){ html.has-tabs body .wsu-top, html.has-tabs body.home-compact .wsu-top{ bottom:calc(78px + env(safe-area-inset-bottom)) !important; } } /* ↑ Top above the tab bar (2026-12-05) */
