/* Participant portal additions on top of admin.css (Fiori theme) */
body.portal { display: flex; flex-direction: column; min-height: 100vh; }
body.portal .shell { padding: 0 20px; gap: 12px; }
.top-nav { display: flex; gap: 4px; margin-left: 8px; height: 100%; }
.top-nav a { display: flex; align-items: center; padding: 0 12px; color: var(--text-2); font-weight: 600; border-bottom: 3px solid transparent; }
.top-nav a:hover { color: var(--text); text-decoration: none; }
.top-nav a.on { color: var(--brand-hover); border-bottom-color: var(--brand); }

.portal-main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 28px 24px 56px; display: flex; flex-direction: column; gap: 24px; }
.portal-main.narrow { max-width: 760px; }
.portal-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 18px 24px; background: #fff; border-top: 1px solid var(--border); color: var(--text-3); font-size: 13px; }

.p-head h1 { margin: 0; font-size: 26px; letter-spacing: -.01em; }
.p-head p { margin: 4px 0 0; color: var(--text-2); }

/* Stepper */
.stepper { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 0; }
.stepper li { display: flex; align-items: center; gap: 10px; flex: 1; color: var(--text-2); font-size: 14px; }
.stepper li:not(:last-child)::after { content: ""; flex: 1; height: 2px; background: var(--border-strong); margin: 0 12px; border-radius: 2px; }
.stepper li.done:not(:last-child)::after { background: var(--brand); }
.stepper .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; border: 2px solid var(--border-strong); background: #fff; flex: none; }
.stepper li.cur { color: var(--text); font-weight: 700; }
.stepper li.cur .dot { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.stepper li.done .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.stepper .lbl { white-space: nowrap; }

/* Forms */
.form-card { padding: 24px 28px 28px; }
.form-card h2 { margin: 0 0 4px; font-size: 18px; }
.form-card .hint { margin: 0 0 20px; color: var(--text-2); font-size: 13px; }
.fgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 20px; }
.fgrid.three { grid-template-columns: repeat(3, 1fr); }
.fgrid .field { max-width: none; min-width: 0; }
.fgrid .full { grid-column: 1 / -1; }
.field label .req { color: var(--negative); margin-left: 2px; }
.field .err { color: var(--negative); font-size: 12px; }
.field.has-err .input, .field.has-err .select { border-color: var(--negative); box-shadow: 0 0 0 1px var(--negative); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--brand); flex: none; }
.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn-lg { height: 44px; padding: 0 22px; font-size: 15px; border-radius: 10px; }

/* Auth card */
.auth-wrap { display: grid; place-items: center; flex: 1; }
.auth-card { width: min(420px, 100%); padding: 32px 30px 26px; }
.auth-card h1 { margin: 0; font-size: 22px; }
.auth-card .sub { margin: 4px 0 22px; color: var(--text-2); }
.auth-card .field { max-width: none; margin-bottom: 14px; }
.auth-card .btn { width: 100%; }
.auth-alt { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); text-align: center; color: var(--text-2); font-size: 14px; }

/* Strava connect */
.strava-box { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; padding: 24px 28px; }
.strava-logo { width: 64px; height: 64px; border-radius: 16px; background: #fc4c02; display: grid; place-items: center; flex: none; }
.strava-logo svg { width: 36px; height: 36px; fill: #fff; }
.btn-strava { background: #fc4c02; border-color: #fc4c02; color: #fff; }
.btn-strava:hover { background: #e34402; border-color: #e34402; color: #fff; }
.perm-list { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; color: var(--text-2); }
.perm-list li { display: flex; gap: 8px; align-items: center; }
.perm-list .ic { color: var(--positive); width: 16px; height: 16px; }

/* Event cards */
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.ev-card { display: flex; flex-direction: column; overflow: hidden; color: var(--text); transition: box-shadow .15s, transform .15s; }
.ev-card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); text-decoration: none; }
.ev-banner { height: 150px; background-size: cover; background-position: center; position: relative; }
.ev-banner .tag { position: absolute; top: 12px; left: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.ev-banner .tag:not(.tag-pos):not(.tag-info):not(.tag-warn) { background: #fff; }
.ev-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ev-title { margin: 0; font-size: 18px; font-weight: 700; }
.ev-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--text-2); font-size: 13px; }
.ev-meta span { display: inline-flex; align-items: center; gap: 6px; }
.ev-meta .ic { width: 15px; height: 15px; }
.ev-foot { margin-top: auto; padding-top: 10px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); }
.ev-price { font-size: 20px; font-weight: 700; }

/* Event hero */
.ev-hero { border-radius: var(--radius-l); min-height: 260px; background-size: cover; background-position: center; display: flex; align-items: flex-end; padding: 28px; color: #fff; box-shadow: var(--shadow-1); }
.ev-hero h1 { margin: 6px 0 0; font-size: 32px; letter-spacing: -.01em; text-shadow: 0 1px 8px rgba(0,0,0,.25); }
.ev-hero p { margin: 4px 0 0; font-size: 16px; opacity: .95; }
.ev-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.ev-side { position: sticky; top: calc(var(--shell-h) + 16px); }
.facts { list-style: none; margin: 0; padding: 0; }
.facts li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.facts li:first-child { border-top: 0; }
.facts .ic { color: var(--brand); margin-top: 2px; }
.facts .k { font-size: 12px; color: var(--text-2); }
.facts .v { font-weight: 600; }
.prose { white-space: pre-line; line-height: 1.6; }
.price-big { font-size: 32px; font-weight: 700; letter-spacing: -.02em; }

/* Dashboard */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kpi { padding: 16px 18px; }
.kpi .k { color: var(--text-2); font-size: 13px; }
.kpi .v { font-size: 30px; font-weight: 300; line-height: 1.15; margin-top: 4px; }
.kpi .v small { font-size: 14px; color: var(--text-2); margin-left: 3px; }
.kpi .s { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.progress { height: 10px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 5px; }
tr.me td { background: var(--brand-soft) !important; }
.you { font-size: 11px; font-weight: 700; color: var(--brand-hover); background: #fff; border: 1px solid var(--info-line); border-radius: 4px; padding: 0 5px; margin-left: 6px; }

@media (max-width: 900px) {
  .ev-layout { grid-template-columns: 1fr; }
  .ev-side { position: static; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  body.portal .shell { padding: 0 10px; }
  .top-nav a { padding: 0 8px; font-size: 13px; }
  .portal-main { padding: 18px 14px 40px; gap: 16px; }
  .fgrid, .fgrid.three { grid-template-columns: 1fr; }
  .form-card { padding: 20px 16px; }
  .stepper .lbl { display: none; }
  .stepper li.cur .lbl { display: inline; }
  .ev-hero { min-height: 200px; padding: 20px; }
  .ev-hero h1 { font-size: 24px; }
  .shell-brand img { height: 26px; }
  .shell-brand .shell-sub { display: none; }
  body.portal .shell > .btn-ghost { display: none; }
}

/* Ticket picker */
.tickets { border: 0; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.tickets legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.ticket { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; background: #fff; transition: border-color .12s, box-shadow .12s; }
.ticket:hover { border-color: var(--brand); }
.ticket input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.ticket:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: var(--brand-soft); }
.ticket input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.t-body { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.t-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.t-name { font-weight: 700; }
.t-price { font-weight: 700; font-size: 16px; white-space: nowrap; }
.t-desc { color: var(--text-2); font-size: 12px; line-height: 1.4; }

/* Policy pages */
.policy-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.policy-nav a { padding: 6px 12px; border-radius: 16px; background: #fff; border: 1px solid var(--border-strong); color: var(--text-2); font-size: 13px; font-weight: 600; }
.policy-nav a:hover { text-decoration: none; color: var(--text); }
.policy-nav a.on { background: var(--brand-soft); border-color: var(--info-line); color: var(--brand-hover); }
.policy h2 { font-size: 16px; margin: 22px 0 6px; }
.policy p, .policy li { line-height: 1.65; color: var(--text); }
.policy ul { padding-left: 20px; margin: 6px 0; }
.portal-foot a { color: var(--text-2); }

/* Event progress cards (My events / Profile) */
.prog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.prog-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; color: var(--text); transition: box-shadow .15s, transform .15s; }
.prog-card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); text-decoration: none; }
.prog-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.prog-title { font-weight: 700; font-size: 16px; }
.prog-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.prog-km .num { font-size: 28px; font-weight: 300; letter-spacing: -.02em; }
.prog-km small { color: var(--text-2); font-size: 13px; }
.prog-stats { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.prog-stats .k { font-size: 12px; color: var(--text-2); }
.prog-stats .v { font-weight: 700; font-size: 16px; }
.prog-stats .v small { font-weight: 400; color: var(--text-2); font-size: 12px; }

/* Homepage */
.home-poster { display: block; border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow-2); background: #1d2d3e; }
.home-poster img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.home-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; padding: 28px; align-items: center; }
.home-hero.no-img { grid-template-columns: 1fr; }
.home-hero-text h1 { margin: 10px 0 4px; font-size: 34px; letter-spacing: -.02em; line-height: 1.15; }
.home-hero-text .lead { margin: 0 0 16px; font-size: 17px; color: var(--text-2); }
.home-hero-img img { display: block; width: 100%; height: auto; border-radius: 12px; }
.home-hero-ph { aspect-ratio: 16 / 9; border-radius: 12px; }
.home-facts { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-wrap: wrap; gap: 14px 28px; }
.home-facts li { display: flex; gap: 10px; align-items: flex-start; }
.home-facts .ic { color: var(--brand); width: 22px; height: 22px; margin-top: 2px; }
.home-facts b { display: block; }
.home-facts small { color: var(--text-2); font-size: 13px; }
.home-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.home-tickets { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.home-ticket { padding: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text); transition: box-shadow .15s, transform .15s; }
.home-ticket:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); text-decoration: none; }
.ht-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 4px; }
.ht-icon .ic { width: 24px; height: 24px; }
.ht-name { font-weight: 700; font-size: 17px; }
.ht-price { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.ht-desc { color: var(--text-2); font-size: 13px; line-height: 1.5; flex: 1; }
.ht-boards { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.home-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.home-step { padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.home-step span:last-child { color: var(--text-2); font-size: 13px; line-height: 1.5; }
.hs-n { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; }
.home-contact { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.home-contact-links { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.home-contact-links a { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; }

/* Event page: show the full poster when one is uploaded */
.ev-poster { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-l); box-shadow: var(--shadow-1); }
.ev-title-row h1 { margin: 6px 0 2px; font-size: 30px; letter-spacing: -.01em; }
.ev-title-row p { margin: 0; color: var(--text-2); font-size: 16px; }

@media (max-width: 900px) {
  .home-hero { grid-template-columns: 1fr; padding: 20px; }
  .home-steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .home-hero-text h1 { font-size: 26px; }
  .home-steps { grid-template-columns: 1fr; }
}

/* Event cards with a poster: show the whole poster + a "Registrations open" ribbon */
.ev-grid { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.ev-banner.has-poster { height: auto; aspect-ratio: 16 / 9; background: #1d2d3e; }
.ev-banner.has-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ev-banner > .tag { z-index: 1; }
.ev-ribbon { display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #256f3a; color: #fff; font-weight: 700; font-size: 14px; padding: 9px 12px; letter-spacing: .01em; }
.ev-ribbon .ic { width: 16px; height: 16px; }
@media (max-width: 480px) { .ev-grid { grid-template-columns: 1fr; } }

/* Membership upgrade */
.upgrade-box { margin-top: 14px; padding: 14px; border: 1px dashed var(--brand); border-radius: 10px; background: var(--brand-soft); }
.ub-title { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 4px; }
.ub-title .ic { color: var(--brand); }
.ub-text { font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.upgrade-banner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 20px; border-left: 4px solid var(--brand); }

/* Top navigation: scroll on small screens instead of wrapping */
.top-nav { overflow-x: auto; scrollbar-width: none; }
.top-nav::-webkit-scrollbar { display: none; }
.top-nav a { white-space: nowrap; }

/* Page hero (About) */
.page-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; padding: 28px; align-items: center; }
.page-hero-text h1 { margin: 10px 0 6px; font-size: 32px; letter-spacing: -.02em; }
.page-hero-text .lead { margin: 0 0 18px; font-size: 17px; color: var(--text-2); line-height: 1.55; }
.page-hero-img { width: 100%; height: 100%; max-height: 340px; object-fit: cover; border-radius: 12px; }
.offer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.offer { padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.offer span { color: var(--text-2); font-size: 14px; line-height: 1.55; }

/* Team */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.team-card { overflow: hidden; display: flex; flex-direction: column; }
.team-photo { aspect-ratio: 4 / 5; background: var(--bg); }
.team-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.team-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.team-body h2 { margin: 0; font-size: 17px; }
.team-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.team-mini { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 14px 8px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-1); color: var(--text); }
.team-mini:hover { text-decoration: none; box-shadow: var(--shadow-2); }
.team-mini img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; margin-bottom: 6px; }
.team-mini b { font-size: 14px; }
.team-mini span { font-size: 12px; color: var(--text-2); }

/* Homepage about + testimonials */
.home-about { display: grid; grid-template-columns: 340px 1fr; gap: 24px; padding: 20px; align-items: center; }
.home-about img { width: 100%; height: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; }
.home-about-text h2 { margin: 8px 0 6px; font-size: 22px; }
.home-about-text p { margin: 0 0 14px; color: var(--text-2); line-height: 1.6; }
.quotes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(300px, 340px); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 12px; }
.quote { margin: 0; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; scroll-snap-align: start; }
.quote blockquote { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text); }
.quote figcaption { display: flex; gap: 10px; align-items: center; }
.quote figcaption img, .quote figcaption .mini { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; }
.quote figcaption b { display: block; font-size: 14px; }
.quote figcaption small { display: block; color: var(--text-2); font-size: 12px; line-height: 1.35; }

/* Contact map */
.map-wrap { margin-top: 18px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); aspect-ratio: 16 / 9; }
.map-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }

@media (max-width: 900px) {
  .page-hero, .home-about { grid-template-columns: 1fr; }
  .team-strip { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 520px) {
  .team-strip { grid-template-columns: repeat(2, 1fr); }
  .quotes { grid-auto-columns: 85%; }
}
.team-photo { position: relative; overflow: hidden; }
.team-photo img { position: absolute; inset: 0; object-position: center 20%; }

/* ===================== Phone layout (rider-first) ===================== */
.menu-btn, .mob-menu, .tabbar { display: none; }

@media (max-width: 760px) {
  /* Compact top bar: logo · (avatar / Create account) · ☰ */
  body.portal .shell { padding: 0 8px 0 12px; gap: 6px; }
  .top-nav, .hide-sm.btn { display: none !important; }
  .shell-join { height: 34px; padding: 0 12px; font-size: 13px; }
  .menu-btn { display: inline-grid; width: 42px; height: 42px; }
  .menu-btn .ic { width: 22px; height: 22px; }

  /* ☰ menu panel */
  .mob-menu:not([hidden]) { display: block; position: fixed; top: var(--shell-h); left: 0; right: 0; z-index: 60;
    background: #fff; box-shadow: var(--shadow-3); border-top: 1px solid var(--border); max-height: calc(100vh - var(--shell-h)); overflow-y: auto; }
  .mob-menu nav { display: flex; flex-direction: column; padding: 6px 0 10px; }
  .mob-menu a { padding: 14px 20px; font-size: 16px; font-weight: 600; color: var(--text); border-left: 3px solid transparent; }
  .mob-menu a:hover { text-decoration: none; background: var(--bg); }
  .mob-menu a.on { color: var(--brand-hover); border-left-color: var(--brand); background: var(--brand-soft); }
  .mob-menu a.mob-menu-cta { margin: 8px 16px 0; text-align: center; border-radius: 10px; background: var(--brand); color: #fff; border: 0; }
  body.menu-open { overflow: hidden; }

  /* Bottom tab bar (app style) */
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    background: #fff; border-top: 1px solid var(--border); box-shadow: 0 -2px 10px rgba(34,53,72,.08);
    padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 58px;
    color: var(--text-2); font-size: 11px; font-weight: 600; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a .ic { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--brand-hover); }
  .tabbar a.on .ic { stroke-width: 2.2; }
  body.portal { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }

  /* Comfortable touch + no iPhone zoom on focus */
  .input, .select, textarea.input { font-size: 16px; min-height: 44px; }
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }
  .btn-lg { min-height: 48px; }
  .check input { width: 22px; height: 22px; }

  /* Event page: ticket box first, then the description */
  .ev-layout { display: flex; flex-direction: column; }
  .ev-side { order: -1; position: static; }
  .ev-title-row h1, .ev-hero h1 { font-size: 24px; }

  /* Tables: only the essentials */
  .hide-sm { display: none !important; }
  .tbl th, .tbl td { padding: 10px 8px; }
  .tbl .microbar { min-width: 0; gap: 6px; }
  .tbl .microbar .track { min-width: 40px; }
  .col-dist { min-width: 0 !important; }
  .table-toolbar .search-field { width: 100%; }
  .kpi .v { font-size: 26px; }

  /* Footer above the tab bar */
  .portal-foot { flex-direction: column; gap: 6px; padding-bottom: 18px; font-size: 12px; }
  .home-hero-text h1 { font-size: 26px; }
  .p-head h1 { font-size: 22px; }
}
@media (max-width: 380px) {
  .shell-join { display: none; }
  .tabbar a { font-size: 10px; }
}
@media (max-width: 760px) {
  .team-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .team-body { padding: 10px 12px 14px; gap: 6px; }
  .team-body h2 { font-size: 14px; }
  .team-body .tag { font-size: 11px; height: auto; padding: 2px 6px; white-space: normal; }
  .page-hero { padding: 18px; }
  .page-hero-text h1 { font-size: 26px; }
}
@media (max-width: 900px) {
  .page-hero-img { height: auto; max-height: none; aspect-ratio: 16 / 9; }
  .home-about img { height: auto; max-height: none; aspect-ratio: 16 / 9; }
}

/* ===================== App feel (phones + installed app) ===================== */
.only-sm, .install-card[hidden], .install-app[hidden] { display: none !important; }
.hello { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hello h1 { margin: 2px 0 0; font-size: 24px; letter-spacing: -.01em; }
.install-card { align-items: center; gap: 14px; padding: 14px 16px; color: var(--text); border: 1px solid var(--info-line); background: linear-gradient(90deg, #fff, var(--brand-soft)); }
.install-card:hover { text-decoration: none; }
.install-card img { width: 48px; height: 48px; border-radius: 12px; box-shadow: var(--shadow-1); }
.install-card span:nth-child(2) { flex: 1; min-width: 0; }
.install-card b { display: block; }
.install-card small { color: var(--text-2); font-size: 12px; }
.mob-menu-legal { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 10px 20px 4px; border-top: 1px solid var(--border); margin-top: 6px; }
.mob-menu .mob-menu-legal a { padding: 6px 0; font-size: 13px; font-weight: 400; color: var(--text-2); border: 0; }
.mob-menu .install-app { display: flex; align-items: center; gap: 10px; color: var(--brand-hover); }
.ios-install:not([hidden]) { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; }
.ios-sheet { background: #fff; width: 100%; border-radius: 18px 18px 0 0; padding: 22px 22px calc(22px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.ios-sheet img { width: 64px; height: 64px; border-radius: 14px; }
.ios-sheet ol { text-align: left; color: var(--text-2); line-height: 1.8; margin: 4px 0 10px; }
.ios-sheet .btn { width: 100%; }

@media (max-width: 760px) {
  .only-sm { display: flex !important; }
  .install-card.only-sm[hidden], .install-app[hidden] { display: none !important; }

  /* App-like canvas: edge-to-edge, no website footer, no tap flash */
  html { -webkit-tap-highlight-color: transparent; }
  body.portal { background: #eef1f4; overscroll-behavior-y: none; }
  .portal-foot { display: none; }
  .portal-main { padding: 14px 12px 24px; gap: 14px; }
  .card { border-radius: 16px; }
  .section-title { font-size: 17px; margin-bottom: 10px; }
  .crumbs { display: none; }
  body.portal .shell { box-shadow: 0 1px 0 var(--border); }
  .tabbar a { -webkit-user-select: none; user-select: none; }
  .tabbar a:active, .btn:active { transform: scale(.97); }

  /* Event page: fixed Join bar above the tabs */
  .join-bar { position: fixed; left: 0; right: 0; bottom: calc(58px + env(safe-area-inset-bottom)); z-index: 54;
    align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px;
    background: #fff; border-top: 1px solid var(--border); box-shadow: 0 -4px 14px rgba(34,53,72,.10); }
  .join-bar b { display: block; font-size: 17px; }
  .join-bar small { color: var(--text-2); font-size: 12px; }
  .join-bar .btn { min-height: 44px; padding: 0 22px; }
  body.portal:has(.join-bar) { padding-bottom: calc(58px + 66px + env(safe-area-inset-bottom)); }
  #join { scroll-margin-top: calc(var(--shell-h) + 10px); }

  /* Progress cards & lists feel like app tiles */
  .prog-grid { grid-template-columns: 1fr; gap: 12px; }
  .ev-grid { grid-template-columns: 1fr; }
}

/* Installed app (opened from the home screen): respect the notch, no browser chrome */
html.is-app body.portal .shell { padding-top: env(safe-area-inset-top); height: calc(var(--shell-h) + env(safe-area-inset-top)); }
