/* ==========================================================================
   HEALTH-STYLE COLOUR TOKENS (Light & OLED Dark)
   --health-* = vivid brand hues for rings, bars and fills
   --t-*      = text-safe hues per theme (WCAG AA >= 4.5:1 on cards)
   ========================================================================== */
:root[data-theme="light"] {
  --bg: #F2F2F7;
  --card: #FFFFFF;
  --card-secondary: #F2F2F7;
  --card-tertiary: #E5E5EA;
  --text: #000000;
  --text-secondary: rgba(60, 60, 67, 0.82);
  --text-muted: #6C6C70;
  --separator: rgba(60, 60, 67, 0.29);
  --seg-bg: rgba(118, 118, 128, 0.12);
  --seg-thumb: #FFFFFF;
  --seg-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 1px 1px rgba(0, 0, 0, 0.04);
  --card-shadow: 0 2px 14px rgba(0, 0, 0, 0.04);
  --nav-bg: rgba(242, 242, 247, 0.88);
  --ring-track-orange: rgba(255, 79, 0, 0.18);
  --ring-track-green: rgba(52, 199, 89, 0.18);
  --ring-track-blue: rgba(0, 122, 255, 0.18);
  --bar-inactive: #D1D1D6;
  --t-green: #156226;
  --t-orange: #C23000;
  --t-amber: #8F3D00;
  --t-blue: #0040DD;
  --t-pink: #C80014;
  --t-purple: #8327B2;
  --tooltip-bg: rgba(28, 28, 30, 0.94);
  --tooltip-text: #FFFFFF;
}

:root[data-theme="dark"] {
  --bg: #000000;
  --card: #1C1C1E;
  --card-secondary: #2C2C2E;
  --card-tertiary: #3A3A3C;
  --text: #FFFFFF;
  --text-secondary: rgba(235, 235, 245, 0.74);
  --text-muted: #98989D;
  --separator: rgba(84, 84, 88, 0.6);
  --seg-bg: rgba(118, 118, 128, 0.26);
  --seg-thumb: #636366;
  --seg-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  --nav-bg: rgba(0, 0, 0, 0.84);
  --ring-track-orange: rgba(255, 79, 0, 0.22);
  --ring-track-green: rgba(48, 209, 88, 0.22);
  --ring-track-blue: rgba(10, 132, 255, 0.22);
  --bar-inactive: #48484A;
  --t-green: #30D158;
  --t-orange: #FF7A3D;
  --t-amber: #FF9F0A;
  --t-blue: #409CFF;
  --t-pink: #FF375F;
  --t-purple: #DA8FFF;
  --tooltip-bg: rgba(242, 242, 247, 0.96);
  --tooltip-text: #000000;
}

:root {
  --health-orange: #FF4F00;
  --health-amber: #FF9500;
  --health-pink: #FF2D55;
  --health-green: #30D158;
  --health-blue: #0A84FF;
  --health-purple: #BF5AF2;
  --active-tab: #C93400;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.42;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
  padding-bottom: 56px;
  overflow-x: hidden;
}

.num, .h-big-num, .h-mini-val, .ring-row-val, .race-meta > :last-child { font-variant-numeric: tabular-nums; }

button { font-family: inherit; }

:focus-visible { outline: 2px solid var(--health-blue); outline-offset: 2px; }

/* ==========================================================================
   STICKY NAVBAR & LIGHT/DARK PILL
   ========================================================================== */
.ios-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--separator);
}

.ios-navbar-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}

.logo {
  display: inline-flex;
  align-items: baseline;
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.logo svg {
  width: 18px;
  height: 22px;
  margin-right: 1px;
  transform: translateY(3px);
}

.logo .dot {
  color: var(--health-orange);
}

.client-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--card-shadow);
  min-width: 0;
  max-width: 100%;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--health-green);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.2);
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.theme-pill {
  display: inline-flex;
  align-items: center;
  background: var(--seg-bg);
  padding: 3px;
  border-radius: 999px;
  user-select: none;
  flex-shrink: 0;
}

.theme-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  min-height: 34px;
  min-width: 44px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.theme-btn.active {
  background: var(--seg-thumb);
  color: var(--text);
  box-shadow: var(--seg-shadow);
}

/* ==========================================================================
   HEADER, PAGE TABS
   ========================================================================== */
.container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 22px 24px 40px;
}

.health-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.health-date-eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.health-large-title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.updated-stamp {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 4px;
}

.ios-segmented {
  display: inline-flex;
  background: var(--seg-bg);
  padding: 2px;
  border-radius: 9px;
  gap: 2px;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  min-height: 34px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
  min-width: 44px;
  text-align: center;
  white-space: nowrap;
}

.seg-btn.active {
  background: var(--seg-thumb);
  box-shadow: var(--seg-shadow);
}

.page-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

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

.page-tab {
  border: none;
  background: var(--card);
  color: var(--text);
  padding: 10px 18px;
  min-height: 40px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--card-shadow);
  transition: all 0.16s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.page-tab.active {
  background: var(--active-tab);
  color: #FFFFFF;
}

.page-view {
  display: none;
}

.page-view.active {
  display: block;
}

/* ==========================================================================
   GRID & CARDS
   ========================================================================== */
.health-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.h-card {
  background: var(--card);
  border-radius: 22px;
  padding: 20px 22px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dock { margin-top: auto; }

.h-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.h-card-head > :last-child:not(:first-child) { margin-left: auto; }

.h-cat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  min-width: 0;
}

.h-cat-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.h-cat-icon svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.h-cat-sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.h-time-chevron {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.h-metric-eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.h-metric-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.h-big-num {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-family: ui-rounded, 'SF Pro Rounded', -apple-system, 'Inter', sans-serif;
}

.h-unit {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
}

.h-delta {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--t-green);
}

.h-date-sub {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 3px;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.caption {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 8px;
}

.tick {
  font-size: 13px;
  font-weight: 600;
  color: var(--t-green);
  white-space: nowrap;
}

/* ==========================================================================
   RINGS + PROGRESS BARS
   ========================================================================== */
.rings-box {
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  background: var(--card-secondary);
  border-radius: 18px;
  padding: 18px 20px;
}

.rings-bars-col {
  display: flex;
  flex-direction: column;
  gap: 13px;
  width: 100%;
}

.ring-row-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ring-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.ring-row-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ring-row-val {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.ring-mini-track {
  width: 100%;
  height: 8px;
  background: var(--card);
  border-radius: 999px;
  overflow: hidden;
}

.ring-mini-fill {
  height: 100%;
  border-radius: 999px;
}

.ring-row-sub {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================================================
   CAPSULE BAR CHART (enquiries with explicit bar values & gridlines)
   ========================================================================== */
.capsule-chart-stage {
  position: relative;
  flex: 1;
  min-height: 215px;
  padding: 28px 82px 28px 6px;
  border-top: 0.5px solid var(--separator);
  border-bottom: 0.5px solid var(--separator);
  margin: 14px 0 8px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  background-image: linear-gradient(to bottom, transparent 49.5%, var(--separator) 50%, transparent 50.5%);
}

.avg-trend-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1.5px dashed var(--health-orange);
  pointer-events: none;
  z-index: 4;
  transition: bottom 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.avg-trend-pill {
  position: absolute;
  right: 0;
  top: -11px;
  background: var(--active-tab);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.capsule-col {
  flex: 1;
  min-width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  z-index: 3;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: inherit;
}

.capsule-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 5px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.capsule-bar {
  width: 100%;
  max-width: 30px;
  min-height: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #FF6B2B 0%, #FF4F00 100%);
  transition: height 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.15s ease;
}

.capsule-col:hover .capsule-bar,
.capsule-col.on .capsule-bar { filter: brightness(1.12); box-shadow: 0 0 0 2px rgba(255, 79, 0, 0.25); }

.capsule-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  position: absolute;
  bottom: -23px;
  white-space: nowrap;
}

.chart-tip {
  position: absolute;
  z-index: 6;
  background: var(--tooltip-bg);
  color: var(--tooltip-text);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 10px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -4px);
  transition: opacity 0.12s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  font-variant-numeric: tabular-nums;
}

.chart-tip.show { opacity: 1; }

.chart-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin: 18px 0 14px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--health-orange);
  flex-shrink: 0;
}

.h-sub-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.h-mini-box {
  background: var(--card-secondary);
  border-radius: 14px;
  padding: 11px 13px;
  min-width: 0;
}

.h-mini-lbl {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.h-mini-val {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-family: ui-rounded, 'SF Pro Rounded', -apple-system, 'Inter', sans-serif;
}

.value-strip {
  margin-top: 12px;
}

/* ==========================================================================
   TOWN-BY-TOWN RANK CLIMBER
   ========================================================================== */
.climber-table {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  gap: 8px;
}

.climber-row {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 11px 15px;
  background: var(--card-secondary);
  border-radius: 14px;
  font-size: 13px;
}

.climber-town {
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.climber-town > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.climber-pc {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.climb-track-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 0;
}

.climb-track-wrap > span {
  flex: 0 0 auto;
  min-width: 52px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.climb-track-wrap > span:last-child { text-align: right; color: var(--text); }

.climb-bar-bg {
  flex: 1;
  height: 10px;
  background: var(--card);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  min-width: 40px;
}

.climb-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}

.climb-bar-fill.top { background: linear-gradient(90deg, rgba(48,209,88,0.35), var(--health-green)); }
.climb-bar-fill.mid { background: linear-gradient(90deg, rgba(255,149,0,0.35), var(--health-amber)); }

.spot-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
  justify-self: end;
  max-width: 160px;
  font-variant-numeric: tabular-nums;
}

.spot-pill.top { background: rgba(48, 209, 88, 0.16); color: var(--t-green); }
.spot-pill.mid { background: rgba(255, 149, 0, 0.18); color: var(--t-amber); }

.ios-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--card-secondary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238E8E93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--text);
  border: none;
  padding: 8px 32px 8px 12px;
  min-height: 38px;
  border-radius: 9px;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  max-width: 100%;
  text-overflow: ellipsis;
}

.ios-select option { background: var(--card); color: var(--text); }

/* ==========================================================================
   LISTS & RIVAL BARS
   ========================================================================== */
.ios-list {
  display: flex;
  flex-direction: column;
  background: var(--card-secondary);
  border-radius: 16px;
  overflow: hidden;
}

.ios-list.fill-list {
  flex: 1;
  justify-content: space-between;
}

.ios-list-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 12px 16px;
  font-size: 13px;
}

.ios-list-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 0;
  bottom: 0;
  height: 1px;
  transform: scaleY(0.5);
  transform-origin: bottom;
  background: var(--separator);
}

.ios-list-item > :first-child {
  flex: 1 1 180px;
  min-width: 0;
}

.ios-list-item > :last-child:not(:first-child) {
  flex: 0 1 auto;
  margin-left: auto;
  text-align: right;
  white-space: normal;
  text-wrap: balance;
}

.ios-list-item > .tick:not(:first-child),
.ios-list-item > .spot-pill:not(:first-child) {
  white-space: nowrap;
  text-wrap: nowrap;
  flex-shrink: 0;
}

/* Keep search rank pills aligned on the right at all widths */
.kw-row {
  cursor: pointer;
  transition: background 0.15s ease;
  flex-wrap: nowrap;
}

.kw-row > :first-child {
  flex: 1 1 auto;
  min-width: 120px;
}

.kw-row:hover { background: rgba(120, 120, 128, 0.08); }
.kw-row.selected { background: rgba(10, 132, 255, 0.12); box-shadow: inset 3px 0 0 var(--health-blue); }

.row-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.highlight-banner {
  background: var(--card-secondary);
  border-radius: 14px;
  padding: 13px 16px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.capsule-race-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.race-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.race-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
}

.race-meta > :last-child { white-space: nowrap; text-align: right; }

.race-meta.you { color: var(--t-orange); font-weight: 700; }

.race-track {
  height: 14px;
  background: var(--card-secondary);
  border-radius: 999px;
  overflow: hidden;
}

.race-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--bar-inactive);
}

.race-fill.you {
  background: linear-gradient(90deg, var(--health-orange), var(--health-amber));
}

/* ==========================================================================
   CALL LOG & TRANSCRIPT DRAWER (Factual, zero fake audio timer)
   ========================================================================== */
.call-item { align-items: flex-start; }

.call-main { flex: 1 1 240px; min-width: 0; }

.call-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.call-name { font-weight: 700; }

.call-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.call-summary {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.call-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 8px;
}

.call-sms-note {
  font-size: 12px;
  color: var(--text-muted);
}

.transcript-pill {
  border: none;
  background: var(--card);
  color: var(--t-blue);
  box-shadow: inset 0 0 0 0.5px var(--separator);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  min-height: 32px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}

.transcript-pill[aria-expanded="true"] {
  background: rgba(10, 132, 255, 0.14);
}

.ios-list-item.call-item > .call-drawer {
  flex: 1 1 100%;
  margin-left: 0;
  text-align: left;
  white-space: normal;
}

.call-drawer {
  background: var(--card);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 8px;
}

.call-drawer[hidden] { display: none; }

.transcript {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bubble {
  max-width: 88%;
  font-size: 13px;
  line-height: 1.4;
  padding: 7px 11px;
  border-radius: 14px;
}

.bubble b { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 1px; }

.bubble.ai { background: var(--card-secondary); align-self: flex-start; }
.bubble.caller { background: rgba(10, 132, 255, 0.14); align-self: flex-end; }
.bubble.sms { background: rgba(48, 209, 88, 0.14); align-self: flex-start; }

.show-all-btn {
  width: 100%;
  border: none;
  background: var(--card-secondary);
  color: var(--t-blue);
  font-size: 13px;
  font-weight: 700;
  min-height: 44px;
  border-radius: 14px;
  cursor: pointer;
  margin-top: 10px;
}

.more-calls { margin-top: 10px; }
.more-calls[hidden] { display: none; }

.plan-list .num-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(10, 132, 255, 0.16);
  color: var(--t-blue);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 10px;
}

.plan-list .ios-list-item > :first-child { display: flex; align-items: flex-start; }

.next-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--t-blue);
  white-space: nowrap;
}

.link-btn {
  border: none;
  background: transparent;
  color: var(--t-blue);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  min-height: 36px;
  padding: 6px 0;
}

.ios-list[hidden] { display: none; }

@supports (corner-shape: squircle) {
  .h-card { corner-shape: squircle; border-radius: 34px; }
  .ios-list, .rings-box, .highlight-banner, .climber-row, .h-mini-box { corner-shape: squircle; border-radius: 24px; }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1180px) and (min-width: 681px) {
  .climber-row {
    grid-template-columns: 168px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 12px;
  }
  .rings-box {
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 14px;
    padding: 14px 16px;
  }
  .rings-box svg {
    width: 110px;
    height: 110px;
  }
}

@media (max-width: 860px) {
  .span-4, .span-5, .span-6, .span-7, .span-8 {
    grid-column: span 12;
  }
  .page-tabs {
    margin: 0 -24px 22px;
    padding: 0 24px 4px;
    scroll-padding-inline: 24px;
    scroll-snap-type: x proximity;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 28px), transparent);
  }
  .page-tab { scroll-snap-align: start; }
}

@media (max-width: 680px) {
  .climber-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "town pill" "track track";
    gap: 8px 12px;
  }
  .climber-town { grid-area: town; justify-content: flex-start; }
  .climb-track-wrap { grid-area: track; }
  .climber-row .spot-pill { grid-area: pill; justify-self: end; }
  .h-sub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rings-box { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .capsule-chart-stage { gap: 4px; padding-left: 2px; padding-right: 88px; }
  .capsule-col { min-width: 28px; }
  .capsule-bar { max-width: 22px; }
  .capsule-lbl { font-size: 11px; }
  .range-head .ios-segmented { width: 100%; }
  .range-head .seg-btn { flex: 1; min-width: 0; padding: 6px 8px; }
  .seg-btn, .theme-btn, .page-tab, .transcript-pill, .link-btn, .ios-select, .signout-btn { min-height: 44px; }
}

.nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.signout-btn {
  border: none;
  background: var(--seg-bg);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  min-height: 34px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.signout-btn:hover { color: var(--text); background: var(--card-tertiary); }
.signout-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.login-gate {
  max-width: 440px;
  margin: 44px auto;
  padding: 0 16px;
}

.login-gate[hidden], .container[hidden] { display: none; }

.login-card {
  background: var(--card);
  border-radius: 22px;
  padding: 26px 24px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-badge-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 79, 0, 0.15);
  color: var(--t-orange);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.login-badge-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.login-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.login-sub { font-size: 13px; color: var(--text-muted); font-weight: 600; }

.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; display: flex; justify-content: space-between; }
.login-input {
  width: 100%;
  border: 1px solid var(--separator);
  background: var(--card-secondary);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 11px 14px;
  min-height: 44px;
  border-radius: 12px;
}

.login-submit {
  width: 100%;
  border: none;
  background: var(--active-tab);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  min-height: 46px;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 4px;
}

@media (max-width: 600px) {
  .ios-navbar-inner { padding: 10px 16px; gap: 8px; }
  .brand-row { gap: 8px; }
  .logo { font-size: 19px; }
  .client-pill { padding: 6px 10px; font-size: 12px; }
  .nav-actions { gap: 6px; }
  .theme-btn { padding: 6px 10px; min-width: 44px; }
  .theme-btn .theme-lbl { display: none; }
  .nav-actions { gap: 6px; }
  .signout-btn { padding: 6px 10px; min-width: 44px; }
  .signout-btn .signout-lbl { display: none; }
  .container { padding: 18px 16px 32px; }
  .health-large-title { font-size: 30px; }
  .h-card { padding: 18px 16px; border-radius: 20px; }
  .page-tabs {
    margin: 0 -16px 18px;
    padding: 0 16px 4px;
    scroll-padding-inline: 16px;
    scroll-snap-type: x proximity;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 24px), transparent);
    mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 24px), transparent);
  }
  .page-tab { scroll-snap-align: start; padding: 10px 15px; }
  .h-delta { margin-left: 0; }
}

.eb-client { display: none; }

@media (max-width: 430px) {
  /* no room for the client pill in the bar: the name moves into the page eyebrow */
  .client-pill { display: none; }
  .eb-client { display: inline; }
}

/* ==========================================================================
   PRODUCTION ADDITIONS
   Everything below replaces what the public sample did with inline style="" attributes (not allowed under the strict CSP)
   and adds the states a live app needs: loading, empty, error, sign-in steps, the call drawer. Same tokens, same type, same radii.
   ========================================================================== */

[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* colour utilities (were inline style="color:..." / background:...) */
.c-orange { color: var(--t-orange); }
.c-green { color: var(--t-green); }
.c-blue { color: var(--t-blue); }
.c-pink { color: var(--t-pink); }
.c-amber { color: var(--t-amber); }
.c-purple { color: var(--t-purple); }
.c-muted { color: var(--text-muted); }
.c-secondary { color: var(--text-secondary); }
.ib-orange { background: rgba(255, 79, 0, 0.15); }
.ib-green { background: rgba(48, 209, 88, 0.15); }
.ib-blue { background: rgba(10, 132, 255, 0.15); }
.ib-pink { background: rgba(255, 45, 85, 0.15); }
.ib-amber { background: rgba(255, 149, 0, 0.16); }
.ib-purple { background: rgba(191, 90, 242, 0.15); }
.mb-0 { margin-bottom: 0; }
.mb-14 { margin-bottom: 14px; }
.mb-16 { margin-bottom: 16px; }
.mb-18 { margin-bottom: 18px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.flush { margin-bottom: 0; }
.tick.warn { color: var(--t-amber); }
.tick.muted { color: var(--text-muted); font-weight: 600; }
.h-time-chevron.pending { color: var(--t-amber); }

.head-right { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.card-slot { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ---------- boot + notices ---------- */
.boot { display: flex; justify-content: center; padding: 72px 16px; }
.boot-card { display: inline-flex; align-items: center; gap: 12px; background: var(--card); border-radius: 999px; padding: 12px 20px; font-size: 13px; font-weight: 600; color: var(--text-secondary); box-shadow: var(--card-shadow); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--separator); border-top-color: var(--health-orange); animation: nm-spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes nm-spin { to { transform: rotate(360deg); } }
.gate-noscript { max-width: 440px; margin: 44px auto; padding: 14px 16px; background: var(--card); border-radius: 14px; font-size: 13px; font-weight: 600; }

.status-banner { background: var(--card); border-radius: 16px; padding: 12px 16px; margin-bottom: 18px; font-size: 13px; font-weight: 600; box-shadow: inset 3px 0 0 var(--health-amber), var(--card-shadow); }

/* ---------- sign-in ---------- */
.auth-notice { background: var(--card); border-radius: 14px; padding: 12px 16px; margin-bottom: 14px; font-size: 13px; font-weight: 600; color: var(--text-secondary); box-shadow: var(--card-shadow); }
.login-error { background: rgba(255, 45, 85, 0.12); color: var(--t-pink); border-radius: 12px; padding: 11px 14px; font-size: 13px; font-weight: 600; line-height: 1.4; }
.login-help { font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.login-help.tight { margin-top: 0; }
.login-input:focus-visible { outline: 2px solid var(--health-blue); outline-offset: 1px; }
.login-input.otp { font-size: 22px; letter-spacing: 0.32em; text-align: center; font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 600; padding-left: 0.32em; }
.login-submit[disabled] { opacity: 0.55; cursor: not-allowed; }
.login-submit:focus-visible { outline: 2px solid var(--health-blue); outline-offset: 2px; }
.login-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; margin-top: -4px; }
.link-btn[disabled] { color: var(--text-muted); cursor: not-allowed; }
@media (max-width: 600px) {
  .login-gate { margin: 24px auto; }
  .link-btn { min-height: 44px; }
}

/* ---------- skeleton loading ---------- */
.skel { display: block; height: 14px; border-radius: 8px; background: var(--card-secondary); position: relative; overflow: hidden; }
.skel::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(120, 120, 128, 0.18), transparent); transform: translateX(-100%); animation: nm-shimmer 1.4s ease-in-out infinite; }
@keyframes nm-shimmer { to { transform: translateX(100%); } }
.skel.big { height: 36px; width: 96px; border-radius: 12px; }
.skel.w40 { width: 40%; } .skel.w60 { width: 60%; } .skel.w80 { width: 80%; }
.skel-block { display: flex; flex-direction: column; gap: 12px; }
.skel-box { height: 120px; border-radius: 16px; background: var(--card-secondary); position: relative; overflow: hidden; }
.skel-box::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(120, 120, 128, 0.18), transparent); transform: translateX(-100%); animation: nm-shimmer 1.4s ease-in-out infinite; }
.skel-box.tall { height: 200px; }

/* ---------- empty + error states ---------- */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 28px 18px; background: var(--card-secondary); border-radius: 16px; flex: 1; min-height: 160px; }
.empty-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--card); color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.empty-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.empty-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.empty-text { font-size: 13px; color: var(--text-muted); max-width: 36ch; line-height: 1.45; }
.empty.compact { min-height: 0; padding: 18px; flex: 0 0 auto; }
.err-box { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; background: var(--card-secondary); border-radius: 14px; padding: 13px 16px; font-size: 13px; font-weight: 600; box-shadow: inset 3px 0 0 var(--health-pink); }
.err-box .link-btn { min-height: 36px; }
.pill-note { display: inline-flex; align-items: center; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(255, 149, 0, 0.18); color: var(--t-amber); white-space: nowrap; }
.pill-note.urgent { background: rgba(255, 45, 85, 0.14); color: var(--t-pink); }
.pill-note.neutral { background: var(--card); color: var(--text-muted); box-shadow: inset 0 0 0 0.5px var(--separator); }

/* ---------- chart: gridless parts that were inline ---------- */
.capsule-chart-stage.empty-chart { align-items: center; justify-content: center; color: var(--text-muted); font-size: 13px; font-weight: 600; }
.capsule-chart-stage.empty-chart .avg-trend-line { display: none; }

/* ---------- allowance + lists ---------- */
.ring-mini-fill.orange { background: var(--health-orange); }
.ring-mini-fill.green { background: var(--health-green); }
.ring-mini-fill.blue { background: var(--health-blue); }
.ring-mini-fill { transition: width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.rings-box svg { max-width: 100%; }
.rings-box .ring-fill { transition: stroke-dashoffset 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.evidence-link { color: var(--t-blue); font-weight: 600; text-decoration: none; }
.evidence-link:hover { text-decoration: underline; }
.kw-row:focus-visible { outline-offset: -2px; }
.climber-row.single .climb-track-wrap > span:first-child { display: none; }
.rival-pos { font-variant-numeric: tabular-nums; }

/* ---------- call log ---------- */
.call-name { overflow-wrap: anywhere; }
.call-tags { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.call-foot .call-sms-note { overflow-wrap: anywhere; }
.call-item { cursor: default; }
.load-more { min-height: 44px; }
.load-sentinel { height: 1px; }
.load-note { font-size: 12px; color: var(--text-muted); text-align: center; padding: 10px 0 2px; }

/* ---------- call drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, 0.45); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); animation: nm-fade 0.2s ease; }
.drawer {
  position: fixed; z-index: 210; top: 0; right: 0; bottom: 0; width: min(520px, 100%);
  background: var(--bg); color: var(--text);
  display: flex; flex-direction: column;
  border-left: 0.5px solid var(--separator);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.28);
  animation: nm-slide-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.drawer:focus { outline: none; }
.drawer-grip { display: none; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; border-bottom: 0.5px solid var(--separator); background: var(--nav-bg); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.drawer-titles { min-width: 0; }
.drawer-eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.drawer-title { font-size: 24px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.12; overflow-wrap: anywhere; }
.drawer-close { flex-shrink: 0; width: 44px; height: 44px; border: none; border-radius: 999px; background: var(--seg-bg); color: var(--text-secondary); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.drawer-close:hover { background: var(--card-tertiary); color: var(--text); }
.drawer-close svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; }
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px 28px; display: flex; flex-direction: column; gap: 16px; -webkit-overflow-scrolling: touch; }
.drawer-section { display: flex; flex-direction: column; }
.drawer-section .section-label { margin-bottom: 8px; }
.drawer-card { background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: var(--card-shadow); }
.drawer-summary { font-size: 14px; font-weight: 500; line-height: 1.5; color: var(--text); overflow-wrap: anywhere; }
.drawer-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.drawer .ios-list { background: var(--card); }
.drawer .ios-list-item > :last-child:not(:first-child) { overflow-wrap: anywhere; }
.drawer a.tel { color: var(--t-blue); font-weight: 700; text-decoration: none; }
.drawer a.tel:hover { text-decoration: underline; }
.drawer .mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 600; }
.drawer audio { width: 100%; height: 44px; color-scheme: light dark; }
.audio-note { font-size: 13px; color: var(--text-secondary); line-height: 1.45; }
.drawer .transcript { gap: 8px; }
.drawer .bubble { max-width: 92%; font-size: 14px; padding: 8px 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.drawer .bubble.ai { background: var(--card); box-shadow: inset 0 0 0 0.5px var(--separator); }
body.drawer-open { overflow: hidden; }
@keyframes nm-slide-in { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes nm-sheet-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes nm-fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 680px) {
  .drawer { top: auto; left: 0; right: 0; width: 100%; height: 92vh; height: 92dvh; border-left: none; border-radius: 22px 22px 0 0; border-top: 0.5px solid var(--separator); animation-name: nm-sheet-in; box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.3); }
  .drawer-grip { display: block; width: 40px; height: 5px; border-radius: 999px; background: var(--separator); margin: 8px auto 0; }
  .drawer-head { padding-top: 10px; border-radius: 22px 22px 0 0; }
  .drawer-title { font-size: 22px; }
  .drawer-body { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
}

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

@media (max-width: 680px) {
  .signout-btn { min-height: 44px; } /* the sample's later .signout-btn rule overrode the 44px touch target; restored here */
}

/* Back link to the Nordmark site (restored from the sample) */
.back-link {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  background: var(--seg-bg); color: var(--text); font-size: 13px; font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap;
  flex-shrink: 0; box-shadow: inset 0 0 0 0.5px var(--separator); transition: background 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.back-link:hover { background: var(--card-tertiary); }
.back-link .back-x { font-size: 14px; line-height: 1; }
a.logo:focus-visible, .back-link:focus-visible { outline: 2px solid var(--health-blue); outline-offset: 2px; }
@media (max-width: 600px) {
  .back-link { padding: 0 12px; gap: 5px; }
  .back-link .back-more { display: none; }
}
.wa-link { color: var(--t-green); font-weight: 700; text-decoration: none; }
.wa-link:hover { text-decoration: underline; }
.theme-btn.theme-auto { min-width: 44px; }
/* a card left alone on its row takes the full width (its partner is hidden because it has no data) */
.health-grid > .h-card.solo { grid-column: span 12; }

/* twelve monthly bars: tighter columns so they fit under 390px */
.capsule-chart-stage.dense { gap: 2px; }
.capsule-chart-stage.dense .capsule-col { min-width: 0; }
.capsule-chart-stage.dense .capsule-bar { max-width: 16px; }
.capsule-chart-stage.dense .capsule-val, .capsule-chart-stage.dense .capsule-lbl { font-size: 10px; }

/* enquiries chart: two stacked series (website enquiries blue on top, AI-answered calls orange below) */
.capsule-bar.capsule-stack { display: flex; flex-direction: column; overflow: hidden; background: none; }
.capsule-stack .seg-calls { background: linear-gradient(180deg, #FF6B2B 0%, #FF4F00 100%); min-height: 3px; }
.capsule-stack .seg-web { background: linear-gradient(180deg, #4DA3FF 0%, var(--health-blue) 100%); min-height: 3px; }
.legend-swatch.web { background: var(--health-blue); margin-left: 12px; }
.chart-legend { flex-wrap: wrap; }
.capsule-chart-stage.dense .capsule-lbl { white-space: nowrap; }
.enquiry-message { white-space: pre-wrap; overflow-wrap: anywhere; }
.enquiry-actions { justify-content: flex-start; }
a.contact-pill { text-decoration: none; overflow-wrap: anywhere; white-space: normal; text-align: left; }
@media (max-width: 680px) { a.contact-pill { min-height: 44px; } }
.capsule-chart-stage.many { gap: 1px; }
.capsule-chart-stage.many .capsule-val { display: none; }
.capsule-chart-stage.many .capsule-bar { max-width: 10px; }

.ai-badges { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.ai-badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.ios-list-item.ai-q > .ai-badges { flex: 0 1 auto; white-space: normal; }
@media (max-width: 680px) { .ios-list-item.ai-q > .ai-badges { justify-content: flex-start; margin-left: 0; } }
