/* The old stylesheet never reset button chrome, so every new control would inherit the UA grey. */
button{background:none}

/* App shell: laptop = brand + centred pill nav in a 64px header.
   Phone (<=860px) = trainer header + floating bottom tab bar (artboards 1c / 1d). */
.shell{position:relative;min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;isolation:isolate;color:var(--fg)}
.shell::before{content:'';position:fixed;inset:0;background:var(--bg-wash);z-index:-2;pointer-events:none}
.shell::after{content:'';position:fixed;left:50%;top:58%;width:min(640px,120vw);aspect-ratio:1;transform:translate(-50%,-50%);border-radius:50%;background:radial-gradient(var(--aura),transparent 65%);filter:blur(30px);opacity:var(--aura-strength);z-index:-1;pointer-events:none;transition:background .6s ease}

.appbar{position:relative;height:64px;flex:none;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 28px;border-bottom:1px solid var(--edge)}
.brand{display:flex;align-items:center;gap:10px;font-family:var(--font-display);font-weight:800;font-size:calc(18px*var(--scale));letter-spacing:-.6px;color:var(--fg);text-decoration:none}
.brand img{width:28px;height:28px}
.brand i{font-style:normal;font-weight:500;color:var(--fg-muted)}

.pill-nav{display:flex;gap:4px;background:var(--surface);padding:4px;border-radius:var(--r-pill);border:1px solid var(--edge);box-shadow:var(--raise)}
.pill-nav button{padding:9px 18px;border-radius:var(--r-pill);font-size:calc(13px*var(--scale));color:var(--fg-2);white-space:nowrap}
.pill-nav button.active{background:var(--on-nav);color:var(--on-nav-ink);font-weight:700}

.appbar-right{display:flex;align-items:center;gap:10px}
.chip{display:inline-flex;align-items:center;gap:6px;padding:8px 12px;border-radius:var(--r-pill);background:var(--chip);font-size:calc(13px*var(--scale));font-weight:600;color:var(--fg);white-space:nowrap}
.chip svg{color:var(--accent-text)}
.chip-accent{background:var(--accent-soft);color:var(--accent-text);font-weight:700}
.avatar{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:linear-gradient(135deg,var(--accent),#2a6f8f);color:var(--accent-ink);font-family:var(--font-display);font-weight:800;font-size:calc(13px*var(--scale));flex:none}

.trainer-head{display:none;align-items:center;gap:10px;min-width:0}
.trainer-head strong{display:block;font-weight:700;font-size:calc(14px*var(--scale));color:var(--fg)}
.trainer-head small{display:block;font-size:calc(11px*var(--scale));color:var(--fg-muted)}

.screen{position:relative;flex:1;min-width:0;display:flex;flex-direction:column}
/* render() stamps the surface on #main from one list of exceptions in app.js, so these
   two rules no longer each re-enumerate every overhauled view in opposite directions. */
.screen #main[data-surface="night"]{max-width:none;margin:0;padding:0;display:flex;flex-direction:column;flex:1;min-width:0}
/* Screens the overhaul has not reached keep the pre-overhaul light surface so their own
   palette stays readable under the dark shell. Each leaves LEGACY_SURFACE as it is restyled. */
.screen #main[data-surface="legacy"]{background:#f9fbf9;color:#293c35}

.tabbar{display:none}
@media(max-width:860px){
 .appbar{height:auto;padding:6px 20px 0;border-bottom:0}
 .appbar .pill-nav,.appbar .brand{display:none}
 .trainer-head{display:flex}
 .tabbar{position:fixed;left:14px;right:14px;bottom:max(18px,env(safe-area-inset-bottom));height:66px;border-radius:var(--r-pill);background:var(--tabbar-bg);border:1px solid var(--edge-2);backdrop-filter:blur(14px);display:flex;justify-content:space-around;align-items:center;padding:0 6px;z-index:40;box-shadow:var(--shadow-sm)}
 .tabbar button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;width:64px;height:52px;border-radius:var(--r-pill);font-size:calc(10px*var(--scale));font-weight:600;color:var(--fg-muted)}
 .tabbar button.active{background:var(--accent-soft);color:var(--accent-text);font-weight:700}
 .screen{padding-bottom:100px}
 .shell::after{top:46%}
}
@media(prefers-reduced-motion:reduce){.shell::after{transition:none}}
:root[data-motion="reduced"] .shell::after{transition:none}
