/* Simplified application shell: a calm hierarchy for the game’s main loops. */
:root {
  --shell-bg: #10162f;
  --shell-panel: #171d3d;
  --shell-panel-raised: #202852;
  --shell-line: rgba(180, 191, 255, .16);
  --shell-text: #f4f4ec;
  --shell-muted: #aeb8dd;
  --shell-accent: #9e8cff;
  --shell-accent-soft: rgba(158, 140, 255, .18);
}

body, #app, .page.on { background: var(--shell-bg); color: var(--shell-text); }

.top {
  min-height: 58px;
  padding: max(8px, env(safe-area-inset-top)) 12px 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--shell-line);
  background: rgba(16, 22, 47, .94);
}

.profileBar {
  min-width: 0;
  border-radius: 12px;
  padding: 5px 7px;
  background: rgba(255,255,255,.04);
}

.headerCurrency, .res.gem {
  min-height: 38px;
  padding: 0 9px;
  border-radius: 11px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--shell-line);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 7px max(8px, env(safe-area-inset-left)) calc(7px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--shell-line);
  background: rgba(16,22,47,.97);
  box-shadow: 0 -10px 28px rgba(4, 7, 22, .24);
}

.tabs button {
  position: relative;
  min-width: 0;
  min-height: 48px;
  padding: 5px 2px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--shell-muted);
  background: transparent;
}

.tabs button > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  line-height: 13px;
  white-space: nowrap;
}

.tabs button.on {
  color: var(--shell-text);
  background: var(--shell-accent-soft);
  border-color: rgba(174,160,255,.32);
}

.tabs button .dot {
  right: 9px;
  top: 7px;
}

#pHome.on {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 10px;
}

.expeditionScroll {
  display: grid;
  gap: 10px;
}

.arena {
  border-radius: 0 0 18px 18px;
  overflow: hidden;
}

.arenaActivities {
  top: auto;
  right: 10px;
  bottom: 10px;
  left: auto;
}

.activitiesBtn {
  display: grid;
  gap: 1px;
  min-width: 142px;
  padding: 8px 11px;
  text-align: left;
  color: var(--shell-text);
  border: 1px solid rgba(206, 196, 255, .32);
  border-radius: 12px;
  background: rgba(23, 29, 61, .88);
  box-shadow: 0 8px 20px rgba(2, 5, 20, .32);
}

.activitiesBtn > span { font: 700 12px/14px 'Work Sans', sans-serif; }
.activitiesBtn > small { color: var(--shell-muted); font: 500 10px/12px 'Work Sans', sans-serif; }
.activitiesBtn.alert { border-color: #f5cd6b; box-shadow: 0 0 0 2px rgba(245,205,107,.18); }

.eqwrap, .forgerow, .encounterCard, .destinationSummary,
.panel, .destinationHeader, .passDestinationHeader, .suggestionsHeader {
  border-color: var(--shell-line);
  box-shadow: 0 8px 24px rgba(3, 6, 20, .16);
}

#gearGrid { padding: 0 12px; }

.forgerow {
  margin: 0 8px;
  padding: 10px;
  gap: 8px;
  border: 1px solid var(--shell-line);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(33,40,82,.96), rgba(19,24,52,.98));
}

/* Chat under the forge: the newest two world-chat lines, one each, always two lines tall. Tapping it opens Chat. */
.homeChat {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  box-sizing: border-box;
  width: calc(100% - 16px);
  margin: 0 8px;
  padding: 8px 12px;
  min-height: 0;
  text-align: left;
  color: var(--shell-muted);
  border: 1px solid var(--shell-line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(33,40,82,.96), rgba(19,24,52,.98));
  box-shadow: 0 8px 24px rgba(3, 6, 20, .16);
}
.homeChat .homeChatIcon { width: 24px; height: 24px; background: #cfc8ff; filter: none; transform: none; }
.homeChat .homeChatMsgs { display: grid; align-content: center; gap: 1px; min-height: 34px; }
.homeChat .hcLine { font: 400 12px/17px 'Work Sans', sans-serif; }
.homeChat .hcLine b { color: var(--shell-text); font: 600 12px/17px 'Work Sans', sans-serif; }
/* a long name (16 letters and a clan tag) is cut with an ellipsis before it takes the whole line, so the message is still read */
.homeChat .hcLine b { display: inline-block; max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.homeChat .hcLine small { color: var(--shell-muted); font: 400 12px/17px 'Work Sans', sans-serif; }
.homeChat > i { color: var(--shell-accent); }
/* "14 online": the heroes of this server who have the game open (the presence ping's answer), a small pill before the arrow:
   a dot and the number only, so the two message lines keep their width */
.homeChat .homeOnline { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px;
  background: rgba(111, 214, 164, .12); border: 1px solid rgba(111, 214, 164, .3); color: #b6f0d2; font: 600 11px/16px 'Work Sans', sans-serif; white-space: nowrap; }
.homeChat .homeOnline[hidden] { display: none; }
.onlineDot { width: 7px; height: 7px; border-radius: 50%; background: #6fd6a4; box-shadow: 0 0 0 0 rgba(111, 214, 164, .6); animation: onlinePulse 2.4s ease-out infinite; }
@keyframes onlinePulse { 0% { box-shadow: 0 0 0 0 rgba(111, 214, 164, .55); } 70%, 100% { box-shadow: 0 0 0 6px rgba(111, 214, 164, 0); } }
@media (prefers-reduced-motion: reduce) { .onlineDot { animation: none; } }
#pHome.arenaEncounterOpen .homeChat { display: none; }   /* a duel or league fight takes the forge screen, like the dock */

.forgeVisual { min-height: 82px; }
.anvilwrap { gap: 7px; }
.anvilbtn { min-height: 54px; border-radius: 13px; }
.forgelvl { border-radius: 11px; }
.autobtn { border-radius: 11px; }

.activitySheetList {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.activitySheetRow {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  text-align: left;
  color: var(--shell-text);
  border: 1px solid var(--shell-line);
  border-radius: 12px;
  background: rgba(255,255,255,.045);
}

.activitySheetRow span { display: grid; gap: 3px; }
.activitySheetRow b { font: 700 13px/16px 'Work Sans', sans-serif; }
.activitySheetRow small { color: var(--shell-muted); font: 400 11px/15px 'Work Sans', sans-serif; }
.activitySheetRow strong { color: #c8bdff; font-size: 11px; }

.page.pad {
  width: min(100%, 760px);
  margin-inline: auto;
  padding: 16px 12px calc(22px + var(--tabH));
}

.destinationHeader, .passDestinationHeader, .suggestionsHeader {
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(34,42,87,.92), rgba(20,26,57,.95));
}

.destinationHeader h1, .passDestinationHeader h1, .suggestionsHeader h1 {
  margin: 4px 0 6px;
  font-size: clamp(23px, 6vw, 31px);
  line-height: 1.1;
}

.destinationHeader p, .passDestinationHeader p, .suggestionsHeader p { color: var(--shell-muted); }

.destinationSection { margin: 20px 4px 9px; font-size: 14px; color: var(--shell-muted); }
.battleMenu { gap: 8px; }
.battleMenu button { min-height: 68px; border-radius: 13px; background: rgba(255,255,255,.045); border-color: var(--shell-line); }

.seg {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 8px 0;
  background: linear-gradient(var(--shell-bg) 76%, transparent);
  scrollbar-width: none;
}

.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 0 0 auto; border-radius: 999px; padding: 8px 12px; }
.seg button.on { background: var(--shell-accent-soft); color: var(--shell-text); }

@media (min-width: 720px) {
  .top { padding-inline: max(20px, calc((100vw - 940px) / 2)); }
  #pHome { width: min(100%, 900px); margin-inline: auto; padding-inline: 10px; }
  .forgerow { margin-inline: 0; }
  .homeChat { width: 100%; margin-inline: 0; }
  .tabs { padding-inline: max(20px, calc((100vw - 760px) / 2)); }
  .tabs button > span { font-size: 11px; }
}

@media (max-width: 360px) {
  .top { gap: 5px; padding-inline: 7px; }
  .profileCopy { max-width: 112px; }
  .headerCurrency, .res.gem { padding-inline: 6px; }
  .activitiesBtn { min-width: 124px; padding: 7px 8px; }
  .tabs button > span { font-size: 9px; }
}
/* Clan hub follow-up: keep the header functional and the Clan page scannable. */
.top { grid-template-columns:minmax(0,1fr) 76px 76px; align-items:start; }
/* A tab that shows the crystals in the first chip hides the second (renderTop): one chip, flush right */
.top .res[hidden] { display:none !important; }
.top:has(.res.gem[hidden]) { grid-template-columns:minmax(0,1fr) 76px; }
.profileStack { display:grid; gap:6px; min-width:0; }
.profileActions { min-width:0; }
.profileActions .activitiesBtn { width:100%; min-width:0; box-shadow:none; }
.headerCurrency, .res.gem { box-sizing:border-box; width:76px; min-width:76px; justify-content:center; }
.arenaActivities { display:none; }
#pClan .clanHubPanel { background:transparent; border:none; box-shadow:none; }
.clanHubPanel > .pb { padding:0; }
.clanIdentity, .clanOverview, .clanMembers { display:grid; gap:12px; }
.clanIdentity { padding:15px; border:1px solid var(--shell-line); border-radius:16px; background:linear-gradient(145deg,rgba(37,44,91,.94),rgba(20,26,57,.96)); }
.clanIdentityMain { display:flex; align-items:center; gap:12px; }
.clanIdentityMain h2 { margin:2px 0; font-size:20px; line-height:1.15; }
.clanIdentityMain p { margin:0; color:var(--shell-muted); font-size:12px; }
.clanStatusChips { display:flex; flex-wrap:wrap; gap:6px; }
.clanStatusChips > span { display:inline-flex; align-items:center; gap:4px; padding:5px 7px; border-radius:999px; background:rgba(255,255,255,.07); color:var(--shell-muted); font-size:11px; }
.clanHubNav { display:flex; gap:5px; overflow:auto; padding:9px 0 3px; scrollbar-width:none; }
.clanHubNav::-webkit-scrollbar { display:none; }
.clanHubNav button { flex:0 0 auto; padding:8px 11px; border:1px solid var(--shell-line); border-radius:999px; background:rgba(255,255,255,.04); color:var(--shell-muted); }
.clanHubNav button.on { color:var(--shell-text); background:var(--shell-accent-soft); border-color:rgba(174,160,255,.32); }
.clanHubNotice { display:grid; grid-template-columns:1fr auto; gap:4px 10px; align-items:center; padding:11px; border:1px solid rgba(245,205,107,.3); border-radius:12px; background:rgba(245,205,107,.08); }
.clanHubNotice span { color:var(--shell-muted); font-size:11px; }
.clanHubNotice .btn { grid-row:1 / span 2; grid-column:2; }
.clanHubActions { display:flex; gap:8px; }
.clanHubActions .btn { flex:1; }
.clanPreviewHead, .clanSectionHead { display:flex; justify-content:space-between; align-items:end; margin-top:4px; }
.clanPreviewHead h3, .clanSectionHead h3 { margin:2px 0 0; font-size:16px; }
.clanRosterPreview, .clanRosterFull { display:grid; gap:6px; }
.clanRosterPreview .row, .clanRosterFull .row { border-color:var(--shell-line); }
.clanMoreMembers { padding:9px; border:1px dashed var(--shell-line); border-radius:10px; color:#c8bdff; background:transparent; }
.clanLeave { margin-top:8px; }
@media (max-width:360px) {
  .top { grid-template-columns:minmax(0,1fr) 66px 66px; }
  .top:has(.res.gem[hidden]) { grid-template-columns:minmax(0,1fr) 66px; }
  .headerCurrency, .res.gem { width:66px; min-width:66px; font-size:11px; }
  .profileActions .activitiesBtn { padding:7px 8px; }
}

/* Header rewards: two direct actions, without a catch-all menu. */
.profileActions { display:grid; grid-template-columns:minmax(0,1fr); gap:6px; }
.profileActions .headerAction { display:grid; min-width:0; min-height:44px; padding:6px 8px; border:1px solid var(--shell-line); border-radius:11px; color:var(--shell-text); background:rgba(255,255,255,.045); box-shadow:none; text-align:left; }
.profileActions .headerAction > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:800; font-size:11px; }
.profileActions .headerAction small { overflow:hidden; color:var(--shell-muted); text-overflow:ellipsis; white-space:nowrap; font-size:9px; line-height:12px; }
.profileActions .headerAction.alert { border-color:rgba(245,205,107,.65); background:rgba(245,205,107,.10); }
.idleDailyGift { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:10px 0; padding:10px; border:1px solid var(--shell-line); border-radius:11px; background:rgba(255,255,255,.045); }
.idleDailyGift > div { display:grid; gap:2px; min-width:0; }
.idleDailyGift small { color:var(--shell-muted); font-size:11px; }
@media (max-width:360px) { .profileActions .headerAction { padding:6px; } .profileActions .headerAction > span { font-size:10px; } }

/* Forge keeps its activity actions together, never in the rest of the app. */
#forgeActivities[hidden] { display:none; }
/* Social is a dedicated landing point; its three destinations stay separate from Clan. */
.socialLanding { display:grid; gap:10px; padding:16px; border:1px solid var(--shell-line); border-radius:16px; background:linear-gradient(145deg,rgba(37,44,91,.94),rgba(20,26,57,.96)); }
.socialLanding h1 { margin:0; font-size:22px; }
.socialLanding .mini { margin:0; }
.socialLandingChoices { display:grid; gap:8px; margin-top:4px; }
.socialLandingChoices button { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; padding:12px; border:1px solid var(--shell-line); border-radius:12px; color:var(--shell-text); background:rgba(255,255,255,.045); text-align:left; }
.socialLandingChoices button span { display:grid; gap:2px; }
.socialLandingChoices button small { color:var(--shell-muted); font-size:11px; }
.socialLandingChoices button strong { color:#c8bdff; font-size:12px; }

/* One consistent Back control makes destination exits predictable. */
.sectionBack {
  display:inline-flex;
  align-items:center;
  min-height:32px;
  margin:0 0 10px;
  padding:0 12px;
  border:1px solid var(--shell-line);
  border-radius:999px;
  color:var(--shell-text);
  background:rgba(255,255,255,.05);
  font:700 12px/1 'Work Sans',sans-serif;
}
#pClan .clanHubPanel { width:100%; }

/* Forge activity actions are compact labels, not a second card hierarchy. */
#forgeActivities { justify-items:start; }
#forgeActivities .headerAction {
  display:inline-flex;
  align-items:center;
  height:32px;
  min-height:32px;
  width:fit-content;
  padding-inline:12px;
}
#forgeActivities .headerAction small { display:none; }

@media (min-width:960px) {
  #app {
    display:grid;
    grid-template-columns:216px minmax(0,1fr);
    grid-template-rows:auto minmax(0,1fr);
    width:100%;
    max-width:none;
    min-height:100vh;
    margin:0;
    overflow:visible;
  }

  .top {
    grid-column:1 / -1;
    grid-row:1;
    width:100%;
    padding-inline:clamp(24px,3vw,48px);
    align-items:center;
  }
  /* a stack taller than the 64px bar spilled over the sidebar: on a wide screen the actions sit beside the profile */
  .profileStack { display:flex; align-items:center; gap:16px; }
  .profileStack .profileBar { flex:none; width:auto; min-width:0; }
  .profileActions { display:flex; align-items:center; gap:8px; }
  .profileActions .headerAction { min-height:36px; padding:5px 12px; }

  .tabs {
    position:sticky;
    top:0;
    left:auto;
    right:auto;
    bottom:auto;
    grid-column:1;
    grid-row:2;
    align-self:start;
    display:grid;
    grid-template-columns:1fr;
    grid-auto-rows:min-content;
    align-content:start;
    gap:6px;
    width:100%;
    max-width:none;
    min-height:calc(100vh - var(--topH));
    margin:0;
    padding:18px 12px;
    border-top:0;
    border-right:1px solid var(--shell-line);
    box-shadow:10px 0 28px rgba(4,7,22,.18);
  }

  .tabs button {
    display:grid;
    grid-template-columns:30px minmax(0,1fr);
    align-items:center;
    gap:9px;
    min-height:46px;
    padding:7px 9px;
    text-align:left;
  }

  .tabs button > span { font-size:12px; line-height:16px; }
  .tabs button .dot { right:10px; top:10px; }

  .page,
  .page.pad {
    grid-column:2;
    grid-row:2;
    width:100%;
    max-width:1340px;
    margin:0 auto;
    padding:30px clamp(28px,4vw,64px) 42px;
  }

  #pHome { width:100%; max-width:1340px; margin:0 auto; padding-inline:clamp(28px,4vw,64px); }
  /* Mobile owns the Forge viewport. Desktop lets the full loop flow in the page, sized so it fits the window: the arena keeps
     its 16:9 shape and gets only the height the rows under it leave (--stageW, below), so a short window gets a smaller
     arena rather than a page that scrolls. */
  #pHome.on {
    --homePadY:clamp(12px,3.2dvh,30px);
    --homeFitH:calc(100dvh - var(--topH,64px) - 2 * var(--homePadY));
    --homeDockRow:140px;   /* the forge row's height: css/expedition.css makes it shorter on a short window */
    display:block;
    height:auto;
    min-height:calc(100dvh - var(--topH,64px));
    overflow:visible;
    padding-block:var(--homePadY);
  }
  @media (max-height:810px) { #pHome.on { --homeDockRow:132px; } }
  @media (max-height:720px) { #pHome.on { --homeDockRow:124px; } }
  #pHome .expeditionScroll {
    width:100%;
    display:grid;
    flex:none;
    min-height:0;
    overflow:visible;
  }
  #pHome #forgeDock {
    width:100%;
    margin:12px 0 0;
  }
  #pHome .homeChat { width:100%; margin:12px 0 0; }
  /* The arena shows a fixed width of the world, so a very wide, short arena crops the fighters at the top (the hero's head
     under the stage label, the enemy cut off): give it one shape on every desktop width instead of stretching it. */
  #pHome.on .arena {
    height:auto;
    min-height:0;
    max-height:none;
    aspect-ratio:16 / 9;
    margin:0 0 12px;
    border-radius:18px;
  }
  .destinationHeader,
  .passDestinationHeader,
  .suggestionsHeader,
  .socialLanding,
  .clanHubPanel { max-width:none; }

  .sectionBack { position:static; margin-bottom:14px; }
}

/* Forge on a wide window: the arena and the anvil on the left, your equipment on the right, all in one view. Under 1180px
   the loop stays one column (above), centred. */
@media (min-width:1180px) {
  #pHome.on {
    /* under the arena: its 12px margin, the forge row (row + 22px of padding and border) and the chat strip (12px + 53px) */
    --stageW:max(400px, calc((var(--homeFitH) - 12px - 12px - (var(--homeDockRow) + 22px) - 12px - 53px - 4px) * 16 / 9));
    display:grid;
    /* the arena column is 1.7fr of the room (a roomy window) or the width that fits the window height, whichever is less;
       equipment takes what is left, up to 520px, and the pair is centred */
    grid-template-columns:min(var(--stageW), calc((100% - 24px) * .62963)) minmax(340px,520px);
    justify-content:center;
    grid-template-rows:auto auto auto auto minmax(0,1fr);
    grid-template-areas:"arena eq" "skills eq" "enc eq" "dock eq" "chat eq";
    column-gap:24px;
    row-gap:0;
    align-content:start;
    align-items:start;
  }
  #pHome .expeditionScroll { display:contents; }
  #pHome .arena { grid-area:arena; margin:0; }
  #pHome .skillrow { grid-area:skills; }
  #pHome .encounterCard { grid-area:enc; }
  #pHome .eqwrap { grid-area:eq; align-self:start; margin:0; }
  #pHome #forgeDock { grid-area:dock; margin:12px 0 0; }
  #pHome .homeChat { grid-area:chat; align-self:start; }
  #pHome .eqwrap #gearGrid { padding:0 14px 14px; }
  #pHome .eqwrap .homeGearGrid { grid-template-columns:repeat(3,minmax(0,1fr)); grid-auto-rows:96px; gap:10px; }
  #pHome .eqwrap .homeGearCard { height:96px; }
  #pHome .eqwrap .homeGearCard .aicon { width:56px; height:56px; }
}

/* One badge: the equipment grid and the forge (Forge level, the anvil, Auto Forge) are a single panel, the grid on top and
   the forge row under it, with no heading above. The forge stays outside the scrolling part (js/08-main.js keeps the anvil
   on screen), so the two halves are two boxes drawn as one: the same flat colour, the corners rounded only at the ends, no
   gap between them. Where the window is wide enough for equipment beside the arena (1180px) they are apart again. */
@media (max-width: 1179px) {
  .eqwrap {
    margin: 0 8px; padding: 8px 0; border: 1px solid var(--shell-line); border-bottom: 0;
    border-radius: 16px 16px 0 0; background: #1a2043; box-shadow: none;
  }
  #pHome #forgeDock {
    margin-top: -10px; padding: 6px 10px 8px; background: #1a2043; box-shadow: none;
    border-top-color: rgba(206, 196, 255, .16); border-radius: 0 0 16px 16px;
  }
}
@media (min-width: 720px) and (max-width: 1179px) { .eqwrap { margin-inline: 0; } }
@media (min-width: 960px) and (max-width: 1179px) {
  #pHome #forgeDock { margin-top: 0; }
  /* One column: the arena, the equipment (162px), the forge row (row + 16px) and the chat strip (12px + 53px) share the
     window height. The whole column takes the width the arena gets, centred, so the rows under it stay as wide as it. */
  #pHome.on { --stageW: max(380px, calc((var(--homeFitH) - 12px - 10px - 162px - (var(--homeDockRow) + 16px) - 12px - 53px - 14px) * 16 / 9)); }
  #pHome .expeditionScroll, #pHome #forgeDock, #pHome .homeChat { width: min(100%, var(--stageW)); margin-inline: auto; }
}
/* the info button: the arena's bottom left corner */
#arena .gearInfo {
  position: absolute; left: 10px; bottom: 10px; top: auto; right: auto; z-index: 6;
  width: 28px; height: 28px; line-height: 26px; font-size: 15px;
}
#pHome.arenaEncounterOpen #arena .gearInfo, #pHome.arenaReplay #arena .gearInfo { display: none; }
/* A phone shows the arena, the badge, and the chat strip without scrolling the top part: the equipment sits right under
   the arena (no gap under the skill row). */
@media (max-width: 719px) {
  .expeditionScroll { gap: 6px; }
  #pHome.on .skillrow { margin-bottom: 0; }
}

/* Collection tabs. Companions / Tech / Shop and the row under them (Skills / Pets / Mounts, the Tech branches,
   Shop / Style) are real tabs: a baseline runs under the strip, the buttons lose their boxes, and the selected
   tab carries an accent bar that sits on the baseline. Same selectors as destinations.css (which has ids in them),
   later in the cascade. The first row sticks under the header, the second under the first. */
:root { --collectionTabsH: 47px; }
#pHero>.seg, #pTech>.seg, #pGems>.seg, #pShop>.seg {
  position: sticky; top: var(--topH, 58px); z-index: 20;
  display: flex; gap: 0; padding: 0; margin: 0 0 16px;
  overflow-x: auto; scrollbar-width: none;
  border: 0; border-radius: 0;
  background: linear-gradient(var(--shell-line), var(--shell-line)) bottom / 100% 1px no-repeat, var(--shell-bg);
}
#pHero>.seg::-webkit-scrollbar, #pTech>.seg::-webkit-scrollbar, #pGems>.seg::-webkit-scrollbar, #pShop>.seg::-webkit-scrollbar { display: none; }
#pHero>.seg button, #pTech>.seg button, #pGems>.seg button, #pShop>.seg button {
  position: relative; flex: 1 1 0; min-width: max-content; min-height: 46px; padding: 10px 16px;
  border: 0; border-bottom: 3px solid transparent; border-radius: 0;
  background: transparent; box-shadow: none; text-shadow: none;
  color: var(--shell-muted); font: 600 14px 'Work Sans', sans-serif;
  transition: color .15s, border-color .15s, background-color .15s;
}
@media (hover: hover) {
  #pHero>.seg button:hover, #pTech>.seg button:hover, #pGems>.seg button:hover, #pShop>.seg button:hover { color: var(--shell-text); background: rgba(255,255,255,.04); }
}
#pHero>.seg button.on, #pTech>.seg button.on, #pGems>.seg button.on, #pShop>.seg button.on,
#pHero>.seg button[aria-selected="true"], #pTech>.seg button[aria-selected="true"], #pGems>.seg button[aria-selected="true"], #pShop>.seg button[aria-selected="true"] {
  color: var(--shell-text); border-bottom-color: var(--shell-accent);
  background: linear-gradient(to top, var(--shell-accent-soft), transparent 75%); box-shadow: none;
}
#pHero>.seg button:focus-visible, #pTech>.seg button:focus-visible, #pGems>.seg button:focus-visible, #pShop>.seg button:focus-visible {
  outline: 2px solid var(--shell-accent); outline-offset: -4px; border-radius: 8px;
}
/* the row under the page tabs is the quieter one */
#pHero>.seg:not(.collectionSeg), #pTech>.seg:not(.collectionSeg), #pGems>.seg:not(.collectionSeg), #pShop>.seg:not(.collectionSeg) {
  top: calc(var(--topH, 58px) + var(--collectionTabsH)); margin-bottom: 14px;
}
#pHero>.seg:not(.collectionSeg) button, #pTech>.seg:not(.collectionSeg) button, #pGems>.seg:not(.collectionSeg) button, #pShop>.seg:not(.collectionSeg) button {
  flex: 1 1 auto; min-height: 40px; padding: 8px 14px; border-bottom-width: 2px; font-size: 13px; font-weight: 500;
}
#pHero>.seg:not(.collectionSeg) button.on, #pTech>.seg:not(.collectionSeg) button.on, #pGems>.seg:not(.collectionSeg) button.on, #pShop>.seg:not(.collectionSeg) button.on {
  font-weight: 600;
}
#pHero>.seg button.alert::after, #pTech>.seg button.alert::after, #pGems>.seg button.alert::after, #pShop>.seg button.alert::after { top: 6px; right: 8px; }
@media (prefers-reduced-motion: reduce) {
  #pHero>.seg button, #pTech>.seg button, #pGems>.seg button, #pShop>.seg button { transition: none; }
}
