/* Authenticated shell — glass / glow / density (not Tailwind defaults) */

:root {
  --shell-bg: #07060f;
  --shell-elevated: #0c0b14;
  --shell-panel: rgba(18, 16, 32, 0.72);
  --shell-panel-solid: #12101e;
  --shell-lift: rgba(255, 255, 255, 0.04);
  --shell-line: rgba(255, 255, 255, 0.07);
  --shell-line-strong: rgba(255, 255, 255, 0.12);
  --shell-ink: #f7f7fb;
  --shell-soft: #c4c4d4;
  --shell-mute: #8a8a9e;
  --shell-accent: #a78bfa;
  --shell-accent-hot: #8b5cf6;
  --shell-accent-glow: rgba(139, 92, 246, 0.45);
  --shell-positive: #34d399;
  --shell-teal: #2dd4bf;
  --shell-radius: 16px;
  --shell-radius-lg: 20px;
  --shell-font: "Plus Jakarta Sans", system-ui, sans-serif;
  --shell-display: "Plus Jakarta Sans", system-ui, sans-serif;
}

.shell-body {
  position: relative;
  min-height: 100%;
  font-family: var(--shell-font);
  color: var(--shell-ink);
  background-color: var(--shell-bg);
  background-image:
    radial-gradient(ellipse 70% 45% at 50% -15%, rgba(139, 92, 246, 0.22), transparent 55%),
    radial-gradient(ellipse 45% 35% at 95% 5%, rgba(56, 189, 248, 0.08), transparent 50%),
    radial-gradient(ellipse 40% 30% at 5% 40%, rgba(167, 139, 250, 0.06), transparent 50%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* Grid atmosphere — same as login, site-wide */
.shell-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 18%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 18%, transparent 72%);
}

/* Flashlight — brighter grid + soft glow following the cursor */
.shell-body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 320ms ease;
  background-image:
    radial-gradient(circle at var(--fx, 50%) var(--fy, 0%), rgba(167, 139, 250, 0.1), transparent 42%),
    linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 100% 100%, 48px 48px, 48px 48px;
  mask-image: radial-gradient(circle 220px at var(--fx, 50%) var(--fy, 0%), #000 0%, rgba(0, 0, 0, 0.35) 45%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle 220px at var(--fx, 50%) var(--fy, 0%), #000 0%, rgba(0, 0, 0, 0.35) 45%, transparent 72%);
}

.shell-body.is-flashlight::after {
  opacity: 1;
}

@media (hover: none), (prefers-reduced-motion: reduce) {
  .shell-body::after { display: none; }
  .shell-sig { display: none; }
}

.shell-body > * {
  position: relative;
  z-index: 1;
}

/* Hidden signatures — only appear under the flashlight */
.shell-body > .shell-sig {
  position: fixed;
  inset: 0;
  z-index: 2;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.15rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 280ms ease;
  mask-image: radial-gradient(circle 200px at var(--fx, -999px) var(--fy, -999px), #000 0%, rgba(0, 0, 0, 0.55) 40%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle 200px at var(--fx, -999px) var(--fy, -999px), #000 0%, rgba(0, 0, 0, 0.55) 40%, transparent 70%);
  user-select: none;
}

.shell-sig--left {
  align-items: flex-start;
  padding: 0 0 1rem 1.25rem;
}

.shell-sig--right {
  align-items: flex-end;
  padding: 0 1.25rem 1rem 0;
}

.shell-sig-label {
  font-family: var(--shell-font);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(196, 196, 212, 0.75);
}

.shell-sig-name {
  font-family: "Alex Brush", cursive;
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
  color: rgba(230, 220, 255, 0.92);
  text-shadow:
    0 0 14px rgba(167, 139, 250, 0.5),
    0 0 3px rgba(255, 255, 255, 0.2);
}

.shell-body.is-flashlight > .shell-sig {
  opacity: 1;
}

.shell-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--shell-line);
  background: rgba(7, 6, 15, 0.72);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
}

.shell-header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 4rem;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.shell-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--shell-ink);
  text-decoration: none;
  flex-shrink: 0;
}

.shell-brand img {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 0;
  object-fit: contain;
  box-shadow: none;
}

.shell-brand-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.shell-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.5rem;
}

@media (min-width: 768px) {
  .shell-nav { display: flex; }
}

.shell-nav-link {
  position: relative;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--shell-mute);
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease;
}

.shell-nav-link:hover {
  color: var(--shell-ink);
  background: var(--shell-lift);
}

.shell-nav-link.is-active {
  color: var(--shell-ink);
  background: rgba(255, 255, 255, 0.06);
}

.shell-nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--shell-accent-hot), transparent);
  box-shadow: 0 0 10px var(--shell-accent-glow);
}

.shell-search {
  display: none;
  flex: 1;
  max-width: 22rem;
  margin: 0 auto;
  position: relative;
}

@media (min-width: 900px) {
  .shell-search { display: block; }
}

.shell-search input {
  width: 100%;
  height: 2.5rem;
  padding: 0 3.5rem 0 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--shell-line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--shell-ink);
  font: inherit;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.shell-search input::placeholder { color: var(--shell-mute); }

.shell-search input:focus {
  border-color: rgba(167, 139, 250, 0.45);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.shell-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: var(--shell-mute);
  pointer-events: none;
}

.shell-search-kbd {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.15rem 0.45rem;
  border-radius: 0.4rem;
  border: 1px solid var(--shell-line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--shell-mute);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
}

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

.shell-cta {
  display: none;
  align-items: center;
  height: 2.35rem;
  padding: 0 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.55);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(91, 33, 182, 0.25));
  color: var(--shell-ink);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.shell-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 28px rgba(139, 92, 246, 0.35);
}

@media (min-width: 768px) {
  .shell-cta { display: inline-flex; }
}

.shell-whats-new {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--shell-line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--shell-mute);
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

@media (min-width: 640px) {
  .shell-whats-new { display: inline-flex; }
}

.shell-whats-new:hover,
.shell-whats-new.is-active {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.1);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.15);
}

.shell-user {
  position: relative;
  display: none;
}

@media (min-width: 640px) {
  .shell-user { display: block; }
}

.shell-avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  height: 2.25rem;
  padding: 0 0.5rem 0 0.2rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  font-family: inherit;
  color: var(--shell-mute);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.shell-avatar-btn > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #8b5cf6, #06b6d4);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.shell-avatar-caret {
  transition: transform 180ms ease;
}

.shell-avatar-btn:hover,
.shell-avatar-btn[aria-expanded="true"] {
  border-color: var(--shell-line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--shell-ink);
}

.shell-avatar-btn[aria-expanded="true"] .shell-avatar-caret {
  transform: rotate(180deg);
}

.shell-menu {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  z-index: 60;
  min-width: 15rem;
  padding: 0.4rem;
  border-radius: 16px;
  border: 1px solid var(--shell-line-strong);
  background: rgba(18, 16, 30, 0.96);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  transform-origin: top right;
  animation: shell-menu-in 160ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes shell-menu-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.shell-menu-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.65rem 0.7rem;
  border-bottom: 1px solid var(--shell-line);
  margin-bottom: 0.35rem;
}

.shell-menu-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #8b5cf6, #06b6d4);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.shell-menu-name {
  display: block;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--shell-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell-menu-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--shell-mute);
}

.shell-menu-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.35rem;
  padding: 0 0.65rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--shell-soft);
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
}

.shell-menu-item svg {
  flex-shrink: 0;
  color: var(--shell-mute);
}

.shell-menu-item:hover,
.shell-menu-item:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  color: var(--shell-ink);
  outline: none;
}

.shell-menu-item:hover svg,
.shell-menu-item.is-active svg {
  color: var(--shell-accent);
}

.shell-menu-item.is-active {
  background: rgba(139, 92, 246, 0.14);
  color: var(--shell-ink);
}

.shell-menu-item.is-danger:hover {
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
}

.shell-menu-item.is-danger:hover svg {
  color: #fca5a5;
}

.shell-menu-tag {
  margin-left: auto;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.16);
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: var(--shell-accent);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.shell-menu-sep {
  height: 1px;
  margin: 0.35rem 0.25rem;
  background: var(--shell-line);
}

@media (prefers-reduced-motion: reduce) {
  .shell-menu { animation: none; }
  .shell-avatar-caret { transition: none; }
}

.shell-icon-btn {
  display: inline-flex;
  width: 2.35rem;
  height: 2.35rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--shell-line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--shell-mute);
  cursor: pointer;
}

.shell-icon-btn:hover {
  color: var(--shell-ink);
  border-color: var(--shell-line-strong);
}

.shell-main {
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
  flex: 1;
}

@media (min-width: 640px) {
  .shell-main { padding: 2rem 1.5rem 3.5rem; }
}

.shell-footer {
  border-top: 1px solid var(--shell-line);
  padding: 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--shell-mute);
}

.shell-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem 1.25rem;
  max-width: 80rem;
  margin: 0 auto;
}

.shell-version {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--shell-line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--shell-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.shell-version:hover {
  border-color: rgba(167, 139, 250, 0.45);
  color: var(--shell-ink);
  background: rgba(139, 92, 246, 0.12);
}

.shell-version-label {
  color: var(--shell-mute);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.58rem;
  font-family: var(--shell-font);
}

/* —— What's New —— */
.wn-version-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.4);
  background: rgba(139, 92, 246, 0.12);
  color: var(--shell-accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
}

.wn-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.wn-card {
  position: relative;
  padding: 1.35rem 1.4rem 1.25rem;
  border-radius: var(--shell-radius-lg);
  border: 1px solid var(--shell-line);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.32);
}

.wn-card.is-latest {
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow:
    0 0 0 1px rgba(139, 92, 246, 0.2),
    0 12px 40px rgba(0, 0, 0, 0.35);
}

.wn-card-head {
  margin-bottom: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--shell-line);
}

.wn-ver {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--shell-ink);
}

.wn-ver-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.wn-latest-pip {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #34d399;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.wn-date {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--shell-mute);
  font-variant-numeric: tabular-nums;
}

.wn-summary {
  margin: 0.75rem 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--shell-soft);
}

.wn-section {
  margin-top: 0.9rem;
}

.wn-section-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--shell-mute);
}

.wn-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 7px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--shell-line);
}

.wn-section-title.is-highlights {
  color: #fbbf24;
}
.wn-section-title.is-highlights .wn-section-icon {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.35);
}

.wn-section-title.is-added { color: #34d399; }
.wn-section-title.is-added .wn-section-icon {
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.35);
}

.wn-section-title.is-changed { color: #38bdf8; }
.wn-section-title.is-changed .wn-section-icon {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
}

.wn-section-title.is-fixed { color: #fbbf24; }
.wn-section-title.is-fixed .wn-section-icon {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.35);
}

.wn-section-title.is-internal { color: #94a3b8; }
.wn-section-title.is-internal .wn-section-icon {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.3);
}

.wn-bullets {
  margin: 0;
  padding-left: 1.35rem;
  list-style: disc;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--shell-soft);
}

.wn-bullets li {
  padding-left: 0.15rem;
}

.wn-bullets li::marker {
  color: currentColor;
  opacity: 0.55;
}

.login-version {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 2;
}

/* —— Scoring page —— */
.sc-total-pip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.4);
  background: rgba(139, 92, 246, 0.12);
  color: var(--shell-soft);
  font-size: 0.75rem;
  font-weight: 600;
}

.sc-total-pip span {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--shell-accent);
}

.sc-card {
  display: flex;
  flex-direction: column;
  padding: 1.2rem 1.25rem 1.15rem;
  border-radius: var(--shell-radius-lg);
  border: 1px solid var(--shell-line);
  border-top: 3px solid var(--sc-accent, var(--shell-line-strong));
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.3);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), border-color 180ms ease;
}

.sc-card:hover {
  transform: translateY(-3px);
}

.sc-card--impact { --sc-accent: var(--shell-teal, #22d3ee); }
.sc-card--mrs { --sc-accent: #2dd4bf; }
.sc-card--reviews { --sc-accent: #34d399; }
.sc-card--consist { --sc-accent: #fbbf24; }

.sc-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.sc-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--shell-ink);
}

.sc-cap {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}

.sc-cap--impact { color: var(--shell-teal, #22d3ee); }
.sc-cap--mrs { color: #2dd4bf; }
.sc-cap--reviews { color: #34d399; }
.sc-cap--consist { color: #fbbf24; }

.sc-bar {
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-bottom: 0.85rem;
}

.sc-bar span {
  display: block;
  height: 100%;
  width: var(--pct, 100%);
  border-radius: inherit;
  background: var(--sc-color, var(--shell-accent));
  box-shadow: 0 0 12px color-mix(in srgb, var(--sc-color, var(--shell-accent)) 55%, transparent);
}

.sc-card-desc {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--shell-mute);
}

.sc-panel {
  padding: 1.25rem 1.35rem 1.35rem;
  border-radius: var(--shell-radius-lg);
  border: 1px solid var(--shell-line);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.26);
}

.sc-panel--muted {
  background: rgba(255, 255, 255, 0.02);
}

.sc-panel-title {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--shell-ink);
}

.sc-panel-sub {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--shell-mute);
}

.sc-rows {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.sc-rows li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sc-row-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--shell-ink);
}

.sc-row-meta {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--shell-mute);
  text-align: right;
}

.sc-chip-info {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: rgba(139, 92, 246, 0.1);
  color: var(--shell-accent);
  font-size: 0.7rem;
  font-weight: 650;
}

.sc-quality {
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.sc-quality--exc { color: #2dd4bf; background: rgba(45, 212, 191, 0.1); border-color: rgba(45, 212, 191, 0.3); }
.sc-quality--good { color: #38bdf8; background: rgba(56, 189, 248, 0.1); border-color: rgba(56, 189, 248, 0.3); }
.sc-quality--ok { color: #fbbf24; background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.3); }
.sc-quality--bad { color: #f87171; background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.3); }

@media (prefers-reduced-motion: reduce) {
  .sc-card { transition: none; }
}

/* —— Page chrome —— */
.lb-head {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .lb-head {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.lb-title {
  margin: 0;
  font-family: var(--shell-display);
  font-size: clamp(1.75rem, 2.5vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.lb-sub {
  margin: 0.4rem 0 0;
  font-size: 0.875rem;
  color: var(--shell-mute);
}

.lb-sub a {
  color: var(--shell-accent);
  text-decoration: none;
  font-weight: 500;
}

.lb-sub a:hover { color: #c4b5fd; }

.lb-windows {
  display: inline-flex;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid var(--shell-line);
  background: rgba(255, 255, 255, 0.03);
}

.lb-windows a {
  min-height: 2rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--shell-mute);
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease;
}

.lb-windows a:hover { color: var(--shell-ink); }

.lb-windows a.is-active {
  color: var(--shell-ink);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px var(--shell-line-strong);
}

/* Board (GitLab server) switcher — larger pill above the leaderboard title */
.lb-boards {
  display: flex;
  width: fit-content;
  margin-bottom: 1rem;
  padding: 0.3rem;
}

.lb-boards a {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.5rem;
  font-size: 1.05rem;
}

/* —— Featured cards —— */
.featured-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.75rem;
  align-items: stretch;
}

@media (min-width: 900px) {
  .featured-row {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end; /* podium baseline */
    gap: 1.1rem;
  }
  /* Visual order: silver | gold | bronze — DOM stays rank order for a11y */
  .featured-card--1 { order: 2; }
  .featured-card--2 { order: 1; }
  .featured-card--3 { order: 3; }
}

.featured-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.05rem 1.1rem 0.95rem;
  border-radius: var(--shell-radius-lg);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--shell-line);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  text-decoration: none;
  color: inherit;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), border-color 200ms ease, box-shadow 200ms ease;
  overflow: hidden;
  /* Entrance (Remotion-style) — idle until .is-in */
  opacity: 0;
  transform: translateY(32px);
  will-change: transform, opacity;
}

.featured-card.is-in {
  animation: featured-rise 0.9s cubic-bezier(0.22, 1.28, 0.36, 1) both;
  animation-delay: var(--card-delay, 0ms);
}

@keyframes featured-rise {
  0% {
    opacity: 0;
    transform: translateY(36px) scale(0.94);
    filter: brightness(1.25);
  }
  65% {
    opacity: 1;
    filter: brightness(1.08);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
}

/* Size hierarchy: #1 > #2 > #3 */
.featured-card--1 {
  padding: 1.45rem 1.4rem 1.2rem;
  flex: 1.38 1 0;
  min-height: 17.5rem;
  z-index: 2;
}

.featured-card--2 {
  padding: 1.2rem 1.2rem 1.05rem;
  flex: 1.12 1 0;
  min-height: 15.25rem;
  z-index: 1;
}

.featured-card--3 {
  padding: 1rem 1.05rem 0.9rem;
  flex: 0.92 1 0;
  min-height: 13.5rem;
  z-index: 0;
}

.featured-card--1 .featured-name {
  font-size: 1.2rem;
}

.featured-card--2 .featured-name {
  font-size: 1.05rem;
}

.featured-card--3 .featured-name {
  font-size: 0.95rem;
}

.featured-card--1 .featured-stat-value {
  font-size: 1.2rem;
}

.featured-card--2 .featured-stat-value {
  font-size: 1.05rem;
}

.featured-card--3 .featured-stat-value {
  font-size: 0.95rem;
}

.featured-card--1 .featured-avatar {
  width: 3.35rem;
  height: 3.35rem;
  font-size: 0.95rem;
}

.featured-card--2 .featured-avatar {
  width: 2.85rem;
  height: 2.85rem;
}

.featured-card--3 .featured-avatar {
  width: 2.4rem;
  height: 2.4rem;
  font-size: 0.7rem;
}

.featured-card--1 .featured-rank-pip {
  width: 1.35rem;
  height: 1.35rem;
  font-size: 0.7rem;
}

.featured-card--3 .featured-rank-pip {
  width: 1.05rem;
  height: 1.05rem;
  font-size: 0.58rem;
}

.featured-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 40%);
  opacity: 0.5;
}

.featured-card.is-in:hover {
  transform: translateY(-4px);
  border-color: var(--shell-line-strong);
}

.featured-card--1.is-in:hover {
  transform: translateY(-5px) scale(1.015);
}

.featured-card--champ {
  border-color: rgba(250, 204, 21, 0.35);
  background:
    linear-gradient(165deg, rgba(139, 92, 246, 0.14), rgba(255, 255, 255, 0.02) 45%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  box-shadow:
    0 0 0 1px rgba(250, 204, 21, 0.2),
    0 0 18px rgba(250, 204, 21, 0.12),
    0 10px 28px rgba(0, 0, 0, 0.35);
}

.featured-card--silver {
  border-color: rgba(203, 213, 225, 0.35);
  background:
    linear-gradient(165deg, rgba(148, 163, 184, 0.1), rgba(255, 255, 255, 0.02) 45%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  box-shadow:
    0 0 0 1px rgba(203, 213, 225, 0.2),
    0 0 14px rgba(148, 163, 184, 0.1),
    0 10px 28px rgba(0, 0, 0, 0.35);
}

.featured-card--bronze {
  border-color: rgba(217, 119, 6, 0.35);
  background:
    linear-gradient(165deg, rgba(180, 83, 9, 0.12), rgba(255, 255, 255, 0.02) 45%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  box-shadow:
    0 0 0 1px rgba(217, 119, 6, 0.2),
    0 0 14px rgba(180, 83, 9, 0.1),
    0 10px 28px rgba(0, 0, 0, 0.35);
}

/* Rotating metal border for podium cards */
@property --medal-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.featured-card--champ::after,
.featured-card--silver::after,
.featured-card--bronze::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  padding: 1.5px;
  pointer-events: none;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: medal-spin 3.2s linear infinite;
}

.featured-card--champ::after {
  background: conic-gradient(
    from var(--medal-angle),
    rgba(250, 204, 21, 0) 0deg,
    rgba(250, 204, 21, 0) 190deg,
    rgba(212, 160, 23, 0.55) 250deg,
    rgba(253, 224, 71, 0.95) 300deg,
    #fff6d5 330deg,
    rgba(253, 224, 71, 0.95) 350deg,
    rgba(212, 160, 23, 0.4) 360deg
  );
}

.featured-card--silver::after {
  background: conic-gradient(
    from var(--medal-angle),
    rgba(226, 232, 240, 0) 0deg,
    rgba(226, 232, 240, 0) 190deg,
    rgba(148, 163, 184, 0.55) 250deg,
    rgba(226, 232, 240, 0.95) 300deg,
    #f8fafc 330deg,
    rgba(226, 232, 240, 0.95) 350deg,
    rgba(148, 163, 184, 0.4) 360deg
  );
  animation-duration: 3.6s;
}

.featured-card--bronze::after {
  background: conic-gradient(
    from var(--medal-angle),
    rgba(251, 146, 60, 0) 0deg,
    rgba(251, 146, 60, 0) 190deg,
    rgba(180, 83, 9, 0.55) 250deg,
    rgba(251, 146, 60, 0.95) 300deg,
    #ffedd5 330deg,
    rgba(251, 146, 60, 0.95) 350deg,
    rgba(180, 83, 9, 0.4) 360deg
  );
  animation-duration: 4s;
}

@keyframes medal-spin {
  to { --medal-angle: 360deg; }
}

@keyframes champ-glow {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(250, 204, 21, 0.2),
      0 0 16px rgba(250, 204, 21, 0.12),
      0 10px 28px rgba(0, 0, 0, 0.35);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(250, 204, 21, 0.35),
      0 0 24px rgba(250, 204, 21, 0.2),
      0 10px 30px rgba(0, 0, 0, 0.38);
  }
}

@keyframes silver-glow {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(203, 213, 225, 0.2),
      0 0 14px rgba(148, 163, 184, 0.1),
      0 10px 28px rgba(0, 0, 0, 0.35);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(226, 232, 240, 0.38),
      0 0 20px rgba(203, 213, 225, 0.18),
      0 10px 30px rgba(0, 0, 0, 0.38);
  }
}

@keyframes bronze-glow {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(217, 119, 6, 0.2),
      0 0 14px rgba(180, 83, 9, 0.1),
      0 10px 28px rgba(0, 0, 0, 0.35);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(251, 146, 60, 0.35),
      0 0 20px rgba(217, 119, 6, 0.18),
      0 10px 30px rgba(0, 0, 0, 0.38);
  }
}

/* Entrance first, then the looping glow */
.featured-card--champ.is-in {
  animation:
    featured-rise 0.9s cubic-bezier(0.22, 1.28, 0.36, 1) both,
    champ-glow 3.6s ease-in-out 0.9s infinite;
}

.featured-card--silver.is-in {
  animation:
    featured-rise 0.9s cubic-bezier(0.22, 1.28, 0.36, 1) both,
    silver-glow 3.8s ease-in-out 0.9s infinite;
}

.featured-card--bronze.is-in {
  animation:
    featured-rise 0.9s cubic-bezier(0.22, 1.28, 0.36, 1) both,
    bronze-glow 4s ease-in-out 0.9s infinite;
}

.featured-card--champ.is-in:hover {
  box-shadow:
    0 0 0 1px rgba(250, 204, 21, 0.42),
    0 0 22px rgba(250, 204, 21, 0.22),
    0 12px 32px rgba(0, 0, 0, 0.4);
}

.featured-card--silver.is-in:hover {
  box-shadow:
    0 0 0 1px rgba(226, 232, 240, 0.45),
    0 0 18px rgba(203, 213, 225, 0.2),
    0 12px 32px rgba(0, 0, 0, 0.4);
}

.featured-card--bronze.is-in:hover {
  box-shadow:
    0 0 0 1px rgba(251, 146, 60, 0.42),
    0 0 18px rgba(217, 119, 6, 0.2),
    0 12px 32px rgba(0, 0, 0, 0.4);
}

@media (prefers-reduced-motion: reduce) {
  .featured-card--champ,
  .featured-card--champ.is-in,
  .featured-card--silver,
  .featured-card--silver.is-in,
  .featured-card--bronze,
  .featured-card--bronze.is-in {
    animation: none;
  }

  .featured-card--champ::after,
  .featured-card--silver::after,
  .featured-card--bronze::after {
    animation: none;
  }

  .featured-card--champ::after {
    background: linear-gradient(135deg, rgba(253, 224, 71, 0.8), rgba(212, 160, 23, 0.35));
  }

  .featured-card--silver::after {
    background: linear-gradient(135deg, rgba(226, 232, 240, 0.85), rgba(148, 163, 184, 0.4));
  }

  .featured-card--bronze::after {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.85), rgba(180, 83, 9, 0.4));
  }
}

.featured-top {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
  position: relative;
  z-index: 1;
}

.featured-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.featured-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  color: #fff;
}

.featured-avatar-wrap[data-rank="1"] .featured-avatar {
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.7), 0 0 16px rgba(251, 191, 36, 0.25);
}

.featured-avatar-wrap[data-rank="2"] .featured-avatar {
  box-shadow: 0 0 0 2px rgba(203, 213, 225, 0.55);
}

.featured-avatar-wrap[data-rank="3"] .featured-avatar {
  box-shadow: 0 0 0 2px rgba(251, 146, 60, 0.55);
}

.featured-rank-pip {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  border: 2px solid var(--shell-panel-solid);
}

.featured-rank-pip[data-rank="1"] { background: #fbbf24; color: #422006; }
.featured-rank-pip[data-rank="2"] { background: #cbd5e1; color: #1e293b; }
.featured-rank-pip[data-rank="3"] { background: #fb923c; color: #431407; }

.featured-id { min-width: 0; flex: 1; }

.featured-name {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.featured-handle {
  margin: 0.1rem 0 0;
  font-size: 0.8rem;
  color: var(--shell-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.featured-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.featured-side {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.featured-side-btn {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--shell-line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--shell-mute);
}

.featured-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.25rem;
  padding: 1rem 0;
  border-top: 1px solid var(--shell-line);
  position: relative;
  z-index: 1;
  margin-top: auto;
}

.featured-stat-label {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--shell-mute);
}

.featured-stat-value {
  margin: 0.15rem 0 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.featured-stat-value.is-pos { color: var(--shell-positive); }
.featured-stat-value.is-accent { color: var(--shell-accent); }

.featured-mrs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.featured-mrs .featured-stat-value {
  margin: 0;
}

.featured-mrs-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.featured-mrs-badges .icon-badge {
  flex-shrink: 0;
}

.featured-score-track {
  margin: 0.85rem 0 0.15rem;
  max-width: none;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  max-width: 11rem;
}

/* User detail per-repo table — MRs count + badges on one line */
.ud-col-mrs {
  min-width: 7rem;
  width: 7.5rem;
}

.ud-mrs-cell {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

.ud-mrs-badges {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.3rem;
}

.ud-mrs-badges .icon-badge {
  flex-shrink: 0;
}

.tech-logo {
  width: 1.25rem;
  height: 1.25rem;
  object-fit: contain;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.12rem;
  flex-shrink: 0;
  transition: transform 140ms ease, background 140ms ease;
}

.tech-logo:hover {
  transform: translateY(-1px) scale(1.08);
  background: rgba(255, 255, 255, 0.12);
}

/* Floating tip for badges + tech logos (ported to body so tables don't clip) */
.ui-tip {
  position: fixed;
  z-index: 80;
  max-width: 16rem;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--shell-line-strong);
  background: rgba(18, 16, 32, 0.96);
  color: var(--shell-ink);
  font-family: var(--shell-font);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translate(-50%, calc(-100% - 8px)) scale(0.96);
  transition: opacity 120ms ease, transform 140ms cubic-bezier(0.22, 1.2, 0.36, 1);
}

.ui-tip.is-on {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 10px)) scale(1);
}

.ui-tip.is-below.is-on {
  transform: translate(-50%, 10px) scale(1);
}

.ui-tip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: rgba(18, 16, 32, 0.96);
}

.ui-tip.is-below::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: rgba(18, 16, 32, 0.96);
}

.icon-badge[data-tip],
.tech-logo[data-tip] {
  cursor: default;
}

@media (prefers-reduced-motion: reduce) {
  .ui-tip {
    transition: none;
  }
}

.featured-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.15rem;
  padding: 0.45rem 0.55rem 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--shell-line);
  position: relative;
  z-index: 1;
}

.featured-footer-text {
  flex: 1;
  min-width: 0;
  font-size: 0.75rem;
  color: var(--shell-mute);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.featured-copy {
  flex-shrink: 0;
  height: 1.7rem;
  padding: 0 0.7rem;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: var(--shell-ink);
  font-size: 0.7rem;
  font-weight: 650;
  cursor: pointer;
  font-family: inherit;
}

.featured-copy:hover { background: rgba(255, 255, 255, 0.14); }

/* —— Table panel —— */
.lb-panel {
  border-radius: var(--shell-radius-lg);
  border: 1px solid var(--shell-line-strong);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.02) inset,
    0 20px 60px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.lb-panel-head {
  display: none;
}

.lb-table-wrap { overflow-x: auto; }

.lb-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.lb-table thead th {
  padding: 0.95rem 1rem;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--shell-mute);
  border-bottom: 1px solid var(--shell-line);
  white-space: nowrap;
}

.lb-table thead th:first-child { padding-left: 1.35rem; }
.lb-table thead th:last-child { padding-right: 1.35rem; }

.lb-table tbody tr {
  transition: background 140ms ease;
}

.lb-table tbody tr:hover {
  background: rgba(167, 139, 250, 0.06);
}

.lb-table tbody td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  vertical-align: middle;
  color: var(--shell-soft);
}

.lb-table tbody tr:last-child td { border-bottom: 0; }

.lb-table tbody td:first-child { padding-left: 1.35rem; }
.lb-table tbody td:last-child { padding-right: 1.35rem; }

.lb-rank {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--shell-mute);
}

.lb-rank.is-1 { color: #fbbf24; }
.lb-rank.is-2 { color: #94a3b8; }
.lb-rank.is-3 { color: #fb923c; }

.lb-person {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.lb-person:hover .lb-person-name { color: #fff; }

.lb-person-avatar {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
}

.lb-person-name {
  display: block;
  font-weight: 600;
  color: var(--shell-ink);
  letter-spacing: -0.01em;
}

.lb-person-handle {
  display: block;
  font-size: 0.75rem;
  color: var(--shell-mute);
}

.lb-score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--shell-ink);
}

/* Score color by band — alarming oranges/reds below 50 */
.score-tier--elite,
[data-score-band="elite"] {
  color: #fbbf24;
  text-shadow: 0 0 18px rgba(251, 191, 36, 0.25);
}

.score-tier--strong,
[data-score-band="strong"] {
  color: #38bdf8;
  text-shadow: 0 0 16px rgba(56, 189, 248, 0.22);
}

.score-tier--solid,
[data-score-band="solid"] {
  color: #2dd4bf;
  text-shadow: 0 0 14px rgba(45, 212, 191, 0.2);
}

.score-tier--caution,
[data-score-band="caution"] {
  color: #fb923c;
  text-shadow: 0 0 16px rgba(251, 146, 60, 0.28);
}

.score-tier--warn,
[data-score-band="warn"] {
  color: #f97316;
  text-shadow: 0 0 16px rgba(249, 115, 22, 0.3);
}

.score-tier--danger,
[data-score-band="danger"] {
  color: #f87171;
  text-shadow: 0 0 18px rgba(248, 113, 113, 0.32);
}

.lb-col-score {
  min-width: 11.5rem;
  width: 12.5rem;
}

.lb-score-cell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  min-width: 10.5rem;
}

.lb-score-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lb-score-cell .lb-score {
  flex: 0 0 2.75rem;
  text-align: right;
  font-size: 1rem;
}

.lb-score-badges {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding-left: 3.5rem; /* align under the score track */
}

.lb-score-badges .icon-badge {
  flex-shrink: 0;
}

.lb-col-mrs {
  min-width: 4rem;
  width: 4.5rem;
  text-align: right;
  padding-left: 0.75rem !important;
  padding-right: 1rem !important;
}

.lb-mrs-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--shell-ink);
  line-height: 1.2;
}

.lb-pos { color: var(--shell-positive); font-weight: 600; font-variant-numeric: tabular-nums; }
.lb-neg { color: #f87171; font-variant-numeric: tabular-nums; }

.lb-chip { display: none; }

.shield-badge { display: none; } /* superseded by icon-only badges */

.icon-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.icon-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--shell-soft);
  flex-shrink: 0;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.icon-badge--sm {
  width: 1.5rem;
  height: 1.5rem;
}

.icon-badge--sm .icon-badge-svg {
  width: 12px;
  height: 12px;
}

.icon-badge:hover {
  transform: translateY(-1px);
}

.icon-badge-svg {
  display: block;
}

.icon-badge-count {
  position: absolute;
  top: -0.3rem;
  right: -0.35rem;
  min-width: 0.95rem;
  height: 0.95rem;
  padding: 0 0.2rem;
  border-radius: 999px;
  background: #0b0a12;
  border: 1px solid currentColor;
  color: inherit;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 0.95rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Tier */
.icon-badge--elite {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.4);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.2);
}
.icon-badge--strong {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.35);
}
.icon-badge--solid {
  color: #2dd4bf;
  background: rgba(45, 212, 191, 0.12);
  border-color: rgba(45, 212, 191, 0.35);
}
.icon-badge--building {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.3);
}
.icon-badge--start {
  color: #64748b;
  background: rgba(100, 116, 139, 0.1);
  border-color: rgba(100, 116, 139, 0.28);
}

/* Standouts */
.icon-badge--impact {
  color: #22d3ee;
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.35);
}
.icon-badge--ships {
  color: #2dd4bf;
  background: rgba(45, 212, 191, 0.12);
  border-color: rgba(45, 212, 191, 0.35);
}
.icon-badge--team {
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.35);
}
.icon-badge--steady {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.35);
}

/* Awards / MR kinds / medals */
.icon-badge--bugfixer {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.14);
  border-color: rgba(251, 146, 60, 0.4);
  box-shadow: 0 0 12px rgba(251, 146, 60, 0.18);
}
.icon-badge--pushfix {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.12);
  border-color: rgba(251, 146, 60, 0.35);
}
.icon-badge--bugfix {
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
}
.icon-badge--gold {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.16);
  border-color: rgba(251, 191, 36, 0.45);
}
.icon-badge--silver {
  color: #cbd5e1;
  background: rgba(203, 213, 225, 0.12);
  border-color: rgba(203, 213, 225, 0.35);
}
.icon-badge--bronze {
  color: #fb923c;
  background: rgba(251, 146, 60, 0.14);
  border-color: rgba(251, 146, 60, 0.4);
}
.icon-badge--ai {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.14);
  border-color: rgba(167, 139, 250, 0.4);
}

.lb-table .icon-badge-row { margin-top: 0.4rem; }

.lb-mobile { display: grid; gap: 0.75rem; }
@media (min-width: 768px) {
  .lb-mobile { display: none; }
  .lb-desktop { display: block; }
}
@media (max-width: 767px) {
  .lb-desktop { display: none; }
}

.lb-mobile-card {
  display: block;
  padding: 1rem;
  border-radius: var(--shell-radius);
  border: 1px solid var(--shell-line);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  color: inherit;
}

.lb-sync {
  margin-bottom: 1.25rem;
  border-radius: var(--shell-radius);
  border: 1px solid var(--shell-line);
  background: rgba(255, 255, 255, 0.02);
}

.lb-sync summary {
  list-style: none;
  cursor: pointer;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--shell-mute);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lb-sync summary::-webkit-details-marker { display: none; }
.lb-sync[open] summary { color: var(--shell-soft); }
.lb-sync-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--shell-line);
  font-size: 0.8125rem;
  color: var(--shell-mute);
}

.lb-empty {
  text-align: center;
  padding: 4rem 1.5rem;
  border-radius: var(--shell-radius-lg);
  border: 1px solid var(--shell-line);
  background: rgba(255, 255, 255, 0.03);
}

.score-track {
  display: flex;
  height: 0.35rem;
  width: 100%;
  max-width: 6.5rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.score-track > div {
  height: 100%;
  min-width: 2px;
}

.score-track-lg {
  height: 0.45rem;
  max-width: none;
}

.score-track-table {
  flex: 1 1 auto;
  width: 7.5rem;
  min-width: 7.5rem;
  max-width: 9rem;
  height: 0.4rem;
}

/* —— Remotion-style motion (user detail) —— */
.score-track-motion {
  position: relative;
  overflow: hidden;
}

.score-track-motion .score-seg {
  width: 0;
  min-width: 0;
  flex-shrink: 0;
  transform-origin: left center;
  transition: none;
}

.score-track-motion.is-in .score-seg,
[data-motion].is-in .score-track-motion .score-seg {
  width: var(--seg-w, 0%);
  min-width: 0;
  animation: score-seg-spring 0.85s cubic-bezier(0.22, 1.2, 0.36, 1) both;
  animation-delay: var(--seg-delay, 0ms);
}

@keyframes score-seg-spring {
  0% {
    width: 0;
    opacity: 0.35;
    filter: brightness(1.4);
  }
  70% {
    filter: brightness(1.15);
  }
  100% {
    width: var(--seg-w, 0%);
    opacity: 1;
    filter: brightness(1);
  }
}

/* Rolling counters — tabular so widths never jump mid-count */
[data-count-to] {
  font-variant-numeric: tabular-nums;
  transition: text-shadow 240ms ease, opacity 240ms ease;
}

[data-count-to].is-counting {
  opacity: 0.94;
  text-shadow: 0 0 14px currentColor;
}

.ud-metric {
  text-align: center;
}

.ud-metric-bar {
  margin: 0.45rem auto 0;
  height: 0.28rem;
  width: 100%;
  max-width: 5.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.ud-metric-bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--bar-color, var(--shell-accent));
  box-shadow: 0 0 12px color-mix(in srgb, var(--bar-color, #a78bfa) 55%, transparent);
}

[data-motion="score"].is-in .ud-metric-bar > span {
  animation: metric-bar-grow 0.9s cubic-bezier(0.22, 1.15, 0.36, 1) both;
  animation-delay: var(--bar-delay, 0ms);
}

@keyframes metric-bar-grow {
  from { width: 0; opacity: 0.4; }
  to { width: var(--pct, 0%); opacity: 1; }
}

.activity-chart {
  overflow: visible;
}

.activity-baseline {
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1;
}

.activity-dow {
  font-size: 7px;
  fill: var(--shell-mute);
}

.activity-dow.is-weekend {
  fill: #fb923c;
}

.activity-slot {
  fill: rgba(255, 255, 255, 0.04);
}

.activity-slot.is-weekend {
  fill: rgba(251, 146, 60, 0.08);
}

.activity-bar {
  fill: #2dd4bf;
  transform-box: fill-box;
  transform-origin: center bottom;
  transform: scaleY(0);
  opacity: 0;
}

.activity-bar.is-weekend {
  fill: #fb923c;
}

.activity-count,
.activity-date {
  font-size: 7px;
  fill: var(--shell-mute);
  opacity: 0;
}

[data-motion="chart"].is-in .activity-bar {
  animation: activity-bar-spring 0.75s cubic-bezier(0.22, 1.35, 0.36, 1) both;
  animation-delay: var(--bar-delay, 0ms);
}

[data-motion="chart"].is-in .activity-count {
  animation: activity-fade 0.45s ease both;
  animation-delay: calc(var(--bar-delay, 0ms) + 280ms);
}

[data-motion="chart"].is-in .activity-date {
  animation: activity-fade 0.5s ease both;
  animation-delay: 0.55s;
}

@keyframes activity-bar-spring {
  0% {
    transform: scaleY(0);
    opacity: 0;
    filter: brightness(1.5);
  }
  65% {
    transform: scaleY(1.08);
    opacity: 1;
    filter: brightness(1.2);
  }
  100% {
    transform: scaleY(1);
    opacity: 1;
    filter: brightness(1);
  }
}

@keyframes activity-fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .score-track-motion .score-seg,
  .score-track-motion.is-in .score-seg,
  [data-motion].is-in .score-track-motion .score-seg {
    animation: none !important;
    width: var(--seg-w, 0%) !important;
    opacity: 1 !important;
    filter: none !important;
  }

  .ud-metric-bar > span,
  [data-motion="score"].is-in .ud-metric-bar > span {
    animation: none !important;
    width: var(--pct, 0%) !important;
    opacity: 1 !important;
  }

  .activity-bar,
  [data-motion="chart"].is-in .activity-bar {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
  }

  .activity-count,
  .activity-date,
  [data-motion="chart"].is-in .activity-count,
  [data-motion="chart"].is-in .activity-date {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* —— Admin —— */
.admin-env-pip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--shell-line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--shell-soft);
}

.admin-env-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

.admin-env-pip.is-sync .admin-env-dot {
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
}

.admin-stat {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  border-radius: var(--shell-radius);
  border: 1px solid var(--shell-line);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
}

.admin-stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  flex-shrink: 0;
}

.admin-stat-icon.is-extract {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.admin-stat-icon.is-agg {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.3);
}

.admin-stat-label {
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--shell-mute);
}

.admin-stat-value {
  margin-top: 0.15rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--shell-ink);
  font-variant-numeric: tabular-nums;
}

.admin-stat-dur {
  margin-left: 0.35rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--shell-mute);
}

.admin-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.14);
  border: 1px solid rgba(167, 139, 250, 0.4);
  color: var(--shell-accent);
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.admin-live-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: currentColor;
  animation: admin-pulse 1.1s ease-in-out infinite;
}

@keyframes admin-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.75); }
}

.admin-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.35rem 1.35rem 1.25rem;
  border-radius: var(--shell-radius-lg);
  border: 1px solid var(--shell-line);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px);
  animation: featured-rise 0.8s cubic-bezier(0.22, 1.28, 0.36, 1) both;
  animation-delay: var(--card-delay, 0ms);
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1), border-color 200ms ease, box-shadow 200ms ease;
}

.admin-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 40%);
  opacity: 0.5;
}

.admin-card:hover {
  transform: translateY(-3px);
  border-color: var(--shell-line-strong);
}

.admin-card.is-danger {
  border-color: rgba(248, 113, 113, 0.35);
}

.admin-card.is-danger:hover {
  border-color: rgba(248, 113, 113, 0.55);
  box-shadow:
    0 0 32px rgba(248, 113, 113, 0.12),
    0 12px 40px rgba(0, 0, 0, 0.4);
}

.admin-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 14px;
  margin-bottom: 1rem;
}

.admin-card-icon.is-safe {
  color: #2dd4bf;
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.3);
}

.admin-card-icon.is-danger {
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.admin-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.admin-card-title {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--shell-ink);
}

.admin-chip {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
}

.admin-chip.is-ok {
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.admin-chip.is-warn {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.admin-card-desc {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--shell-mute);
  margin-bottom: 0.65rem;
}

.admin-card-note {
  font-size: 0.75rem;
  color: var(--shell-mute);
  margin-bottom: 0.65rem;
}

.admin-card-note.is-warn {
  color: #fbbf24;
}

.admin-btn {
  margin-top: auto;
  min-height: 44px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 0 1.25rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 650;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.3);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.admin-btn:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}

.admin-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.985);
}

.admin-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  color: var(--shell-mute);
}

.admin-btn.is-danger {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
}

.admin-btn.is-danger:hover:not(:disabled) {
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
}

.admin-refreeze-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  margin-top: auto;
}

.admin-refreeze-row .admin-btn {
  margin-top: 0;
}

.admin-btn-auto {
  width: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}

.admin-refreeze-input {
  flex: 1 1 auto;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid var(--shell-line-strong);
  background: var(--shell-panel-solid);
  color: var(--shell-ink);
  padding: 0 0.875rem;
  font-family: inherit;
  font-size: 0.875rem;
}

.admin-refreeze-input::placeholder {
  color: var(--shell-mute);
}

.admin-refreeze-input:focus {
  outline: 2px solid var(--shell-accent);
  outline-offset: 1px;
}

@media (prefers-reduced-motion: reduce) {
  .admin-card {
    animation: none;
    opacity: 1;
    transform: none;
    transition: none;
  }

  .admin-live-dot {
    animation: none;
  }
}

/* —— Architecture diagrams —— */
.arch-page { margin: 0; }

.arch-section { margin-bottom: 2.25rem; }

.arch-section-title {
  margin: 0 0 0.85rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--shell-mute);
}

.arch-section-title span {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  margin-left: 0.4rem;
  opacity: 0.9;
}

.arch-panel {
  border-radius: var(--shell-radius-lg);
  border: 1px solid var(--shell-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  padding: 1.35rem 1.25rem;
  overflow-x: auto;
}

.arch-node {
  border-radius: 12px;
  border: 1px solid var(--shell-line-strong);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.75rem 0.85rem;
}

.arch-node--sm {
  padding: 0.55rem 0.65rem;
  text-align: center;
  min-width: 7rem;
}

.arch-node--live {
  border-color: rgba(96, 165, 250, 0.45);
  background: linear-gradient(165deg, rgba(59, 130, 246, 0.14), rgba(255, 255, 255, 0.02));
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.12);
}

.arch-node--sync {
  border-color: rgba(52, 211, 153, 0.45);
  background: linear-gradient(165deg, rgba(16, 185, 129, 0.14), rgba(255, 255, 255, 0.02));
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.12);
}

.arch-node--redis {
  border-color: rgba(248, 113, 113, 0.4);
  background: linear-gradient(165deg, rgba(239, 68, 68, 0.12), rgba(255, 255, 255, 0.02));
}

.arch-node--dynamo {
  border-color: rgba(251, 191, 36, 0.4);
  background: linear-gradient(165deg, rgba(245, 158, 11, 0.12), rgba(255, 255, 255, 0.02));
}

.arch-node--gitlab {
  border-color: rgba(252, 109, 38, 0.45);
  background: linear-gradient(165deg, rgba(252, 109, 38, 0.12), rgba(255, 255, 255, 0.02));
}

.arch-node--llm {
  border-color: rgba(167, 139, 250, 0.5);
  background: linear-gradient(165deg, rgba(139, 92, 246, 0.14), rgba(255, 255, 255, 0.02));
}

.arch-node--hit {
  border-color: rgba(52, 211, 153, 0.5);
  background: linear-gradient(165deg, rgba(16, 185, 129, 0.14), rgba(255, 255, 255, 0.02));
}

.arch-node--miss {
  border-color: rgba(251, 191, 36, 0.5);
  background: linear-gradient(165deg, rgba(245, 158, 11, 0.14), rgba(255, 255, 255, 0.02));
}

.arch-node--core {
  border-color: rgba(96, 165, 250, 0.55);
  background: linear-gradient(165deg, rgba(59, 130, 246, 0.2), rgba(255, 255, 255, 0.03));
}

.arch-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 0.35rem;
}

.arch-label--live { color: #93c5fd; }
.arch-label--sync { color: #6ee7b7; }
.arch-label--redis { color: #fca5a5; }
.arch-label--dynamo { color: #fcd34d; }
.arch-label--gitlab { color: #fdba74; }
.arch-label--llm { color: #c4b5fd; }
.arch-label--muted { color: var(--shell-soft); }
.arch-label--hit { color: #6ee7b7; }
.arch-label--miss { color: #fcd34d; }

.arch-sub {
  margin: 0 0 0.55rem;
  font-size: 0.7rem;
  color: var(--shell-mute);
}

.arch-chip {
  display: block;
  font-size: 0.7rem;
  color: var(--shell-soft);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--shell-line);
  border-radius: 6px;
  padding: 0.28rem 0.45rem;
  margin-top: 0.3rem;
}

.arch-meta {
  margin-top: 0.65rem;
  font-size: 0.7rem;
  color: var(--shell-mute);
  font-variant-numeric: tabular-nums;
}

.arch-meta strong {
  color: var(--shell-soft);
  font-weight: 600;
}

.arch-arrow {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  color: var(--shell-mute);
  font-size: 0.65rem;
}

/* Horizontal connector: a line that links two nodes, chevron at the end */
.arch-arrow:not(.arch-arrow--v) {
  flex: 1 1 2.5rem;
  min-width: 2.5rem;
  height: 1.4rem;
}

.arch-arrow:not(.arch-arrow--v)::before {
  content: "";
  position: absolute;
  left: -0.25rem;
  right: -0.25rem;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: linear-gradient(90deg,
    rgba(167, 139, 250, 0.12),
    rgba(167, 139, 250, 0.5) 45%,
    rgba(45, 212, 191, 0.45));
  border-radius: 2px;
}

.arch-arrow:not(.arch-arrow--v) svg {
  position: absolute;
  right: -0.3rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.85rem;
  height: 0.85rem;
  opacity: 0.75;
  color: #c4b5fd;
}

/* Vertical connector: a line dropping between stacked nodes */
.arch-arrow--v {
  padding: 1.1rem 0 0.15rem;
  min-height: 2.6rem;
  gap: 0.15rem;
}

.arch-arrow--v::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  height: 1rem;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.12), rgba(167, 139, 250, 0.55));
  border-radius: 2px;
}

.arch-arrow--v svg {
  width: 0.85rem;
  height: 0.85rem;
  opacity: 0.75;
  color: #c4b5fd;
}

.arch-flow {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: max-content;
}

/* —— Node logos (driven by node type modifier) —— */
.arch-node--gitlab,
.arch-node--redis,
.arch-node--dynamo,
.arch-node--live,
.arch-node--sync,
.arch-node--core,
.arch-node--llm,
.arch-node--browser,
.arch-node--auth {
  position: relative;
}

.arch-node--gitlab::before,
.arch-node--redis::before,
.arch-node--dynamo::before,
.arch-node--live::before,
.arch-node--sync::before,
.arch-node--core::before,
.arch-node--llm::before,
.arch-node--browser::before,
.arch-node--auth::before {
  content: "";
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  margin: 0 0 0.45rem;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

/* Center the logo on the compact (flow) nodes */
.arch-node--sm.arch-node--gitlab::before,
.arch-node--sm.arch-node--redis::before,
.arch-node--sm.arch-node--dynamo::before,
.arch-node--sm.arch-node--live::before,
.arch-node--sm.arch-node--sync::before,
.arch-node--sm.arch-node--core::before,
.arch-node--sm.arch-node--llm::before,
.arch-node--sm.arch-node--browser::before,
.arch-node--sm.arch-node--auth::before {
  margin-left: auto;
  margin-right: auto;
}

.arch-node--gitlab::before { background-image: url("../img/logo.svg"); }
.arch-node--redis::before { background-image: url("../img/tech/redis.svg"); }
.arch-node--dynamo::before { background-image: url("../img/tech/aws-dynamodb.svg"); }
.arch-node--live::before { background-image: url("../img/tech/fastapi.svg"); }
.arch-node--sync::before { background-image: url("../img/tech/fastapi.svg"); }
.arch-node--core::before { background-image: url("../img/tech/python.svg"); }
.arch-node--llm::before { background-image: url("../img/tech/llm.svg"); }
.arch-node--browser::before { background-image: url("../img/tech/browser.svg"); }
.arch-node--auth::before { background-image: url("../img/tech/auth.svg"); }

.arch-secret::before {
  content: "";
  display: inline-block;
  vertical-align: -0.3rem;
  width: 1.15rem;
  height: 1.15rem;
  margin-right: 0.5rem;
  background: url("../img/tech/amazon-aws.svg") center/contain no-repeat;
}

.arch-flow-note {
  margin: 0.85rem 0 0;
  font-size: 0.75rem;
  color: var(--shell-mute);
  line-height: 1.45;
}

.arch-flow-note code {
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--shell-soft);
}

.arch-topo-clients {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.25rem;
}

.arch-topo-client {
  width: 9rem;
  text-align: center;
}

.arch-topo-mid {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.arch-topo-col {
  width: 13.5rem;
  flex-shrink: 0;
}

.arch-topo-stores {
  width: 12.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: center;
  flex-shrink: 0;
}

.arch-topo-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}

.arch-topo-links > div {
  width: 13.5rem;
  text-align: center;
}

.arch-secret {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--shell-mute);
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--shell-line);
  background: rgba(255, 255, 255, 0.03);
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}

.arch-windows {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 5rem;
}

.arch-windows span {
  display: block;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.3);
  background: rgba(59, 130, 246, 0.1);
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
}

.arch-score-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

@media (min-width: 768px) {
  .arch-score-grid { grid-template-columns: repeat(4, 1fr); }
}

.arch-score-card {
  border-radius: 12px;
  border: 1px solid var(--shell-line);
  border-top-width: 3px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.85rem;
}

.arch-score-card--impact { border-top-color: var(--shell-teal); }
.arch-score-card--mrs { border-top-color: var(--shell-positive); }
.arch-score-card--reviews { border-top-color: #a78bfa; }
.arch-score-card--consist { border-top-color: #fbbf24; }

/* Architecture motion — stagger in + flowing packets */
[data-motion="arch"] .arch-node,
[data-motion="arch"] .arch-arrow,
[data-motion="arch"] .arch-windows,
[data-motion="arch"] .arch-secret,
[data-motion="arch"] .arch-score-card,
[data-motion="arch"] .arch-score-grid + div {
  opacity: 0;
  transform: translateY(14px) scale(0.96);
}

[data-motion="arch"].is-in .arch-node,
[data-motion="arch"].is-in .arch-arrow,
[data-motion="arch"].is-in .arch-windows,
[data-motion="arch"].is-in .arch-secret,
[data-motion="arch"].is-in .arch-score-card,
[data-motion="arch"].is-in .arch-score-grid + div {
  animation: arch-step-in 0.6s cubic-bezier(0.22, 1.28, 0.36, 1) both;
  animation-delay: calc(var(--arch-i, 0) * 70ms);
}

@keyframes arch-step-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.arch-arrow {
  position: relative;
}

.arch-packet {
  position: absolute;
  top: 50%;
  left: 0;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 999px;
  background: #a78bfa;
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.85), 0 0 18px rgba(45, 212, 191, 0.45);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.arch-packet--v {
  top: 0;
  left: 50%;
  margin-top: 0;
  margin-left: -3.5px;
}

[data-motion="arch"].is-in .arch-packet {
  animation: arch-packet-h 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  animation-delay: calc(0.55s + var(--arch-i, 0) * 70ms);
}

[data-motion="arch"].is-in .arch-packet--v {
  animation-name: arch-packet-v;
}

[data-motion="arch"].is-in .arch-arrow svg {
  animation: arch-arrow-glow 1.8s ease-in-out infinite;
  animation-delay: calc(0.55s + var(--arch-i, 0) * 70ms);
}

@keyframes arch-packet-h {
  0% { left: 8%; opacity: 0; transform: scale(0.6); }
  15% { opacity: 1; transform: scale(1); }
  85% { opacity: 1; }
  100% { left: 78%; opacity: 0; transform: scale(0.6); }
}

@keyframes arch-packet-v {
  0% { top: 10%; opacity: 0; transform: scale(0.6); }
  15% { opacity: 1; transform: scale(1); }
  85% { opacity: 1; }
  100% { top: 70%; opacity: 0; transform: scale(0.6); }
}

@keyframes arch-arrow-glow {
  0%, 100% { opacity: 0.45; color: var(--shell-mute); }
  50% { opacity: 1; color: #c4b5fd; }
}

[data-motion="arch"].is-in .arch-node--live,
[data-motion="arch"].is-in .arch-node--sync,
[data-motion="arch"].is-in .arch-node--redis,
[data-motion="arch"].is-in .arch-node--dynamo,
[data-motion="arch"].is-in .arch-node--gitlab,
[data-motion="arch"].is-in .arch-node--llm,
[data-motion="arch"].is-in .arch-node--browser,
[data-motion="arch"].is-in .arch-node--auth,
[data-motion="arch"].is-in .arch-node--core {
  transition: box-shadow 280ms ease;
}

[data-motion="arch"].is-in .arch-node--live:hover { box-shadow: 0 0 28px rgba(59, 130, 246, 0.35); }
[data-motion="arch"].is-in .arch-node--sync:hover { box-shadow: 0 0 28px rgba(16, 185, 129, 0.35); }
[data-motion="arch"].is-in .arch-node--redis:hover { box-shadow: 0 0 28px rgba(239, 68, 68, 0.3); }
[data-motion="arch"].is-in .arch-node--dynamo:hover { box-shadow: 0 0 28px rgba(245, 158, 11, 0.3); }
[data-motion="arch"].is-in .arch-node--gitlab:hover { box-shadow: 0 0 28px rgba(252, 109, 38, 0.35); }
[data-motion="arch"].is-in .arch-node--llm:hover { box-shadow: 0 0 28px rgba(139, 92, 246, 0.35); }
[data-motion="arch"].is-in .arch-node--browser:hover { box-shadow: 0 0 28px rgba(148, 163, 184, 0.35); }
[data-motion="arch"].is-in .arch-node--auth:hover { box-shadow: 0 0 28px rgba(251, 191, 36, 0.3); }
[data-motion="arch"].is-in .arch-node--core:hover { box-shadow: 0 0 28px rgba(59, 130, 246, 0.4); }

@media (prefers-reduced-motion: reduce) {
  [data-motion="arch"] .arch-node,
  [data-motion="arch"] .arch-arrow,
  [data-motion="arch"] .arch-windows,
  [data-motion="arch"] .arch-secret,
  [data-motion="arch"] .arch-score-card,
  [data-motion="arch"] .arch-score-grid + div,
  [data-motion="arch"].is-in .arch-node,
  [data-motion="arch"].is-in .arch-arrow,
  [data-motion="arch"].is-in .arch-windows,
  [data-motion="arch"].is-in .arch-secret,
  [data-motion="arch"].is-in .arch-score-card,
  [data-motion="arch"].is-in .arch-score-grid + div {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    animation: none !important;
  }

  .arch-packet,
  [data-motion="arch"].is-in .arch-packet,
  [data-motion="arch"].is-in .arch-arrow svg {
    animation: none !important;
    opacity: 0 !important;
  }

  [data-motion="arch"].is-in .arch-arrow svg {
    opacity: 0.55 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .featured-card,
  .featured-card.is-in {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }

  .shell-cta, .lb-windows a, .lb-table tbody tr {
    transition: none !important;
  }

  [data-count-to],
  [data-count-to].is-counting {
    transition: none !important;
    text-shadow: none !important;
    opacity: 1 !important;
  }
}
