/* header-wallet fix (2026-10-27): balance pill no longer overlaps the "Gemme" nav tab.
   Cause: .app-header grid had a fixed minmax(300px,1fr) actions column while the actions
   content was ~400px wide, so .header-actions overflowed leftward over .primary-nav. */
html .app-header { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 14px; }
html .app-header > .primary-nav { justify-self: center; min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
html .app-header > .primary-nav::-webkit-scrollbar { display: none; }
html .app-header .primary-nav .nav-link { flex-shrink: 0; }
html .app-header > .header-actions { min-width: 0; flex-wrap: nowrap; }
html .app-header > .header-actions > * { flex-shrink: 0; }

/* Premium navy/gold balance pill with coin icon */
html .app-header .balance, html[data-skin="v2"] .app-header .balance {
  display: inline-grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
  min-width: 0; margin: 0; padding: 4px 12px 4px 5px; height: 38px; box-sizing: border-box;
  border: 1px solid rgba(232,190,92,.55); border-radius: 999px; text-align: left; white-space: nowrap;
  background: linear-gradient(180deg, #16204a, #0b1230); box-shadow: inset 0 1px rgba(255,255,255,.08), 0 2px 10px rgba(0,0,0,.35);
}
html .app-header .balance::before {
  content: "€"; grid-row: 1 / span 3; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  font: 900 .8rem/1 system-ui, sans-serif; color: #3a2600;
  background: radial-gradient(circle at 35% 30%, #fff3c4, #f3c75a 45%, #b7862a); box-shadow: inset 0 -2px rgba(0,0,0,.18), 0 0 0 1px rgba(255,220,140,.5);
}
html .app-header .balance span { grid-column: 2; color: #c9b47a; font-size: .6rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; line-height: 1; }
html .app-header .balance strong, html[data-skin="v2"] .app-header .balance strong { grid-column: 2; margin: 2px 0 0; color: #f7d77a; font-size: .9rem; font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; }
html .app-header .balance .balance-stale { grid-column: 2; font-size: .55rem; line-height: 1; }
html .app-header .balance .balance-stale[hidden] { display: none; }

/* Mid desktop: compact connection chip and nav so everything fits */
@media (max-width: 1440px) and (min-width: 1101px) {
  html .app-header #connection-button { width: 38px; padding: 0; justify-content: center; }
  html .app-header #connection-label { display: none; }
  html .app-header .primary-nav .nav-link { padding-left: 10px; padding-right: 10px; gap: 6px; }
}
@media (max-width: 1300px) and (min-width: 1101px) {
  html .app-header .primary-nav .nav-link > span:first-child:not(:only-child) { display: none; }
}

@media (max-width: 1200px) and (min-width: 1101px) { html .app-header .primary-nav .nav-link { padding-left: 7px; padding-right: 7px; } html .app-header { column-gap: 10px; } }
/* Tablet/mobile: show a compact balance pill (amount only) instead of hiding it */
@media (max-width: 1100px) {
  html .app-header { grid-template-columns: auto minmax(0, 1fr); }
  html .app-header > .header-actions { justify-self: end; }
  html .app-header .balance, html[data-skin="v2"] .app-header .balance { display: inline-grid; height: 34px; padding: 3px 10px 3px 4px; column-gap: 6px; }
  html .app-header .balance::before { width: 24px; height: 24px; font-size: .72rem; }
  html .app-header .balance span { display: none; }
  html .app-header .balance strong, html[data-skin="v2"] .app-header .balance strong { margin: 0; font-size: .82rem; }
}
@media (max-width: 360px) {
  html .app-header .balance, html[data-skin="v2"] .app-header .balance { padding-right: 8px; }
  html .app-header .balance strong, html[data-skin="v2"] .app-header .balance strong { font-size: .74rem; }
  html .app-header > .header-actions { gap: 4px; }
}
@media (max-width: 430px) and (min-width: 381px) { html .app-header .v2-brand-h { height: 28px; } }
/* guests never see the wallet */
html[data-skin="v2"][data-v2-guest] .app-header .balance { display: none !important; }
