/* Compass — Shell + shared component styles */

/* Topbar */
.cmp-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--hairline);
}
.cmp-topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 32px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
}
.cmp-brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit;
}
.cmp-logo-image {
  display: block;
  width: auto;
  height: 28px;
  object-fit: contain;
}
.cmp-brand-text { display: flex; flex-direction: column; line-height: 1; gap: 3px; }
.cmp-brand-name {
  font-size: var(--h5-size);
  line-height: var(--h5-line);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.cmp-brand-sub {
  font-size: var(--overline-size);
  line-height: var(--overline-line);
  font-weight: var(--overline-weight);
  letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-mute);
}

.cmp-nav {
  display: flex; align-items: center; gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  justify-self: center;
}
.cmp-nav-item {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: var(--title-2-size);
  line-height: var(--title-2-line);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink-mute);
  text-decoration: none;
  transition: all 120ms ease;
}
.cmp-nav-item:hover { color: var(--ink); }
.cmp-nav-item.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.cmp-topbar-right { display: flex; align-items: center; gap: 12px; }
.cmp-cmd {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px 7px 14px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--ink-mute);
  font-size: 12px;
  min-width: 280px;
  transition: all 120ms ease;
}
.cmp-cmd:hover { background: var(--surface); border-color: var(--hairline-strong); color: var(--ink-soft); }
.cmp-cmd kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--ink-mute);
}

.cmp-avatar {
  position: relative;
  width: 32px; height: 32px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.cmp-avatar-dot {
  position: absolute; bottom: -1px; right: -1px;
  width: 9px; height: 9px;
  background: var(--pos);
  border: 2px solid var(--paper);
  border-radius: 999px;
}

/* Page layout */
.cmp-page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 36px 32px 96px;
}
.cmp-page-narrow {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 32px 96px;
}

/* Page header */
.cmp-pagehead {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: end;
  padding-bottom: 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--hairline);
}
.cmp-pagehead-main { display: flex; flex-direction: column; gap: 14px; }
.cmp-pagehead-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(36px, 4vw, var(--h2-size));
  line-height: 1.16;
  letter-spacing: var(--h2-track);
  margin: 0;
  color: var(--ink);
}
.cmp-pagehead-sub {
  font-size: var(--body-sm-size);
  line-height: var(--body-sm-line);
  color: var(--ink-soft);
  max-width: 64ch;
  line-height: 1.5;
  margin: 0;
}
.cmp-pagehead-aside { display: flex; flex-direction: column; gap: 16px; align-items: flex-end; }
.cmp-pagehead-meta {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
}
.cmp-pagehead-actions { display: flex; gap: 8px; }

/* Section */
.cmp-section { margin-top: 56px; }
.cmp-section-head {
  display: flex; justify-content: space-between; align-items: end;
  margin-bottom: 20px;
  gap: 24px;
}
.cmp-section-title {
  font-size: var(--h4-size);
  line-height: var(--h4-line);
  font-weight: var(--h4-weight);
  letter-spacing: 0;
  margin: 0;
  color: var(--ink);
}
.cmp-section-sub {
  font-size: var(--body-xs-size);
  line-height: var(--body-xs-line);
  color: var(--ink-mute);
  margin: 4px 0 0;
}

/* Stat */
.cmp-stat {
  display: flex; flex-direction: column; gap: 8px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
}
.cmp-stat-value {
  font-size: var(--h2-size);
  line-height: var(--h2-line);
  color: var(--ink);
  letter-spacing: var(--h2-track);
  font-weight: var(--h2-weight);
}
.cmp-stat-big .cmp-stat-value { font-size: var(--h1-size); line-height: var(--h1-line); letter-spacing: var(--h1-track); }
.cmp-stat-sub {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--body-xs-size);
  line-height: var(--body-xs-line);
  color: var(--ink-mute);
}

@media (max-width: 980px) {
  .cmp-topbar-inner {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px 16px;
  }
  .cmp-nav {
    justify-self: stretch;
    overflow-x: auto;
    white-space: nowrap;
    padding: 4px;
  }
  .cmp-topbar-right {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }
  .cmp-cmd {
    min-width: 0;
    flex: 1 1 220px;
  }
  .cmp-page, .cmp-page-narrow {
    padding: 20px 16px 72px;
  }
  .cmp-pagehead {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 16px;
    padding-bottom: 20px;
    margin-bottom: 20px;
  }
  .cmp-pagehead-aside {
    align-items: flex-start;
  }
  .cmp-pagehead-meta, .cmp-pagehead-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .cmp-topbar-inner {
    padding: 10px 14px;
    gap: 8px;
  }
  .cmp-cmd {
    display: none;
  }
  .cmp-nav-item {
    padding: 10px 14px;
    font-size: 12px;
    line-height: 16px;
  }
  .cmp-brand-sub {
    display: none;
  }
  .cmp-page, .cmp-page-narrow {
    padding: 16px 14px 80px;
  }
  .cmp-pagehead-title {
    font-size: clamp(28px, 9vw, 36px);
    line-height: 1.14;
  }
  .cmp-section {
    margin-top: 28px;
  }
  .cmp-section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .cmp-stat { padding: 18px; }
  .cmp-stat-value { font-size: var(--h3-size); line-height: var(--h3-line); }
}

/* Range bar */
.cmp-range {
  position: relative; width: 100%;
  padding: 8px 0;
}
.cmp-range-track {
  position: relative;
  height: 6px;
  background: var(--surface-3);
  border-radius: 999px;
}
.cmp-range-fill {
  position: absolute;
  top: 0; bottom: 0;
  border-radius: 999px;
  background: var(--ink);
  opacity: 0.85;
}
.cmp-range-mid {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 12px;
  background: var(--ink);
  border-radius: 1px;
  transform: translateX(-1px);
}
.cmp-range-marker {
  position: absolute;
  top: -7px;
  transform: translateX(-50%);
}
.cmp-range-marker-dot {
  width: 14px; height: 14px;
  border: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 999px;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Pulse dot */
.cmp-pulse { position: relative; display: inline-block; width: 8px; height: 8px; }
.cmp-pulse-core, .cmp-pulse-ring {
  position: absolute; inset: 0;
  border-radius: 999px;
  background: var(--pc, var(--accent));
}
.cmp-pulse-ring { animation: pulse 1.6s ease-out infinite; opacity: 0.6; }
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.6); opacity: 0; }
}

/* Aurora */
.cmp-aurora {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
}
.cmp-aurora-blob {
  position: absolute;
  width: 520px; height: 520px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}
.cmp-aurora-blob.a {
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  top: -240px; right: -180px;
  opacity: 0.22;
}
.cmp-aurora-blob.b {
  background: radial-gradient(circle, #FF7A59 0%, transparent 70%);
  bottom: -220px; left: -160px;
  opacity: 0.16;
}

/* Tip */
.cmp-tip { position: relative; display: inline-block; }
.cmp-tip-label {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all 160ms ease;
  z-index: 100;
}
.cmp-tip:hover .cmp-tip-label { opacity: 1; transform: translateX(-50%) translateY(0); }
