:root {
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.5rem;
  --rail-width: 16.5rem;
  --content-width: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --glass: color-mix(in srgb, var(--bg-primary) 78%, transparent);
  --ring-accent: color-mix(in srgb, var(--accent) 28%, var(--border));
  --dot-ready: var(--success);
  --dot-setup: var(--warning);
  --dot-off: var(--danger);
}

[hidden] {
  display: none !important;
}

body.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: 1rem;
  color: #fff;
}

.logo-mark {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: var(--weight-bold);
  letter-spacing: -0.03em;
}

.wordmark:hover {
  color: var(--text-primary);
}

.wordmark .logo-mark {
  font-size: 1.7rem;
}

.wordmark-sub {
  color: var(--text-muted);
  font-family: var(--font-primary);
  font-weight: var(--weight-medium);
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--glass);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0.85rem var(--gutter);
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link {
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  background: var(--surface);
  color: var(--text-primary);
}

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--divider);
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem var(--gutter) 2.5rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-size: var(--text-sm);
}

.footer-links a {
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-note {
  width: 100%;
  color: var(--text-disabled);
  font-size: var(--text-xs);
}

.tagline {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.page {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5rem) var(--gutter) 4rem;
}

.page-narrow {
  max-width: 46rem;
}

.page-head {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: var(--weight-bold);
  line-height: 1.05;
  letter-spacing: var(--tracking-tight);
}

.lede {
  max-width: 60ch;
  color: var(--text-secondary);
  font-size: var(--text-lg);
  line-height: var(--leading-body);
}

.glow-card {
  position: relative;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 7%, var(--surface)), var(--surface) 55%);
  border: 1px solid var(--ring-accent);
  border-radius: var(--radius-xl);
}

.flat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.card-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--text-disabled);
}

.dot-ready {
  background: var(--dot-ready);
  box-shadow: 0 0 0.6rem color-mix(in srgb, var(--dot-ready) 70%, transparent);
}

.dot-setup {
  background: var(--dot-setup);
  box-shadow: 0 0 0.6rem color-mix(in srgb, var(--dot-setup) 60%, transparent);
}

.dot-off,
.dot-disabled {
  background: var(--dot-off);
}

.button-danger {
  background: color-mix(in srgb, var(--danger) 16%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
  color: var(--danger-300);
}

.button-danger:hover {
  background: color-mix(in srgb, var(--danger) 26%, var(--surface));
  color: var(--danger-100);
}

.button-sm {
  min-height: 2.15rem;
  padding: 0.4rem 0.75rem;
  font-size: var(--text-xs);
}

.button[disabled],
.button[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.button .icon {
  width: 1.05em;
  height: 1.05em;
}

.icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.prose {
  max-width: 70ch;
  color: var(--text-secondary);
  line-height: 1.75;
}

.prose h2 {
  margin: 3rem 0 0.9rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  scroll-margin-top: 6rem;
}

.prose h3 {
  margin: 1.75rem 0 0.6rem;
  font-size: 1.05rem;
  scroll-margin-top: 6rem;
}

.prose p,
.prose ul,
.prose ol,
.prose table {
  margin: 0 0 1rem;
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
}

.prose li {
  margin: 0.35rem 0;
}

.prose li::marker {
  color: var(--text-disabled);
}

.prose strong {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.prose a {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent);
  text-underline-offset: 3px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.prose th,
.prose td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.prose th {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.table-scroll {
  overflow-x: auto;
  margin: 0 0 1rem;
}

.legal-layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.legal-toc {
  position: sticky;
  top: 5.5rem;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  padding-right: 0.5rem;
  font-size: var(--text-sm);
}

.legal-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.legal-toc li {
  counter-increment: toc;
}

.legal-toc a {
  display: flex;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  border-left: 2px solid var(--border);
  color: var(--text-muted);
}

.legal-toc a::before {
  content: counter(toc);
  min-width: 1.25rem;
  color: var(--text-disabled);
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
}

.legal-toc a:hover,
.legal-toc a.active {
  border-left-color: var(--accent);
  color: var(--text-primary);
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.callout {
  margin: 0 0 1.25rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--ring-accent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-secondary));
  color: var(--text-secondary);
}

@media (max-width: 860px) {
  .legal-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .legal-toc {
    position: static;
    max-height: none;
  }
}

.consent {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 60;
  width: min(26rem, calc(100vw - 2rem));
  padding: 1.15rem 1.25rem 1.25rem;
  box-shadow: 0 20px 50px rgb(0 0 0 / 0.45);
}

.consent p {
  margin: 0.4rem 0 1rem;
  font-size: var(--text-sm);
}

.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.home-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  min-height: calc(100svh - 4rem);
  padding: 3rem var(--gutter);
  text-align: center;
}

.home-hero .hero-logo {
  width: min(10rem, 34vw);
  height: min(10rem, 34vw);
  cursor: default;
}

.hero-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0 0.3em;
  font-size: min(5rem, 13vw);
  line-height: 1;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.home-stats {
  display: flex;
  justify-content: center;
  padding: 0 var(--gutter) 6rem;
}

.home-stats .stats {
  position: static;
  translate: none;
}

.stat-value[data-loading] {
  color: var(--text-disabled);
}

.stats-dot[data-state="offline"] {
  background: var(--warning);
  box-shadow: 0 0 0.6rem color-mix(in srgb, var(--warning) 60%, transparent);
}

.products {
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 3vw, 2rem);
}

.products .page-head {
  margin-bottom: clamp(0.5rem, 2vw, 1rem);
}

.page-title {
  text-wrap: balance;
}

.highlight {
  position: relative;
  display: inline-block;
  background: linear-gradient(100deg, var(--noble-300), var(--accent-400) 60%, #8adcff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.highlight::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.02em;
  height: 0.12em;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-400), #8adcff);
  -webkit-mask-image: linear-gradient(90deg, #000 50%, transparent 50%);
  mask-image: linear-gradient(90deg, #000 50%, transparent 50%);
  -webkit-mask-size: 200% 100%;
  mask-size: 200% 100%;
  -webkit-mask-position: 0 0;
  mask-position: 0 0;
}

@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="reduce"]) .highlight::after {
    animation: highlight-sweep 700ms var(--ease-out) 250ms both;
  }
}

@keyframes highlight-sweep {
  from {
    -webkit-mask-position: 100% 0;
    mask-position: 100% 0;
  }
  to {
    -webkit-mask-position: 0 0;
    mask-position: 0 0;
  }
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.plans-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: clamp(1rem, 2.5vw, 1.5rem);
  align-items: start;
}

.plans,
.get-pro {
  --pad: clamp(1.25rem, 3.5vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: var(--pad);
}

.plans-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.plan-toggle {
  --knob-pad: 0.25rem;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: var(--knob-pad);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-primary) 60%, transparent);
  isolation: isolate;
}

.plan-toggle button {
  min-width: 5.5rem;
  min-height: 44px;
  padding: 0.5rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition:
    color var(--dur-base) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

.plan-toggle button:active {
  transform: scale(var(--press-scale));
}

.plan-toggle button[aria-checked="true"] {
  color: #fff;
}

.plan-toggle button:focus-visible {
  outline: 2px solid var(--accent-300);
  outline-offset: 2px;
}

.plan-toggle-knob {
  position: absolute;
  z-index: -1;
  top: var(--knob-pad);
  bottom: var(--knob-pad);
  left: var(--knob-pad);
  width: calc(50% - var(--knob-pad));
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0.35rem 1rem color-mix(in srgb, var(--accent) 35%, transparent);
  transition:
    translate var(--dur-slow) var(--ease-in-out),
    background-color var(--dur-slow) var(--ease-in-out);
}

.plan-toggle[data-active="pro"] .plan-toggle-knob {
  translate: 100% 0;
  background: linear-gradient(120deg, var(--accent-600), #4fb8e8);
}

.plan-toggle.is-moving .plan-toggle-knob {
  animation: knob-stretch var(--dur-slow) var(--ease-in-out);
}

@keyframes knob-stretch {
  50% {
    scale: 1.12 1;
  }
}

.limit-list {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.limit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  min-height: 2.9rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}

.limit-row:last-child {
  border-bottom: 0;
}

.limit-row dt {
  color: var(--text-primary);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.limit-row dd {
  margin: 0;
}

.limit-value {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-semibold);
}

.limit-from {
  color: var(--text-muted);
  font-weight: var(--weight-medium);
}

.limit-arrow {
  color: var(--text-muted);
}

.limit-to {
  min-width: 2.5ch;
  color: var(--noble-200);
  text-align: right;
}

.limit-row-note dt {
  color: var(--text-muted);
}

.skeleton-row dt,
.skeleton-row dd {
  height: 0.85rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-elevated) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  color: transparent;
  animation: skeleton 1.4s ease infinite;
}

.skeleton-row dt {
  width: 60%;
}

.skeleton-row dd {
  width: 2.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="reduce"]) .limit-row:not(.skeleton-row) {
    animation: row-in 220ms var(--ease-out) both;
    animation-delay: calc(var(--row, 0) * var(--stagger));
  }
}

@keyframes row-in {
  from {
    opacity: 0;
    translate: 0 0.35rem;
  }
}

.limit-list {
  transition:
    opacity var(--dur-fast) var(--ease-out),
    filter var(--dur-fast) var(--ease-out);
}

.limit-list.is-swapping {
  opacity: 0;
  filter: blur(2px);
  transition:
    opacity var(--dur-exit-fast) var(--ease-in),
    filter var(--dur-exit-fast) var(--ease-in);
}

:root .limit-list[data-settled] .limit-row:not(.skeleton-row) {
  animation: none;
}

.show-all {
  align-self: flex-start;
  min-height: 44px;
  margin-left: -0.6rem;
}

.get-pro .steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.get-pro .steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--text-primary);
}

.step-number {
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--noble-100);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
}

.get-pro-cta {
  width: 100%;
  min-height: 3rem;
  font-size: var(--text-base);
  box-shadow: 0 0.5rem 1.5rem color-mix(in srgb, var(--accent) 30%, transparent);
}

.bot-card {
  --pad: clamp(1.25rem, 3.5vw, 2rem);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  padding: var(--pad);
  border-radius: var(--radius-xl);
}

.bot-card-text {
  display: flex;
  flex: 1 1 22rem;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 40rem;
}

.bot-card-text p {
  color: var(--text-secondary);
}

.bot-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.product-name {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: -0.03em;
}

.product-name img {
  width: 3rem;
  height: 3rem;
  border-radius: 0.85rem;
}

.features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: clamp(0.5rem, 2vw, 1.5rem);
}

.feature-grid {
  --pad: 1.1rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-grid li {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: var(--pad);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
}

.feature-grid h3 {
  font-size: var(--text-base);
  text-wrap: balance;
}

.feature-grid p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 0.25rem;
  border-radius: max(0.4rem, calc(var(--radius-lg) - var(--pad)));
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--noble-200);
}

.feature-icon .icon {
  width: 1.15rem;
  height: 1.15rem;
}

@media (max-width: 1024px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .plans-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .feature-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .bot-card-actions,
  .bot-card-actions .button {
    width: 100%;
  }

  .plans-head {
    flex-direction: column;
    align-items: stretch;
  }
}

.center-page {
  display: grid;
  place-items: center;
  flex: 1;
  padding: 3rem var(--gutter);
}

.login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  width: min(100%, 27rem);
  padding: 2.5rem 2rem 2rem;
  text-align: center;
}

.login-card .logo-mark {
  font-size: 4rem;
}

.login-card .button {
  width: 100%;
}

.fine-print {
  color: var(--text-muted);
  font-size: var(--text-xs);
  line-height: 1.6;
}

.alert {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--danger) 10%, var(--bg-secondary));
  color: var(--danger-100);
  font-size: var(--text-sm);
  text-align: left;
}

.alert-info {
  border-color: var(--ring-accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-secondary));
  color: var(--text-secondary);
}

.alert-success {
  border-color: color-mix(in srgb, var(--success) 45%, var(--border));
  background: color-mix(in srgb, var(--success) 10%, var(--bg-secondary));
  color: var(--success-100);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field > label,
.field-label {
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.hint {
  color: var(--text-muted);
  font-size: var(--text-xs);
  line-height: 1.5;
}

textarea {
  min-height: 6rem;
  resize: vertical;
  line-height: 1.5;
}

select {
  appearance: none;
  padding-right: 2.25rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 1.15rem) 52%,
    calc(100% - 0.8rem) 52%;
  background-size:
    0.35rem 0.35rem,
    0.35rem 0.35rem;
  background-repeat: no-repeat;
  cursor: pointer;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem 1.25rem;
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  width: 2.75rem;
  height: 1.55rem;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg-tertiary);
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

.switch::after {
  content: "";
  position: absolute;
  left: 0.2rem;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 180ms var(--ease-out), background-color 160ms var(--ease-out);
}

.switch[aria-checked="true"] {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--border));
  background: color-mix(in srgb, var(--accent) 35%, var(--bg-tertiary));
}

.switch[aria-checked="true"]::after {
  transform: translateX(1.15rem);
  background: #fff;
}

.switch:disabled {
  opacity: 0.5;
  cursor: wait;
}

.picker {
  position: relative;
}

.picker > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  padding: 0.45rem 2.25rem 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0.625rem;
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: var(--text-sm);
  list-style: none;
  cursor: pointer;
}

.picker > summary::-webkit-details-marker {
  display: none;
}

.picker > summary::after {
  content: "";
  position: absolute;
  right: 0.95rem;
  top: 1.2rem;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(45deg);
}

.picker[open] > summary {
  border-color: var(--focus-ring);
}

.picker-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 20;
  max-height: 18rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  box-shadow: 0 18px 40px rgb(0 0 0 / 0.45);
}

.picker-menu input {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.picker-menu input:focus {
  box-shadow: none;
}

.picker-options {
  overflow-y: auto;
  padding: 0.3rem;
}

.picker-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  cursor: pointer;
}

.picker-option:hover {
  background: var(--surface);
  color: var(--text-primary);
}

.picker-option input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

.picker-group {
  padding: 0.55rem 0.6rem 0.25rem;
  color: var(--text-disabled);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-primary);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-swatch {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--text-muted);
}

.app {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100svh;
}

.rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  height: 100vh;
  height: 100svh;
  padding: 1.25rem 0.9rem;
  border-right: 1px solid var(--divider);
  background: var(--bg-secondary);
  overflow-y: auto;
}

.rail .wordmark {
  padding: 0 0.45rem;
}

.server-switch {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-align: left;
  cursor: pointer;
}

.server-switch:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.server-switch span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guild-icon {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 0.7rem;
  background: var(--surface-elevated);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
}

.guild-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.guild-icon-lg {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1.1rem;
  font-size: var(--text-base);
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.rail-label {
  padding: 0.9rem 0.6rem 0.35rem;
  color: var(--text-disabled);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

.rail-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.rail-link:hover {
  background: var(--surface);
  color: var(--text-primary);
}

.rail-link[aria-current="page"] {
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--text-primary);
  box-shadow: inset 2px 0 0 var(--accent);
}

.rail-foot {
  position: sticky;
  bottom: -1.25rem;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: auto -0.9rem -1.25rem;
  padding: 0.7rem 1.4rem 1.25rem;
  border-top: 1px solid var(--divider);
  background: var(--bg-secondary);
  font-size: var(--text-sm);
}

.avatar {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface-elevated);
  object-fit: cover;
}

.avatar-lg {
  width: 4rem;
  height: 4rem;
}

.rail-user {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.icon-button:hover {
  background: var(--surface);
  color: var(--text-primary);
}

.main {
  min-width: 0;
  padding: clamp(1.5rem, 4vw, 2.75rem) var(--gutter) 4rem;
}

.main-inner {
  max-width: var(--content-width);
  margin: 0 auto;
}

.view-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 1.75rem;
}

.view-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -0.03em;
}

.view-sub {
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  margin: 0 0 0.4rem -0.6rem;
  padding: 0.5rem 0.85rem 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.crumb .icon {
  width: 1.1em;
  height: 1.1em;
}

.crumb:hover,
.crumb:focus-visible {
  background: var(--surface);
  color: var(--text-primary);
}

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

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.spread {
  justify-content: space-between;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

@media (max-width: 960px) {
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
  padding: 1.35rem 1.5rem 1.5rem;
}

.metric + .metric {
  border-left: 1px solid var(--border);
}

.metric-label {
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.metric-value {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: var(--tracking-heading);
}

.metric-note {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

@media (max-width: 860px) {
  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric:nth-child(3) {
    border-left: 0;
  }

  .metric:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }
}

.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1.5rem;
  border-top: 1px solid var(--border);
}

.list-item:first-child {
  border-top: 0;
}

a.list-item {
  color: inherit;
}

a.list-item:hover {
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.list-main {
  flex: 1;
  min-width: 0;
}

.list-title {
  overflow: hidden;
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-sub {
  overflow: hidden;
  color: var(--text-muted);
  font-size: var(--text-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-end {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: var(--text-xs);
  text-align: right;
}

.module-tile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
}

a.module-tile:hover {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text-primary);
}

.module-tile .list-main {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.data-table th {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--divider);
  color: var(--text-secondary);
  vertical-align: middle;
}

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

.data-table tbody tr[data-href] {
  cursor: pointer;
}

.data-table tbody tr[data-href]:hover td {
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.data-table .num {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cell-user {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  color: var(--text-primary);
}

.cell-user img {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
}

.cell-user .cell-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.truncate {
  display: block;
  max-width: 28rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-card {
  overflow-x: auto;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.toolbar input,
.toolbar select {
  width: auto;
  min-width: 11rem;
}

.toolbar .grow-field {
  flex: 1 1 14rem;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
  text-align: center;
}

.empty strong {
  color: var(--text-primary);
}

.kv {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.6rem 1.25rem;
  margin: 0;
  font-size: var(--text-sm);
}

.kv dt {
  color: var(--text-muted);
}

.kv dd {
  margin: 0;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.quote {
  margin: 0;
  padding: 0.8rem 1rem;
  border-left: 2px solid var(--border-strong);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding: 0.25rem;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}

.tab {
  padding: 0.45rem 0.85rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  cursor: pointer;
}

.tab:hover {
  color: var(--text-primary);
}

.tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--text-primary);
}

.setting {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--divider);
}

.setting:first-child {
  border-top: 0;
  padding-top: 0;
}

.setting-text {
  max-width: 46ch;
}

.setting-text strong {
  display: block;
  color: var(--text-primary);
  font-size: var(--text-sm);
}

.setting-text span {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.setting-control {
  flex: 0 1 22rem;
  min-width: 12rem;
}

@media (max-width: 640px) {
  .setting {
    flex-direction: column;
    gap: 0.6rem;
  }

  .setting-control {
    width: 100%;
    flex-basis: auto;
  }
}

.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-elevated) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.4s ease infinite;
}

@keyframes skeleton {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.loading-view {
  display: grid;
  gap: 1rem;
}

.loading-view .skeleton:first-child {
  width: 40%;
  height: 2.2rem;
}

.loading-view .skeleton {
  height: 7rem;
}

.toasts {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(24rem, calc(100vw - 2rem));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  box-shadow: 0 14px 34px rgb(0 0 0 / 0.4);
  color: var(--text-primary);
  font-size: var(--text-sm);
  animation: toast-in 220ms var(--ease-out);
}

.toast-success {
  border-color: color-mix(in srgb, var(--success) 50%, var(--border));
}

.toast-error {
  border-color: color-mix(in srgb, var(--danger) 55%, var(--border));
}

.toast-success .icon {
  color: var(--success);
}

.toast-error .icon {
  color: var(--danger);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

dialog.modal {
  width: min(32rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 1px solid var(--ring-accent);
  border-radius: var(--radius-lg);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  box-shadow: 0 30px 70px rgb(0 0 0 / 0.55);
}

dialog.modal::backdrop {
  background: rgb(5 8 12 / 0.65);
  backdrop-filter: blur(3px);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
}

.server-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  color: var(--text-primary);
}

a.server-card:hover {
  border-color: var(--ring-accent);
  background: var(--surface);
  color: var(--text-primary);
}

.server-card .list-main strong {
  display: block;
  overflow: hidden;
  font-size: var(--text-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pro-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 30%, transparent), color-mix(in srgb, #8adcff 25%, transparent));
  color: var(--noble-100);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
}

.user-badge {
  --badge-ink: var(--text-primary);
  --badge-glow: transparent;
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.55rem 0.18rem 0.45rem;
  overflow: hidden;
  border: 1px solid var(--badge-edge);
  border-radius: 999px;
  background: var(--badge-fill);
  box-shadow: 0 0 0 0 var(--badge-glow), inset 0 1px 0 color-mix(in srgb, #fff 14%, transparent);
  color: var(--badge-ink);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.01em;
  line-height: 1.4;
  white-space: nowrap;
  cursor: default;
  user-select: none;
}

.user-badge .icon {
  width: 0.95rem;
  height: 0.95rem;
}

.user-badge::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, color-mix(in srgb, #fff 22%, transparent) 50%, transparent 65%);
  transform: translateX(-120%);
  content: '';
  pointer-events: none;
}

.user-badge:hover::after {
  transform: translateX(120%);
  transition: transform 700ms var(--ease-out);
}

.user-badge-developer {
  --badge-fill: linear-gradient(120deg, color-mix(in srgb, #5865f2 34%, var(--bg-secondary)), color-mix(in srgb, #3fd0c9 26%, var(--bg-secondary)));
  --badge-edge: color-mix(in srgb, #7c87ff 55%, transparent);
  --badge-ink: color-mix(in srgb, #c9cdff 70%, var(--text-primary));
}

.user-badge-developer .icon {
  color: #8fe7e1;
}

.user-badge-pro {
  --badge-fill: linear-gradient(120deg, color-mix(in srgb, #f5b74a 30%, var(--bg-secondary)), color-mix(in srgb, #f27a9b 24%, var(--bg-secondary)));
  --badge-edge: color-mix(in srgb, #f5b74a 55%, transparent);
  --badge-ink: color-mix(in srgb, #ffe2a8 70%, var(--text-primary));
}

.user-badge-pro .icon {
  color: #ffc861;
  fill: currentColor;
}

:root[data-theme='light'] .user-badge-developer {
  --badge-ink: #3a3fb0;
}

:root[data-theme='light'] .user-badge-developer .icon {
  color: #158c86;
}

:root[data-theme='light'] .user-badge-pro {
  --badge-ink: #8a5300;
}

:root[data-theme='light'] .user-badge-pro .icon {
  color: #d98a00;
}

.user-badge.is-compact {
  padding: 0.2rem;
}

.user-badge.is-compact .icon {
  width: 0.8rem;
  height: 0.8rem;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 9rem;
  padding: 0.5rem 0 0;
}

.bar {
  flex: 1;
  min-width: 2px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--accent-400), var(--accent-700));
  opacity: 0.85;
}

.bar:hover {
  opacity: 1;
}

.bar-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.meter {
  position: relative;
  height: 0.4rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface);
}

.meter span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: var(--accent);
}

.mobile-bar {
  display: none;
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: min(18rem, 86vw);
    transform: translateX(-102%);
    transition: transform 220ms var(--ease-out);
    box-shadow: 20px 0 50px rgb(0 0 0 / 0.5);
  }

  .app[data-rail="open"] .rail {
    transform: none;
  }

  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--divider);
    background: var(--glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
}

.notice-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.notice-404 .big {
  font-family: var(--font-display);
  font-size: clamp(4rem, 14vw, 8rem);
  font-weight: var(--weight-bold);
  letter-spacing: -0.06em;
  line-height: 1;
}

@media (max-width: 560px) {
  .site-nav-links .nav-link.hide-sm {
    display: none;
  }

  .card-head,
  .card-body,
  .list-item {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (max-width: 560px) {
  .hide-sm {
    display: none;
  }

  .metric {
    padding: 1.1rem 1rem 1.2rem;
  }
}

.list-item .switch {
  margin-left: 0.25rem;
}

.chart svg text {
  font-family: var(--font-primary);
  font-variant-numeric: tabular-nums;
}

.chart[data-chart] [data-bar]:hover path {
  fill: var(--accent-hover);
}

.field-label {
  display: block;
}

.rail-link .badge {
  padding: 0.1rem 0.45rem;
}

.bell {
  position: relative;
}

.bell:active {
  transform: scale(var(--press-scale));
}

.bell-count {
  position: absolute;
  top: -0.2rem;
  right: -0.25rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.3rem;
  border: 2px solid var(--bg-primary);
  border-radius: 999px;
  background: var(--danger-500);
  color: #fff;
  font-size: 0.65rem;
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  line-height: 0.75rem;
  text-align: center;
}

.bell.is-pulsing .icon {
  animation: bell-ring 600ms var(--ease-out);
}

.bell.is-pulsing .bell-count {
  animation: bell-pulse 600ms var(--ease-out);
}

@keyframes bell-ring {
  20% { transform: rotate(14deg); }
  45% { transform: rotate(-10deg); }
  70% { transform: rotate(5deg); }
}

@keyframes bell-pulse {
  40% { transform: scale(1.25); box-shadow: 0 0 0 6px color-mix(in srgb, var(--danger-500) 25%, transparent); }
}

.note-pop {
  position: fixed;
  z-index: 80;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  box-shadow: 0 18px 44px rgb(0 0 0 / 0.45);
  animation: pop-in var(--dur-base) var(--ease-out);
}

.note-pop.is-leaving {
  animation: pop-out var(--dur-exit-base) var(--ease-in) forwards;
  pointer-events: none;
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(var(--pop-from)); }
}

@keyframes pop-out {
  to { opacity: 0; transform: scale(var(--pop-from)); }
}

.note-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.75rem 0.7rem 1rem;
  border-bottom: 1px solid var(--divider);
}

.note-pop-head h2 {
  margin: 0;
  font-size: var(--text-base);
}

.note-pop-list {
  flex: 1;
  margin: 0;
  padding: 0.35rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
}

.note-pop-list li {
  animation: row-in 240ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * var(--stagger));
}

.note-pop-item {
  position: relative;
  display: block;
  padding: 0.65rem 0.75rem 0.65rem 1.4rem;
  border-radius: calc(var(--radius-md) - 0.35rem);
  color: var(--text-secondary);
  text-decoration: none;
}

.note-pop-item:hover,
.note-pop-item:focus-visible {
  background: var(--surface);
}

.note-pop-item.is-unread {
  color: var(--text-primary);
}

.unread-dot {
  position: absolute;
  top: 1.05rem;
  left: 0.55rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent-500);
}

.note-pop-foot {
  display: block;
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--divider);
  color: var(--accent-300);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-align: center;
}

.note-pop-foot:hover {
  background: var(--surface);
}

.note-pop-loading {
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem;
}

.note-pop-loading .skeleton {
  height: 3.5rem;
}

.note-pop .empty {
  padding: 2rem 1.25rem;
}

.note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  margin-bottom: 0.3rem;
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.note-source {
  color: var(--text-secondary);
  font-weight: var(--weight-semibold);
}

.md {
  color: inherit;
  font-size: var(--text-sm);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.md p,
.md ul,
.md blockquote,
.md pre {
  margin: 0 0 0.35rem;
}

.md > :last-child {
  margin-bottom: 0;
}

.md ul {
  padding-left: 1.2rem;
}

.md blockquote {
  padding-left: 0.7rem;
  border-left: 3px solid var(--border-strong);
}

.md code {
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  background: var(--surface-elevated);
  font-size: 0.9em;
}

.md-code {
  padding: 0.6rem 0.75rem;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  background: var(--surface);
  white-space: pre-wrap;
}

.md-code code {
  padding: 0;
  background: none;
}

.md-h {
  color: var(--text-primary);
  font-weight: var(--weight-bold);
  line-height: 1.3;
}

.md-h1 { font-size: var(--text-lg); }
.md-h2 { font-size: var(--text-base); }

.md-sub {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.md-emoji {
  width: 1.3em;
  height: 1.3em;
  margin: 0 0.05em;
  object-fit: contain;
  vertical-align: -0.3em;
}

.md-h1 .md-emoji {
  width: 1.2em;
  height: 1.2em;
}

.md-mention {
  padding: 0 0.2rem;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent-500) 18%, transparent);
  color: var(--accent-200);
}

.md a {
  color: var(--accent-300);
  text-decoration: underline;
}

.md-clamp {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.md-clamp p,
.md-clamp ul,
.md-clamp blockquote {
  display: inline;
  margin: 0 0.3rem 0 0;
}

.md-clamp .md-sub,
.md-clamp pre {
  display: none;
}

.note-files {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0.6rem 0 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.note-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.75rem;
}

.toast-info .icon {
  color: var(--accent-400);
}

.notes-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.notes-list {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.note-card {
  position: relative;
  padding: 1rem 1.1rem 1rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  animation: row-in 240ms var(--ease-out) both;
  animation-delay: calc(min(var(--i, 0), 10) * var(--stagger));
}

.note-card.is-unread {
  border-color: color-mix(in srgb, var(--accent-500) 45%, var(--border));
}

.note-card .unread-dot {
  top: 1.35rem;
  left: 0.6rem;
}

.note-card:target {
  outline: 2px solid var(--accent-500);
  outline-offset: 2px;
}

.note-card-delete {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
}

.note-card .note-meta {
  padding-right: 2.5rem;
}

.note-card.is-removing {
  animation: note-out 180ms var(--ease-in) forwards;
}

@keyframes note-out {
  to { opacity: 0; transform: translateX(12px); }
}

@media (prefers-reduced-motion: reduce) {
  .note-pop,
  .note-pop.is-leaving,
  .note-pop-list li,
  .note-card,
  .bell.is-pulsing .icon,
  .bell.is-pulsing .bell-count {
    animation-duration: 1ms;
    animation-delay: 0ms;
  }
}

.md-clamp .md-h {
  font-size: inherit;
}

:root[data-motion="reduce"] *,
:root[data-motion="reduce"] *::before,
:root[data-motion="reduce"] *::after {
  animation-duration: 1ms !important;
  animation-delay: 0ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 1ms !important;
  transition-delay: 0ms !important;
  scroll-behavior: auto !important;
}

:root[data-underline-links] a:not(.button):not(.icon-button):not(.wordmark):not(.rail-link):not(.nav-link):not(.note-pop-item):not(.server-switch) {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

:root[data-underline-links] .nav-link,
:root[data-underline-links] .rail-link {
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1px;
}

.site-nav-inner {
  position: relative;
}

.site-nav-links {
  position: relative;
  margin-left: auto;
}

.nav-pill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: var(--radius-sm);
  background: var(--surface);
  opacity: 0;
  pointer-events: none;
  transition:
    transform var(--dur-slow) var(--ease-in-out),
    width var(--dur-slow) var(--ease-in-out),
    opacity var(--dur-fast) var(--ease-out);
}

.site-nav-links .nav-link {
  position: relative;
  z-index: 1;
}

.site-nav-links .nav-link:hover,
.site-nav-links .nav-link[aria-current="page"] {
  background: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-account-slot {
  display: contents;
}

.nav-account-placeholder {
  width: 6.5rem;
  height: 2.15rem;
}

.nav-account {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 14rem;
  min-height: 2.5rem;
  padding: 0.25rem 0.55rem 0.25rem 0.3rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-press) var(--ease-out);
}

.nav-account:hover,
.nav-account[aria-expanded="true"] {
  background: var(--surface-elevated);
}

.nav-account:active,
.nav-menu-button:active,
.icon-button:active {
  transform: scale(var(--press-scale));
}

.nav-account .avatar {
  width: 1.85rem;
  height: 1.85rem;
}

.nav-account-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-chevron {
  width: 1rem;
  height: 1rem;
  color: var(--text-muted);
  transform: rotate(-90deg);
  transition: transform var(--dur-base) var(--ease-out);
}

.nav-account[aria-expanded="true"] .nav-chevron {
  transform: rotate(90deg);
}

.avatar-fallback {
  display: inline-grid;
  place-items: center;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
}

.nav-menu-button {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
}

.swap-icon {
  position: relative;
  display: inline-grid;
  width: 1.25rem;
  height: 1.25rem;
}

.swap-icon .icon {
  grid-area: 1 / 1;
  width: 100%;
  height: 100%;
  transition: opacity var(--dur-base) var(--ease-out), filter var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}

.swap-icon[data-state="menu"] .swap-b,
.swap-icon[data-state="close"] .swap-a {
  opacity: 0;
  filter: blur(3px);
  transform: scale(0.8);
}

.menu-pop {
  position: fixed;
  z-index: 80;
  display: flex;
  flex-direction: column;
  min-width: 13rem;
  padding: 0.35rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  box-shadow: 0 18px 44px rgb(0 0 0 / 0.45);
  animation: pop-in 180ms var(--ease-out);
}

.menu-pop.is-leaving {
  animation: pop-out 145ms var(--ease-in) forwards;
  pointer-events: none;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.5rem;
  padding: 0.5rem 0.7rem;
  border: 0;
  border-radius: calc(var(--radius-md) - 0.35rem);
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: var(--text-sm);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu-item span:first-of-type {
  flex: 1;
}

.menu-item:hover,
.menu-item:focus-visible {
  outline: none;
  background: var(--surface);
  color: var(--text-primary);
}

.menu-item:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent-500);
}

.menu-count {
  min-width: 1.4rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--danger-500);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.menu-sep {
  height: 1px;
  margin: 0.3rem 0.4rem;
  background: var(--divider);
}

.nav-sheet {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  max-height: calc(100svh - 4rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-bottom: 1px solid var(--divider);
  background: var(--bg-secondary);
  box-shadow: 0 24px 40px rgb(0 0 0 / 0.45);
  animation: sheet-in 220ms var(--ease-out);
}

.nav-sheet.is-leaving {
  animation: sheet-out 175ms var(--ease-in) forwards;
}

@keyframes sheet-in {
  from { opacity: 0; clip-path: inset(0 0 100% 0); }
  to { opacity: 1; clip-path: inset(0 0 0 0); }
}

@keyframes sheet-out {
  to { opacity: 0; clip-path: inset(0 0 100% 0); }
}

.nav-sheet-inner {
  display: grid;
  gap: 0.75rem;
  padding: 0.75rem var(--gutter) 1.25rem;
}

.nav-sheet-list {
  display: grid;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-sheet-list li {
  animation: row-in 240ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * var(--stagger));
}

.nav-sheet-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-height: 3rem;
  padding: 0.6rem 0.75rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-primary);
  font: inherit;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.nav-sheet-link:hover,
.nav-sheet-link[aria-current="page"] {
  background: var(--surface);
}

.nav-sheet-link .icon {
  color: var(--text-muted);
}

.nav-sheet-account {
  padding-top: 0.75rem;
  border-top: 1px solid var(--divider);
}

.nav-sheet-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.25rem 0.75rem 0.6rem;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.nav-sheet-login {
  justify-content: center;
}

@media (max-width: 720px) {
  .site-nav-links,
  .nav-account,
  .nav-login {
    display: none;
  }

  .nav-menu-button {
    display: inline-grid;
  }

  .nav-account-placeholder {
    width: 2.15rem;
  }

  .site-nav-inner .wordmark {
    margin-right: auto;
  }

  .bell {
    width: 2.75rem;
    height: 2.75rem;
  }
}

:root.sheet-open body {
  overflow: hidden;
}

.settings-body {
  display: grid;
  gap: 0;
}

.settings-body > * + * {
  padding-top: 1.1rem;
  margin-top: 1.1rem;
  border-top: 1px solid var(--divider);
}

.setting-fieldset {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.setting-title {
  padding: 0;
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.choice-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}

.choice:hover {
  background: var(--surface);
}

.choice:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent-500) 60%, var(--border));
  background: color-mix(in srgb, var(--accent-500) 8%, transparent);
}

.choice:has(input:focus-visible) {
  outline: 2px solid var(--accent-500);
  outline-offset: 2px;
}

.choice input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0.15rem 0 0;
  flex-shrink: 0;
  accent-color: var(--accent-500);
}

.choice-text {
  display: grid;
  gap: 0.15rem;
}

.choice-label {
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.setting-text {
  display: grid;
  gap: 0.2rem;
}

.settings-sync {
  margin: 0;
}

.settings-card + .settings-card {
  margin-top: 1.25rem;
}

.rail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.rail-collapse .icon {
  transition: transform var(--dur-slow) var(--ease-in-out);
}

.rail-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 901px) {
  .app {
    transition: grid-template-columns var(--dur-slow) var(--ease-in-out);
  }

  :root[data-rail-collapsed] .app {
    --rail-width: 4.75rem;
  }

  :root[data-rail-collapsed] .rail {
    align-items: center;
    padding-inline: 0.6rem;
    overflow-x: hidden;
  }

  :root[data-rail-collapsed] .rail-top {
    flex-direction: column;
  }

  :root[data-rail-collapsed] .rail .wordmark span,
  :root[data-rail-collapsed] .rail-text,
  :root[data-rail-collapsed] .rail-label,
  :root[data-rail-collapsed] .rail-user,
  :root[data-rail-collapsed] .server-switch > span,
  :root[data-rail-collapsed] .server-switch > .icon,
  :root[data-rail-collapsed] .rail-link .badge {
    display: none;
  }

  :root[data-rail-collapsed] .rail .wordmark {
    padding: 0;
  }

  :root[data-rail-collapsed] .rail-collapse .icon {
    transform: rotate(180deg);
  }

  :root[data-rail-collapsed] .server-switch {
    justify-content: center;
    width: auto;
    padding: 0.35rem;
  }

  :root[data-rail-collapsed] .rail-nav {
    align-items: center;
  }

  :root[data-rail-collapsed] .rail-link {
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
  }

  :root[data-rail-collapsed] .rail-foot {
    flex-direction: column;
    align-self: stretch;
    margin-inline: -0.6rem;
    padding-inline: 0;
  }
}

@media (max-width: 900px) {
  .rail-collapse {
    display: none;
  }
}

.field-error {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--danger-300);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

.field-error::before {
  content: "!";
  display: inline-grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--danger-500);
  color: #fff;
  font-size: 0.65rem;
}

[aria-invalid="true"] {
  border-color: var(--danger-500) !important;
}

.alert-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  border-color: color-mix(in srgb, var(--warning-500) 45%, var(--border));
  background: color-mix(in srgb, var(--warning-500) 10%, var(--bg-secondary));
  color: var(--warning-100);
}

.alert-warning .icon {
  flex-shrink: 0;
  color: var(--warning-500);
}

.plain-list {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.turnstile-box {
  min-height: 65px;
}

.page-banner {
  max-width: var(--content-width, 72rem);
  margin: 0 auto 1.25rem;
}

.logo-img {
  width: 1em;
  height: 1em;
  border-radius: 22%;
  object-fit: contain;
}

.site-banner {
  border-bottom: 1px solid var(--divider);
  background: color-mix(in srgb, var(--accent-500) 12%, var(--bg-secondary));
  color: var(--text-primary);
  font-size: var(--text-sm);
  animation: banner-in 220ms var(--ease-out);
}

.site-banner-warning {
  background: color-mix(in srgb, var(--warning-500) 14%, var(--bg-secondary));
}

.site-banner-inner {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0.4rem var(--gutter);
}

.site-banner-inner > .icon {
  flex-shrink: 0;
  color: var(--accent-300);
}

.site-banner-warning .site-banner-inner > .icon {
  color: var(--warning-500);
}

.site-banner p {
  flex: 1;
  margin: 0;
  overflow-wrap: anywhere;
}

.site-banner a {
  color: inherit;
  font-weight: var(--weight-semibold);
  text-decoration: underline;
}

.site-banner .icon-button {
  width: 2.75rem;
  height: 2.75rem;
}

.site-banner.is-leaving {
  animation: banner-out var(--dur-exit-base) var(--ease-in) forwards;
}

@keyframes banner-in {
  from { opacity: 0; clip-path: inset(0 0 100% 0); }
  to { opacity: 1; clip-path: inset(0 0 0 0); }
}

@keyframes banner-out {
  to { opacity: 0; clip-path: inset(0 0 100% 0); }
}

.maintenance-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.45rem var(--gutter);
  background: var(--warning-500);
  color: #1a1204;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.maintenance-bar a {
  color: inherit;
  text-decoration: underline;
}

.maintenance {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 100svh;
  text-align: center;
}

.maintenance-logo {
  border-radius: 22%;
  object-fit: contain;
}

.logo-setting {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1.25rem;
}

.logo-preview {
  flex-shrink: 0;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  object-fit: contain;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}

.check-row input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--accent-500);
}

.heatmap-toolbar {
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}

.heatmap-page {
  flex: 1 1 16rem;
  min-width: 0;
}

.heatmap-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin: 1rem 0 0.75rem;
}

.heat-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.heat-legend-bar {
  width: 7rem;
  height: 0.5rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #184f95, #3987e5, #86b6ef, #cde2fb);
}

.heatmap-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
}

.heatmap-scaler {
  transform-origin: 0 0;
}

.heatmap-scaler iframe {
  display: block;
  border: 0;
  background: var(--bg-primary);
}

.heatmap-loading {
  position: absolute;
  inset: 0;
  padding: 1.25rem;
  background: var(--bg-tertiary);
}

.section-label {
  margin: 2rem 0 0.85rem;
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 0 0 1rem;
  padding: 0;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  list-style: none;
}

.chart-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 3px;
}

.chart [data-bar].is-hover path {
  filter: brightness(1.18);
}

.chart-tip {
  position: absolute;
  z-index: 5;
  display: grid;
  gap: 0.25rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.35);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  white-space: nowrap;
  pointer-events: none;
}

.chart-tip-title {
  color: var(--text-muted);
  font-weight: var(--weight-medium);
}

.chart-tip-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.chart-tip-row strong {
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.chart-tip-key {
  width: 0.75rem;
  height: 2px;
  border-radius: 2px;
}

.health-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.health-strip .metric:nth-child(4) {
  border-left: 0;
}

.health-strip .metric:nth-child(n + 4) {
  border-top: 1px solid var(--border);
}

@media (max-width: 860px) {
  .health-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .health-strip .metric:nth-child(4),
  .health-strip .metric:nth-child(6) {
    border-left: 1px solid var(--border);
  }

  .health-strip .metric:nth-child(3),
  .health-strip .metric:nth-child(5) {
    border-left: 0;
  }

  .health-strip .metric:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }
}

.terminal-card {
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.terminal-bar .grow-field {
  flex: 1 1 12rem;
  min-width: 0;
  width: auto;
}

.link-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-right: auto;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.link-status .status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--text-muted);
}

.link-status[data-online='true'] .status-dot {
  background: var(--success-500);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success-500) 25%, transparent);
}

.link-status[data-online='false'] .status-dot {
  background: var(--danger-500);
}

.terminal {
  height: min(60vh, 34rem);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0.75rem 0;
  background: color-mix(in srgb, var(--bg-primary) 70%, black);
  font-family: ui-monospace, 'Cascadia Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.55;
}

.terminal:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.log-line {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.1rem 1rem;
}

.log-line:hover {
  background: color-mix(in srgb, var(--text-primary) 4%, transparent);
}

.log-line time {
  color: var(--text-muted);
}

.log-type {
  min-width: 4.5rem;
  font-weight: var(--weight-semibold);
}

.log-error .log-type {
  color: var(--danger-300);
}

.log-success .log-type {
  color: var(--success-300);
}

.log-info .log-type {
  color: var(--warning-300);
}

.log-text {
  color: var(--text-primary);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.log-where {
  display: block;
  color: var(--text-muted);
}

.log-empty {
  margin: 0;
  padding: 1rem;
  color: var(--text-muted);
  font-family: var(--font-primary);
}

.terminal-foot {
  margin: 0;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--border);
}

.terminal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

@media (max-width: 600px) {
  .log-line {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.15rem 0.6rem;
  }

  .log-text {
    grid-column: 1 / -1;
  }

  .terminal-actions .button {
    width: 100%;
  }
}

.chart-card .card-head .button {
  flex-shrink: 0;
  white-space: nowrap;
}

.chart-table {
  max-height: 22rem;
  overflow: auto;
}

.grid-2:has(> .chart-card) {
  align-items: start;
}

.grow-field {
  --grow: 1.025;
}

:root {
  --scrollbar-thumb: color-mix(in srgb, var(--text-muted) 35%, transparent);
  --scrollbar-thumb-hover: color-mix(in srgb, var(--text-muted) 60%, transparent);
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

* {
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: var(--scrollbar-thumb) padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover) padding-box;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

.rail,
.nav-sheet,
.note-pop-list,
.picker-options,
.legal-toc {
  scrollbar-width: none;
}

.rail::-webkit-scrollbar,
.nav-sheet::-webkit-scrollbar,
.note-pop-list::-webkit-scrollbar,
.picker-options::-webkit-scrollbar,
.legal-toc::-webkit-scrollbar {
  display: none;
}

.select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.select-trigger {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.65rem 2.4rem 0.65rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 0.625rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: var(--text-sm);
  text-align: left;
  cursor: pointer;
  transition:
    border-color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    transform var(--dur-press) var(--ease-out);
}

.select-trigger:hover:not(:disabled) {
  border-color: var(--border-strong);
}

.select-trigger:active:not(:disabled) {
  transform: scale(var(--press-scale));
}

.select-trigger:focus-visible,
.select-trigger.is-open {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus-ring) 20%, transparent);
}

.select-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.select-value {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.select-chevron {
  position: absolute;
  right: 0.95rem;
  top: 50%;
  width: 0.45rem;
  height: 0.45rem;
  margin-top: -0.3rem;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform var(--dur-base) var(--ease-out), margin-top var(--dur-base) var(--ease-out);
}

.select-trigger.is-open .select-chevron {
  margin-top: -0.05rem;
  transform: rotate(225deg);
}

.toolbar .select-trigger {
  width: auto;
  min-width: 11rem;
}

.select-pop {
  position: fixed;
  z-index: 1000;
  display: flex;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  box-shadow: 0 18px 40px rgb(0 0 0 / 0.45);
  animation: pop-in var(--dur-base) var(--ease-out);
}

.select-pop.is-leaving {
  animation: pop-out var(--dur-exit-base) var(--ease-in) forwards;
  pointer-events: none;
}

.select-list {
  flex: 1;
  margin: 0;
  padding: 0.3rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  outline: none;
  scrollbar-width: none;
}

.select-list::-webkit-scrollbar {
  display: none;
}

.select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-height: 2.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.select-option.is-active {
  background: var(--surface);
  color: var(--text-primary);
}

.select-option[aria-selected='true'] {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.select-option[aria-selected='true'] .icon {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  color: var(--accent);
}

.select-option[aria-disabled='true'] {
  opacity: 0.5;
  cursor: not-allowed;
}

.select-option-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.select-group {
  padding: 0.55rem 0.65rem 0.25rem;
  color: var(--text-disabled);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

.select-list:focus-visible .select-option.is-active {
  box-shadow: inset 0 0 0 1px var(--focus-ring);
}

[aria-invalid='true'].select-trigger {
  border-color: var(--danger-500);
}

.picker[open] > .picker-menu {
  transform-origin: 50% 0;
  animation: pop-in var(--dur-base) var(--ease-out);
}

.picker.is-closing > .picker-menu {
  animation: pop-out var(--dur-exit-base) var(--ease-in) forwards;
  pointer-events: none;
}

.picker > summary::after {
  transition: transform var(--dur-base) var(--ease-out), top var(--dur-base) var(--ease-out);
}

.picker[open]:not(.is-closing) > summary::after {
  top: 1.35rem;
  transform: rotate(225deg);
}

.member-results {
  transition: opacity var(--dur-fast) var(--ease-out);
}

.member-results.is-busy {
  opacity: 0.6;
}

.member-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  margin: 0;
  padding: 1rem 1.5rem 0.35rem;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.member-note-pro {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-muted);
}

.member-note-pro .icon {
  width: 0.9rem;
  height: 0.9rem;
  color: #ffc861;
}

.tooltip {
  position: fixed;
  z-index: 1100;
  max-width: min(18rem, calc(100vw - 16px));
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm, 8px);
  background: var(--bg-tertiary);
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.35);
  color: var(--text-primary);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium, 500);
  line-height: 1.45;
  overflow-wrap: anywhere;
  pointer-events: none;
  animation: pop-in var(--dur-fast) var(--ease-out);
}

.tooltip.is-leaving {
  animation: pop-out var(--dur-exit-fast) var(--ease-in) forwards;
}

[data-tip] {
  cursor: default;
}

a[data-tip],
button[data-tip],
summary[data-tip],
label[data-tip],
[role='button'][data-tip] {
  cursor: pointer;
}

button[data-tip]:disabled {
  cursor: not-allowed;
}
