.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 0;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 150ms ease, background-color 150ms ease;
}

.nav-link.active {
  color: var(--ink);
  background: var(--hover);
}
@media (hover: hover) and (pointer: fine) {
  .nav-link:hover {
    color: var(--ink);
    background: var(--hover);
  }
}

.account-button {
  display: inline-flex;
  width: 36px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0.8px solid var(--line);
  border-radius: 0;
  color: var(--ink-soft);
  background: var(--card);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.account-button-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.account-button span {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .account-button:hover {
    background: var(--hover);
  }
}

.account-button[hidden] {
  display: none;
}

.lang-toggle {
  display: inline-flex;
  width: 36px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0.8px solid var(--line);
  border-radius: 0;
  color: var(--ink-soft);
  background: var(--card);
  cursor: pointer;
}

.lang-toggle {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

@media (hover: hover) and (pointer: fine) {
  .lang-toggle:hover {
    background: var(--hover);
  }
}

.lang-toggle-code {
  line-height: 1;
}

.lang-toggle-label {
  display: none;
}

.scroll-top-button {
  position: fixed;
  right: 24px;
  bottom: calc(48px + env(safe-area-inset-bottom, 0px));
  z-index: 45;
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0.8px solid var(--line);
  border-radius: 0;
  color: var(--ink-soft);
  background: var(--overlay);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px) scale(0.92);
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    visibility 0s linear 180ms,
    background-color 150ms ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.scroll-top-button.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    visibility 0s,
    background-color 150ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .scroll-top-button:hover {
    color: var(--ink);
    background: var(--hover);
  }
}

.scroll-top-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.permission-page.active {
  display: grid;
  min-height: 58vh;
  place-items: center;
}

.permission-content {
  width: min(100%, 680px);
  padding: 48px 24px 56px;
  text-align: center;
}

.permission-copy {
  min-width: 0;
}

.permission-copy .eyebrow {
  margin-bottom: 10px;
}

.permission-copy h1 {
  margin: 0 0 10px;
}

.permission-login {
  width: 100%;
  margin: 28px 0 0;
  padding: 22px 22px 20px;
  border: 0.8px solid var(--line);
  border-radius: 0;
  background: var(--card);
}

.permission-login h2 {
  margin: 0 0 18px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.permission-login .auth-form {
  gap: 14px;
}

.permission-login .auth-form label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
}

.permission-login .auth-form input {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 400;
}

.permission-login .auth-primary,
.permission-login .auth-secondary {
  min-height: 40px;
  margin-top: 4px;
  font-size: 14px;
}

.permission-login .auth-backup-label {
  margin-top: 8px;
}

.permission-mascot {
  display: block;
  width: min(100%, 280px);
  max-height: 360px;
  justify-self: center;
  object-fit: contain;
}

@media (max-width: 720px) {
  .permission-content {
    grid-template-columns: minmax(0, 380px);
    justify-content: center;
    gap: 12px;
    text-align: center;
  }

  .permission-mascot {
    width: min(42vw, 160px);
    max-height: 200px;
  }

  .permission-login {
    text-align: left;
  }
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 0.8px solid var(--line);
}

.overview-card {
  display: block;
  min-width: 0;
  padding: 20px 18px 22px;
  border-right: 0.8px solid var(--line);
  border-bottom: 0.8px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: background 120ms ease;
}

.overview-card:first-child {
  border-left: 0.8px solid var(--line);
}

@media (hover: hover) and (pointer: fine) {
  .overview-card:hover {
    background: var(--card);
  }
}

.overview-icon {
  margin-bottom: 20px;
  font-size: 20px;
}

.overview-card h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.overview-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.arrow-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--focus);
  font-size: 14px;
  font-weight: 600;
}

.tracking-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 30px;
  padding: 20px;
  border: 0.8px solid var(--line);
  background: var(--card);
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .tracking-cta:hover {
    background: var(--surface-subtle);
  }
}

.tracking-cta strong {
  display: block;
  margin-bottom: 5px;
}

.tracking-cta span {
  color: var(--muted);
  font-size: 14px;
}

.page-meta {
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
}

.strategy-intro {
  padding-bottom: 28px;
}

.strategy-intro h1 {
  font-size: clamp(32px, 5vw, 46px);
}

.strategy-intro p {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.65;
}

.link-list,
.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 0.8px solid var(--line);
}

.status-grid {
  margin-top: 28px;
}

.group-link,
.status-item {
  padding: 16px;
  border-right: 0.8px solid var(--line);
  border-bottom: 0.8px solid var(--line);
}

.group-link {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.group-link:nth-child(odd),
.status-item:nth-child(odd) {
  border-left: 0.8px solid var(--line);
}

@media (hover: hover) and (pointer: fine) {
  .group-link:hover {
    background: var(--card);
  }
}

.status-item {
  padding: 18px 16px;
}

.status-label {
  margin-bottom: 6px;
  font-weight: 650;
}

.status-value {
  color: var(--muted);
  font-size: 14px;
}

.notice {
  margin-top: 28px;
  padding: 16px;
  border-left: 3px solid var(--dm-line-strong, #9b9a97);
  background: var(--hover);
  color: var(--muted);
  line-height: 1.55;
}

.card {
  padding: 18px;
  border: 0.8px solid var(--line);
  border-radius: 0;
  background: var(--card);
}

button.small {
  padding: 8px 10px;
  border: 0.8px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: var(--card);
  cursor: pointer;
  font-weight: 600;
}

.doc-toc {
  position: sticky;
  top: var(--topbar-height, 64px);
  z-index: 4;
  display: flex;
  align-items: center;
  width: 320px;
  height: calc(100vh - var(--topbar-height, 64px));
  max-height: calc(100vh - var(--topbar-height, 64px));
  margin-left: 20px;
  /* Promote to its own compositor layer so the sticky element tracks
     sub-pixel trackpad scrolling without jittering. */
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
}

.doc-toc-card {
  width: 100%;
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 16px 14px 12px;
  border: 0.8px solid var(--line);
  border-radius: 0;
  background: var(--card);
  overscroll-behavior: contain;
}

.doc-toc-heading {
  margin: 0 0 12px;
  padding: 0 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.doc-toc-list,
.doc-toc-children {
  margin: 0;
  padding: 0;
  list-style: none;
}

.doc-toc-item {
  margin: 0 0 2px;
}

.doc-toc-item + .doc-toc-item {
  margin-top: 8px;
}

.doc-toc-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 2px;
}

.doc-toc-toggle,
.doc-toc-toggle-spacer {
  display: flex;
  width: 18px;
  height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.doc-toc-toggle {
  cursor: pointer;
}

.doc-toc-toggle::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 140ms ease;
}

.doc-toc-item.is-expanded > .doc-toc-row .doc-toc-toggle::before {
  transform: translateY(-1px) rotate(45deg);
}

.doc-toc-link {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .doc-toc-link:hover {
    background: var(--hover);
  }
}

.doc-toc-link.is-active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.doc-toc-num {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.doc-toc-text {
  min-width: 0;
  white-space: nowrap;
}

.doc-toc-children {
  display: none;
  padding: 4px 0 6px 20px;
}

.doc-toc-item.is-expanded > .doc-toc-children {
  display: block;
}

.doc-toc-link-sub {
  color: var(--muted);
  font-weight: 400;
}

.doc-toc-link-sub.is-active {
  color: var(--accent);
}

@media (max-width: 1020px) {
  .doc-toc {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    margin-left: 0;
    transform: none;
    will-change: auto;
  }

  .doc-toc-card {
    max-height: 380px;
  }
}

.chart-crosshair {
  position: absolute;
  z-index: 1;
  width: 1px;
  background: var(--chart-crosshair);
  pointer-events: none;
  transform: translateX(-50%);
}
