/* =========================================================================
   Sign in / sign up screen, and the signed-in application shell.
   ========================================================================= */

/* ------------------------------------------------------------------ auth */

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, var(--glow), transparent 70%),
    var(--bg);
}
.auth-wrap {
  width: min(430px, 100%);
  text-align: center;
}
.auth-brand {
  justify-content: center;
  margin-bottom: 1.5rem;
}

.auth-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 2rem 1.75rem;
  text-align: left;
}
.auth-card h1 {
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
}
.auth-lede {
  font-size: 0.9rem;
  color: var(--ink-2);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}
.auth-card .field input {
  font-family: var(--font-body);
  padding: 0.62rem 0.75rem;
}
.auth-card .btn {
  margin-top: 0.35rem;
}

.pw-wrap {
  position: relative;
}
.pw-wrap input {
  padding-right: 4rem !important;
}
.pw-toggle {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  translate: 0 -50%;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-3);
  padding: 0.2rem 0.35rem;
  border-radius: 4px;
}
.pw-toggle:hover {
  color: var(--accent);
}

.field-hint {
  font-size: 0.75rem;
  color: var(--ink-3);
  margin-top: 0.35rem;
  line-height: 1.5;
}
.optional {
  font-weight: 400;
  color: var(--ink-3);
  font-size: 0.72rem;
}

.auth-swap {
  margin-top: 1.4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.87rem;
  color: var(--ink-2);
  text-align: center;
}
.auth-swap a {
  color: var(--accent);
  font-weight: 600;
}
.auth-foot {
  margin-top: 1.25rem;
  font-size: 0.83rem;
}
.auth-foot a {
  color: var(--ink-3);
}
.auth-foot a:hover {
  color: var(--accent);
}

/* =============================================================== wallets */

.wallet-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.wallet-option {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.8rem 0.9rem;
  text-align: left;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: all 0.16s var(--ease);
}
.wallet-option:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.wallet-option.connecting {
  border-color: var(--accent);
  opacity: 0.75;
  pointer-events: none;
}
.wallet-icon {
  position: relative;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  color: var(--icon);
  flex-shrink: 0;
  overflow: hidden;
}
/* The real logo sits over the letter tile; if it fails to load it is hidden
   and the tile underneath becomes the fallback with no layout shift. */
.wallet-icon img.wallet-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 7px;
  object-fit: cover;
  background: var(--bg-1);
}
.wallet-icon img.wallet-logo.gone {
  display: none;
}
.wallet-icon img {
  width: 24px;
  height: 24px;
  display: block;
  border-radius: 5px;
}
.wallet-icon svg {
  width: 17px;
  height: 17px;
  display: block;
}
.wallet-name {
  flex: 1;
  min-width: 0;
}
.wallet-name small {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--ink-3);
  margin-top: 0.1rem;
}
.wallet-arrow {
  width: 16px;
  height: 16px;
  color: var(--ink-3);
  flex-shrink: 0;
}
.wallet-option.muted {
  opacity: 0.7;
}
.wallet-tag {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.14rem 0.45rem;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.16);
  color: var(--up);
  flex-shrink: 0;
}
.wallet-letter {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--icon);
  font-size: 0.85rem;
  font-weight: 700;
}

/* A wallet whose download page we just opened, waiting to be detected. */
.wallet-option.waiting {
  border-color: var(--accent);
  background: var(--accent-soft);
  cursor: default;
}
.wallet-option.waiting .wallet-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  animation: wallet-spin 0.8s linear infinite;
}
@keyframes wallet-spin {
  to {
    transform: rotate(1turn);
  }
}
@media (prefers-reduced-motion: reduce) {
  .wallet-option.waiting .wallet-icon::after {
    animation: none;
  }
}
.wallet-reload {
  flex-shrink: 0;
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.wallet-reload:hover {
  border-color: var(--accent);
}

.wallet-heading {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 0.55rem;
}
.wallet-list + .wallet-heading {
  margin-top: 1.25rem;
}

.wallet-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.25rem;
}
.wallet-head h1 {
  font-size: 1.3rem;
  margin: 0;
}

.wallet-search {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.75rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.wallet-search svg {
  width: 16px;
  height: 16px;
  color: var(--ink-3);
  flex-shrink: 0;
}
.wallet-search input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  font-size: 0.9rem;
  font-family: var(--font-body);
}

.wallet-list.scroll {
  max-height: 340px;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}
.wallet-list.scroll::-webkit-scrollbar {
  width: 6px;
}
.wallet-list.scroll::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 3px;
}
.wallet-none {
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.87rem;
  color: var(--ink-3);
}

.wallet-empty {
  text-align: center;
  padding: 1.5rem 1rem;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-md);
}
.wallet-empty > svg {
  width: 30px;
  height: 30px;
  color: var(--ink-3);
  margin-bottom: 0.7rem;
}
.wallet-empty b {
  display: block;
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 0.4rem;
}
.wallet-empty p {
  font-size: 0.85rem;
  color: var(--ink-3);
  line-height: 1.6;
  margin-bottom: 0.9rem;
}
.wallet-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}
.wallet-links a {
  color: var(--accent);
  font-weight: 600;
}
.wallet-links a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wallet-note {
  display: flex;
  gap: 0.65rem;
  padding: 0.8rem 0.9rem;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  border: 1px solid rgba(61, 130, 255, 0.26);
  font-size: 0.83rem;
  color: var(--ink-2);
  line-height: 1.55;
}
.wallet-note svg {
  width: 17px;
  height: 17px;
  color: var(--icon);
  flex-shrink: 0;
  margin-top: 1px;
}
.wallet-note strong {
  color: var(--ink);
}

.wallet-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--r-full);
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-2);
}
.wallet-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--up);
  flex-shrink: 0;
}

/* =========================================================== onboarding */

.auth-wrap:has(.onboard) {
  width: min(560px, 100%);
}
.onboard h1 {
  font-size: 1.55rem;
  text-align: center;
  margin-bottom: 0.5rem;
}
.onboard .auth-lede {
  text-align: center;
  margin-bottom: 1.5rem;
}

.onboard-progress {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.6rem;
}
.onboard-bar {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--bg-3);
  overflow: hidden;
}
.onboard-bar span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}
.onboard-count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-3);
}
.onboard-count b {
  color: var(--accent);
  font-weight: 500;
}

/* Block, not flex: the number has to sit inline with the first word rather
   than being pushed onto its own line by a long question. */
.onboard-q {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.55;
  margin-bottom: 1rem;
}
.onboard-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  margin-right: 0.45rem;
}
.onboard-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: var(--bg-3);
  color: var(--ink-3);
  margin-left: 0.45rem;
  vertical-align: 2px;
}

.onboard-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.onboard-option {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.72rem 0.9rem;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: all 0.16s var(--ease);
}
.onboard-option:hover {
  border-color: var(--line-2);
  color: var(--ink);
}
.onboard-option.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}
.onboard-dot {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--line-2);
  flex-shrink: 0;
  transition: all 0.16s;
}
.onboard-dot.single {
  border-radius: 50%;
}
.onboard-dot.multi {
  border-radius: 4px;
}
.onboard-option.on .onboard-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--bg-1);
}
.onboard-option.on .onboard-dot.multi {
  box-shadow: inset 0 0 0 2px var(--bg-1);
}

.onboard-actions {
  display: flex;
  gap: 0.6rem;
}
.onboard-actions .btn {
  flex: 1;
}
.onboard-skip {
  display: block;
  width: 100%;
  margin-top: 0.9rem;
  padding: 0.5rem;
  font-size: 0.83rem;
  color: var(--ink-3);
}
.onboard-skip:hover {
  color: var(--accent);
}

/* ============================================================== dialogs */

.modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(4, 8, 17, 0.66);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.16s var(--ease);
}
.modal-scrim.in {
  opacity: 1;
}

.modal {
  width: min(420px, 100%);
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.6rem;
  text-align: center;
  transform: translateY(8px) scale(0.98);
  transition: transform 0.18s var(--ease);
}
.modal-scrim.in .modal {
  transform: none;
}

.modal-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--icon);
}
.modal-icon.danger {
  background: rgba(244, 63, 94, 0.14);
  color: var(--down);
}
.modal-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.modal h2 {
  font-family: var(--font-body);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 0.4rem;
}
.modal p {
  font-size: 0.88rem;
  color: var(--ink-2);
  line-height: 1.6;
}
.modal-field {
  margin: 1.15rem 0 0;
  text-align: left;
}
.modal-field input {
  font-family: var(--font-body);
  padding: 0.6rem 0.75rem;
}
.modal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.4rem;
}
.modal-actions .btn {
  flex: 1;
}

.btn-danger {
  background: var(--down);
  color: #fff;
}
.btn-danger:hover {
  background: #e11d48;
}

/* ========================================================== app shell */

/*
 * The dashboard runs on its own surface palette rather than the marketing
 * site's. It is a light, high-contrast application face by default; the dark
 * values below keep the theme toggle working rather than leaving half the page
 * unreadable for anyone who prefers it.
 */
.app-body {
  --surface: #ffffff;
  --canvas: #f6f7f9;
  --edge: #e6e9ef;
  --edge-soft: #f1f4f8;
  --edge-mid: #edf0f4;
  --hover: #fafbfc;
  --blue-tint: #eff5ff;
  --blue-line: #dbe7fe;
  --green-ink: #047857;
  --green-tint: #f2fbf7;
  --green-line: #d5f0e3;
  --amber-ink: #b45309;
  --amber-tint: #fef6e7;
  --amber-line: #fbe3b4;

  min-height: 100vh;
  background: var(--canvas);
}

:root[data-theme='dark'] .app-body,
:root:not([data-theme='light']) .app-body {
  --surface: #0d1628;
  --canvas: #070d1a;
  --edge: rgba(140, 170, 220, 0.14);
  --edge-soft: rgba(140, 170, 220, 0.08);
  --edge-mid: rgba(140, 170, 220, 0.11);
  --hover: rgba(140, 170, 220, 0.05);
  --blue-tint: rgba(61, 130, 255, 0.12);
  --blue-line: rgba(61, 130, 255, 0.26);
  --green-ink: #34d399;
  --green-tint: rgba(16, 185, 129, 0.12);
  --green-line: rgba(16, 185, 129, 0.26);
  --amber-ink: #fbbf24;
  --amber-tint: rgba(245, 158, 11, 0.12);
  --amber-line: rgba(245, 158, 11, 0.26);
}

/* A dashboard is an application, not a landing page: the display face reads as
   squeezed at these sizes, so product surfaces use the body font throughout. */
.app-body h1,
.app-body h2,
.app-body h3,
.app-body h4,
.auth-body h1,
.auth-body h2 {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: -0.015em;
}
.app-body .brand-name,
.auth-body .brand-name {
  font-family: var(--font-display);
}

/* ------------------------------------------------------------- header */

.hdr {
  position: sticky;
  top: 0;
  z-index: 45;
  background: var(--surface);
  border-bottom: 1px solid var(--edge);
}
.hdr-in {
  height: 60px;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
}
.hdr .brand {
  flex-shrink: 0;
  color: var(--ink);
}
.hdr-divider {
  width: 1px;
  height: 22px;
  background: var(--edge);
  flex-shrink: 0;
}
.hdr-spacer {
  flex: 1;
}

.hdr-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.hdr-nav::-webkit-scrollbar {
  display: none;
}
.hdr-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  font-size: 0.845rem;
  font-weight: 500;
  padding: 0.44rem 0.75rem;
  border-radius: var(--r-btn);
  color: var(--ink-3);
}
.hdr-nav a:hover {
  background: var(--edge-soft);
  color: var(--ink);
}
.hdr-nav a.active {
  background: var(--edge-soft);
  color: var(--ink);
  font-weight: 600;
}
.hdr-nav svg {
  width: 11px;
  height: 11px;
  color: var(--ink-3);
  flex-shrink: 0;
}

/* ------------------------------------------------------- jump to search */

.hdr-search {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 230px;
  flex-shrink: 0;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--edge);
  background: var(--hover);
  border-radius: var(--r-btn);
  font-size: 0.78rem;
  color: var(--ink-3);
  cursor: pointer;
  transition: border-color 0.15s;
}
.hdr-search:hover {
  border-color: var(--line-2);
}
.hdr-search svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
.hdr-search span {
  flex: 1;
  text-align: left;
}
.hdr-search kbd {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--ink-3);
  border: 1px solid var(--edge);
  background: var(--surface);
  border-radius: 4px;
  padding: 1px 5px;
}

.jump {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  justify-items: center;
  align-items: start;
  padding: 12vh 1.25rem 1.25rem;
  background: rgba(6, 10, 20, 0.45);
  backdrop-filter: blur(3px);
}
.jump[hidden] {
  display: none;
}
.jump-panel {
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.jump-field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--edge);
  color: var(--ink-3);
}
.jump-field svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.jump-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
}
.jump-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 0.4rem;
}
.jump-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.65rem;
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  color: var(--ink-2);
  cursor: pointer;
}
.jump-item.on,
.jump-item:hover {
  background: var(--blue-tint);
  color: var(--ink);
}
.jump-item svg {
  width: 15px;
  height: 15px;
  color: var(--icon);
  flex-shrink: 0;
}
.jump-item small {
  margin-left: auto;
  font-size: 0.74rem;
  color: var(--ink-3);
}
.jump-none {
  padding: 1.4rem;
  text-align: center;
  font-size: 0.86rem;
  color: var(--ink-3);
}

/* --------------------------------------------------------- account menu */

.acct {
  position: relative;
  flex-shrink: 0;
}
.acct-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 4px 11px 4px 4px;
  border: 1px solid var(--edge);
  background: var(--surface);
  border-radius: 9px;
  cursor: pointer;
}
.acct-btn:hover {
  background: var(--hover);
}
.acct-av {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: linear-gradient(140deg, var(--accent), #06b6d4);
  display: block;
  flex-shrink: 0;
}
.acct-name {
  font-size: 0.72rem;
  color: var(--ink-2);
}
.acct-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 230px;
  padding: 0.45rem;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.16s var(--ease), transform 0.16s var(--ease), visibility 0.16s;
  z-index: 60;
}
.acct.open .acct-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.acct-who {
  padding: 0.55rem 0.6rem 0.7rem;
  border-bottom: 1px solid var(--edge);
  margin-bottom: 0.35rem;
}
.acct-who b {
  display: block;
  font-size: 0.87rem;
  color: var(--ink);
}
.acct-who small {
  display: block;
  font-size: 0.76rem;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
}
.acct-menu a,
.acct-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-radius: var(--r-sm);
  font-size: 0.86rem;
  color: var(--ink-2);
}
.acct-menu a:hover,
.acct-menu button:hover {
  background: var(--edge-soft);
  color: var(--ink);
}
.acct-menu .danger {
  color: var(--down);
}

/* ---------------------------------------------------------- system pill */

.sys-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--r-full);
  border: 1px solid var(--green-line);
  background: var(--green-tint);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--green-ink);
  white-space: nowrap;
  flex-shrink: 0;
}
.sys-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--up);
  flex-shrink: 0;
}
.sys-pill[data-state='connecting'],
.sys-pill[data-state='warn'] {
  border-color: var(--amber-line);
  background: var(--amber-tint);
  color: var(--amber-ink);
}
.sys-pill[data-state='connecting'] i,
.sys-pill[data-state='warn'] i {
  background: #f59e0b;
}
.sys-pill[data-state='down'] {
  border-color: rgba(244, 63, 94, 0.28);
  background: rgba(244, 63, 94, 0.1);
  color: var(--down);
}
.sys-pill[data-state='down'] i {
  background: var(--down);
}

/* ------------------------------------------------------------- layout */

.wrap {
  max-width: 1360px;
  margin: 0 auto;
  padding: 2.25rem 2rem 3.75rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
/* The rail only appears on the overview, so the grid gains its column only
   when there is something to put in it. */
.wrap.has-rail {
  grid-template-columns: minmax(0, 1fr) 300px;
}
.col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.rail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 5.5rem;
}
.rail[hidden] {
  display: none;
}

/* Most pages stack a title over a lede; the ones with buttons opt into a row. */
.page-head.with-action {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.page-head h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.032em;
  margin: 0 0 0.45rem;
}
.page-head h1 em {
  font-family: var(--font-mono);
  font-style: normal;
  font-weight: 500;
  font-size: 1.68rem;
  color: var(--accent);
}
.page-head p {
  font-size: 0.9rem;
  color: var(--ink-3);
  line-height: 1.6;
  margin: 0;
  max-width: 34rem;
}
.head-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

@media (max-width: 1180px) {
  .wrap.has-rail {
    grid-template-columns: minmax(0, 1fr);
  }
  .rail {
    position: static;
  }
}
@media (max-width: 860px) {
  .hdr-in {
    gap: 0.7rem;
    padding: 0 1.1rem;
  }
  .hdr-search,
  .hdr-divider {
    display: none;
  }
  .acct-name {
    display: none;
  }
  .acct-btn {
    padding: 4px;
  }
}
@media (max-width: 620px) {
  .wrap {
    padding: 1.5rem 1.1rem 3rem;
  }
  .sys-pill span {
    display: none;
  }
  .sys-pill {
    padding: 0.3rem 0.5rem;
  }
  .page-head h1 {
    font-size: 1.6rem;
  }
  .page-head h1 em {
    font-size: 1.35rem;
  }
}

/* ------------------------------------------------------- metric strip */

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--edge);
  border: 1px solid var(--edge);
  border-radius: 14px;
  overflow: hidden;
}
.metric {
  background: var(--surface);
  padding: 1.25rem;
  min-width: 0;
}
.metric-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-3);
  margin-bottom: 0.85rem;
}
.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}
.metric-figure {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.metric-num {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
}
.metric-num.dim {
  color: var(--ink-3);
}
.metric-unit {
  font-size: 0.87rem;
  color: var(--ink-3);
  margin-left: 0.3rem;
}
.metric-foot {
  font-size: 0.72rem;
  color: var(--ink-3);
}
.metric svg.spark {
  width: 76px;
  height: 26px;
  flex-shrink: 0;
}

.tag-warn {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--amber-ink);
  background: var(--amber-tint);
  border: 1px solid var(--amber-line);
  padding: 2px 7px;
  border-radius: 5px;
  white-space: nowrap;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 26px;
  flex-shrink: 0;
}
.bars i {
  width: 4px;
  border-radius: 2px;
  background: var(--edge);
  display: block;
}
.bars i.on {
  background: var(--accent);
}

.track {
  height: 4px;
  border-radius: 2px;
  background: var(--edge-mid);
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.track i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
}

.chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.chips span {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.05em;
  color: var(--ink-2);
  background: var(--edge-soft);
  border: 1px solid var(--edge);
  padding: 2px 5px;
  border-radius: 4px;
}

@media (max-width: 1180px) {
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .metrics {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------- guides */

.guides {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--edge-mid);
  border: 1px solid var(--edge-mid);
  border-radius: 11px;
  overflow: hidden;
}
.guide {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 1rem;
  background: var(--surface);
  color: var(--ink);
}
.guide:hover {
  background: var(--blue-tint);
}
.guide-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--blue-tint);
  border: 1px solid var(--blue-line);
  display: grid;
  place-items: center;
  color: var(--icon);
}
.guide-icon svg {
  width: 15px;
  height: 15px;
}
.guide b {
  display: block;
  font-size: 0.845rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.guide b em {
  font-style: normal;
  color: var(--accent);
}
.guide span span {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-3);
  line-height: 1.55;
}
@media (max-width: 1180px) {
  .guides {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 620px) {
  .guides {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------- rail */

.upsell {
  border: 1px solid var(--blue-line);
  border-radius: 14px;
  background: linear-gradient(165deg, var(--blue-tint), var(--surface));
  padding: 1.25rem;
}
.upsell-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}
.upsell-head svg {
  width: 15px;
  height: 15px;
  color: var(--icon);
  flex-shrink: 0;
}
.upsell p {
  font-size: 0.78rem;
  color: var(--ink-2);
  line-height: 1.6;
  margin: 0 0 0.85rem;
}

.rail-card {
  border: 1px solid var(--edge);
  border-radius: 14px;
  background: var(--surface);
  padding: 1.25rem;
}
.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.rail-head b {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.tag-live {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--green-ink);
  background: var(--green-tint);
  border: 1px solid var(--green-line);
  padding: 3px 8px;
  border-radius: var(--r-full);
  white-space: nowrap;
}
.tag-mute {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--ink-3);
  white-space: nowrap;
}

.mrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--edge-soft);
}
.mrow:last-of-type {
  border-bottom: 0;
}
.mname {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-2);
}
.mname span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: block;
  flex-shrink: 0;
  background: var(--up);
}
.dot.amber {
  background: #f59e0b;
}
.dot.grey {
  background: var(--ink-3);
}
.mval {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-shrink: 0;
}
.mval code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-2);
}
.chg {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  width: 3.4rem;
  text-align: right;
  color: var(--green-ink);
}
.chg.down {
  color: var(--down);
}
.mmeta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-3);
  text-align: right;
}
.rail-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.72rem;
  color: var(--ink-3);
  margin-top: 0.85rem;
}
.rail-foot a {
  font-size: 0.72rem;
  color: var(--accent);
}

/* ------------------------------------------------------- key detail */

.crumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--ink-3);
  margin-bottom: 0.9rem;
  overflow-wrap: anywhere;
}
.crumb a {
  color: var(--accent);
  font-weight: 500;
}
.crumb a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dtabs-line {
  display: flex;
  gap: 1.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.5rem;
}
.dtab-btn {
  padding: 0.7rem 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.16s;
}
.dtab-btn:hover {
  color: var(--ink);
}
.dtab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.detail {
  padding-top: 0.5rem;
}
.detail[hidden] {
  display: none;
}
.detail-row {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--line);
}
.detail-row:last-child {
  border-bottom: 0;
}
.detail-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}
.detail-value {
  font-size: 0.88rem;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
@media (max-width: 700px) {
  .detail-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .detail-label {
    grid-column: 1 / -1;
  }
}

.key-field {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.55rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  max-width: 100%;
}
.key-field code {
  font-size: 0.79rem;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------- row menu */

.row-menu {
  position: relative;
  display: inline-block;
}
.row-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 160px;
  padding: 0.35rem;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: opacity 0.15s var(--ease), transform 0.15s var(--ease), visibility 0.15s;
  z-index: 30;
}
.row-menu.open .row-menu-list {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.row-menu-list a,
.row-menu-list button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.55rem;
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}
.row-menu-list a:hover,
.row-menu-list button:hover {
  background: var(--bg-2);
  color: var(--ink);
}
.row-menu-list .danger {
  color: var(--down);
}
.page-head h1 {
  font-size: clamp(1.6rem, 3vw, 2.05rem);
  letter-spacing: -0.03em;
  margin-bottom: 0.45rem;
}
.page-head p {
  color: var(--ink-2);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 70ch;
}

.welcome-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(16, 185, 129, 0.32);
  background: rgba(16, 185, 129, 0.09);
  border-radius: var(--r-md);
  font-size: 0.88rem;
  color: var(--ink-2);
  line-height: 1.55;
}
.welcome-banner svg {
  width: 17px;
  height: 17px;
  color: var(--up);
  flex-shrink: 0;
  margin-top: 2px;
}
.welcome-banner strong {
  color: var(--ink);
}

/* -------------------------------------------------------------- cards */

.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.35rem;
  margin-bottom: 1.25rem;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.15rem;
}
.card-head h2 {
  font-size: 1.02rem;
  margin-bottom: 0.2rem;
}
.card-head p {
  font-size: 0.84rem;
  color: var(--ink-3);
  line-height: 1.55;
  max-width: 62ch;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr));
  gap: 1.25rem;
  align-items: start;
}
.grid-2 > .card {
  margin-bottom: 0;
}

/* quick links */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 0.5rem 1.75rem;
}
.quick {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.8rem 0.7rem;
  border-radius: var(--r-md);
  transition: background 0.15s;
}
.quick:hover {
  background: var(--bg-2);
}
.quick-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  display: inline-grid;
  place-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  color: var(--icon);
  flex-shrink: 0;
}
.quick:hover .quick-icon {
  border-color: var(--accent);
}
.quick-icon svg {
  width: 19px;
  height: 19px;
  display: block;
}
.quick b {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.15rem;
}
.quick span {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-3);
  line-height: 1.5;
}

/* -------------------------------------------------------------- tables */

.table-wrap {
  overflow-x: auto;
}
table.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 560px;
}
table.dash-table th {
  text-align: left;
  padding: 0.5rem 0.7rem;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
  font-weight: 700;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
table.dash-table td {
  padding: 0.72rem 0.7rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}
table.dash-table tr:last-child td {
  border-bottom: 0;
}
table.dash-table td.strong {
  color: var(--ink);
  font-weight: 600;
}
table.dash-table th.num,
table.dash-table td.num {
  text-align: right;
}
table.dash-table tr.revoked td {
  opacity: 0.55;
}
.dash-empty {
  text-align: center;
  padding: 1.6rem;
  color: var(--ink-3);
}
.muted {
  color: var(--ink-3);
}
.tag {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: var(--bg-3);
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.link-btn {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}
.link-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn.danger {
  color: var(--down);
}

/* key cell with reveal + copy */

/* A revealed key is 40 characters; let it wrap instead of widening the table
   until the actions column is pushed out of view. */
table.dash-table td.key-td {
  white-space: normal;
  min-width: 260px;
}
.key-cell {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.key-cell code {
  font-family: var(--font-mono);
  font-size: 0.79rem;
  color: var(--ink);
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
  min-width: 0;
}
.icon-mini {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-sm);
  color: var(--icon);
  flex-shrink: 0;
  transition: all 0.15s;
}
.icon-mini:hover {
  background: var(--accent-soft);
  color: var(--accent-hi);
}
.icon-mini svg {
  width: 15px;
  height: 15px;
  display: block;
}

.key-callout {
  padding: 0.9rem 1rem;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
  border-radius: var(--r-md);
  margin-bottom: 1.1rem;
}
.key-callout strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.55rem;
  color: var(--ink);
}
.key-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.62rem 0.75rem;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
}
.key-box code {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
  color: var(--ink);
}
.key-box .btn {
  flex-shrink: 0;
}

/* --------------------------------------------------------------- stats */

.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
/* Scoped to .metric-row so these simple tiles do not collide with the
   overview's .metrics strip, which styles its own .metric children. */
.metric-row .metric {
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--r-lg);
  padding: 1.1rem 1.2rem;
}
.metric-row .metric b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.35rem;
  font-variant-numeric: tabular-nums;
}
.metric-row .metric b small {
  font-size: 0.45em;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: -0.01em;
}
.metric-row .metric span {
  font-size: 0.8rem;
  color: var(--ink-3);
}
.metric-row .metric-trial {
  border-color: var(--blue-line);
  background: linear-gradient(180deg, var(--blue-tint), var(--surface) 70%);
}

.usage-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.4rem;
  height: 160px;
  padding-top: 0.5rem;
}
.usage-bar {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.4rem;
  min-width: 0;
}
.usage-fill {
  background: linear-gradient(180deg, var(--accent), var(--accent-soft));
  border-radius: 4px 4px 0 0;
  transition: height 0.5s var(--ease);
}
.usage-bar span {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--ink-3);
  text-align: center;
}

/* ------------------------------------------------------- market status */

.mkt-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.72rem 0;
  border-bottom: 1px solid var(--line);
}
.mkt-row:last-child {
  border-bottom: 0;
}
.mkt-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}
.mkt-state {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: var(--r-full);
  text-transform: lowercase;
}
.mkt-state.live {
  background: rgba(16, 185, 129, 0.16);
  color: var(--up);
}
.mkt-state.quiet {
  background: var(--bg-3);
  color: var(--ink-3);
}
.mkt-meta {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-3);
  text-align: right;
  white-space: nowrap;
}

/* -------------------------------------------------------------- plan */

.plan-now {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--bg-2);
  margin-bottom: 1.25rem;
}
.plan-badge {
  padding: 0.3rem 0.7rem;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
}
.plan-now p {
  font-size: 0.86rem;
  color: var(--ink-2);
  margin: 0;
}
.plan-now .btn {
  margin-left: auto;
}

/* One row per tier in the dashboard's buy panel. */
.buy-tiers {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.buy-tier {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-2);
}
.buy-tier > div {
  flex: 1;
  min-width: 0;
}
.buy-tier b {
  display: block;
  font-size: 0.92rem;
}
.buy-tier small {
  display: block;
  font-size: 0.79rem;
  color: var(--ink-3);
  margin-top: 0.12rem;
}
.buy-tier .btn {
  flex-shrink: 0;
}
