/* ===================================================================
   Orbit Across — application stylesheet
   Builds on Across design system tokens. Adds Orbit-specific motion:
   the orbital ring trace on the active tool rail item.
   =================================================================== */

:root {
  /* App chrome — proxies to design system tokens so dark mode and
     the warm-paper light theme just work. */
  --app-bg:          var(--bg);
  --app-surface:     var(--surface);
  --app-surface-2:   var(--surface-2);
  --app-border:      var(--border);
  --app-border-strong: var(--border-strong);
  --app-text:        var(--text);
  --app-text-muted:  var(--text-muted);
  --app-text-subtle: var(--text-subtle);

  /* Suite chrome accent */
  --app-brand:       var(--brand);

  /* Layout */
  --topbar-h:        56px;

  /* Bind product accent */
  --accent: var(--orbit);
}

/* ============================================================
   RESET
   ============================================================ */
html, body { background: var(--app-bg); color: var(--app-text); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 { color: var(--app-text); }
* { box-sizing: border-box; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ============================================================
   APP SHELL — topbar over workspace
   ============================================================ */
.app {
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "topbar"
    "workspace";
  height: 100vh;
  min-height: 720px;
}

/* ============================================================
   TOP BAR — brand left, tool tabs center, menu right
   ============================================================ */
.topbar {
  grid-area: topbar;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 0 28px;
  border-bottom: 1px solid var(--rule);
  background: var(--app-bg);
}

/* Brand lockup */
.topbar__brand {
  justify-self: start;
  min-width: 0;
  display: flex; align-items: center; gap: 10px;
  height: 100%;
  background: transparent; border: 0;
  padding: 0; margin: 0;
  cursor: pointer;
  color: var(--app-text);
  font: inherit;
  text-decoration: none;
}
.topbar__mark {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  flex-shrink: 0;
  color: var(--orbit);
}
.topbar__brand-name {
  font-size: 14.5px; font-weight: 700;
  letter-spacing: -0.015em;
}

/* Tab strip */
.topbar__tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  justify-self: center;
  height: 100%;
}

.tab {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  height: 100%;
  padding: 0 10px;
  background: transparent;
  border: 0;
  color: var(--app-text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--fast) var(--ease);
}
.tab:hover { color: var(--app-text); }

.tab__icon {
  display: grid; place-items: center;
  width: 22px; height: 22px;
  position: relative;
  font-size: 16px;
  color: currentColor;
}

.tab__name { white-space: nowrap; }

/* Active state — underline + orbit ring around icon */
.tab.is-active { color: var(--app-text); }
.tab.is-active::after {
  content: "";
  position: absolute;
  left: 10px; right: 4px;
  bottom: -1px;
  height: 2px;
  background: var(--orbit);
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
@media (prefers-reduced-motion: no-preference) {
  .tab.is-active::after {
    transform-origin: left center;
    animation: wing-wipe-x var(--wing-duration) var(--wing-easing);
  }
}
/* Inactive tabs — quiet underline on hover */
.tab:not(.is-active)::after {
  content: "";
  position: absolute;
  left: 10px; right: 4px; bottom: -1px; height: 2px;
  background: color-mix(in oklab, var(--app-text) 22%, transparent);
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  transform: scaleX(0); transform-origin: left center;
  transition: transform var(--med) var(--wing-easing);
  pointer-events: none;
}
.tab:not(.is-active):hover::after { transform: scaleX(1); }

/* Orbit ring around active tab icon */
.tab.is-active .tab__icon::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.25px solid color-mix(in oklab, var(--orbit) 42%, transparent);
  pointer-events: none;
}
.tab.is-active .tab__icon::after {
  content: "";
  position: absolute;
  width: 4px; height: 4px;
  background: var(--orbit);
  border-radius: 50%;
  top: -4px; left: 50%;
  margin-left: -2px;
  pointer-events: none;
}

/* ============================================================
   WORKSPACE
   ============================================================ */
.workspace {
  grid-area: workspace;
  overflow: auto;
  background: var(--app-bg);
  position: relative;
}
.workspace__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--workspace-pad, 36px 40px 72px);
  position: relative;
}

/* Tool-switch arrival animation */
@media (prefers-reduced-motion: no-preference) {
  html[data-live] .workspace__inner, html[data-live] .landing__sheet {
    animation: tool-arrival var(--wing-duration) var(--wing-easing) both;
  }
  @keyframes tool-arrival {
    from { opacity: 0; transform: translateY(7px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

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

/* ============================================================
   TOOL HEAD
   ============================================================ */
.tool-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}
.tool-head__title-block { min-width: 0; }
.tool-head__eyebrow {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--orbit);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.tool-head__eyebrow::before {
  content: ""; width: 6px; height: 6px;
  background: var(--orbit);
}
.tool-head__title {
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.025em; margin: 0;
  line-height: 1.1;
}
.tool-head__sub {
  font-size: 14.5px; color: var(--app-text-muted);
  margin: 6px 0 0; max-width: 60ch;
}
.tool-head__sub strong {
  color: var(--app-text); font-weight: 500;
}
.tool-head__actions {
  display: flex; gap: 8px; flex-shrink: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; height: 34px;
  background: var(--app-surface);
  color: var(--app-text);
  border: 1px solid var(--app-border-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
  white-space: nowrap;
  position: relative;
}
.btn:hover {
  border-color: var(--app-border-strong);
  background: color-mix(in oklab, var(--app-text) 2.5%, var(--app-surface));
}
.btn i { font-size: 15px; }

.btn--primary {
  background: var(--orbit); color: #fff;
  border-color: var(--orbit);
}
.btn--primary:hover {
  background: color-mix(in oklab, var(--orbit) 88%, black);
  border-color: color-mix(in oklab, var(--orbit) 88%, black);
}

.btn--ghost {
  background: transparent; border-color: transparent;
  color: var(--app-text-muted);
}
.btn--ghost:hover { background: var(--app-surface-2); color: var(--app-text); }

.btn--sm { height: 28px; padding: 4px 10px; font-size: 12px; }
.btn--icon { width: 32px; padding: 0; justify-content: center; }

/* ============================================================
   PANELS / CARDS
   ============================================================ */
.panel {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--app-border);
}
.panel__title {
  font-size: 13px; font-weight: 600; margin: 0;
  display: flex; align-items: center; gap: 8px;
}
.panel__title-eyebrow {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--app-text-subtle); font-weight: 600;
  margin-right: 10px;
}
.panel__body { padding: 18px; }

/* Utilities */
.eyebrow-mono {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--app-text-subtle); font-weight: 600;
}
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.live-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--orbit);
}

/* ============================================================
   LANDING
   ============================================================ */
.landing {
  min-height: calc(100vh - var(--topbar-h));
  padding: 48px 32px 72px;
  display: flex; flex-direction: column;
  align-items: center;
  position: relative;
  background: var(--app-bg);
}

.landing__sheet {
  position: relative; z-index: 1;
  width: 100%; max-width: 960px;
}

.landing__hero {
  padding: 44px 0 40px;
  border-bottom: 1px solid var(--rule);
}
.landing__kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--orbit);
  margin-bottom: 24px;
}
.landing__kicker::before {
  content: ""; width: 20px; height: 1px; background: var(--orbit);
}

.landing__title {
  font-size: clamp(36px, 4.6vw, 52px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 20px;
  max-width: 18ch;
  color: var(--app-text);
  text-wrap: balance;
}
.landing__title em {
  font-style: italic;
  font-weight: 600;
  color: var(--orbit);
}
.landing__sub {
  font-size: 17.5px;
  font-weight: 400;
  color: var(--app-text);
  max-width: 54ch;
  margin: 0;
  line-height: 1.62;
  text-wrap: pretty;
}

/* Tool grid — ruled table with 1px-gap hairlines */
.landing__tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  width: 100%;
  border-bottom: 1px solid var(--rule);
}

.tool-card {
  position: relative;
  background: var(--app-surface);
  border: 0; border-radius: 0;
  padding: 24px 28px 20px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  display: flex; flex-direction: column;
  gap: 14px;
  min-height: 192px;
  overflow: hidden;
  transition: background var(--med) var(--ease);
}
/* Wing-wipe on hover — leading edge accent */
.tool-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--orbit);
  transform: scaleY(0); transform-origin: bottom;
  transition: transform var(--med) var(--ease);
}
.tool-card:hover {
  background: color-mix(in oklab, var(--orbit) 4%, var(--app-surface));
}
.tool-card:hover::before { transform: scaleY(1); transform-origin: top; }

.tool-card__head {
  display: flex; align-items: center; justify-content: space-between;
}
.tool-card__icon-bare {
  font-size: 20px; color: var(--app-text-muted);
  transition: color var(--med) var(--ease);
}
.tool-card:hover .tool-card__icon-bare { color: var(--orbit); }
.tool-card__index {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .14em; color: var(--app-text-subtle);
}
.tool-card__title {
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.02em; margin: 0;
}
.tool-card__desc {
  font-size: 13.5px;
  color: color-mix(in oklab, var(--app-text) 74%, transparent);
  line-height: 1.55; margin: 0;
}
.tool-card__foot {
  margin-top: auto;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--app-text-subtle);
}
.tool-card__cta {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--app-text);
}
.tool-card__cta i { transition: transform var(--med) var(--ease); }
.tool-card:hover .tool-card__cta i { transform: translateX(3px); }

/* Feature card — wide hero row */
.tool-card--feature {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 24px;
  min-height: 0;
  padding: 22px 28px;
}
.tool-card--feature .tool-card__icon-bare {
  font-size: 28px; color: var(--app-text-muted);
  flex-shrink: 0;
}
.tool-card--feature:hover .tool-card__icon-bare { color: var(--orbit); }
.tool-card__feature-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 5px;
}
.tool-card__feature-main .tool-card__desc { max-width: 52ch; }
.tool-card__feature-side {
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 10px;
  text-align: right;
  font-size: 12px; color: var(--app-text-subtle);
}

/* Sync band */
.landing__sync-band {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px;
  margin-top: 28px;
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.landing__sync-band__icon {
  font-size: 18px; color: var(--app-text-muted);
  flex-shrink: 0;
}
.landing__sync-band__main { flex: 1; min-width: 0; }
.landing__sync-band__title {
  font-weight: 600; color: var(--app-text);
  font-size: 13px;
}
.landing__sync-band__desc {
  color: var(--app-text-muted); font-size: 12.5px;
  margin-top: 2px;
}
.landing__sync-band__actions {
  display: flex; gap: 8px; flex-shrink: 0;
}

/* Footer */
.landing__foot, .tool-footer {
  margin-top: 40px; padding-top: 22px;
  border-top: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
  gap: 20px; flex-wrap: wrap;
  font-size: 12px; color: var(--app-text-subtle);
  font-family: var(--font-mono); letter-spacing: .04em;
}
.landing__foot-sep { width: 1px; height: 12px; background: var(--app-border-strong); }
.landing__foot-link {
  color: var(--app-text-muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--app-border-strong);
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.landing__foot-link:hover { color: var(--app-text); border-bottom-color: var(--app-text-subtle); }
.landing__foot-copy { color: var(--app-text-muted); }
.landing__foot-ver { color: var(--app-text-subtle); }
.landing__foot-made {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--app-text-muted);
  text-decoration: none;
  transition: color var(--fast) var(--ease);
}
.landing__foot-made:hover { color: var(--app-text); }
.landing__foot-flag { display: inline-flex; }

/* Footer flag tooltips — dark-theme contrast fix.
   The Across UI tooltip bubble uses #0B0F14 (obsidian), which disappears
   against the dark footer. Give it a lighter surface + border in dark mode. */
[data-theme="dark"] .landing__foot-flag .across-tip__bubble {
  background: var(--surface-2, #1E2328);
  border: 1px solid var(--app-border, color-mix(in oklab, #fff 12%, transparent));
}

/* Circular-SVG flag token — replaces emoji flags everywhere.
   Square source SVGs, so border-radius:50% just keeps them round;
   inset hairline keeps the disc crisp on any surface. */
.o-flag {
  display: inline-block;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  background: var(--app-surface-2);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--app-text) 12%, transparent);
}

/* Tips button — pill trigger in footer */
.tips-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; border: 1px solid var(--app-border);
  border-radius: 999px; padding: 6px 13px 6px 11px;
  font: inherit; font-size: 12.5px; font-weight: 500;
  color: var(--app-text-muted); cursor: pointer;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.tips-btn:hover {
  color: var(--app-text); border-color: var(--app-text-subtle);
  background: color-mix(in oklab, var(--app-text) 5%, transparent);
}
.tips-btn kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px;
  font-family: var(--font-mono); font-size: 11px; line-height: 1;
  color: var(--app-text-muted);
  background: color-mix(in oklab, var(--app-text) 5%, transparent);
  border: 1px solid var(--app-border);
  border-radius: 4px;
  border-bottom-width: 2px;
}

/* ============================================================
   MENU
   ============================================================ */
.topbar__menu-wrap {
  position: relative;
  justify-self: end;
  display: flex; align-items: center;
  height: 100%;
}

.menu-trigger {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: var(--app-surface);
  color: var(--app-text);
  border: 1px solid var(--app-border-strong);
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.menu-trigger i { font-size: 16px; }
.menu-trigger:hover {
  background: color-mix(in oklab, var(--app-text) 4%, var(--app-surface));
  border-color: var(--app-text-subtle);
}
.menu-trigger.is-open {
  background: color-mix(in oklab, var(--app-text) 6%, var(--app-surface));
  border-color: var(--app-text-subtle);
}

/* Orbit ring flourish */
.menu-trigger__ring {
  position: absolute; inset: -5px;
  border-radius: 50%;
  border: 1px dashed color-mix(in oklab, var(--orbit) 50%, transparent);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity var(--med) var(--ease), transform var(--med) var(--ease);
  pointer-events: none;
}
.menu-trigger.is-open .menu-trigger__ring {
  opacity: 1; transform: scale(1);
}

/* Panel */
.menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  padding: 8px;
  z-index: 50;
  display: none;
}
.menu-panel.is-open {
  display: block;
  animation: menu-panel-in 140ms var(--ease);
  transform-origin: top right;
}
@keyframes menu-panel-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.menu-panel__head {
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--app-border);
  margin-bottom: 6px;
  display: flex; flex-direction: column; gap: 2px;
}
.menu-panel__brand {
  font-size: 13px; font-weight: 700;
  letter-spacing: -0.01em;
}
.menu-panel__caption {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: .04em;
  color: var(--app-text-subtle);
}

.menu-panel__group {
  display: flex; flex-direction: column;
  padding: 4px 0;
  border-bottom: 1px solid var(--app-border);
}
.menu-panel__group--first { padding-top: 4px; }
.menu-panel__group:last-of-type { border-bottom: 0; }

.menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: transparent; border: 0;
  border-radius: var(--radius-sm);
  color: var(--app-text);
  font-size: 13.5px; font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--fast) var(--ease);
  font-family: inherit;
}
.menu-item i { font-size: 16px; color: var(--app-text-muted); flex-shrink: 0; }
.menu-item > span:first-of-type { flex: 1; min-width: 0; }
.menu-item:hover { background: color-mix(in oklab, var(--app-text) 5%, transparent); }
.menu-item:hover i { color: var(--app-text); }

.menu-item__hint {
  display: inline-flex; align-items: center; gap: 3px;
  flex: 0 0 auto !important;
}
.menu-item__hint kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  font-family: var(--font-mono);
  font-size: 11px; line-height: 1;
  color: var(--app-text-muted);
  background: color-mix(in oklab, var(--app-text) 5%, transparent);
  border: 1px solid var(--app-border);
  border-radius: 4px;
}
.menu-item__ext {
  font-size: 13px !important;
  color: var(--app-text-subtle) !important;
  flex: 0 0 auto;
}

.menu-item--quiet {
  color: var(--app-text-muted);
  font-weight: 500;
  padding-left: 12px;
}
.menu-item--quiet:hover { color: var(--app-text); }

/* ── Install button (enhanced UI) ── */
[data-menu-action="install"] i {
  position: relative;
}
.install-badge {
  position: absolute;
  top: -3px;
  right: -4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orbit-base);
  color: var(--orbit-base);
  font-size: 0;
  line-height: 1;
  pointer-events: none;
  animation: orbit-install-pulse 2s ease-in-out infinite;
}
@keyframes orbit-install-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.3); }
}
@media (prefers-reduced-motion: reduce) {
  .install-badge { animation: none; }
}
.install-button--loading {
  opacity: 0.6;
  pointer-events: none;
}
.install-button--loading i {
  animation: orbit-install-spin 1s linear infinite;
}
@keyframes orbit-install-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .install-button--loading i { animation: none; }
}
.install-button--success {
  background: color-mix(in oklab, var(--orbit-base) 10%, transparent);
  color: var(--orbit-base);
}
.install-button--error {
  background: color-mix(in oklab, var(--accent-warm) 10%, transparent);
  color: var(--accent-warm);
}
.install-feedback {
  color: var(--app-text-muted);
  font-size: 12px;
  margin: 0;
  padding: 4px 10px;
}

.menu-panel__foot {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 6px;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: .04em;
  color: var(--app-text-subtle);
}
.menu-panel__foot a {
  color: inherit; text-decoration: none;
  transition: color var(--fast) var(--ease);
}
.menu-panel__foot a:hover { color: var(--app-text); }
.menu-panel__foot-sep {
  width: 1px; height: 10px;
  background: var(--app-border-strong);
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
}
.menu-backdrop.is-open { display: block; }

/* Menu account module — Save & Sync (logged out) */
.menu-acct {
  padding: 13px 13px 14px;
  margin: -8px -8px 6px;
  background: linear-gradient(180deg, var(--orbit-softer), transparent);
  border-bottom: 1px solid var(--app-border);
}
.menu-acct__eyebrow {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--orbit);
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 7px;
}
.menu-acct__eyebrow::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--orbit);
}
.menu-acct__title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.menu-acct__desc {
  font-size: 12px; color: var(--app-text-muted);
  margin: 3px 0 11px; line-height: 1.45;
}
.menu-acct__cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 38px;
  background: var(--orbit); color: #fff;
  border: 0; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background var(--fast) var(--ease);
}
.menu-acct__cta:hover { background: color-mix(in oklab, var(--orbit) 88%, black); }
.menu-acct__cta i { font-size: 16px; }
.menu-acct__alt {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; margin-top: 7px;
  background: transparent; border: 0;
  color: var(--app-text-muted);
  font: inherit; font-size: 12px; font-weight: 500;
  cursor: pointer; padding: 5px;
  border-radius: var(--radius-sm);
  transition: color var(--fast) var(--ease);
}
.menu-acct__alt:hover { color: var(--app-text); }
.menu-acct__alt i { font-size: 14px; }

/* ============================================================
   ABOUT / TEXT PAGE
   ============================================================ */
.about-layout {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 48px;
  align-items: start;
}
.about-nav {
  position: sticky; top: 24px;
  display: flex; flex-direction: column; gap: 2px;
}
.about-nav__item {
  display: block; padding: 6px 10px;
  font-size: 13px; color: var(--app-text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: color var(--fast) var(--ease),
              background var(--fast) var(--ease),
              border-color var(--fast) var(--ease);
}
.about-nav__item:hover {
  color: var(--app-text);
  background: color-mix(in oklab, var(--app-text) 4%, transparent);
}
.about-nav__item.is-active {
  color: var(--orbit); border-left-color: var(--orbit);
  background: var(--orbit-softer); font-weight: 500;
}
.about-prose { max-width: 720px; display: flex; flex-direction: column; gap: 56px; padding-bottom: 80px; }
.about-section { display: flex; flex-direction: column; gap: 18px; }
.about-section h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 4px; padding-bottom: 12px; border-bottom: 1px solid var(--app-border); }
.about-section p { font-size: 15px; line-height: 1.75; color: var(--app-text-muted); margin: 0; text-wrap: pretty; }
.about-section strong { color: var(--app-text); font-weight: 600; }

/* Meta bar — mono version/author/date line */
.about-meta {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--app-text-subtle); margin-bottom: -4px;
}
.about-meta__sep { width: 1px; height: 10px; background: var(--app-border-strong); }

/* Lede — larger intro paragraph */
.about-lede { font-size: 16.5px; line-height: 1.65; color: var(--app-text); margin: 0; text-wrap: pretty; }

/* Pull quote / callout */
.about-callout {
  border-left: 3px solid var(--orbit);
  padding: 14px 20px;
  background: var(--orbit-softer);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 15px; line-height: 1.65;
  color: var(--app-text-muted); font-style: italic;
  margin: 4px 0 0;
}

/* Tools list inside about */
.about-tool-list { border: 1px solid var(--app-border); border-radius: var(--radius); overflow: hidden; }
.about-tool-row {
  display: grid; grid-template-columns: 30px 118px 1fr;
  gap: 14px; align-items: center; padding: 11px 16px;
  border-bottom: 1px solid var(--app-border);
  transition: background var(--fast) var(--ease);
}
.about-tool-row:last-child { border-bottom: none; }
.about-tool-row:hover { background: color-mix(in oklab, var(--app-text) 2.5%, transparent); }
.about-tool-row__icon {
  width: 28px; height: 28px; display: grid; place-items: center;
  background: var(--app-surface-2); border: 1px solid var(--app-border);
  border-radius: 6px; font-size: 14px; color: var(--app-text);
}
.about-tool-row__name { font-size: 13px; font-weight: 600; color: var(--app-text); }
.about-tool-row__desc { font-size: 13.5px; color: var(--app-text-muted); line-height: 1.5; }

/* Footer action links */
.about-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

@media (max-width: 920px) {
  .about-layout { grid-template-columns: 1fr; }
  .about-nav {
    position: static; flex-direction: row; flex-wrap: wrap; gap: 4px;
    padding-bottom: 8px; border-bottom: 1px solid var(--app-border);
  }
  .about-nav__item { border-left: none; border-bottom: 2px solid transparent; padding: 4px 10px; }
  .about-nav__item.is-active { border-bottom-color: var(--orbit); border-left-color: transparent; background: transparent; }
}

/* ---- Text page — simple prose layout (terms, privacy, support, etc.) ---- */
.text-page { max-width: 720px; padding-bottom: 40px; }
.text-page__section { margin-top: 32px; }
.text-page__section h2 {
  font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 10px;
}
.text-page__section h3 {
  font-size: 15px; font-weight: 600; margin: 24px 0 8px;
}
.text-page__section p {
  font-size: 15px; line-height: 1.75; color: var(--app-text-muted); margin: 0 0 14px;
  text-wrap: pretty;
}
.text-page__section strong { color: var(--app-text); font-weight: 600; }
.text-page__section ul {
  padding-left: 20px; margin: 8px 0 14px;
  font-size: 15px; line-height: 1.75; color: var(--app-text-muted);
}
.text-page__section li + li { margin-top: 6px; }
.text-page__section a {
  color: var(--orbit); text-decoration: none;
  border-bottom: 1px dotted var(--orbit);
  transition: border-color var(--fast) var(--ease);
}
.text-page__section a:hover { border-bottom-style: solid; }
.text-page__updated {
  margin-top: 36px; padding-top: 18px;
  border-top: 1px solid var(--app-border);
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .06em; color: var(--app-text-subtle);
}

/* ---- Feature request form ---- */
.orbit-form { margin-top: 24px; display: flex; flex-direction: column; gap: 20px; max-width: 520px; }
.orbit-form__group { display: flex; flex-direction: column; gap: 6px; }
.orbit-form__label {
  font-size: 13px; font-weight: 600; color: var(--app-text);
}
.orbit-form__hint { font-size: 12px; color: var(--app-text-muted); }
.orbit-form__input,
.orbit-form__select,
.orbit-form__textarea {
  width: 100%; padding: 8px 12px;
  background: var(--app-surface); color: var(--app-text);
  border: 1px solid var(--app-border-strong);
  border-radius: var(--radius-sm);
  font: inherit; font-size: 14px; line-height: 1.55;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.orbit-form__input:focus,
.orbit-form__select:focus,
.orbit-form__textarea:focus {
  outline: none;
  border-color: var(--orbit);
  box-shadow: 0 0 0 3px var(--orbit-softer);
}
.orbit-form__textarea { resize: vertical; min-height: 120px; }
.orbit-form__radio-group { display: flex; flex-direction: column; gap: 8px; }
.orbit-form__radio {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--app-text-muted); cursor: pointer;
}
.orbit-form__radio input[type="radio"] { accent-color: var(--orbit); }
.orbit-form__check {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--app-text-muted); cursor: pointer;
}
.orbit-form__check input[type="checkbox"] { accent-color: var(--orbit); }
.orbit-form__actions { display: flex; gap: 8px; margin-top: 4px; }
.orbit-form__status {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.5; display: none;
}
.orbit-form__status--success {
  display: block;
  background: var(--orbit-softer); color: var(--orbit);
  border: 1px solid color-mix(in oklab, var(--orbit) 20%, transparent);
}
.orbit-form__status--error {
  display: block;
  background: color-mix(in oklab, var(--error, #ef4444) 8%, transparent);
  color: var(--error, #ef4444);
  border: 1px solid color-mix(in oklab, var(--error, #ef4444) 20%, transparent);
}

/* ============================================================
   404 VIEW
   ============================================================ */
.orbit-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  text-align: center;
  padding: var(--space-6, 24px);
}
.orbit-404__code {
  font-size: 4rem;
  font-weight: 800;
  color: var(--app-text-subtle);
  font-family: var(--font-mono);
}
.orbit-404__msg {
  color: var(--app-text-muted);
  margin: 8px 0 20px;
}

/* Visually hidden */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border-width: 0;
}

/* ============================================================
   TIPS & SHORTCUTS MODAL
   ============================================================ */
.tips-overlay {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: color-mix(in oklab, var(--app-text) 38%, transparent);
  animation: tips-fade .16s var(--ease);
}
@keyframes tips-fade { from { opacity: 0; } to { opacity: 1; } }

.tips-card {
  position: relative;
  width: 100%; max-width: 540px;
  max-height: calc(100vh - 48px); overflow-y: auto;
  background: var(--app-surface); color: var(--app-text);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 24px 60px -18px color-mix(in oklab, var(--app-text) 55%, transparent);
  padding: 26px 28px 28px;
  animation: tips-rise .2s var(--ease);
}
@keyframes tips-rise {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to   { opacity: 1; transform: none; }
}

.tips-card__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 22px;
}
.tips-card__title {
  font-size: 17px; font-weight: 650; letter-spacing: -0.01em; margin: 0;
  display: flex; align-items: center; gap: 10px;
}
.tips-card__title i { color: var(--orbit); font-size: 20px; }
.tips-card__close {
  flex-shrink: 0; width: 30px; height: 30px;
  display: grid; place-items: center;
  background: transparent; border: 0; border-radius: var(--radius-sm);
  color: var(--app-text-muted); cursor: pointer; font-size: 17px;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.tips-card__close:hover {
  color: var(--app-text);
  background: color-mix(in oklab, var(--app-text) 6%, transparent);
}

.tips-sec + .tips-sec { margin-top: 22px; }
.tips-sec__label {
  display: block;
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--app-text-subtle); margin-bottom: 11px;
}
.tips-shortcuts { display: flex; flex-direction: column; gap: 2px; }
.tips-shortcut {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--app-text);
}
.tips-shortcut:hover { background: color-mix(in oklab, var(--app-text) 4%, transparent); }
.tips-key-combo { display: inline-flex; align-items: center; gap: 4px; }
.tips-key {
  min-width: 22px; height: 22px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
  color: var(--app-text);
  background: color-mix(in oklab, var(--app-text) 6%, transparent);
  border: 1px solid var(--app-border); border-bottom-width: 2px;
  border-radius: 6px;
}

@media (max-width: 540px) {
  .tips-card { padding: 22px 18px; }
}

/* ============================================================
   SIGNATURE MOTION — the wing-wipe
   ============================================================ */
@keyframes wing-wipe-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Button wing-wipe */
.btn::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--orbit);
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  transform: scaleX(0); transform-origin: left center;
  transition: transform var(--wing-duration) var(--wing-easing);
  pointer-events: none;
}
.btn--icon::after, .btn--ghost::after { display: none; }
.btn--primary::after {
  background: color-mix(in oklab, #fff 60%, transparent);
}
.btn:hover::after, .btn:active::after { transform: scaleX(1); }

@media (prefers-reduced-motion: reduce) {
  .btn::after, .tab:not(.is-active)::after { transition: none; }
  .tab.is-active::after { animation: none; }
  .menu-panel { animation: none; }
  .tips-overlay, .tips-card { animation: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 920px) {
  .topbar { gap: 12px; padding: 0 16px; }
  .tab { padding: 0 8px; }
  .tab__name { display: none; }
  .tab.is-active::after { left: 8px; right: 8px; }
  /* Tab tooltips on mobile */
  .tab::before {
    content: attr(data-name);
    position: absolute;
    top: calc(100% - 8px); left: 50%;
    transform: translateX(-50%) translateY(-2px);
    background: var(--obsidian); color: #fff;
    padding: 5px 9px; border-radius: 4px;
    font-size: 11.5px; font-weight: 500; white-space: nowrap;
    opacity: 0; pointer-events: none;
    transition: opacity 120ms ease, transform 120ms ease;
    z-index: 1100;
  }
  .tab:focus-visible::before { opacity: 1; transform: translateX(-50%) translateY(0); }
  @media (hover: hover) {
    .tab:hover::before { opacity: 1; transform: translateX(-50%) translateY(0); }
  }
  .landing__tools { grid-template-columns: 1fr; }
  .tool-card--feature { flex-direction: column; align-items: flex-start; gap: 14px; }
  .tool-card__feature-side { align-items: flex-start; text-align: left; width: 100%; flex-direction: row; justify-content: space-between; }
  .about-layout { grid-template-columns: 1fr; }
  .about-nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--app-border); }
  .about-nav__item { border-left: none; border-bottom: 2px solid transparent; padding: 4px 10px; }
  .about-nav__item.is-active { border-bottom-color: var(--orbit); border-left-color: transparent; background: transparent; }
}

@media (max-width: 600px) {
  .topbar { gap: 8px; padding: 0 20px; }
  .topbar__brand-name { display: none; }
  .topbar__brand, .topbar__tabs, .topbar__menu-wrap { min-width: 0; }
  .landing { padding: 24px 20px 56px; }
  .landing__sync-band { flex-direction: column; align-items: flex-start; }
  .landing__sync-band__actions { width: 100%; }
}

/* -------------------------------------------------------------------
   OFFLINE BAR — subtle banner shown when navigator.onLine === false
   ------------------------------------------------------------------- */
.orbit-offline-bar {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 7px 16px;
  background: color-mix(in oklab, var(--accent-warm) 12%, var(--app-surface));
  border-bottom: 1px solid color-mix(in oklab, var(--accent-warm) 20%, var(--app-border));
  font-size: 12.5px; font-weight: 500;
  color: var(--app-text-muted);
  text-align: center;
}
.orbit-offline-bar i { font-size: 14px; color: var(--accent-warm); }

/* -------------------------------------------------------------------
   STALE DATA BADGE — shown on tool cards when data is from cache
   ------------------------------------------------------------------- */
.orbit-stale-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px;
  background: color-mix(in oklab, var(--accent-warm) 8%, var(--app-surface-2));
  border: 1px solid color-mix(in oklab, var(--accent-warm) 16%, var(--app-border));
  border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent-warm);
  white-space: nowrap;
}
.orbit-stale-badge i { font-size: 12px; }

/* Offline empty state for tools that require network */
.orbit-offline-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
  padding: 60px 24px;
  text-align: center;
}
.orbit-offline-empty__icon { font-size: 40px; color: var(--app-text-subtle); opacity: 0.5; }
.orbit-offline-empty__title { font-size: 16px; font-weight: 600; color: var(--app-text); margin: 0; }
.orbit-offline-empty__desc { font-size: 13px; color: var(--app-text-muted); max-width: 340px; margin: 0; line-height: 1.6; }

/* ───────────────────────────────────────────────────────────────
   DARK MODE — App-specific contrast fixes
   The Across UI kit segments have low contrast in dark mode.
   These overrides increase selected-state visibility.

   Strategy: Use BOTH [data-theme="dark"] and @media
   (prefers-color-scheme: dark) to catch all dark mode paths.
   Use hardcoded hex values (pre-computed from orbit-base #22C55E
   mixed with surface-2 #1B2129) to avoid color-mix() + var()
   failures where missing variables invalidate the whole rule.
   ─────────────────────────────────────────────────────────────── */

/* --- Segment active state: white text + green tinted bg + green inset ring --- */
html[data-theme="dark"] .across-st-seg .across-st-seg__btn.is-active,
[data-theme="dark"] .across-st-seg .across-st-seg__btn.is-active {
  background: #1f3a2b;
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1.5px #22C55E99;
}

/* --- Segment container: darker for contrast with active button --- */
html[data-theme="dark"] .across-st-seg,
[data-theme="dark"] .across-st-seg {
  background: #0f141a;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- Segment inactive buttons: brighter text for readability --- */
html[data-theme="dark"] .across-st-seg .across-st-seg__btn:not(.is-active),
[data-theme="dark"] .across-st-seg .across-st-seg__btn:not(.is-active) {
  color: #D1D5DB;
}

/* --- Pill tabs active state --- */
html[data-theme="dark"] .across-pill-tabs .across-pill-tabs__btn.is-active,
[data-theme="dark"] .across-pill-tabs .across-pill-tabs__btn.is-active {
  background: #1a3526;
  color: #fff;
  border-color: #22C55E80;
  font-weight: 600;
}

/* --- Toggle "On" label --- */
html[data-theme="dark"] .cfg-toggle__side.is-on,
[data-theme="dark"] .cfg-toggle__side.is-on {
  color: #22C55E;
}

/* --- Top nav active tab: full white for contrast --- */
html[data-theme="dark"] .tab.is-active,
[data-theme="dark"] .tab.is-active {
  color: #ffffff;
}

/* --- Units sidebar active category --- */
html[data-theme="dark"] .mx-cat.is-active,
[data-theme="dark"] .mx-cat.is-active {
  background: #1a3526;
  color: #fff;
}

/* --- Confirm button (destructive action) --- */
html[data-theme="dark"] .btn--danger-armed,
[data-theme="dark"] .btn--danger-armed,
html[data-theme="dark"] .btn--danger-armed:hover,
[data-theme="dark"] .btn--danger-armed:hover {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* System-dark fallback (same overrides via media query) */
@media (prefers-color-scheme: dark) {
  .across-st-seg .across-st-seg__btn.is-active {
    background: #1f3a2b;
    color: #fff;
    font-weight: 600;
    box-shadow: inset 0 0 0 1.5px #22C55E99;
  }
  .across-st-seg {
    background: #0f141a;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
  .across-st-seg .across-st-seg__btn:not(.is-active) {
    color: #D1D5DB;
  }
  .across-pill-tabs .across-pill-tabs__btn.is-active {
    background: #1a3526;
    color: #fff;
    border-color: #22C55E80;
    font-weight: 600;
  }
  .cfg-toggle__side.is-on {
    color: #22C55E;
  }
  .btn--danger-armed,
  .btn--danger-armed:hover {
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}
