:root {
  --ui-surface: var(--panel, var(--bg-elevated));
  --ui-surface-2: var(--panel-2, var(--bg-elevated-2));
  --ui-surface-glass: color-mix(in srgb, var(--ui-surface) 88%, transparent);
  --ui-surface-soft: color-mix(in srgb, var(--ui-surface-2) 78%, var(--bg) 22%);
  --ui-border: var(--line);
  --ui-border-strong: color-mix(in srgb, var(--line) 72%, var(--text) 28%);
  --ui-border-soft: color-mix(in srgb, var(--line) 60%, transparent);
  --ui-shadow-sm: 0 8px 20px rgba(16, 32, 51, 0.08);
  --ui-shadow-md: 0 16px 38px rgba(16, 32, 51, 0.12);
  --ui-shadow-lg: 0 24px 64px rgba(16, 32, 51, 0.16);
  --ui-radius-sm: 12px;
  --ui-radius-md: 16px;
  --ui-radius-lg: 22px;
  --ui-radius-xl: 28px;
  --ui-accent-soft: color-mix(in srgb, var(--primary) 12%, transparent);
  --ui-accent-strong: color-mix(in srgb, var(--primary) 28%, transparent);
  --ui-success-soft: color-mix(in srgb, var(--success) 10%, var(--ui-surface));
  --ui-warning-soft: color-mix(in srgb, var(--warning) 10%, var(--ui-surface));
  --ui-danger-soft: color-mix(in srgb, var(--danger) 10%, var(--ui-surface));
  --ui-bg-top: color-mix(in srgb, var(--bg) 92%, var(--ui-surface) 8%);
  --ui-bg-bottom: color-mix(in srgb, var(--bg) 98%, var(--ui-surface) 2%);
  --table-columns: minmax(0, 1.48fr) 140px 156px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  background: var(--bg, #f3f5f8);
}

html body {
  margin: 0;
  font-family:
    Inter,
    "PingFang SC",
    "Microsoft YaHei",
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    radial-gradient(circle at top, color-mix(in srgb, var(--primary) 14%, transparent), transparent 28%),
    radial-gradient(circle at 15% 0%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 18%),
    linear-gradient(180deg, var(--ui-bg-top) 0%, var(--ui-bg-bottom) 100%);
  color: var(--text, #132033);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition:
    background 0.22s ease,
    color 0.22s ease;
  position: relative;
}

html body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 0%, rgba(255, 255, 255, 0.02) 100%),
    linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.015) 50%, transparent 100%);
  mix-blend-mode: soft-light;
  opacity: 0.55;
}

::selection {
  background: var(--ui-accent-soft);
  color: var(--text-strong);
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 24%, transparent);
}

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 20px 84px;
  position: relative;
  isolation: isolate;
}

body .page-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: 18px;
  padding: var(--space-md) 14px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-xl);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--ui-surface) 92%, transparent), color-mix(in srgb, var(--ui-surface-2) 88%, transparent));
  box-shadow: var(--ui-shadow-sm);
  backdrop-filter: blur(16px);
}

body .page-shell.compact {
  margin-bottom: 14px;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: auto;
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--space-xs);
  margin-bottom: 0;
  border: 1px solid var(--ui-border);
  border-radius: 999px;
  background: var(--ui-surface-glass);
  backdrop-filter: blur(18px);
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav-brand,
.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  text-decoration: none;
}

.nav-brand {
  padding: 10px 13px;
  border-radius: 999px;
  background: var(--ui-accent-soft);
  border: 1px solid var(--ui-accent-strong);
  color: var(--primary);
  font-size: var(--text-sm);
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
  transition:
    border-color 0.16s ease,
    color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.nav-link:hover {
  border-color: var(--ui-border-soft);
  color: var(--text);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.nav-link.active {
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 84%, #fff 16%), var(--primary));
  border-color: transparent;
  color: #fff;
  box-shadow: var(--ui-shadow-sm);
}

body .nav-brand,
body .nav-link,
body .btn,
.asset-tab,
.thead button,
.ended-toggle {
  min-height: 44px;
}

.nav-link.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.overview-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 8px 4px;
}

.overview-bar__main {
  min-width: 0;
}

.overview-bar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.overview-bar__main small {
  display: block;
  color: var(--primary);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.overview-bar__heading {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: 6px;
}

.overview-bar__heading h1 {
  margin: 0;
  font-size: var(--text-3xl);
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: var(--text-strong);
}

.btn {
  appearance: none;
  border: 1px solid var(--ui-border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--ui-surface-2) 86%, #fff 14%), var(--ui-surface));
  color: var(--text-muted);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: var(--text-sm);
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
  box-shadow: var(--ui-shadow-sm);
}

.btn:hover {
  border-color: var(--ui-border-strong);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: var(--ui-shadow-md);
}

.btn:active {
  transform: translateY(0);
}

.overview-bar__actions .btn {
  min-height: 44px;
  padding: 0 var(--space-lg);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
}

.btn-link {
  text-decoration: none;
}

.table-toolbar {
  position: absolute;
  top: -34px;
  left: 0;
  height: 34px;
  padding: 0;
  margin-bottom: 0;
  border: none;
  background: transparent;
  overflow: visible;
  z-index: 4;
}

.asset-tabs {
  position: absolute;
  left: 0;
  bottom: 0;
  display: inline-flex;
  align-items: flex-end;
  gap: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  isolation: isolate;
}

.asset-tab {
  appearance: none;
  position: relative;
  z-index: 2;
  margin-right: 0;
  margin-left: -14px;
  border: 1px solid color-mix(in srgb, var(--ui-border) 64%, transparent);
  border-bottom: none;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--bg-elevated-2) 78%, var(--bg) 22%),
      color-mix(in srgb, var(--bg-elevated-2) 92%, var(--panel) 8%)
    );
  color: color-mix(in srgb, var(--text-muted) 88%, var(--text-quiet) 12%);
  min-width: 90px;
  min-height: 44px;
  padding: 0 15px;
  border-radius: 8px 8px 0 0;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 1px 2px rgba(16, 32, 51, 0.012);
  transform: translateY(7px);
}

.asset-tab:hover {
  color: var(--text);
  transform: translateY(5px);
}

.asset-tab.is-active {
  z-index: 8;
  background: linear-gradient(180deg, var(--primary), color-mix(in srgb, var(--primary) 88%, #000 12%));
  color: #fff;
  border-color: var(--primary);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 4px 12px color-mix(in srgb, var(--primary) 24%, transparent);
  transform: translateY(0);
  min-width: 118px;
  min-height: 44px;
  padding-inline: 22px;
}

.asset-tab.is-active::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 0;
  height: 1px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 42%, transparent);
}

.asset-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 6px;
  background: var(--ui-surface);
}

.asset-tab.is-active {
  letter-spacing: 0;
}

.table.table-with-footer {
  border-top-left-radius: 0;
}

.table.table-with-footer .thead {
  border-top-left-radius: 0 22px 0 0;
}

.asset-tab:first-child {
  border-top-left-radius: 18px;
  padding-left: 18px;
  margin-left: 0;
  z-index: 6;
}

.asset-tab.is-active:first-child::after {
  left: -1px;
  right: 0;
  bottom: -3px;
  height: 8px;
  border-bottom-left-radius: 16px;
}

.asset-tab:nth-child(2) {
  z-index: 5;
}

.asset-tab:nth-child(3) {
  z-index: 4;
}

.asset-tab:nth-child(4) {
  z-index: 3;
}

.asset-tab:nth-child(5) {
  z-index: 2;
}

.asset-tab:not(.is-active) {
  color: color-mix(in srgb, var(--text-muted) 84%, var(--text-quiet) 16%);
}

.asset-tab:not(.is-active):nth-child(odd) {
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--bg-elevated-2) 80%, var(--bg) 20%),
      color-mix(in srgb, var(--bg-elevated-2) 94%, var(--panel) 6%)
    );
}

.ended-toggle {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-lg) 18px;
  border: none;
  border-radius: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--ui-surface-2) 80%, #fff 20%), var(--ui-surface));
  color: var(--text-soft);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition:
    border-color 0.16s ease,
    color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.ended-toggle:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--primary) 3%, var(--ui-surface));
}

.ended-toggle__count {
  display: inline-flex;
  min-width: 28px;
  min-height: 28px;
  padding: 0 var(--space-sm);
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  font-size: var(--text-sm);
  font-weight: 700;
}

.ended-list {
  border-top: 1px solid var(--ui-border);
  overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--ui-surface) 96%, transparent), var(--ui-surface));
}

.table-with-footer {
  position: relative;
  overflow: visible;
  margin-top: 52px;
  padding-top: 0;
}

.table-footer {
  border-top: 1px solid var(--ui-border);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin: 22px 0 var(--space-md);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title h2 {
  margin: 0;
  font-size: var(--text-md);
  letter-spacing: -0.015em;
  color: var(--text-strong);
}

.panel-count {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--ui-accent-soft);
  border: 1px solid var(--ui-accent-strong);
  color: var(--primary);
  font-size: var(--text-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.section-title .hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: right;
}

/* ── R36: Subtle background texture for table section ── */
.table {
  background:
    radial-gradient(circle, color-mix(in srgb, var(--text) 3%, transparent) 0.5px, transparent 0.5px),
    linear-gradient(180deg, color-mix(in srgb, var(--ui-surface) 96%, transparent), var(--ui-surface)),
    var(--ui-surface);
  background-size: 24px 24px, 100% 100%, 100% 100%;
  border: 1px solid var(--ui-border);
  border-radius: 22px;
  overflow: visible;
  box-shadow: var(--ui-shadow-lg);
}

.thead,
.row {
  display: grid;
  grid-template-columns: var(--table-columns);
  gap: 14px;
  align-items: center;
}

.thead {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: var(--space-md) 18px 11px;
  border-bottom: 2px solid color-mix(in srgb, var(--ui-border) 88%, var(--primary) 12%);
  border-radius: 22px 22px 0 0;
  font-size: var(--text-2xs);
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--ui-surface-2) 78%, transparent), color-mix(in srgb, var(--ui-surface) 96%, transparent)),
    var(--ui-surface);
  backdrop-filter: blur(12px);
}

.thead button {
  all: unset;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 44px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.16s ease, color 0.16s ease;
}

.thead button:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.thead > :nth-child(n + 2) {
  justify-self: end;
  text-align: right;
}

.row {
  position: relative;
  min-height: 88px;
  padding: 13px 18px;
  border-top: 1px solid var(--ui-border-soft);
  text-decoration: none;
  color: inherit;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.row:first-of-type {
  border-top: none;
}

.row:nth-child(odd) {
  background: color-mix(in srgb, var(--ui-surface) 99%, var(--bg) 1%);
}

.row:hover {
  background: color-mix(in srgb, var(--primary) 4%, var(--ui-surface));
  transform: translateY(-1px);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.08),
    inset 3px 0 0 var(--primary),
    inset 0 1px 0 color-mix(in srgb, var(--primary) 8%, transparent);
}

/* Risk-level left accent on rows */
.row[data-risk="low"] {
  border-left: 3px solid color-mix(in srgb, var(--success) 40%, transparent);
}

.row[data-risk="medium"] {
  border-left: 3px solid color-mix(in srgb, var(--warning) 40%, transparent);
}

.row[data-risk="high"] {
  border-left: 3px solid color-mix(in srgb, var(--danger) 40%, transparent);
}

.name {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 0;
  padding-right: 10px;
}

.logo {
  width: 42px;
  height: 42px;
  padding: var(--space-sm);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--ui-surface), var(--ui-surface-2));
  border: 1px solid color-mix(in srgb, var(--ui-border) 82%, transparent);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--primary);
  flex: 0 0 auto;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 10px 18px rgba(16, 32, 51, 0.08);
  overflow: hidden;
}

/* ── R42: Polished logo styling ── */
.logo.is-text {
  font-size: var(--text-xs, 11px);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary, #2f6fe8) 8%, var(--ui-surface, #fff)), var(--ui-surface-2, #eef2f7));
  color: var(--primary, #2f6fe8);
}

.logo.is-image {
  padding: 4px;
  background: var(--ui-surface, #fff);
  border: 1px solid color-mix(in srgb, var(--ui-border, #dde4ec) 72%, transparent);
  border-radius: 12px;
}

.logo-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 8px;
}

.title {
  min-width: 0;
}

.title-line {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-width: 0;
}

.title strong {
  display: block;
  font-size: var(--text-base);
  line-height: var(--leading-tight);
  letter-spacing: 0.01em;
  color: var(--text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.title span {
  display: block;
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-top: 3px;
  line-height: var(--leading-normal);
}

.title .facts {
  margin-top: var(--space-xs);
  font-size: var(--text-2xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--text-muted) 80%, transparent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.title .summary {
  margin-top: var(--space-xs);
  color: var(--text-quiet);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  max-width: 100%;
  opacity: 0.82;
}

.title .cta {
  margin-top: 7px;
  color: var(--primary);
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 0.03em;
}

.metric-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-height: 100%;
  justify-content: center;
  padding-left: var(--space-xl);
  padding-right: var(--space-sm);
  border-left: 1px solid color-mix(in srgb, var(--ui-border) 50%, transparent);
}

.metric-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-2xs);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.metric-value {
  font-size: var(--text-lg);
  font-weight: 800;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--text-strong);
  letter-spacing: 0.01em;
}

.metric-value.apr {
  color: var(--success);
  font-size: 1.25em;
  font-weight: 800;
}

.metric-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: right;
  line-height: var(--leading-normal);
  max-width: 140px;
}

.time-progress {
  width: min(140px, 100%);
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 3px;
}

.metric-cell--time .time-progress {
  width: 100%;
}

.time-progress__track {
  width: 100%;
  height: 14px;
  border-radius: 10px;
  overflow: hidden;
  background: color-mix(in srgb, var(--primary) 10%, var(--ui-border-soft));
}

.time-progress__fill {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 55%, white), color-mix(in srgb, var(--primary) 82%, white), var(--primary));
  min-width: 24px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pulse animation for progress bars near completion */
@keyframes progressPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.78; }
}

.time-progress__fill[style*="8"], .time-progress__fill[style*="9"] {
  animation: progressPulse 2s ease-in-out infinite;
}

.time-progress.is-urgent .time-progress__fill {
  background: linear-gradient(90deg, var(--warning), var(--danger));
  animation: progressPulse 1.6s ease-in-out infinite;
}

.time-progress__pct {
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  padding-right: 5px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.time-progress.is-estimated .time-progress__fill {
  background: repeating-linear-gradient(
    -45deg,
    color-mix(in srgb, var(--primary) 60%, white),
    color-mix(in srgb, var(--primary) 60%, white) 3px,
    var(--primary) 3px,
    var(--primary) 6px
  );
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 var(--space-sm);
  border-radius: 999px;
  font-size: var(--text-2xs);
  font-weight: 700;
  margin-left: var(--space-sm);
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  line-height: var(--leading-loose);
  box-shadow: none;
  backdrop-filter: none;
  opacity: 0.94;
}

.recommended {
  background: color-mix(in srgb, var(--success) 8%, var(--ui-surface));
  color: color-mix(in srgb, var(--success) 88%, var(--text));
  border-color: color-mix(in srgb, var(--success) 14%, transparent);
}

.watching {
  background: color-mix(in srgb, var(--warning) 8%, var(--ui-surface));
  color: color-mix(in srgb, var(--warning) 88%, var(--text));
  border-color: color-mix(in srgb, var(--warning) 14%, transparent);
}

.exit,
.ended {
  background: color-mix(in srgb, var(--danger) 8%, var(--ui-surface));
  color: color-mix(in srgb, var(--danger) 88%, var(--text));
  border-color: color-mix(in srgb, var(--danger) 14%, transparent);
}

:root[data-theme="light"] body .page-shell,
:root[data-theme="light"] .table,
:root[data-theme="light"] .ended-list {
  border-color: color-mix(in srgb, var(--line) 88%, #fff 12%);
  box-shadow:
    0 14px 28px rgba(18, 31, 53, 0.07),
    0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

:root[data-theme="light"] .row:nth-child(odd) {
  background: color-mix(in srgb, var(--ui-surface) 96%, var(--bg) 4%);
}

/* ── Dark mode enhancements ── */
:root[data-theme="dark"] .recommended {
  background: color-mix(in srgb, var(--success) 12%, var(--ui-surface));
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 22%, transparent);
}

:root[data-theme="dark"] .watching {
  background: color-mix(in srgb, var(--warning) 12%, var(--ui-surface));
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 22%, transparent);
}

:root[data-theme="dark"] .exit,
:root[data-theme="dark"] .ended {
  background: color-mix(in srgb, var(--danger) 12%, var(--ui-surface));
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 22%, transparent);
}

:root[data-theme="dark"] .table,
:root[data-theme="dark"] .ended-list {
  border-color: color-mix(in srgb, var(--line) 60%, transparent);
}

:root[data-theme="dark"] .row {
  border-top-color: color-mix(in srgb, var(--line) 48%, transparent);
}

:root[data-theme="dark"] .row:hover {
  background: color-mix(in srgb, var(--primary) 6%, var(--ui-surface));
  box-shadow:
    0 4px 16px rgba(255, 255, 255, 0.04),
    inset 3px 0 0 var(--primary),
    inset 0 1px 0 color-mix(in srgb, var(--primary) 10%, transparent);
}

/* ── R32: Dark theme thead and empty-state ── */
:root[data-theme="dark"] .thead {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--ui-surface-2) 88%, transparent), color-mix(in srgb, var(--ui-surface) 96%, transparent)),
    var(--ui-surface);
  backdrop-filter: blur(16px);
  border-bottom-color: color-mix(in srgb, var(--ui-border) 72%, var(--primary) 8%);
}

:root[data-theme="dark"] .empty-state {
  color: var(--text-muted);
  background: color-mix(in srgb, var(--ui-surface) 60%, transparent);
  border-radius: 16px;
}

:root[data-theme="dark"] .empty-state::before {
  opacity: 0.25;
}

.empty-state {
  padding: var(--space-3xl) 20px;
  color: var(--text-muted);
  text-align: center;
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
}

.empty-state::before {
  content: "\2014";
  display: block;
  margin-bottom: var(--space-md);
  font-size: var(--text-2xl);
  opacity: 0.35;
  letter-spacing: 0.3em;
}

/* ── R41/R50: Footer styling with fallbacks ── */
.footer {
  margin-top: var(--space-3xl, 48px);
  padding: var(--space-lg, 16px) 0;
  border-top: 1px solid color-mix(in srgb, var(--ui-border-soft, #dde4ec) 56%, transparent);
  color: var(--text-muted, #607086);
  font-size: var(--text-xs, 11px);
  line-height: var(--leading-relaxed, 1.7);
  text-align: center;
  letter-spacing: 0.01em;
}

.footer a {
  color: var(--text-muted, #607086);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer a:hover {
  color: var(--text, #132033);
}

#reviews-anchor {
  height: 1px;
}

@media (max-width: 900px) {
  body .page-shell {
    flex-direction: column;
    align-items: stretch;
  }

}

@media (max-width: 820px) {
  .table-toolbar::before,
  .table-toolbar::after {
    display: none;
  }

  .table.table-with-footer {
    border-top-left-radius: 22px;
  }

  .table.table-with-footer .thead {
    border-top-left-radius: 22px 22px 0 0;
  }

  .table-with-footer {
    margin-top: var(--space-lg);
  }

  .thead {
    display: none;
  }

  .row {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-radius: 18px;
  }

  .row:hover {
    transform: none;
    box-shadow:
      inset 3px 0 0 var(--primary),
      inset 0 1px 0 color-mix(in srgb, var(--primary) 8%, transparent);
  }

  .name {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-right: 0;
  }

  .logo {
    width: 48px;
    height: 48px;
    padding: 9px;
    border-radius: 16px;
  }

  .title-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .status {
    margin-left: 0;
  }

  .title strong {
    font-size: var(--text-md);
    line-height: var(--leading-tight);
  }

  .title span {
    line-height: var(--leading-normal);
  }

  .title .facts {
    margin-top: 6px;
    font-size: var(--text-2xs);
    letter-spacing: 0.08em;
  }

  .title .summary {
    -webkit-line-clamp: 2;
    margin-top: 5px;
  }

  .cta {
    margin-top: var(--space-sm);
  }

  .metric-cell {
    align-items: flex-start;
    padding: 14px var(--space-lg);
    padding-left: var(--space-lg);
    border-left: none;
    border: 1px solid var(--ui-border-soft);
    border-radius: 18px;
    background: color-mix(in srgb, var(--ui-surface) 94%, var(--bg) 6%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  }

  .metric-label {
    color: color-mix(in srgb, var(--text-muted) 90%, var(--primary) 10%);
  }

  .metric-value {
    font-size: var(--text-lg);
  }

  .metric-meta {
    max-width: none;
    text-align: left;
  }

  .metric-cell--time .time-progress {
    max-width: none;
    margin-top: 5px;
  }

  .time-progress {
    margin-top: var(--space-xs);
  }

  .time-progress__track {
    height: 6px;
  }

  .time-progress__label {
    text-align: left;
  }

  .section-title {
    flex-direction: column;
    align-items: flex-start;
  }

  .overview-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .overview-bar__actions {
    width: 100%;
    justify-content: space-between;
  }

  .table-toolbar {
    position: static;
    height: auto;
    padding: var(--space-md) 14px 0;
    margin-bottom: 0;
    left: auto;
    top: auto;
    z-index: auto;
  }

  .asset-tabs {
    position: static;
    display: flex;
    width: 100%;
    justify-content: flex-start;
    gap: var(--space-sm);
    overflow-x: auto;
    padding: var(--space-xs) var(--space-2xs) 10px;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
  }

  .asset-tabs::-webkit-scrollbar {
    display: none;
  }

  .asset-tab {
    flex: 0 0 auto;
    min-width: 90px;
    padding: 0 14px;
    margin-left: 0;
    border-radius: 999px;
    border-bottom: 1px solid color-mix(in srgb, var(--ui-border) 88%, transparent);
    transform: none;
    scroll-snap-align: start;
  }

  .asset-tab:hover {
    transform: none;
  }

  .asset-tab.is-active {
    min-width: 104px;
    transform: none;
  }

  .asset-tab.is-active::after {
    bottom: -1px;
  }

  .asset-tab:first-child {
    border-top-left-radius: 999px;
    padding-left: 14px;
  }

  .overview-bar__heading {
    flex-wrap: wrap;
  }

  .overview-bar__heading h1 {
    font-size: var(--text-2xl);
    max-width: none;
  }

  .section-title .hint {
    text-align: left;
  }

  .ended-toggle {
    padding: 14px var(--space-lg);
    border: 1px solid var(--ui-border-soft);
    border-radius: 16px;
    background: color-mix(in srgb, var(--ui-surface-2) 74%, var(--bg) 26%);
    box-shadow: none;
  }

  .ended-list {
    margin-top: var(--space-sm);
    border-top: 1px solid var(--ui-border-soft);
    border-radius: 16px;
  }
}

@media (max-width: 720px) {
  .table-toolbar::before,
  .table-toolbar::after {
    display: none;
  }

  .table.table-with-footer {
    border-top-left-radius: 22px;
  }

  .table.table-with-footer .thead {
    border-top-left-radius: 22px 22px 0 0;
  }

  .table-with-footer {
    margin-top: var(--space-md);
  }

  .overview-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .overview-bar__actions {
    width: 100%;
    justify-content: space-between;
  }

  .asset-tabs {
    position: static;
    width: 100%;
    gap: var(--space-sm);
    overflow-x: auto;
    padding: var(--space-xs) var(--space-2xs) 10px;
  }

  .asset-tab {
    flex: 0 0 auto;
    min-width: 86px;
    padding: 0 14px;
    border-radius: 999px;
    border-bottom: 1px solid color-mix(in srgb, var(--ui-border) 88%, transparent);
    scroll-snap-align: start;
    margin-left: 0;
  }

  .asset-tab.is-active {
    min-width: 102px;
  }

  .table-toolbar {
    position: static;
    height: auto;
    padding: var(--space-md) 14px 0;
    margin-bottom: 0;
    left: auto;
    top: auto;
    z-index: auto;
  }

  .table-with-footer {
    margin-top: 0;
    padding-top: 0;
  }

  .thead {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 0 14px 12px;
    border-bottom: none;
    border-radius: 0;
    background: transparent;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .thead::-webkit-scrollbar {
    display: none;
  }

  .thead > :first-child {
    display: none;
  }

  .thead > :nth-child(n + 2) {
    justify-self: auto;
    text-align: left;
  }

  .thead button {
    justify-content: center;
    padding: 0 var(--space-lg);
    border: 1px solid var(--ui-border-soft);
    border-radius: 999px;
    background: color-mix(in srgb, var(--ui-surface) 92%, var(--bg) 8%);
    box-shadow: var(--ui-shadow-sm);
    white-space: nowrap;
  }

  .row {
    padding: 14px;
  }

  .title strong {
    font-size: var(--text-base);
  }

  .metric-cell {
    padding: var(--space-md) 14px;
    align-items: flex-start;
    border-left: none;
    border-radius: 16px;
  }

  .time-progress {
    width: 100%;
    max-width: none;
  }

  .time-progress__label {
    text-align: left;
  }

  .btn {
    font-size: var(--text-sm);
    padding: 9px var(--space-md);
  }

  .nav {
    padding-top: var(--space-xs);
  }

  .nav-link,
  .nav-brand {
    font-size: var(--text-sm);
    padding: 9px var(--space-md);
  }

  .wrap {
    padding-inline: 14px;
  }

  .ended-toggle {
    padding: var(--space-md) 14px;
    font-size: var(--text-sm);
  }

  .ended-toggle__count {
    min-width: 24px;
    min-height: 24px;
    font-size: var(--text-xs);
  }

  .ended-list {
    margin-top: 6px;
    border-radius: 14px;
  }
}

@media (max-width: 640px) {
  .wrap {
    padding: 14px var(--space-md) 72px;
  }

  body .page-shell {
    margin-bottom: var(--space-md);
    padding: var(--space-md);
    border-radius: 20px;
  }

  .overview-bar {
    gap: 14px;
    margin-bottom: 14px;
  }

  .overview-bar__heading h1 {
    font-size: var(--text-2xl);
  }

  .section-title {
    margin: 18px 0 10px;
  }

  .section-title h2 {
    font-size: var(--text-base);
  }

  .table-with-footer {
    margin-top: var(--space-sm);
  }

  .table-toolbar {
    padding: 10px 10px 0;
  }

  .asset-tabs {
    gap: var(--space-sm);
    padding: 9px 10px 11px;
    border: 1px solid var(--ui-border-soft);
    border-radius: 24px;
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--ui-surface) 88%, transparent), color-mix(in srgb, var(--ui-surface-2) 84%, transparent)),
      var(--ui-surface);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.5),
      var(--ui-shadow-sm);
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 10px;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
  }

  .asset-tab {
    min-width: 84px;
    min-height: 44px;
    padding: 0 var(--space-lg);
    border: 1px solid color-mix(in srgb, var(--ui-border) 72%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--ui-surface) 90%, var(--bg) 10%);
    color: color-mix(in srgb, var(--text-muted) 82%, var(--text-quiet) 18%);
    transform: none;
    scroll-snap-align: center;
    box-shadow: none;
  }

  .asset-tab:hover {
    transform: none;
  }

  .asset-tab.is-active {
    min-width: 102px;
    transform: translateY(-1px);
    background: linear-gradient(180deg, color-mix(in srgb, var(--ui-surface) 98%, #fff 2%), color-mix(in srgb, var(--ui-surface-2) 94%, #fff 6%));
    border-color: color-mix(in srgb, var(--ui-border-strong) 42%, transparent);
    box-shadow: var(--ui-shadow-sm);
  }

  .asset-tab.is-active::before,
  .asset-tab.is-active::after {
    display: none;
  }

  .table {
    border-radius: 20px;
  }

  .thead {
    display: flex;
    gap: var(--space-sm);
    padding: 0 10px 10px;
  }

  .row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
    border-radius: 20px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--ui-surface) 98%, transparent), color-mix(in srgb, var(--ui-surface-2) 94%, transparent));
    box-shadow: 0 10px 24px rgba(16, 32, 51, 0.05);
  }

  .row:nth-child(odd) {
    background: linear-gradient(180deg, color-mix(in srgb, var(--ui-surface) 97%, transparent), color-mix(in srgb, var(--ui-surface-2) 92%, transparent));
  }

  .row:hover {
    transform: none;
    box-shadow: 0 10px 24px rgba(16, 32, 51, 0.05);
  }

  .name {
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
    padding-right: 0;
  }

  .logo {
    width: 46px;
    height: 46px;
    padding: var(--space-sm);
    border-radius: 16px;
  }

  .title-line {
    width: 100%;
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px var(--space-sm);
  }

  .title strong {
    flex: 1 1 auto;
    min-width: 0;
    font-size: var(--text-md);
    line-height: var(--leading-tight);
    letter-spacing: -0.01em;
  }

  .status {
    margin-left: auto;
    min-height: 20px;
    padding: 0 7px;
    font-size: 9px;
  }

  .title span {
    line-height: var(--leading-tight);
  }

  .title .facts {
    margin-top: var(--space-2xs);
    font-size: 9px;
    letter-spacing: 0.08em;
    color: color-mix(in srgb, var(--text-muted) 94%, var(--text-quiet) 6%);
  }

  .title .summary {
    margin-top: var(--space-xs);
    -webkit-line-clamp: 1;
    color: color-mix(in srgb, var(--text-muted) 82%, var(--text-quiet) 18%);
  }

  .title .cta {
    margin-top: 6px;
    font-size: var(--text-xs);
    letter-spacing: 0.02em;
    color: color-mix(in srgb, var(--primary) 86%, var(--text));
    opacity: 0.88;
  }

  .metric-cell {
    align-items: flex-start;
    justify-content: flex-start;
    min-height: auto;
    gap: var(--space-2xs);
    padding: 10px var(--space-md) 11px;
    border: 1px solid var(--ui-border-soft);
    border-radius: 16px;
    background: color-mix(in srgb, var(--ui-surface) 92%, var(--bg) 8%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }

  .metric-label {
    font-size: 9px;
    letter-spacing: 0.14em;
  }

  .metric-value {
    font-size: var(--text-lg);
    line-height: 1.05;
  }

  .metric-value.apr {
    font-size: var(--text-xl);
  }

  .metric-meta {
    max-width: none;
    text-align: left;
    font-size: var(--text-2xs);
    line-height: var(--leading-tight);
  }

  .time-progress {
    width: 100%;
    margin-top: var(--space-2xs);
  }

  .metric-cell--time .time-progress {
    margin-top: var(--space-xs);
  }

  .time-progress__track {
    height: 5px;
  }

  .time-progress__label {
    text-align: left;
    font-size: 9px;
  }

  .ended-toggle {
    padding: 11px 13px;
    border: 1px solid var(--ui-border-soft);
    border-radius: 14px;
    background: color-mix(in srgb, var(--ui-surface-2) 68%, var(--bg) 32%);
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: 650;
    box-shadow: none;
  }

  .ended-toggle:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--ui-surface-2) 74%, var(--bg) 26%);
  }

  .ended-toggle__count {
    min-width: 22px;
    min-height: 22px;
    padding: 0 7px;
    background: color-mix(in srgb, var(--text-muted) 10%, transparent);
    color: var(--text-muted);
  }

  .ended-list {
    margin-top: 6px;
    border-top: 1px solid var(--ui-border-soft);
    border-radius: 14px;
    background: color-mix(in srgb, var(--ui-surface) 90%, var(--bg) 10%);
  }

  .ended-list .row {
    background: transparent;
    opacity: 0.86;
    box-shadow: none;
  }

  .ended-list .row:nth-child(odd) {
    background: transparent;
  }

  .ended-list .row:hover {
    background: color-mix(in srgb, var(--ui-surface) 94%, var(--bg) 6%);
    box-shadow: none;
  }

  .ended-list .status,
  .ended-list .metric-label,
  .ended-list .metric-meta,
  .ended-list .time-progress__label {
    color: color-mix(in srgb, var(--text-muted) 82%, var(--text-quiet) 18%);
  }
}

@media (max-width: 520px) {
  .wrap {
    padding: 12px var(--space-sm) 68px;
  }

  .table-toolbar {
    padding: var(--space-sm) var(--space-sm) 0;
  }

  /* R22: scrollable asset tabs on small mobile */
  .asset-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .asset-tabs::-webkit-scrollbar {
    display: none;
  }

  /* R22: reduce overview-bar padding */
  .overview-bar {
    padding: 4px 2px;
  }

  .asset-tabs,
  .thead {
    scroll-padding-inline: var(--space-sm);
  }

  .thead {
    margin: 0 var(--space-sm) var(--space-sm);
    padding: var(--space-sm);
    border: 1px solid var(--ui-border-soft);
    border-radius: 18px;
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--ui-surface) 92%, transparent), color-mix(in srgb, var(--ui-surface-2) 88%, transparent)),
      var(--ui-surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }

  /* R22: smaller thead font on small mobile */
  .thead button {
    font-size: 9px;
    font-weight: 700;
  }

  #rows,
  .ended-list {
    display: grid;
    gap: var(--space-md);
    padding-inline: var(--space-sm);
  }

  #rows {
    padding-bottom: var(--space-sm);
  }

  .ended-list {
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    padding-bottom: var(--space-sm);
    border-top: none;
  }

  .row {
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-areas:
      "logo title"
      "logo facts"
      "summary summary"
      "cta cta"
      "apr apr"
      "time time";
    gap: var(--space-sm) var(--space-md);
    align-items: start;
    padding: var(--space-lg);
    border: 1px solid var(--ui-border-soft);
    border-top: 1px solid var(--ui-border-soft);
    border-radius: 18px;
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--ui-surface) 98%, transparent), color-mix(in srgb, var(--ui-surface-2) 94%, transparent)),
      var(--ui-surface);
    box-shadow: var(--ui-shadow-sm);
  }

  .row:first-of-type {
    border-top: 1px solid var(--ui-border-soft);
  }

  .row:nth-child(odd) {
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--ui-surface) 98%, transparent), color-mix(in srgb, var(--ui-surface-2) 94%, transparent)),
      var(--ui-surface);
  }

  .row:hover {
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--ui-surface) 98%, transparent), color-mix(in srgb, var(--ui-surface-2) 94%, transparent)),
      var(--ui-surface);
    box-shadow: var(--ui-shadow-sm);
  }

  .name,
  .title,
  .title-line {
    display: contents;
  }

  .logo {
    grid-area: logo;
    width: 48px;
    height: 48px;
    padding: var(--space-sm);
    border-radius: 16px;
  }

  .title strong {
    grid-area: title;
    min-width: 0;
    font-size: var(--text-md);
    line-height: var(--leading-tight);
  }

  .title .facts {
    grid-area: facts;
    margin-top: 0;
    line-height: var(--leading-normal);
  }

  .title .summary {
    grid-area: summary;
    margin-top: 0;
    -webkit-line-clamp: 2;
  }

  .title .cta {
    grid-area: cta;
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    min-height: 20px;
  }

  .status {
    grid-area: apr;
    justify-self: end;
    align-self: start;
    z-index: 1;
    margin-left: 0;
    min-height: 28px;
    padding-inline: var(--space-md);
  }

  .metric-cell {
    min-height: 44px;
    gap: var(--space-2xs);
    padding: var(--space-md);
    border-radius: 16px;
    background: color-mix(in srgb, var(--ui-surface) 94%, var(--bg) 6%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }

  .row .metric-cell:not(.metric-cell--time) {
    grid-area: apr;
    padding-right: 104px;
  }

  .metric-cell--time {
    grid-area: time;
  }

  .metric-value.apr {
    font-size: var(--text-xl);
  }

  .metric-meta {
    max-width: none;
  }

  .metric-cell--time .time-progress {
    margin-top: var(--space-xs);
  }

  .time-progress__track {
    height: 6px;
  }
}

/* ── R21: Improved mobile layout (768px) ── */
@media (max-width: 768px) {
  .metric-cell {
    flex-direction: column;
    align-items: flex-start;
  }

  .row {
    padding: 10px 14px;
  }

  .name {
    width: 100%;
  }

  .title {
    width: 100%;
  }
}

/* ── R22: 480px extra-small tweaks ── */
@media (max-width: 480px) {
  .asset-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }

  .asset-tabs::-webkit-scrollbar {
    display: none;
  }

  .overview-bar {
    padding: 4px 0;
  }

  .thead button {
    font-size: 9px;
  }
}

/* ── R43: Subtle one-time shimmer on row first paint ── */
@keyframes rowShimmer {
  0% {
    background-position: -100% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.row::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--primary, #2f6fe8) 4%, transparent) 40%,
    color-mix(in srgb, var(--primary, #2f6fe8) 7%, transparent) 50%,
    color-mix(in srgb, var(--primary, #2f6fe8) 4%, transparent) 60%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation:
    rowShimmer 0.8s ease 0.4s 1 both,
    rowShimmerOpacity 0.3s ease 1.2s 1 forwards;
}

@keyframes rowShimmerOpacity {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .row::after {
    animation: none;
    display: none;
  }
}

/* ── R28: Row entrance stagger animation ── */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.row {
  animation: fadeSlideUp 0.35s ease both;
}

.row:nth-child(1) { animation-delay: 0s; }
.row:nth-child(2) { animation-delay: 0.04s; }
.row:nth-child(3) { animation-delay: 0.08s; }
.row:nth-child(4) { animation-delay: 0.12s; }
.row:nth-child(5) { animation-delay: 0.16s; }
.row:nth-child(6) { animation-delay: 0.2s; }
.row:nth-child(7) { animation-delay: 0.24s; }
.row:nth-child(8) { animation-delay: 0.28s; }
.row:nth-child(9) { animation-delay: 0.32s; }
.row:nth-child(10) { animation-delay: 0.36s; }
.row:nth-child(n+11) { animation-delay: 0.4s; }

/* ── R30: Consistent hover/active transitions on rows ── */
.row:active {
  transform: scale(0.995);
  transition: transform 0.1s ease;
}

/* ── R40: Consistent transition durations (styles) ── */
.row {
  transition:
    background 0.2s ease,
    border-color 0.15s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.nav-link {
  transition:
    border-color 0.2s ease,
    color 0.15s ease,
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.btn {
  transition:
    border-color 0.2s ease,
    color 0.15s ease,
    background 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.btn:active,
.nav-link:active:not(.disabled),
.row:active {
  transition: transform 0.1s ease;
}

.asset-tab {
  transition:
    background 0.2s ease,
    color 0.15s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.ended-toggle {
  transition:
    border-color 0.2s ease,
    color 0.15s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

/* ── R30: Consistent border-radius audit ── */
/* small: 8px, medium: 12px, large: 16-20px — existing values already consistent */

/* ── Page entrance animation ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.wrap {
  animation: fadeIn 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
