:root {
  --bg: #0a0b10;
  --panel: #141622;
  --card: #0f1020;
  --ink: #e7f6f2;
  --muted: #98b3ad;
  --amber: #ffd166;
  --red: #ff3b30;
  --accent: #8bf3e6; /* subtle cyan for headings */
  --glow: 0 0 24px rgba(255,209,102,.25);
  --radius: 16px;
  --border: 1px solid rgba(255,255,255,.06);
  --top-gap: clamp(12px, 4vh, 40px);
}

/* Basic box-sizing and html, body styles */
* {
  box-sizing: border-box;
}
html, body {
  height: 100%;
  overflow-x: hidden; /* Prevent horizontal scroll */
  padding-top: calc(var(--top-gap) + env(safe-area-inset-top, 0px));
  margin: 0;
  font: 16px/1.5 ui-sans-serif, system-ui, Segoe UI, Roboto, Inter;
  color: var(--ink);
  background: radial-gradient(1200px 800px at 20% -10%, rgba(255,59,48,.08), transparent 60%),
              radial-gradient(1000px 600px at 120% 10%, rgba(255,209,102,.07), transparent 60%),
              var(--bg);
}

a, .url, .link {
  overflow-wrap: break-word;
  word-break: break-all;
  white-space: normal;
}


/* Utility classes */
.hidden {
  display: none !important;
}

/* Layout containers */
.app-frame {
  width: min(70vw, 1200px);
  margin: 0 auto;
  padding-inline: 8px;
}
@media (max-width: 900px) {
  .app-frame {
    width: calc(100vw - 16px);
  }
}
@media (min-width: 1800px) {
  .app-frame {
    width: 75vw;
  }
}

/* Topbar styles */
.topbar {
  position: relative;
  padding: 20px 18px;
  border: var(--border);
  border-radius: 24px;
  background:
    radial-gradient(120% 140% at 15% 0%, rgba(255,59,48,.14), transparent 35%),
    radial-gradient(120% 140% at 85% 15%, rgba(255,209,102,.12), transparent 40%),
    linear-gradient(180deg, #161829, #101223);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.03),
    0 20px 40px rgba(0,0,0,.35),
    0 0 60px rgba(255,59,48,.12),
    0 0 120px rgba(255,209,102,.08);
}
.topbar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.03) 0 2px, transparent 2px 4px);
  mix-blend-mode: overlay;
  opacity: .35;
  animation: scan 9s linear infinite;
}

/* 3-column grid inside topbar */
.tb-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

/* Logo styling */
.logo {
  width: 128px;
  height: 128px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 0 18px rgba(255,209,102,.45);
}
@media (max-width: 720px) {
  .logo {
    width: 48px;
    height: 48px;
  }
}

/* Spacer for centering title */
.tb-spacer {
  width: 60px;
  height: 60px;
  @media (max-width: 720px) {
    width: 48px;
    height: 48px;
  }
}

/* Glitch title styles */
.title-glitch {
  position: relative;
  margin: 0;
  text-align: center;
  font-size: 38px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: .6px;
  color: #f7f7f2;
  text-shadow: 0 0 12px rgba(255,209,102,.25), 0 0 24px rgba(255,59,48,.20);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.title-glitch::before,
.title-glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: .8;
  filter: blur(.2px);
}
.title-glitch::before {
  color: #ff3b30;
  transform: translateX(calc(-50% - 1px));
  animation: gl1 2.2s steps(12) infinite;
}
.title-glitch::after {
  color: #ffd166;
  transform: translateX(calc(-50% + 1px));
  animation: gl2 2.2s steps(12) infinite;
}

/* Scan background animation for topbar */
@keyframes scan {
  0% { background-position: 0 -12px; }
  100% { background-position: 0 12px; }
}

/* Glitch animations */
@keyframes gl1 {
  0%, 100% { clip-path: inset(0 0 0 0); transform: translateX(calc(-50% - 1px)); }
  40% { clip-path: inset(6% 0 6% 0); transform: translateX(calc(-50% - 2px)); }
}
@keyframes gl2 {
  0%, 100% { clip-path: inset(0 0 0 0); transform: translateX(calc(-50% + 1px)); }
  50% { clip-path: inset(4% 0 4% 0); transform: translateX(calc(-50% + 2px)); }
}

/* Responsive for glitch title and logo */
@media (max-width: 720px) {
  .title-glitch { font-size: 22px; letter-spacing: .4px; }
}

/* --- Menu & Pills --- */
.menu {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 22px 0;
  padding: 16px 18px;
  background: var(--panel);
  border: var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 10px 24px rgba(0,0,0,.25) inset;
}

/* Pills styles */
.pill {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  min-height: 42px;
  min-width: 132px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(180deg, #0b0d19, #0a0b14);
  color: #eaf2ef;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: transform .06s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}
.pill:hover {
  border-color: rgba(255,209,102,.55);
  box-shadow: 0 0 0 2px rgba(255,209,102,.18);
}
.pill:active {
  transform: translateY(1px);
}
.pill.active {
  color: #0b0b0e;
  background: linear-gradient(180deg, #ffd166, #f3a33b);
  border-color: #f3a33b;
  box-shadow: 0 0 0 3px rgba(255,209,102,.22),
              0 6px 16px rgba(243,163,59,.25);
}
.pill.danger {
  border-color: rgba(255,59,48,.55);
  color: #ffd7d4;
}
.pill.danger:hover {
  box-shadow: 0 0 0 2px rgba(255,59,48,.22);
}
/* Responsive pills */
@media (max-width: 640px) {
  .pill {
    flex: 1 1 46%;
    min-width: unset;
    text-align: center;
  }
}

/* --- Content panels and layout --- */
.panel {
  padding: 18px;
  background: var(--panel);
  border: var(--border);
  border-radius: 24px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02), 0 20px 40px rgba(0,0,0,.35);
}
.view.hidden {
  display: none;
}

/* Headings */
h2 {
  margin: 6px 0 12px;
  color: var(--amber);
  font-size: 18px;
}
h3 {
  margin: 0 0 10px;
  color: #f7f2d6;
  font-size: 16px;
}
.sub {
  color: var(--muted);
  margin-top: -4px;
}

/* Card styles */
.card {
  background: var(--card);
  border: var(--border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
}

/* Rows and grids */
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 10px 0;
}
.row label {
  flex: 1;
  color: #dfe9e6;
}
.row input[type="range"] {
  width: 180px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

/* Buttons and interactive elements */
.primary {
  background: linear-gradient(180deg, #ffd166, #ffb703);
  border: none;
  color: #1a1000;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}
.primary:hover {
  filter: brightness(1.05);
}

/* Legends and labels */
.legend {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

/* Bars & progress */
.bars {
  display: grid;
  gap: 8px;
}
.bar {
  background: #0b0d19;
  border: var(--border);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  margin: 10px 0 14px;
  padding: 10px 12px;
}
.bar .fill {
  height: 12px;
  background: linear-gradient(90deg, #ff3b30, #ffd166);
}
.bar .label {
  padding: 6px 8px;
  font-size: 13px;
  color: #c8d9d5;
}

/* Toggles and disclaimers */
.toggle {
  display: block;
  margin: 10px 0;
}
.disclaimer {
  color: var(--muted);
  font-size: 13px;
  margin-top: 10px;
}

/* Footer styles */
.footer {
  margin-top: auto;
  padding: 12px 18px;
  border: var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #161829, #101223);
  color: #cfd7d4;
  font-size: 16px;
  text-align: center;
  box-shadow: 0 6px 24px rgba(0,0,0,.35) inset;
}

/* Document list & sections */
.item-list {
  display: block;
  margin-top: 8px;
}
.section-title {
  margin: 18px 0 8px;
  color: #ffd166;
  font-weight: 700;
  font-size: 16px;
}

/* List rows & chips */
.li-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  margin: 8px 0;
  background: var(--card);
  border: var(--border);
  border-radius: 12px;
}
.numchip {
  min-width: 34px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 700;
  color: #1a1200;
  background: #ffd166;
}
.li-row label {
  color: #dfe9e6;
  line-height: 1.35;
}
.li-row input[type="range"] {
  width: 220px;
}

/* Value chip styles */
.valchip {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,209,102,.15);
  border: 1px solid rgba(255,209,102,.35);
  color: #ffe9b5;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* Section wrap */
.section-wrap {
  padding: 12px;
  border: var(--border);
  border-radius: 14px;
  background: #0f1020;
  margin-bottom: 12px;
}

/* Accessibility modes and high contrast styles are maintained as-is */
html.reduce-motion {
  scroll-behavior: auto;
}
html.reduce-motion .title-glitch::before,
html.reduce-motion .title-glitch::after,
html.reduce-motion .topbar::after {
  animation: none !important;
}
html.high-contrast {
  --ink: #ffffff;
  --panel: #0c0f1a;
  --border: 1px solid rgba(255,255,255,.28);
}
html.high-contrast body {
  filter: contrast(1.12) saturate(1.05);
}
html.high-contrast .panel,
html.high-contrast .menu,
html.high-contrast .card,
html.high-contrast .topbar,
html.high-contrast .footer {
  border: var(--border) !important;
  box-shadow: none;
}
html.high-contrast h1,
html.high-contrast h2,
html.high-contrast h3,
html.high-contrast .section-title,
html.high-contrast .title-glitch {
  color: #ffffff !important;
  text-shadow: none !important;
}
html.high-contrast input[type="range"] {
  filter: brightness(1.15) contrast(1.2) !important;
}
html.high-contrast .pill {
  background: #13182a !important;
  border-color: #ffffff5a !important;
  color: #ffffff !important;
  box-shadow: none !important;
}
html.high-contrast .pill.active {
  background: #ffd166 !important;
  color: #111218 !important;
  border-color: #ffffff !important;
  box-shadow: 0 0 0 3px #ffffff55 !important;
}
html.high-contrast input[type="range"] {
  filter: brightness(1.15) contrast(1.2) !important;
}

/* Respect OS preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  .title-glitch::before,
  .title-glitch::after,
  .topbar::after { animation: none !important; }
}

/* Forced high contrast mode overrides (if needed) */
html.high-contrast body {
  filter: none !important;
  color: #ffffff !important;
  background: #0a0b10 !important;
}
html.high-contrast .topbar,
html.high-contrast .menu,
html.high-contrast .panel,
html.high-contrast .card,
html.high-contrast .footer {
  background: #0d1020 !important;
  border: 2px solid #ffffff3a !important;
  box-shadow: none !important;
}
html.high-contrast h1,
html.high-contrast h2,
html.high-contrast h3,
html.high-contrast .section-title,
html.high-contrast .title-glitch {
  color: #ffffff !important;
  text-shadow: none !important;
}
html.high-contrast .title-glitch::before,
html.high-contrast .title-glitch::after,
html.high-contrast .topbar::after {
  content: none !important;
  animation: none !important;
}
html.high-contrast .pill {
  background: #13182a !important;
  border-color: #ffffff5a !important;
  color: #ffffff !important;
  box-shadow: none !important;
}
html.high-contrast .pill.active {
  background: #ffd166 !important;
  color: #111218 !important;
  border-color: #ffffff !important;
  box-shadow: 0 0 0 3px #ffffff55 !important;
}
html.high-contrast input[type="range"] {
  filter: brightness(1.15) contrast(1.2) !important;
}

/* Additional specific styles for toggles and settings */
#view-settings .toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
#view-settings .toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}
#view-settings .toggle label {
  cursor: pointer;
}


/* ===================== Electron-only polish ===================== */

html.electron .topbar { overflow: hidden; }
html.electron .tb-inner { gap: 16px; flex-wrap: wrap; }
html.electron .logo { width: 128px; height: 128px; flex: 0 0 auto; }

/* Responsive, wrapped title that scales with window size */
html.electron .title-glitch {
  flex: 1 1 0;
  margin: 0;
  text-align: center;
  white-space: normal;                 
  line-height: 1.06;
  letter-spacing: 0.4px;
  font-size: clamp(20px, 3.2vw, 34px) !important;
}

/* Menu buttons on desktop */
html.electron .menu .pill { transform: translateZ(0); padding-inline: 22px; }

/* Narrow desktop windows */
@media (max-width: 1100px) {
  html.electron .logo { width: 76px; height: 76px; }
  html.electron .title-glitch { font-size: clamp(19px, 3.4vw, 32px) !important; }
}
@media (max-width: 900px) {
  html.electron .logo { width: 68px; height: 68px; }
  html.electron .title-glitch { font-size: clamp(18px, 3.8vw, 30px) !important; }
}
@media (max-width: 740px) {
  /* Hide logo when window gets tight; title takes full width */
  html.electron .logo { display: none; }
  html.electron .title-glitch { font-size: clamp(18px, 4.2vw, 28px) !important; }
}

html.electron .title-glitch::before,
html.electron .title-glitch::after {
  content: none !important;
  animation: none !important;
  filter: none !important;
}

html.electron .title-glitch {
  text-shadow: 0 0 12px rgba(255, 200, 120, .25),
               0 2px 18px rgba(255, 140, 80, .18);
  font-size: clamp(20px, 3.2vw, 34px);
  white-space: normal;                  
}

/* =========================
   MOBILE-FIRST POLISH
   ========================= */

/* Respect phone notches / status bars */
:root { --safe-top: env(safe-area-inset-top, 0px); --safe-bot: env(safe-area-inset-bottom, 0px); }
body { padding-top: max(0px, var(--safe-top)); }

@media (max-width: 768px), (pointer: coarse) {
  .app-frame { padding: clamp(8px, 3vw, 16px); }

  .topbar { padding: 10px 12px; border-radius: 18px; }
  .topbar .logo { width: 64px; height: 64px; margin-right: 10px; }
  .title-glitch {
    font-size: clamp(18px, 6vw, 26px);
    line-height: 1.15;
    text-align: center;
  }

  .menu {
    gap: 10px;
    padding: 10px 8px;
    margin: 10px 0 14px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .menu .pill {
    flex: 0 0 auto;
    min-width: 140px;
    height: 44px;
    font-size: 16px;
    border-radius: 18px;
    scroll-snap-align: start;
  }

  .panel .view { padding: 14px 12px; }
  .card { padding: 12px; border-radius: 16px; }
  .grid-2 { display: block; }      
  .grid-2 > .card { margin-bottom: 14px; }

  h2 { font-size: clamp(18px, 5.4vw, 22px); }
  h3 { font-size: clamp(16px, 4.8vw, 20px); }

  .item-list .row {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 8px;
    padding: 12px;
    border-radius: 14px;
  }
  .item-list .num {
    width: 36px; height: 36px;
    font-size: 18px;
    line-height: 36px;
  }
  .item-list .q {
    font-size: 18px;
    line-height: 1.35;
  }

  .item-list .chip { 
    justify-self: end; 
    margin: 0 2px 2px 0;
    font-size: 14px;
    padding: 6px 10px;
  }
  .item-list .ctrl { margin-top: 2px; }
  .item-list input[type="range"] { width: 100%; height: 28px; }

  .legend li, .bars .bar { font-size: 15px; }
  .disclaimer { font-size: 12.5px; }

  .footer { padding-bottom: max(10px, var(--safe-bot)); }
}

@media (max-width: 768px) {
  canvas, .chart-container, .chart-title {
    background: none !important;
    box-shadow: none !important;
    filter: none !important;
  }
}

/* ========= MOBILE-ONLY LAYOUT ========= */
@media (max-width: 820px), (pointer: coarse) {
  .title-glitch,
  .title-glitch::before,
  .title-glitch::after {
    text-shadow: none !important;
    animation: none !important;
    transform: none !important;
    clip-path: none !important;
  }
  .title-glitch {
    font-size: clamp(18px, 6vw, 26px);
    line-height: 1.15;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    text-align: center;
    hyphens: auto;
    word-break: normal;
    flex: 1;
  }

  .menu {
    gap: 10px;
    padding: 10px 8px;
    margin: 12px 0 16px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }
  .menu .pill {
    flex: 0 0 auto;
    min-width: 140px;
    height: 44px;
    font-size: 16px;
    border-radius: 18px;
    scroll-snap-align: start;
  }

  /* QUESTION ROW: stack chip + slider below text */
  .item-list .row {
    display: grid;
    grid-template:
      "num q"     auto
      "chip chip" auto
      "ctrl ctrl" auto / 52px 1fr;
    gap: 8px 12px;
    align-items: center;
    padding: 14px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.06);
    background: rgba(255,255,255,.02);
    margin-bottom: 12px;
  }
  .item-list .row .num  { grid-area: num;  justify-self: center; width:36px; height:36px; line-height:36px; font-size:18px; }
  .item-list .row .q    { grid-area: q;    font-size:18px; line-height:1.34; }
  .item-list .row .chip { grid-area: chip; justify-self: start; font-size:14px; padding:6px 10px; }
  .item-list .row .ctrl { grid-area: ctrl; width: 100%; }

  .item-list input[type="range"] {
    width: 100%;
    height: 28px;
    -webkit-tap-highlight-color: transparent;
  }

  /* cards/charts */
  .grid-2 { display: block; }
  .grid-2 > .card { margin-bottom: 14px; }

  :root { --safe-bot: env(safe-area-inset-bottom, 0px); }
  .footer { padding-bottom: max(10px, var(--safe-bot)); }
}

/* ========= MOBILE: put chip + slider BELOW the question (old .li-row markup) ========= */
@media (max-width: 820px), (pointer: coarse) {
  .item-list .li-row {
    display: grid;
    grid-template:
      "num q"     auto
      "chip chip" auto
      "ctrl ctrl" auto / 52px 1fr;
    gap: 8px 12px;
    align-items: center;
    padding: 14px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.06);
    background: rgba(255,255,255,.02);
    margin-bottom: 12px;
  }

  .item-list .li-row > div { display: contents; }
  .item-list .li-row .numchip { grid-area: num; justify-self: center; }
  .item-list .li-row > label  { grid-area: q;   font-size: 18px; line-height: 1.34; }
  .item-list .li-row .valchip { grid-area: chip; justify-self: start; font-size: 14px; padding: 6px 10px; }
  .item-list .li-row input[type="range"] { grid-area: ctrl; width: 100%; height: 28px; -webkit-tap-highlight-color: transparent; }
}

/* --- Restore number chip styling + place it in the grid --- */
.item-list .li-row > .numchip{
  grid-area: num;                 
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 18px;
  background: rgba(255,209,102,.18);
  border: 1px solid rgba(255,209,102,.55);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 6px rgba(0,0,0,.25);
  color: #1a1300; 
}

/* High-contrast mode keeps it readable */
.high-contrast .item-list .li-row > .numchip{
  background: #ffd166;
  border-color: #ffd166;
  color: #1a1300;
}

/* ---------- MOBILE ONLY: chip under text, slider full width ---------- */
@media (max-width: 820px), (pointer: coarse) {
  .item-list .li-row{
    display: grid;
    grid-template:
      "num q"    auto
      "chip chip" auto
      "ctrl ctrl" auto / 52px 1fr;
    gap: 8px 12px;
    align-items: center;
    padding: 14px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.06);
    background: rgba(255,255,255,.02);
    margin-bottom: 12px;
  }
  .item-list .li-row > .numchip{           
    grid-area: num;
    display:inline-flex; align-items:center; justify-content:center;
    width:44px; height:44px; border-radius:999px;
    font: 700 18px/1 var(--font, ui-sans-serif);
    background: rgba(255,209,102,.18);
    border: 1px solid rgba(255,209,102,.55);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 6px rgba(0,0,0,.25);
    color:#ffffff;
  }
  .high-contrast .item-list .li-row > .numchip{
    background:#ffd166; border-color:#ffd166; color:#1a1300;
  }
  .item-list .li-row > label{ grid-area:q; }
  .item-list .li-row > .valchip{ grid-area:chip; justify-self:start; }
  .item-list .li-row > input[type="range"]{ grid-area:ctrl; width:100%; }
}

/* ===================== DESKTOP RESET (keeps mobile intact) ===================== */
@media (min-width: 821px) and (pointer: fine) {
  /* Ensure the row uses the 4-column inline layout on desktop */
  .item-list .li-row {
    display: grid !important;
    grid-template-columns: 48px 1fr 180px 260px !important; /* num | text | chip | slider */
    gap: 10px 16px;
    align-items: center;
    position: relative;
  }

  /* Some previous global style was shoving the number chip around — reset it */
  .item-list .li-row > .numchip {
    position: static !important;        
    grid-column: 1 !important;          
    grid-row: auto !important;
    justify-self: center;
    width: 36px; height: 36px; line-height: 36px;
    border-radius: 999px;
    font: 700 16px/36px var(--font, ui-sans-serif);
    background: rgba(255,209,102,.18);
    border: 1px solid rgba(255,209,102,.45);
    color: #ffffff;                  
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.767);                    
  }

  /* Make sure the middle wrapper div doesn’t use display:contents on desktop */
  .item-list .li-row > div {
    display: block !important;           
  }

  .item-list .li-row > label        { grid-column: 2 !important; }
  .item-list .li-row > .valchip     { grid-column: 3 !important; justify-self: start; }
  .item-list .li-row input[type="range"] { grid-column: 4 !important; width: 100%; }
}

/* ---------- DESKTOP: make number chips visible & centered ---------- */
@media (min-width: 821px) and (pointer: fine) {
  .item-list .li-row > .numchip{
    justify-self: center;         
    display: inline-grid;            
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;

    font-weight: 700;
    font-size: 18px;
    line-height: 1;
    font-feature-settings: "tnum" 1; 

    background: radial-gradient(ellipse at 30% 30%,
                rgba(255,209,102,.22),
                rgba(255,209,102,.12) 60%,
                rgba(0,0,0,.05));
    border: 1px solid rgba(255,209,102,.55);
    color: #ffdf8a;                  
    text-shadow: 0 1px 0 rgba(0,0,0,.6);
  }

  /* High-contrast mode */
  .high-contrast .item-list .li-row > .numchip{
    background: #ffd166;
    border-color: #ffd166;
    color: #1a1300;
    text-shadow: none;
  }
}

/* ===== DESKTOP: perfectly center the number  ===== */
@media (min-width: 821px) and (pointer: fine) {
  :root { --chip-nudge-y: 5px; } 

  .item-list .li-row > .numchip{
    width: 44px;
    height: 44px;
    border-radius: 999px;
    box-sizing: border-box;
    padding: 0;
    display: inline-block;        
    line-height: 44px;            
    text-align: center;            
    font-weight: 700;
    font-size: 18px;
    font-variant-numeric: lining-nums tabular-nums;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    top: var(--chip-nudge-y);
  }
}

