/* ── Variables ── */
:root {
  --font-display: "Vanilla Whale", "Nunito", sans-serif;
  --font-body: "Nunito", sans-serif;
  --font-studio: "Bleeding Cowboys", "Vanilla Whale", serif;
  --ink: #f4efe1;
  --muted: #b8c5c8;
  --deep: #02070c;
  --water: #061722;
  --glass: rgba(7, 31, 47, 0.72);
  --line: rgba(244, 239, 225, 0.18);
  --gold: #d7b56d;
  --accent: #8ecde7;
  --fg: var(--ink);
  --link-hover: var(--gold);
  --focus-ring: rgba(255, 222, 148, 0.96);
  --sidebar-w: 230px;
  --content-max: 96rem;
  --hero-stats-width: min(28rem, 44vw);
  color-scheme: dark;
}

/* ── Reset / Base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-body);
  min-height: 100%;
  background-color: var(--deep);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  min-width: 20rem;
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--deep);
  line-height: 1.5;
  -webkit-tap-highlight-color: rgba(215, 181, 109, 0.2);
}

img,
svg {
  max-width: 100%;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

a,
a * {
  text-decoration: none !important;
}

a {
  color: var(--gold);
  font-weight: 700;
  opacity: 0.75;
  transition: opacity 140ms;
}

a:hover,
a:focus-visible {
  opacity: 1;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

/* Interactive controls brighten in place; hover and focus never shift geometry. */
:where(a, button, summary, [role="button"], .button, input[type="button"], input[type="submit"], input[type="reset"]):hover,
:where(a, button, summary, [role="button"], .button, input[type="button"], input[type="submit"], input[type="reset"]):focus-visible {
  transform: none !important;
}

h1,
h2,
h3,
h4,
h5,
h6,
.site-logo,
.display-heading {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  text-transform: none;
}

/* ── Water background animation ── */
@property --wx1 { syntax: '<percentage>'; initial-value: 72%; inherits: false; }
@property --wy1 { syntax: '<percentage>'; initial-value: 14%; inherits: false; }
@property --wx2 { syntax: '<percentage>'; initial-value: 8%;  inherits: false; }
@property --wy2 { syntax: '<percentage>'; initial-value: 82%; inherits: false; }
@property --wx3 { syntax: '<percentage>'; initial-value: 38%; inherits: false; }
@property --wy3 { syntax: '<percentage>'; initial-value: 48%; inherits: false; }


/* ── Page background ── */
.app-page {
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background: linear-gradient(180deg, var(--water) 0%, var(--deep) 100%);
  background-attachment: fixed;
}

/* ── Per-page background image — z-index 0, behind animation ── */
.app-page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: var(--page-bg, none);
  background-size: cover;
  background-position: center 33%;
  filter: blur(28px) saturate(0.45);
  opacity: 0.55;
  transform: scale(1.06);
  transform-origin: center;
  pointer-events: none;
}

/* ── Animated water blobs — z-index 1, above the image ── */
.app-page::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 60% 48% at var(--wx1) var(--wy1), rgba(84, 146, 176, 0.45), transparent),
    radial-gradient(ellipse 50% 40% at var(--wx3) var(--wy3), rgba(84, 146, 176, 0.28), transparent),
    radial-gradient(ellipse 35% 28% at var(--wx2) var(--wy2), rgba(84, 146, 176, 0.18), transparent);
  pointer-events: none;
}

/* ── App layout ── */
.app-layout {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  z-index: 2;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  background: rgba(2, 7, 16, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  transition: transform 260ms cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
  display: block;
  padding: 1rem 0.5rem 0.9rem;
  text-decoration: none;
  color: rgba(244, 239, 225, 0.95);
  font-family: var(--font-display);
  font-size: 2.4rem;
  letter-spacing: 0.03em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  opacity: 1;
  transition: color 320ms ease-in-out;
}

.sidebar-brand:hover,
.sidebar-brand:focus-visible {
  color: var(--gold);
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.75rem 0.5rem;
}

.sidebar-user-card {
  display: grid;
  gap: 0.6rem;
  margin: 0.05rem 0.15rem;
  padding: 0.7rem;
  border: 1px solid rgba(215, 181, 109, 0.25);
  border-radius: 0.85rem;
  background:
    linear-gradient(135deg, rgba(215, 181, 109, 0.13), transparent 55%),
    rgba(255, 255, 255, 0.035);
  transition: border-color 180ms ease, background-color 180ms ease;
}

.sidebar-user-summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.sidebar-user-identity {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  color: inherit;
  opacity: 1;
}

.sidebar-user-identity:hover .sidebar-user-avatar,
.sidebar-user-identity:focus-visible .sidebar-user-avatar {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(215, 181, 109, 0.22);
}

.sidebar-user-avatar {
  width: 2.85rem;
  height: 2.85rem;
  flex: 0 0 auto;
  border: 2px solid rgba(215, 181, 109, 0.65);
  border-radius: 50%;
  object-fit: cover;
  background: rgba(3, 19, 29, 0.9);
  box-shadow: 0 0 0 3px rgba(215, 181, 109, 0.1);
  transition: border-color 320ms ease-in-out, box-shadow 320ms ease-in-out;
}

.sidebar-user-avatar--default {
  padding: 0.3rem;
}

.sidebar-user-copy {
  display: grid;
  flex: 1;
  min-width: 0;
  opacity: 0.75;
  transition: opacity 320ms ease-in-out;
}

.sidebar-user-identity:hover .sidebar-user-copy,
.sidebar-user-identity:focus-visible .sidebar-user-copy {
  opacity: 1;
}

.sidebar-user-identity:hover .sidebar-user-copy strong,
.sidebar-user-identity:focus-visible .sidebar-user-copy strong,
.sidebar-user-identity:hover .sidebar-user-title,
.sidebar-user-identity:focus-visible .sidebar-user-title {
  color: var(--gold);
}

.sidebar-user-copy strong {
  display: block;
  overflow: hidden;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 320ms ease-in-out;
}

.sidebar-user-copy span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.sidebar-user-title {
  max-height: 2rem;
  overflow: hidden;
  line-height: 1.15;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: max-height 180ms ease, opacity 150ms ease, color 320ms ease-in-out;
}

.sidebar-user-card:not(.is-collapsed) .sidebar-user-copy {
  transform: translateY(-0.12rem);
}

.sidebar-user-toggle {
  display: grid;
  width: 2rem;
  height: 2rem;
  min-height: 2rem;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  color: rgba(244, 239, 225, 0.82);
  background: transparent;
  box-shadow: none;
  opacity: 1;
  transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease;
}

.sidebar-user-toggle:hover,
.sidebar-user-toggle:focus-visible,
.sidebar-user-toggle.is-collapse-cued {
  border-color: rgba(215, 181, 109, 0.7);
  color: var(--gold);
  background: rgba(215, 181, 109, 0.12);
}

.sidebar-user-toggle.is-collapse-cued {
  animation: sidebar-collapse-cue 700ms ease-in-out 2;
}

.sidebar-user-chevron {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(225deg) translate(-1px, -1px);
  transition: transform 180ms ease;
}

.sidebar-user-expanded {
  display: grid;
  max-height: 5rem;
  gap: 0.45rem;
  overflow: hidden;
  opacity: 1;
  transition: max-height 210ms ease, opacity 160ms ease;
}

.sidebar-user-action,
.sidebar-user-logout button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  color: rgba(244, 239, 225, 0.82);
  background: rgba(255, 255, 255, 0.05);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  opacity: 1;
  text-decoration: none;
  text-transform: uppercase;
  transition: border-color 130ms, background 130ms, color 130ms;
}

.sidebar-user-action:hover,
.sidebar-user-action:focus-visible,
.sidebar-user-logout button:hover,
.sidebar-user-logout button:focus-visible {
  border-color: rgba(215, 181, 109, 0.7);
  color: var(--gold);
  background: rgba(215, 181, 109, 0.1);
}

.sidebar-user-action {
  width: 100%;
  gap: 0.45rem;
}

.sidebar-user-logout {
  margin: 0;
}

.sidebar-user-logout button {
  appearance: none;
  width: 100%;
  gap: 0.45rem;
  cursor: pointer;
}

.sidebar-user-expanded .nav-icon {
  width: 1rem;
  height: 1rem;
}

.sidebar-user-card.is-collapsed {
  gap: 0;
}

.sidebar-user-card.is-collapsed .sidebar-user-title {
  max-height: 0;
  opacity: 0;
}

.sidebar-user-card.is-collapsed .sidebar-user-expanded {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.sidebar-user-card.is-collapsed .sidebar-user-chevron {
  transform: rotate(45deg) translate(-1px, -1px);
}

@keyframes sidebar-collapse-cue {
  0%, 100% { box-shadow: 0 0 0 0 rgba(215, 181, 109, 0); }
  50% { box-shadow: 0 0 0 5px rgba(215, 181, 109, 0.3); }
}

.sidebar-section-label {
  padding: 0.55rem 0.6rem 0.18rem;
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar-divider {
  height: 1px;
  margin: 0.45rem 0.6rem;
  background: var(--line);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.62rem;
  padding: 0.58rem 0.65rem;
  border-radius: 0.58rem;
  color: rgba(244, 239, 225, 0.65);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  opacity: 1;
  transition: color 160ms ease, background 160ms ease;
}

.nav-link-form {
  margin: 0;
}

.nav-button {
  width: 100%;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 800;
  font-size: 0.9rem;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  justify-content: flex-start;
  min-height: unset;
  cursor: pointer;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--gold);
  background: rgba(215, 181, 109, 0.1);
  opacity: 1;
}

.nav-link.active,
.nav-link.active:hover,
.nav-link.active:focus-visible {
  background: rgba(215, 181, 109, 0.12);
  color: var(--gold);
  opacity: 1;
}

.nav-icon {
  width: 1.3rem;
  height: 1.3rem;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: var(--icon-url) center / contain no-repeat;
  mask: var(--icon-url) center / contain no-repeat;
}

.icon-leaderboard { --icon-url: url("/icons/nav/leaderboard.svg"); }
.icon-savers      { --icon-url: url("/icons/nav/savers.svg"); }
.icon-spenders    { --icon-url: url("/icons/nav/killers.svg"); }
.icon-krill       { --icon-url: url("/icons/nav/krill.svg"); }
.icon-reroll      { --icon-url: url("/icons/reroll.svg"); }

.user-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex-wrap: nowrap;
}

.user-cell > a:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-cell-avatar-link {
  display: block;
  flex: 0 0 auto;
  border-radius: 50%;
  opacity: 1;
}

.user-cell-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.user-cell-avatar--default {
  object-position: 65% center;
}

.user-cell-avatar-link:hover .user-cell-avatar,
.user-cell-avatar-link:focus-visible .user-cell-avatar {
  box-shadow: 0 0 0 3px rgba(215, 181, 109, 0.34);
}

.online-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: rgb(80, 210, 110);
  flex-shrink: 0;
  box-shadow: 0 0 4px rgb(80, 210, 110, 0.7);
}

.feed-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.1rem;
}

.feed-badges {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

/* ── Inline krill amount (icon + number) ── */
.krill-amount {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.krill-icon {
  width: 0.9rem;
  height: 0.9rem;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("/icons/nav/savers.svg") center / contain no-repeat;
  mask: url("/icons/nav/savers.svg") center / contain no-repeat;
  opacity: 0.7;
}
.icon-current     { --icon-url: url("/icons/nav/current.svg"); }
.icon-badges      { --icon-url: url("/icons/nav/badges.svg"); }
.icon-register    { --icon-url: url("/icons/nav/register.svg"); }
.icon-join        { --icon-url: url("/icons/nav/join.svg"); }
.icon-login       { --icon-url: url("/icons/nav/login.svg"); }
.icon-dashboard   { --icon-url: url("/icons/nav/dashboard.svg"); }
.icon-whale       { --icon-url: url("/icons/nav/whale.svg"); }
.icon-buy         { --icon-url: url("/icons/nav/buy.svg"); }
.icon-kill        { --icon-url: url("/icons/nav/kill.svg"); }
.icon-inventory   { --icon-url: url("/icons/nav/inventory.svg"); }
.icon-profile     { --icon-url: url("/icons/nav/profile.svg"); }
.icon-admin       { --icon-url: url("/icons/nav/admin.svg"); }
.icon-contact     { --icon-url: url("/icons/nav/contact.svg"); }
/* ── Mobile sidebar overlay ── */
.sidebar-overlay {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(0, 0, 0, 0.62);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 220ms ease, visibility 220ms ease;
}

/* ── Main content area ── */
.app-main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.app-main > main {
  flex: 1;
}

/* ── Mobile top bar ── */
.mobile-topbar {
  display: none;
  align-items: center;
  gap: 0.65rem;
  min-height: calc(3.5rem + env(safe-area-inset-top));
  padding: calc(0.38rem + env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) 0.38rem max(0.75rem, env(safe-area-inset-left));
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(2, 7, 14, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.button.topbar-trade--buy {
  border-color: rgb(80, 210, 110);
  color: #0a1a22;
  background: rgb(80, 210, 110);
}

.button.topbar-trade--buy:not(:disabled):hover,
.button.topbar-trade--buy:not(:disabled):focus-visible {
  border-color: rgb(118, 232, 145);
  color: #0a1a22;
  background: rgb(105, 224, 132);
}

.button.topbar-trade--kill {
  border-color: rgb(245, 90, 90);
  color: #0a1a22;
  background: rgb(245, 90, 90);
}

.button.topbar-trade--kill:not(:disabled):hover,
.button.topbar-trade--kill:not(:disabled):focus-visible {
  border-color: rgb(255, 145, 145);
  color: #0a1a22;
  background: rgb(255, 122, 122);
}

.hamburger {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 140ms;
}

.hamburger:hover {
  opacity: 1;
}

.hamburger-icon {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--ink);
  -webkit-mask: url("/icons/menu.svg") center / contain no-repeat;
  mask: url("/icons/menu.svg") center / contain no-repeat;
}

/* ── Sidebar open state ── */
.sidebar-open .sidebar {
  transform: translateX(0);
}

.sidebar-open .sidebar-overlay {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

body.sidebar-open {
  overflow: hidden;
}

/* ── Page wrap ── */
.page-wrap {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding: clamp(1rem, 2vw, 1.75rem) clamp(1rem, 2.4vw, 2rem) clamp(2.25rem, 5vw, 4rem);
}

.page-wrap.pantry-page {
  max-width: none;
  padding-inline: 1.5rem;
}

.page-wrap.narrow {
  width: 100%;
  max-width: 46rem;
  margin-inline: auto;
}

/* ── How It Works ── */
.how-it-works-logo {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 8vw, 6rem);
  color: var(--ink);
  text-align: center;
  letter-spacing: 0.03em;
  margin-bottom: 2rem;
}
.how-it-works-tagline {
  text-align: center;
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--muted);
  margin: -1rem auto 2.5rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.how-it-works-intro {
  text-align: center;
  max-width: 580px;
  margin: 0 auto 2.5rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}
.how-it-works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1.5rem;
}
.how-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.07), transparent 46%),
    rgba(7, 31, 47, 0.46);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 0.6rem 2rem rgba(0,0,0,0.22);
  overflow: hidden;
}
.how-card-image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}
.how-card-body {
  padding: 1.4rem 1.4rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}
.how-card-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4vw, 3.2rem);
  font-weight: 700;
  line-height: 1;
  margin: 0;
  color: var(--fg);
}
.how-card-title span {
  color: var(--gold);
}
.how-card-body p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--muted);
}
.how-card-cta {
  margin-top: auto;
  padding-top: 1rem;
}
.how-it-works-duo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.how-card-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 1.2rem;
}

.how-card-actions .button {
  flex: 1;
}

/* ── Auth pages ── */
.auth-form-main .panel > p.muted {
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}
.auth-form-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-hero {
  position: relative;
  width: 100%;
  height: clamp(160px, 22vw, 220px);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-bottom: 1px solid var(--line);
}
.auth-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.auth-hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 33%;
  display: block;
}
.auth-hero-heading {
  position: relative;
  z-index: 1;
  padding: 0 1.5rem;
  font-family: var(--font-display);
  font-size: clamp(4rem, 10vw, 7rem);
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
}

.dashboard-account-hero {
  height: clamp(170px, 22vw, 230px);
  justify-content: space-between;
  gap: 1rem;
  padding: 5px 1.5rem;
}

.dashboard-hero-copy,
.hero-stats {
  position: relative;
  z-index: 1;
}

.dashboard-hero-copy .auth-hero-heading {
  padding: 0;
}

.dashboard-hero-copy p {
  margin: 0.15rem 0 0;
  color: var(--gold);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
}

.hero-stats {
  display: flex;
  gap: 0.7rem;
  width: var(--hero-stats-width);
  min-width: var(--hero-stats-width);
}

.hero-stats-col {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 0.5rem;
}

.hero-stats-col::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 9rem;
  height: 9rem;
  opacity: 0.1;
  pointer-events: none;
}

.hero-stats-col--krill::before {
  background-color: rgb(80, 210, 110);
  -webkit-mask: url("/icons/nav/savers.svg") center / contain no-repeat;
  mask: url("/icons/nav/savers.svg") center / contain no-repeat;
}

.hero-stats-col--kills::before {
  background-color: rgb(245, 90, 90);
  -webkit-mask: url("/icons/nav/killers.svg") center / contain no-repeat;
  mask: url("/icons/nav/killers.svg") center / contain no-repeat;
}

.hero-col-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  margin: 0;
  padding: 0.45rem 0.6rem 0.35rem;
  font-size: 1.05rem;
  font-weight: 900;
  text-align: center;
  letter-spacing: 0.03em;
}

.hero-stat {
  padding: 0.72rem 0.9rem;
  text-align: center;
}

.hero-stats-col--krill { border: 1px solid rgba(80, 210, 110, 0.5); }
.hero-stats-col--kills { border: 1px solid rgba(245, 90, 90, 0.5); }

.hero-stats-col--krill .hero-col-heading { color: rgb(80, 210, 110); }
.hero-stats-col--kills .hero-col-heading { color: rgb(245, 90, 90); }

.hero-stats-col--krill .hero-stat { border-top: 1px solid rgba(80, 210, 110, 0.25); }
.hero-stats-col--kills .hero-stat { border-top: 1px solid rgba(245, 90, 90, 0.25); }

.hero-stat strong,
.hero-stat span {
  display: block;
}

.hero-stat strong {
  color: var(--ink);
  font-size: clamp(1.1rem, 2.2vw, 1.6rem);
  line-height: 1.1;
}

.hero-stat span {
  margin-top: 0.22rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.hero-stats-col--krill .hero-stat span { color: rgba(80, 210, 110, 0.85); }
.hero-stats-col--kills .hero-stat span { color: rgba(245, 90, 90, 0.85); }

.hero-joined {
  margin-top: 0.3rem !important;
  color: rgba(244, 239, 225, 0.45) !important;
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
}

/* ── Page heading ── */
.page-heading {
  margin-bottom: 1.5rem;
}

.page-heading h1 {
  margin: 0 0 0.4rem;
}

/* ── Panel / Card ── */
.panel,
.info-card {
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 46%),
    rgba(7, 31, 47, 0.46);
  box-shadow: 0 0.6rem 2rem rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: clamp(1rem, 2.5vw, 1.6rem);
}

/* ── The Current: main flow + my current, side by side ── */
/* Mirror the profile page's .profile-panels-grid exactly (same track sizing,
   gap, and stretch) so both surfaces share one column geometry; width and
   horizontal margins come from the shared .page-wrap, and column padding from
   the shared .panel — no extra max-width here. */
.current-columns {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  /* Stretch so both columns share a top and bottom edge even when one holds
     fewer events; each column's pager is pinned to that shared bottom. */
  align-items: stretch;
  gap: 1rem;
}

/* Brief dim while a page is being fetched and swapped in (JS pagination). */
.current-columns.is-paging {
  opacity: 0.6;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

/* Logged-out visitors only see the main flow, centred and narrower. */
.current-columns--single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 64rem;
  margin-inline: auto;
}

/* Grid gap owns the spacing, so drop the stacked-panel top margin. This needs
   a three-class selector (0,3,0) to beat `.panel + .panel` (0,2,0), which is
   declared later in this file and would otherwise push the second column
   (My Current) 1rem below the first and break the top alignment. Each column
   is a flex column so its pager can sit at the bottom edge. */
.current-columns > .panel.current-column {
  margin-top: 0;
  display: flex;
  flex-direction: column;
}

.current-column .pager {
  margin-top: auto;
}

/* Collapse to a single stacked column at the same breakpoint the profile
   grid uses, keeping the two surfaces consistent. */
@media (max-width: 768px) {
  .current-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}

.panel + .panel {
  margin-top: 1rem;
}

.panel h1,
.panel h2,
.info-card h2 {
  margin: 0 0 0.5rem;
}

/* ── Panel header row (title + view-all link) ── */
.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.panel-header h2 {
  margin: 0;
}

/* ── Dashboard panel: large title + bottom-right view-all ── */
.dash-panel {
  display: flex;
  flex-direction: column;
}

.dash-panel-title {
  font-size: clamp(1.7rem, 3.5vw, 2.5rem);
  margin: 0 0 0.85rem;
}

.dash-panel .feed-list {
  margin-top: 0.65rem;
}

.dash-panel-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.85rem;
}

.view-all-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--gold);
  text-decoration: none;
  opacity: 0.82;
  white-space: nowrap;
  flex-shrink: 0;
}

.view-all-link:hover {
  opacity: 1;
}

.view-all-icon {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  background: currentColor;
  -webkit-mask: url("/icons/right.svg") center / contain no-repeat;
  mask: url("/icons/right.svg") center / contain no-repeat;
  flex-shrink: 0;
}

/* ── Dashboard grid (home page) ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.dash-full {
  grid-column: 1 / -1;
}

/* ── CTA card (logged-out home) ── */
.cta-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.7rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.cta-card .site-logo {
  display: block;
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  letter-spacing: 0.04em;
  line-height: 1;
}

.cta-card p {
  color: var(--muted);
  max-width: 38rem;
  line-height: 1.62;
  margin: 0;
  font-size: 1rem;
}

.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 0.2rem;
}

/* ── User welcome card (logged-in home) ── */
.user-welcome-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.user-welcome-info {
  flex: 1;
  min-width: 0;
}

.user-welcome-info h1 {
  margin: 0 0 0.15rem;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
}

.user-welcome-rank {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.03em;
}

.user-welcome-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.dashboard-actions {
  display: flex;
  gap: 3rem;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 0;
  margin-bottom: 1rem;
}

.profile-view-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
}

.tab-btn {
  display: inline-flex;
  min-height: 2.45rem;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: rgba(244, 239, 225, 0.78);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  opacity: 1;
  text-transform: uppercase;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.tab-btn:hover,
.tab-btn:focus-visible,
.tab-btn.active {
  border-color: rgba(215, 181, 109, 0.7);
  color: var(--gold);
  background: rgba(215, 181, 109, 0.1);
}

.admin-access-panel {
  margin: 1rem 0;
}

.admin-setting-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-setting-input {
  min-width: 12rem;
  flex: 1;
}

.admin-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.admin-inline-check input {
  width: 1.15rem;
  min-height: 1.15rem;
}

.admin-resync-form {
  margin-top: 0.8rem;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  color: #fff;
  text-decoration: none;
  opacity: 0.75;
  transition: opacity 0.15s ease;
}

.action-btn:hover {
  opacity: 1;
}

.action-btn.active,
.action-btn.active:hover,
.action-btn.active:focus-visible {
  color: var(--gold);
  opacity: 1;
}

.action-icon {
  display: block;
  width: 2.6rem;
  height: 2.6rem;
  background: currentColor;
  -webkit-mask: var(--icon-url) center / contain no-repeat;
  mask: var(--icon-url) center / contain no-repeat;
}

.action-btn-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.panel-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-heading-row h2,
.panel-heading-row p {
  margin: 0;
}

.panel-heading-row p {
  margin-top: 0.25rem;
}

.inventory-expiring-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}

.inventory-expiring-list li {
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: rgba(2, 7, 12, 0.24);
}

.inventory-expiring-list li + li {
  margin-top: 0;
}

.inventory-expiring-list strong,
.inventory-expiring-list span {
  display: block;
}

.inventory-expiring-list span {
  color: var(--muted);
  font-size: 0.84rem;
  margin-top: 0.28rem;
}


/* ── Eyebrow ── */
.eyebrow {
  margin: 0 0 0.32rem;
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

/* ── Muted ── */
.muted {
  color: var(--muted);
}

/* ── Prose: long-form legal/policy content ── */
.prose h2 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--gold);
  margin: 1.8rem 0 0.5rem;
}
.prose h2:first-child {
  margin-top: 0.5rem;
}
.prose-sub {
  padding-left: 1.75rem;
  margin-top: 1.2rem;
}
.prose h3 {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.015em;
  color: var(--accent);
  margin: 0 0 0.4rem -15px;
  border-left: 2px solid var(--accent);
  padding-left: 0.6rem;
}
.prose p,
.prose ul,
.prose ol {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--muted);
  margin: 0 0 0.9rem;
}
.prose ul,
.prose ol {
  padding-left: 1.4rem;
}
.prose li {
  margin-bottom: 0.3rem;
}
.prose a {
  color: var(--accent);
}
.prose strong {
  color: var(--fg);
  font-weight: 600;
}

.policy-effective-date {
  margin: 0.2rem 0 1.2rem;
  font-size: 0.8rem;
}

/* ── Buttons ── */
.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.65rem;
  padding: 0.62rem 1.35rem;
  border: 1px solid rgba(215, 181, 109, 0.72);
  border-radius: 999px;
  color: #0a1a22;
  background: var(--gold);
  font: inherit;
  font-weight: 800;
  font-size: 0.89rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  opacity: 1;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

.button:not(:disabled):hover,
.button:not(:disabled):focus-visible {
  border-color: #ead08e;
  background: #e3c47d;
  opacity: 1;
}

.btn-icon {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: var(--icon-url) center / contain no-repeat;
  mask: var(--icon-url) center / contain no-repeat;
}

.button:disabled,
button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.button.ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line);
}

.button.ghost:not(:disabled):hover,
.button.ghost:not(:disabled):focus-visible {
  border-color: rgba(215, 181, 109, 0.7);
  color: var(--gold);
  background: rgba(215, 181, 109, 0.1);
}


.button.danger {
  background: #ff927a;
  border-color: #ff927a;
  color: #1a0400;
}

.button.danger:not(:disabled):hover,
.button.danger:not(:disabled):focus-visible {
  border-color: #ffb09f;
  color: #1a0400;
  background: #ffab98;
}

.button.sm {
  min-height: 2.35rem;
  padding: 0.38rem 0.9rem;
  font-size: 0.82rem;
}

/* ── Forms ── */
.form-stack {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.28rem;
  color: var(--muted);
  font-size: 0.87rem;
  text-align: left;
}

label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

input[type="checkbox"],
input[type="radio"] {
  width: 1.15rem;
  height: 1.15rem;
  min-height: 1.15rem;
  flex: 0 0 auto;
  padding: 0;
  accent-color: var(--gold);
}

/* ── Contact form steps ── */
[data-contact-step] {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
[data-contact-step][hidden] {
  display: none;
}
.contact-step-heading {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.contact-step-progress {
  margin-bottom: -0.45rem;
}
.radio-group {
  display: grid;
  gap: 0.6rem;
}
[data-contact-next] {
  align-self: flex-end;
}
.radio-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  cursor: pointer;
  transition: border-color 130ms;
}
.radio-row:has(input:checked) {
  border-color: rgba(215, 181, 109, 0.52);
}
.radio-row input[type="radio"] {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  accent-color: var(--accent, #5fa8d3);
  cursor: pointer;
}
.radio-row span {
  color: var(--ink);
  font-size: 0.93rem;
}
.contact-step-actions {
  display: flex;
  gap: 0.75rem;
}
.contact-step-actions .button {
  flex: 1;
}

/* ── Honeypot (bot trap, hidden from real users) ── */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ── Checkbox rows ── */
.check-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.check-wrap input[type="checkbox"] {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  accent-color: var(--accent, #5fa8d3);
  cursor: pointer;
}
.check-wrap label {
  display: inline;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}
.check-wrap label a {
  color: var(--ink);
}

/* ── Field group (input + note) ── */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.field-note {
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.75;
  padding-left: 0.25rem;
}
.field-status {
  font-size: 0.78rem;
  font-weight: 700;
  padding-left: 0.25rem;
  min-height: 0;
}
.field-status.available { color: var(--gold); }
.field-status.taken     { color: #e07070; }
.field-status.checking  { color: var(--muted); opacity: 0.75; }

/* ── Icon-prefixed inputs ── */
.input-wrap {
  position: relative;
}
.input-wrap input {
  padding-left: 2.5rem;
}
.input-wrap input[type="date"]::-webkit-calendar-picker-indicator {
  display: none;
}
.field-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.05rem;
  height: 1.05rem;
  background: var(--muted);
  -webkit-mask: var(--icon-url) center / contain no-repeat;
  mask: var(--icon-url) center / contain no-repeat;
  pointer-events: none;
  opacity: 0.65;
}
.icon-field-email    { --icon-url: url("/icons/input/email.svg"); }
.icon-field-user     { --icon-url: url("/icons/input/user.svg"); }
.icon-field-calendar { --icon-url: url("/icons/input/calendar.svg"); }
.icon-field-at       { --icon-url: url("/icons/input/at.svg"); }
.icon-field-phrase   { --icon-url: url("/icons/input/phrase.svg"); }
.icon-field-krill    { --icon-url: url("/icons/nav/krill.svg"); }
.icon-field-hash     { --icon-url: url("/icons/input/hash.svg"); }

input::placeholder {
  color: var(--muted);
  opacity: 0.65;
}
input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  color: var(--muted);
  opacity: 0.65;
}
input[type="date"]:valid::-webkit-datetime-edit-fields-wrapper {
  color: var(--ink);
  opacity: 1;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.62rem 0.88rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  color: var(--ink);
  background: rgba(2, 7, 12, 0.55);
  font: inherit;
  font-size: 0.93rem;
  transition: border-color 130ms;
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(215, 181, 109, 0.52);
  box-shadow: 0 0 0 3px rgba(215, 181, 109, 0.12);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.check-row input {
  width: auto;
  min-height: auto;
}

/* ── App shell (auth / centered pages) ── */
.app-shell {
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
}

.hero-panel {
  width: min(42rem, 100%);
  padding: clamp(1.5rem, 5vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 42%),
    var(--glass);
  box-shadow: 0 1.75rem 4.5rem rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(14px);
}

/* ── Buy Krill packages ── */
.package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 0.82rem;
}

.package-card {
  display: flex;
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 100%;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0.95rem;
  border: 1px solid var(--line);
  border-radius: 0.82rem;
  background: rgba(2, 7, 12, 0.38);
  color: var(--ink);
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.package-card strong {
  margin-bottom: 0.18rem;
  font-size: 1rem;
}

.package-card span,
.package-card em {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.package-card--unavailable {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.package-card--soon {
  cursor: default;
}

.package-card-image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 0.6rem;
  margin-bottom: 0.6rem;
  background: rgba(255, 255, 255, 0.035);
}

.package-badge {
  position: absolute;
  top: 1.35rem;
  left: 1.35rem;
  right: 1.35rem;
  z-index: 1;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: #c22e2e;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-align: center;
}

.package-card .package-badge--fresh {
  background: rgb(80, 210, 110);
  color: #000;
}

.package-card .package-badge--markdown {
  color: #000;
}

.package-card .package-buy-now {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  grid-column: 1 / -1;
  width: 100%;
  min-height: 2.5rem;
  margin-top: 0.6rem;
  border: 1px solid rgb(80, 210, 110);
  border-radius: 999px;
  background: rgb(80, 210, 110);
  color: #0a1a22;
  font-size: 0.89rem;
  font-weight: 800;
}

.package-card .package-buy-now--soon {
  border-color: rgba(255, 255, 255, 0.25);
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.08em;
}

.inventory-list li + li {
  margin-top: 0.85rem;
}

/* ── Unified Inventory / Krill Mart ── */
.modal-close-control {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  min-height: 2rem;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(215, 181, 109, 0.5);
  border-radius: 0.28rem;
  color: rgba(244, 239, 225, 0.78);
  background: rgba(3, 19, 29, 0.72);
  box-shadow: none;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
  opacity: 1;
  text-transform: uppercase;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.modal-close-control:hover,
.modal-close-control:focus-visible {
  border-color: var(--gold);
  color: #03131d;
  background: var(--gold);
}

.inventory-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 1100px) {
  .inventory-toolbar {
    display: none;
  }
}

.profile-panels-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
}

/* Grid gap handles spacing in both 2-col and 1-col layouts, so drop the
   stacked-panel top margin that would otherwise push later cells down and
   break top alignment between Claims to Fame and the Pantry. */
.profile-panels-grid > .panel {
  margin-top: 0;
}

/* ── Profile tabs: Material-style toolbar of opened profiles ── */
/* Author `display:flex` beats the UA `[hidden]` rule, so restore hiding
   explicitly — this also suppresses the empty-bar flash before JS runs and
   keeps the lone self-tab fully hidden. */
.profile-tabs[hidden] {
  display: none;
}

/* A flat, full-bleed toolbar in the sidebar's colour with an underline
   indicator for the active tab — active and inactive tabs are the same size. */
.profile-tabs {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  padding: 0 clamp(0.35rem, 1.6vw, 1rem);
  background: rgba(2, 7, 16, 0.82);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

/* Single sliding active-indicator, sized/positioned by JS to the active tab. */
.profile-tab-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  pointer-events: none;
  transition: left 220ms cubic-bezier(0.4, 0, 0.2, 1),
              width 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-tabs::-webkit-scrollbar {
  height: 4px;
}

.profile-tabs::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 2px;
}

.profile-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  max-width: 12rem;
  padding: 0.5rem 0.45rem 0.5rem 0.7rem;
  color: var(--muted);
  background: transparent;
  transition: color 160ms ease, background-color 160ms ease;
}

.profile-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.045);
}

.profile-tab--active {
  color: var(--ink);
}

.profile-tab-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.profile-tab-link:hover {
  color: inherit;
}

/* Stretch the link across the whole tab so the entire chip is clickable;
   the close button is lifted above this overlay to stay interactive. */
.profile-tab-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.profile-tab-avatar {
  width: 1.2rem;
  height: 1.2rem;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(2, 7, 12, 0.5);
}

.profile-tab-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-tab-close {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  min-width: 0;
  min-height: 0;
  flex: 0 0 auto;
  padding: 0;
  border: none;
  border-radius: 50%;
  color: inherit;
  background: transparent;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.5;
  transition: background-color 140ms ease, opacity 140ms ease;
}

.profile-tab-close:hover,
.profile-tab-close:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  opacity: 1;
}

/* Self tab reserves the close-button footprint (slightly wider tab) but shows
   nothing there — its tab can never be closed. */
.profile-tab-close--placeholder {
  visibility: hidden;
  pointer-events: none;
}

.inventory-toolbar-actions {
  display: flex;
  align-items: center;
  width: var(--hero-stats-width);
  min-width: var(--hero-stats-width);
  gap: 0.7rem;
}

.inventory-toolbar-actions .inventory-action {
  flex: 1 1 0;
  min-width: 0;
  min-height: 3rem;
  box-shadow: none;
}

.inventory-toolbar-actions .inventory-action .nav-icon {
  width: 1.45rem;
  height: 1.45rem;
}

.inventory-toolbar-actions .inventory-action--buy {
  border-color: rgb(80, 210, 110);
  color: #0a1a22;
  background: rgb(80, 210, 110);
}

.inventory-toolbar-actions .inventory-action--buy:not(:disabled):hover,
.inventory-toolbar-actions .inventory-action--buy:not(:disabled):focus-visible {
  border-color: rgb(118, 232, 145);
  color: #0a1a22;
  background: rgb(105, 224, 132);
}

.inventory-toolbar-actions .inventory-action--kill {
  border-color: rgb(245, 90, 90);
  color: #0a1a22;
  background: rgb(245, 90, 90);
}

.inventory-toolbar-actions .inventory-action--kill:not(:disabled):hover,
.inventory-toolbar-actions .inventory-action--kill:not(:disabled):focus-visible {
  border-color: rgb(255, 145, 145);
  color: #0a1a22;
  background: rgb(255, 122, 122);
}

.package-expiry-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 28rem), 1fr));
  align-items: start;
  gap: 1.25rem 1rem;
}

.package-expiry-group {
  display: grid;
  min-width: 0;
  gap: 0.68rem;
}

.package-expiry-heading {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin: 0;
  padding: 0.15rem 0 0.48rem;
  border-bottom: 1px solid rgba(244, 239, 225, 0.18);
  font-family: var(--font-body);
  line-height: 1.1;
}

.package-expiry-heading span {
  color: var(--gold);
  font-size: clamp(0.92rem, 1.7vw, 1.12rem);
  font-weight: 1000;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.package-expiry-heading strong {
  color: var(--gold);
  font-size: clamp(0.92rem, 1.7vw, 1.12rem);
  font-weight: 1000;
}

.package-expiry-grid {
  width: 100%;
  max-width: min(100%, calc((4 * 106px) + (3 * 0.7rem)));
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  justify-self: start;
}

.inventory-kill-button {
  width: 100%;
}

.inventory-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 20rem;
  text-align: center;
}

.inventory-empty-state p {
  margin: 0;
}

.krill-shop-modal {
  width: min(72rem, calc(100vw - 2rem));
  max-width: none;
  max-height: calc(100dvh - 2rem);
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(215, 181, 109, 0.48);
  border-radius: 1.15rem;
  color: var(--ink);
  background: rgba(3, 19, 29, 0.98);
  box-shadow: 0 2rem 6rem rgba(0, 0, 0, 0.72);
}

.krill-shop-modal::backdrop {
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.krill-shop-modal-shell {
  padding: clamp(1rem, 2.5vw, 1.6rem);
}

.krill-shop-modal-header {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.5rem;
  padding: 0.2rem 0 0.75rem;
  border-bottom: 1px solid rgba(244, 239, 225, 0.12);
  background: rgba(3, 19, 29, 0.97);
}

.krill-shop-modal-header h2,
.krill-shop-modal-header p {
  margin-top: 0;
}

.krill-shop-modal-header h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 3.3rem);
}

.krill-shop-modal-close {
  flex-shrink: 0;
}

.krill-shop-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr));
  margin-top: 1rem;
}

.shop-reroll-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1rem;
}

.shop-reroll-row[hidden] {
  display: none;
}

.package-grid .package-card[hidden] {
  display: none;
}

.krill-kill-package-form {
  min-width: 0;
  margin: 0;
}

.krill-kill-package-card {
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  align-content: start;
  justify-items: stretch;
  text-transform: none;
  letter-spacing: normal;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.krill-kill-package-card strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 1rem;
}

.krill-kill-package-card:hover,
.krill-kill-package-card:focus-visible {
  border-color: #ff927a;
  background: rgba(75, 23, 18, 0.5);
}

.krill-kill-empty-state {
  margin-top: 1rem;
  text-align: center;
}

.krill-kill-empty-state p {
  margin-top: 0;
}

body.krill-shop-open {
  overflow: hidden;
}

/* ── Table ── */
.table-wrap {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(215, 181, 109, 0.45) rgba(255, 255, 255, 0.04);
  -webkit-overflow-scrolling: touch;
}

.table-wrap:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.58rem 0.48rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.87rem;
}

th {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.col-score-th {
  text-align: right;
}

.col-score {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── Share button on feed posts ── */
.feed-share-btn {
  flex-shrink: 0;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  opacity: 0.28;
  transition: opacity 140ms;
}

.feed-share-btn:hover {
  opacity: 0.75;
}

.feed-share-icon {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
  background: var(--ink);
  -webkit-mask: url("/icons/share.svg") center / contain no-repeat;
  mask: url("/icons/share.svg") center / contain no-repeat;
}

/* ── Share modal ── */
.share-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: modal-bg-in 200ms ease forwards;
}

.share-modal {
  width: min(460px, 100%);
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: rgba(4, 14, 28, 0.97);
  backdrop-filter: blur(20px);
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.6);
  animation: modal-slide-up 240ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.share-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.share-modal-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  margin: 0;
  color: var(--ink);
}

.share-modal-close-btn {
  flex-shrink: 0;
  cursor: pointer;
}

.share-modal-preview {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
  line-height: 1.55;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 0.6rem;
  border: 1px solid var(--line);
  white-space: pre-wrap;
  word-break: break-word;
}

.share-platforms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.share-platform-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.72rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  opacity: 0.78;
  transition: background 130ms, opacity 130ms;
}

.share-platform-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  opacity: 1;
}

.share-platform-icon {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: var(--platform-icon) center / contain no-repeat;
  mask: var(--platform-icon) center / contain no-repeat;
}

@keyframes modal-bg-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modal-slide-up {
  from { opacity: 0; transform: translateY(1rem); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Feed post enter animation ── */
@keyframes feed-post-enter {
  from { opacity: 0; transform: translateY(-0.6rem); }
  to   { opacity: 1; transform: translateY(0); }
}

.feed-post.is-new {
  animation: feed-post-enter 350ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ── Material-style toast notifications ── */
.toast-region {
  position: fixed;
  z-index: 400;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  display: flex;
  width: min(28rem, calc(100vw - 2rem));
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
}

.app-toast {
  --toast-accent: var(--accent);
  --toast-accent-soft: rgba(142, 205, 231, 0.16);
  position: relative;
  display: grid;
  width: 100%;
  min-height: 4rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.72rem 0.72rem 0.72rem 0.9rem;
  overflow: hidden;
  border: 1px solid rgba(244, 239, 225, 0.2);
  border-left: 0.28rem solid var(--toast-accent);
  border-radius: 0.8rem;
  color: var(--ink);
  background: rgba(15, 31, 42, 0.98);
  box-shadow: 0 0.9rem 2.6rem rgba(0, 0, 0, 0.52), 0 0.2rem 0.65rem rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  pointer-events: auto;
  animation: toast-enter 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.app-toast--success {
  --toast-accent: rgb(80, 210, 110);
  --toast-accent-soft: rgba(80, 210, 110, 0.16);
}

.app-toast--error {
  --toast-accent: rgb(245, 90, 90);
  --toast-accent-soft: rgba(245, 90, 90, 0.16);
}

.app-toast--warning {
  --toast-accent: var(--gold);
  --toast-accent-soft: rgba(215, 181, 109, 0.16);
}

.app-toast-icon {
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--toast-accent);
  border-radius: 50%;
  color: var(--toast-accent);
  background: var(--toast-accent-soft);
  font-size: 0.88rem;
  font-weight: 1000;
  line-height: 1;
}

.app-toast-icon::before {
  content: 'i';
}

.app-toast--success .app-toast-icon::before {
  content: '\2713';
}

.app-toast--error .app-toast-icon::before,
.app-toast--warning .app-toast-icon::before {
  content: '!';
}

.app-toast-message {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.35;
}

.app-toast-dismiss {
  width: 2.35rem;
  height: 2.35rem;
  min-height: 2.35rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-size: 0.82rem;
  font-weight: 1000;
  letter-spacing: 0;
  line-height: 1;
  opacity: 1;
  transform: none;
}

.app-toast-dismiss:not(:disabled):hover,
.app-toast-dismiss:not(:disabled):focus-visible {
  border: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: none;
  opacity: 1;
  transform: none;
}

.app-toast.is-leaving {
  pointer-events: none;
  animation: toast-exit 180ms cubic-bezier(0.4, 0, 1, 1) both;
}

@keyframes toast-enter {
  from { opacity: 0; transform: translateY(0.75rem) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-exit {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(0.45rem) scale(0.98); }
}

/* ── Feed list (social post style) ── */
.feed-list,
.plain-list {
  display: flex;
  flex-direction: column;
  list-style: none;
  padding: 0;
  margin: 0;
}

.feed-post {
  display: flex;
  gap: 0.85rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}

.feed-post:first-child {
  padding-top: 0;
}

.feed-post:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.feed-post-avatar {
  display: block;
  flex-shrink: 0;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  overflow: hidden;
  opacity: 1;
  transition: box-shadow 160ms ease;
}

a.feed-post-avatar:hover,
a.feed-post-avatar:focus-visible {
  box-shadow: 0 0 0 3px rgba(215, 181, 109, 0.34);
}

.feed-post-avatar-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}

.feed-post-avatar-img--default {
  object-position: 65% center;
}

.feed-badge-avatar {
  width: 100%;
  height: 100%;
  display: block;
}

.feed-post-avatar-default {
  width: 100%;
  height: 100%;
  background: rgba(215, 181, 109, 0.1);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feed-avatar-krill {
  display: block;
  width: 55%;
  height: 55%;
  background: rgba(215, 181, 109, 0.5);
  -webkit-mask: url("/icons/nav/krill.svg") center / contain no-repeat;
  mask: url("/icons/nav/krill.svg") center / contain no-repeat;
}

.feed-post-body {
  flex: 1;
  min-width: 0;
}

.feed-post-meta {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}

.feed-post-username {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--ink);
  text-decoration: none;
}

.feed-online-dot {
  align-self: center;
  flex-shrink: 0;
}

.feed-post-time {
  font-size: 0.76rem;
  color: var(--muted);
}

.feed-post-message {
  margin: 0;
  font-size: 0.93rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink);
}

/* ── Badge list ── */
.badge-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.78rem;
  padding: 0;
  list-style: none;
  margin: 0;
}

.badge-list li,
.badge-list article {
  padding: 0.88rem;
  border: 1px solid var(--line);
  border-radius: 0.82rem;
  background: rgba(2, 7, 12, 0.38);
}

.badge-list span {
  display: block;
  color: var(--muted);
  margin-top: 0.28rem;
  font-size: 0.82rem;
}

.profile-badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 106px));
  gap: 0.7rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.profile-badge-card {
  display: block;
  position: relative;
  width: 100%;
  min-height: 0;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: rgba(2, 7, 12, 0.46);
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
  opacity: 1;
  transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease;
}

.profile-badge-card:hover,
.profile-badge-card:focus-visible {
  border-color: rgba(215, 181, 109, 0.7);
  color: var(--link-hover);
  background: rgba(255, 255, 255, 0.07);
}

.profile-badge-card img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.profile-stash-card {
  position: relative;
}

.profile-stash-card img,
.stash-detail-image {
  background: rgba(2, 7, 12, 0.52);
  object-fit: cover;
}

.profile-stash-krill-overlay {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 0.4rem 0.35rem 0.35rem;
  color: #fff;
  background: linear-gradient(to top, rgba(1, 6, 10, 0.94), rgba(1, 6, 10, 0.7));
  font-size: 0.68rem;
  font-weight: 1000;
  line-height: 1;
  pointer-events: none;
  text-align: center;
  text-shadow: 0 1px 2px #000;
}

.profile-badge-title-overlay {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  padding: 0.4rem 0.35rem 0.35rem;
  color: #fff;
  background: linear-gradient(to top, rgba(1, 6, 10, 0.94), rgba(1, 6, 10, 0.7));
  font-size: 0.68rem;
  font-weight: 1000;
  line-height: 1.25;
  pointer-events: none;
  text-align: center;
  text-shadow: 0 1px 2px #000;
}

.unearned-badges {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.unearned-badges summary {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  list-style: none;
  transition: color 160ms ease;
}

.unearned-badges summary::-webkit-details-marker {
  display: none;
}

.unearned-badges summary::before {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 160ms ease;
}

.unearned-badges[open] summary::before {
  transform: rotate(45deg) translate(-1px, -1px);
}

.unearned-badges summary:hover,
.unearned-badges summary:focus-visible {
  color: var(--gold);
}

.unearned-badge-count {
  min-width: 1.45rem;
  padding: 0.12rem 0.4rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  text-align: center;
}

.profile-badge-grid--unearned {
  grid-template-columns: repeat(auto-fill, minmax(62px, 76px));
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.profile-badge-card--unearned img {
  filter: grayscale(1) contrast(0.88) brightness(0.68);
  transition: filter 180ms ease;
}

.profile-badge-card--unearned:hover img,
.profile-badge-card--unearned:focus-visible img {
  filter: grayscale(1) contrast(1) brightness(0.82);
}

.badge-detail-modal {
  width: min(52rem, calc(100vw - 2rem));
  max-width: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(215, 181, 109, 0.48);
  border-radius: 1.2rem;
  color: var(--ink);
  background: rgba(3, 19, 29, 0.98);
  box-shadow: 0 2rem 6rem rgba(0, 0, 0, 0.72);
}

.badge-detail-modal::backdrop {
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.badge-detail-shell {
  position: relative;
  padding: clamp(1rem, 2.5vw, 1.5rem);
}

.badge-detail-close {
  position: absolute;
  z-index: 1;
  top: 0.75rem;
  right: 0.75rem;
}

.badge-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.25rem, 4vw, 2.5rem);
}

.badge-detail-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 0;
}

.badge-detail-copy {
  padding: clamp(0.9rem, 2.5vw, 1.35rem);
  padding-right: clamp(3.65rem, 7vw, 4.2rem);
  border: 2px solid #101010;
  color: #101010;
  background: #f5f0df;
  font-family: var(--font-body);
  box-shadow: inset 0 0 0 2px rgba(16, 16, 16, 0.1);
}

.badge-facts-name {
  display: grid;
  padding-bottom: 0.55rem;
  border-bottom: 0.45rem solid #101010;
}

.badge-facts-name strong {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 1000;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.badge-facts-description {
  padding: 0.65rem 0;
  border-bottom: 1px solid #101010;
}

.badge-facts-description p {
  margin: 0;
  color: #101010;
  font-size: 0.9rem;
  line-height: 1.35;
}

.stash-detail-ingredients {
  padding: 0.65rem 0;
  border-bottom: 1px solid #101010;
}

.stash-detail-ingredients > strong {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.68rem;
  font-weight: 1000;
  letter-spacing: 0.04em;
}

.stash-detail-ingredients p {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  color: #101010;
  font-size: 1rem;
  line-height: 1.2;
}

.stash-detail-ingredients b {
  font-weight: 1000;
}

.badge-detail-earned {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding-top: 0.55rem;
  font-size: 0.82rem;
  font-weight: 900;
}

.badge-detail-earned span {
  color: #101010;
  font-size: inherit;
  font-weight: 1000;
  letter-spacing: 0.04em;
}

.stash-detail-kill {
  padding-top: 0.75rem;
}

.stash-detail-kill .button {
  width: 100%;
}

body.badge-detail-open {
  overflow: hidden;
}

/* ── Account list ── */
/* ── Leaderboard pages ── */
.leaderboard-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
}

.leaderboard-page-grid > .panel {
  margin-top: 0;
}

.leaderboard-ranking-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.leaderboard-explainer {
  position: sticky;
  top: 1rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgba(215, 181, 109, 0.14), transparent 42%),
    rgba(3, 19, 29, 0.72);
}

.leaderboard-explainer-heading {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.leaderboard-explainer-heading .eyebrow,
.leaderboard-explainer-heading h2 {
  margin: 0;
}

.leaderboard-explainer-heading h2 {
  margin-top: 0.2rem;
  font-size: clamp(1.65rem, 3vw, 2.3rem);
  line-height: 1;
}

.leaderboard-explainer-icon {
  width: 3.2rem;
  height: 3.2rem;
  flex: 0 0 auto;
  color: var(--gold);
}

.leaderboard-explainer-intro {
  margin: 1rem 0;
  color: var(--ink);
  line-height: 1.6;
}

.leaderboard-rule-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.leaderboard-rule-list div {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0.8rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.leaderboard-rule-list dt {
  color: var(--gold);
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.leaderboard-rule-list dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.5;
}

.leaderboard-explainer-foot {
  margin: 0.8rem 0 0;
  padding-top: 1rem;
  border-top: 0.2rem solid rgba(215, 181, 109, 0.6);
  color: var(--ink);
  font-weight: 900;
  font-style: italic;
}

.leaderboard-explainer-actions {
  display: flex;
  margin-top: 1rem;
}

.leaderboard-explainer-action {
  width: 100%;
}

.button.leaderboard-explainer-action:not(.danger) {
  border-color: rgb(80, 210, 110);
  color: #0a1a22;
  background: rgb(80, 210, 110);
}

.button.leaderboard-explainer-action:not(.danger):hover,
.button.leaderboard-explainer-action:not(.danger):focus-visible {
  border-color: rgb(118, 232, 145);
  color: #0a1a22;
  background: rgb(105, 224, 132);
}

.button.leaderboard-explainer-action.danger {
  border-color: rgb(245, 90, 90);
  color: #0a1a22;
  background: rgb(245, 90, 90);
}

.button.leaderboard-explainer-action.danger:hover,
.button.leaderboard-explainer-action.danger:focus-visible {
  border-color: rgb(255, 145, 145);
  color: #0a1a22;
  background: rgb(255, 122, 122);
}

.leaderboard-modal-count {
  margin: 0.2rem 0 1rem;
}

.leaderboard-modal-table {
  max-height: min(65dvh, 44rem);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
}

.leaderboard-modal-table .table-wrap {
  overflow: visible;
}

.leaderboard-modal-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #061722;
}

body.leaderboard-modal-open {
  overflow: hidden;
}

body.share-modal-open {
  overflow: hidden;
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 1200px) {
  .leaderboard-page-grid {
    grid-template-columns: 1fr;
  }

  .leaderboard-explainer {
    position: static;
    order: -1;
  }
}

/* ── Card grid ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1rem;
}

.card-grid.two {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
}

/* ── Pager ── */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

.pager-page {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pager-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  opacity: 0.75;
  transition: opacity 140ms;
}

.pager-btn:not(.disabled):hover {
  opacity: 1;
}

.pager-btn.disabled {
  opacity: 0.1;
  cursor: default;
  pointer-events: none;
}

.pager-icon {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--ink);
}

.pager-prev .pager-icon {
  -webkit-mask: url("/icons/left.svg") center / contain no-repeat;
  mask: url("/icons/left.svg") center / contain no-repeat;
}

.pager-next .pager-icon {
  -webkit-mask: url("/icons/right.svg") center / contain no-repeat;
  mask: url("/icons/right.svg") center / contain no-repeat;
}

/* ── Footer ── */
.site-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1.25rem max(0.95rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.16);
  color: rgba(244, 239, 225, 0.42);
  font-size: 0.78rem;
  font-weight: 800;
  margin-top: auto;
}

.copyright-line,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.32rem;
  text-transform: uppercase;
}

.footer-links {
  justify-content: flex-end;
}

.copyright-symbol {
  width: 0.82rem;
  height: 0.82rem;
  background: currentColor;
  -webkit-mask: url("/icons/copyright.svg") center / contain no-repeat;
  mask: url("/icons/copyright.svg") center / contain no-repeat;
}

.site-footer a {
  color: var(--ink);
  opacity: 0.5;
  transition: opacity 140ms;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  opacity: 1;
}

.footer-links a + a::before {
  content: "|";
  display: inline-block;
  margin-right: 0.32rem;
  opacity: 0.45;
}

/* ── Profile avatar ── */
.profile-avatar-wrap {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  width: clamp(4.5rem, 9vw, 6.5rem);
  height: clamp(4.5rem, 9vw, 6.5rem);
  margin-left: 1.5rem;
  align-self: center;
}

.profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  border: 3px solid rgba(215, 181, 109, 0.6);
  display: block;
  background: #fff;
}

.profile-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  margin-top: 0.42rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.profile-status-dot {
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.profile-status--online { color: rgb(80, 210, 110); }
.profile-status--online .profile-status-dot {
  background: rgb(80, 210, 110);
  box-shadow: 0 0 4px rgba(80, 210, 110, 0.7);
}

.profile-status--offline { color: rgba(184, 197, 200, 0.55); }
.profile-status--offline .profile-status-dot { background: rgba(184, 197, 200, 0.35); }

.profile-mode-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 1.75rem;
  margin-top: 0.42rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: rgba(244, 239, 225, 0.55);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  opacity: 1;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 160ms ease;
}

.profile-mode-button:hover,
.profile-mode-button:focus-visible {
  color: var(--gold);
}

.profile-joined {
  text-align: center;
  margin: 0.35rem 0 0;
}

.profile-avatar--default {
  object-position: 65% center;
}

.profile-avatar--lg {
  width: 8rem;
  height: 8rem;
}

.upload-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ── Edit profile section ── */
.edit-profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 1rem;
}

.edit-upload-card {
  display: flex;
  height: 100%;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
}

.edit-profile-grid .panel + .panel {
  margin-top: 0;
}

.edit-avatar-preview {
  display: flex;
  height: clamp(10rem, 18vw, 12rem);
  align-items: center;
  justify-content: center;
}

.edit-banner-preview {
  width: 100%;
  height: clamp(10rem, 18vw, 12rem);
  border-radius: 0.65rem;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
}

.edit-upload-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.edit-upload-form label.button {
  cursor: pointer;
}

.upload-confirm-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

/* Author `display:flex` beats the UA `[hidden]` rule, so restore hiding */
.upload-confirm-row[hidden] {
  display: none;
}

label.button[hidden] {
  display: none;
}

/* ── Compact shell: tablets and narrow desktop windows ── */
@media (max-width: 1100px) {
  .sidebar {
    width: min(86vw, 19.5rem);
    transform: translateX(-100%);
    box-shadow: 1.5rem 0 3.5rem rgba(0, 0, 0, 0.48);
  }

  .app-main {
    margin-left: 0;
  }

  .mobile-topbar {
    display: flex;
  }
}

/* ── Mobile content layout ── */
@media (max-width: 768px) {
  .app-page {
    background-attachment: scroll;
  }

  .app-page::before {
    filter: saturate(0.58);
    opacity: 0.38;
    transform: scale(1.01);
  }

  .app-page::after {
    opacity: 0.75;
  }

  .auth-hero {
    display: flex;
    height: clamp(8rem, 27vw, 10rem);
  }

  .dashboard-account-hero {
    height: auto;
    min-height: 10rem;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.8rem;
    padding: 2.75rem 1rem 1rem;
  }

  .page-wrap.pantry-page {
    padding-inline: 1rem;
  }

  .dashboard-account-hero--with-stats {
    min-height: 0;
    padding-top: 3.25rem;
  }

  .auth-hero-heading {
    padding-inline: 1rem;
    font-size: clamp(2.8rem, 12vw, 4.8rem);
    line-height: 0.95;
  }

  .dashboard-hero-copy {
    max-width: 100%;
  }

  .dashboard-hero-copy .auth-hero-heading {
    overflow-wrap: anywhere;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .profile-panels-grid {
    grid-template-columns: 1fr;
  }

  .dash-full {
    grid-column: auto;
  }

  .krill-shop-modal {
    width: calc(100vw - 1rem);
    max-height: calc(100dvh - 1rem);
  }

  .hero-stats {
    width: 100%;
    min-width: 0;
    gap: 0.5rem;
  }

  .inventory-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .inventory-toolbar-actions {
    width: 100%;
    min-width: 0;
    gap: 0.5rem;
  }

  .account-stats {
    width: 100%;
  }

  .inventory-expiring-list,
  .edit-profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-hero.dashboard-account-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "avatar copy"
      "stats stats";
    align-items: center;
    justify-content: stretch;
    gap: 1rem;
    padding: 1.25rem 1rem 1rem;
  }

  .profile-hero .profile-avatar-wrap {
    grid-area: avatar;
    width: 5.5rem;
    height: auto;
    margin-left: 0;
    align-self: start;
  }

  .profile-hero .profile-avatar {
    aspect-ratio: 1;
  }

  .profile-hero .dashboard-hero-copy {
    grid-area: copy;
  }

  .profile-hero .hero-stats {
    grid-area: stats;
  }

  .profile-banned-hero {
    display: flex !important;
  }

  .panel,
  .info-card,
  .how-card,
  .hero-stats-col,
  .mobile-topbar {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .admin-tabs {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0.15rem 0.1rem 0.45rem;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .admin-tabs::-webkit-scrollbar {
    display: none;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

/* ── Phones ── */
@media (max-width: 600px) {
  .page-wrap {
    padding: 0.9rem 0.75rem 2.25rem;
  }

  .toast-region {
    left: max(0.75rem, env(safe-area-inset-left));
    right: max(0.75rem, env(safe-area-inset-right));
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    width: auto;
  }

  .app-toast {
    min-height: 3.75rem;
    gap: 0.65rem;
    padding: 0.65rem;
  }

  .panel,
  .info-card {
    padding: 0.9rem;
    border-radius: 0.9rem;
  }

  .auth-hero {
    height: 8.25rem;
  }

  .dashboard-account-hero {
    height: auto;
  }

  .hero-col-heading {
    padding: 0.4rem 0.35rem 0.32rem;
    font-size: 0.82rem;
  }

  .hero-stat {
    padding: 0.58rem 0.38rem;
  }

  .hero-stat strong {
    font-size: clamp(1rem, 5vw, 1.3rem);
  }

  .hero-stat span {
    font-size: 0.62rem;
    letter-spacing: 0.05em;
  }

  .panel-heading-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .inventory-toolbar {
    position: sticky;
    z-index: 15;
    top: calc(3.5rem + env(safe-area-inset-top) + 0.35rem);
    padding: 0.65rem;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    background: rgba(3, 19, 29, 0.96);
    box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.36);
  }

  .krill-shop-grid,
  .package-grid {
    grid-template-columns: 1fr;
  }

  .krill-shop-modal {
    width: calc(100vw - 0.5rem);
    max-height: calc(100dvh - 0.5rem);
    border-radius: 0.9rem;
  }

  .krill-shop-modal-shell {
    padding: 0.75rem;
  }

  .krill-shop-modal-header {
    padding-bottom: 0.65rem;
  }

  .krill-shop-modal-header h2 {
    font-size: clamp(2rem, 11vw, 2.8rem);
  }

  .krill-shop-grid .package-card {
    display: grid;
    grid-template-columns: 5.75rem minmax(0, 1fr);
    grid-auto-flow: row;
    align-content: center;
    align-items: start;
    column-gap: 0.75rem;
    row-gap: 0.1rem;
    padding: 0.65rem;
  }

  .krill-shop-grid .package-card-image {
    grid-column: 1;
    grid-row: 1 / span 8;
    width: 5.75rem;
    margin: 0;
  }

  .krill-shop-grid .package-card > :not(.package-card-image) {
    grid-column: 2;
  }

  .krill-shop-grid .package-card strong {
    align-self: end;
  }

  .profile-badge-grid {
    grid-template-columns: repeat(auto-fill, minmax(72px, 88px));
    gap: 0.55rem;
  }

  .profile-badge-grid--unearned {
    grid-template-columns: repeat(auto-fill, minmax(56px, 68px));
    gap: 0.45rem;
  }

  .badge-detail-modal {
    width: calc(100vw - 0.5rem);
    max-height: calc(100dvh - 0.5rem);
    overflow: auto;
    border-radius: 0.9rem;
  }

  .badge-detail-shell {
    padding: 0.75rem;
  }

  .badge-detail-layout {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .badge-detail-image {
    width: min(100%, 18rem);
    max-height: 36dvh;
    justify-self: center;
  }

  .badge-detail-copy {
    padding: 0.85rem;
  }

  .badge-detail-close {
    position: sticky;
    top: 0.25rem;
    right: auto;
    display: flex;
    margin: 0 0 -2.75rem auto;
  }

  .share-modal-overlay {
    align-items: flex-end;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .share-modal {
    width: 100%;
    max-height: min(90dvh, 46rem);
    overflow-y: auto;
    padding: 1rem;
    border-radius: 1.15rem 1.15rem 0 0;
  }

  .feed-post {
    gap: 0.6rem;
    padding-block: 0.8rem;
  }

  .feed-post-avatar {
    width: 2.35rem;
    height: 2.35rem;
  }

  .feed-post-message {
    font-size: 0.9rem;
  }

  th,
  td {
    padding: 0.52rem 0.28rem;
    font-size: 0.82rem;
  }

  .user-cell {
    gap: 0.35rem;
  }

  .user-cell-avatar {
    width: 2rem;
    height: 2rem;
  }

  .admin-setting-form {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-setting-input {
    min-width: 0;
  }

  input,
  select,
  textarea {
    font-size: 1rem;
  }

  .how-it-works-logo {
    margin: 0.5rem 0 1.25rem;
    font-size: clamp(3rem, 18vw, 4.5rem);
  }

  .how-it-works-tagline {
    margin-bottom: 1.5rem;
    font-size: 0.82rem;
  }

  .how-it-works-grid,
  .how-it-works-duo {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .how-it-works-duo {
    margin-top: 1rem;
  }
}

/* ── Small phones ── */
@media (max-width: 420px) {
  .mobile-topbar {
    gap: 0.48rem;
    padding-right: max(0.6rem, env(safe-area-inset-right));
    padding-left: max(0.6rem, env(safe-area-inset-left));
  }

  .profile-hero.dashboard-account-hero {
    grid-template-columns: 4.75rem minmax(0, 1fr);
    gap: 0.75rem;
    padding-inline: 0.75rem;
  }

  .profile-hero .profile-avatar-wrap {
    width: 4.75rem;
  }

  .profile-mode-button {
    padding-inline: 0.35rem;
    font-size: 0.59rem;
  }

  .leaderboard-explainer-heading {
    align-items: flex-start;
    gap: 0.65rem;
  }

  .leaderboard-explainer-icon {
    width: 2.6rem;
    height: 2.6rem;
  }

  .leaderboard-rule-list div {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .contact-step-actions,
  .how-card-actions {
    flex-direction: column;
  }

  .badge-detail-earned {
    gap: 0.5rem;
    font-size: 0.75rem;
  }

  .site-footer {
    padding-inline: 0.75rem;
  }
}

/* ── Touch ergonomics ── */
@media (pointer: coarse) {
  .nav-link,
  .sidebar-user-action,
  .sidebar-user-logout button,
  .sidebar-user-toggle,
  .button,
  .button.sm,
  .modal-close-control,
  .feed-share-btn,
  .pager-btn,
  .profile-mode-button,
  .tab-btn,
  .unearned-badges summary {
    min-height: 2.75rem;
  }

  .sidebar-user-toggle,
  .modal-close-control,
  .feed-share-btn,
  .pager-btn {
    width: 2.75rem;
    height: 2.75rem;
  }

  .radio-row {
    min-height: 2.75rem;
  }

  .radio-row input[type="radio"],
  .check-wrap input[type="checkbox"] {
    width: 1.3rem;
    height: 1.3rem;
  }

  .site-footer a {
    padding-block: 0.35rem;
  }
}

@media (hover: none) {
  a {
    opacity: 0.9;
  }

  .feed-share-btn {
    opacity: 0.62;
  }
}

@supports (content-visibility: auto) {
  .feed-post:nth-child(n + 12),
  .inventory-package-grid > li:nth-child(n + 7),
  .badge-list > :nth-child(n + 12) {
    content-visibility: auto;
  }

  .feed-post:nth-child(n + 12) {
    contain-intrinsic-size: auto 5.25rem;
  }

  .inventory-package-grid > li:nth-child(n + 7) {
    contain-intrinsic-size: auto 22rem;
  }
}

/* ── Battery, bandwidth, and motion preferences ── */
.app-page.effects-lite::before {
  filter: saturate(0.55);
  opacity: 0.36;
  transform: scale(1.01);
}

.app-page.effects-lite .panel,
.app-page.effects-lite .info-card,
.app-page.effects-lite .how-card,
.app-page.effects-lite .hero-stats-col,
.app-page.effects-lite .sidebar,
.app-page.effects-lite .mobile-topbar {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .app-page::after {
    opacity: 0.62;
  }
}

@media (prefers-contrast: more) {
  :root {
    --muted: #d1dcde;
    --line: rgba(244, 239, 225, 0.36);
  }

  a,
  .feed-share-btn {
    opacity: 1;
  }
}

/* ── Sense-of-humor notice (cookie-banner parody) ── */
.humor-banner {
  position: fixed;
  z-index: 300;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  left: max(1rem, env(safe-area-inset-left));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(215, 181, 109, 0.45);
  border-radius: 0.9rem;
  color: var(--ink);
  background: rgba(15, 31, 42, 0.98);
  box-shadow: 0 0.9rem 2.6rem rgba(0, 0, 0, 0.52), 0 0.2rem 0.65rem rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.humor-banner[hidden] {
  display: none;
}

.humor-banner-text {
  flex: 1 1 16rem;
  margin: 0;
  font-size: 0.87rem;
  line-height: 1.4;
}

.humor-banner-text strong {
  color: var(--gold);
}

.humor-banner-ok {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (min-width: 70rem) {
  .humor-banner {
    left: calc(var(--sidebar-w) + max(1rem, env(safe-area-inset-left)));
    max-width: 56rem;
  }
}
