/* ETERNAL unified rail — ONE implementation for every page (et- prefix avoids
   collisions with the legacy a2-*.css and the scoped Svelte bundles).

   ONE PAINT, EVERY PAGE (Oct 25): the rail owns its own theme. It used to
   inherit --rail / --rail-border / --text* / --font-* from the page's :root —
   but only the two Svelte shells define those. The 15 legacy pages had no
   :root, so the rail fell back to rail.css's own defaults and painted a
   SECOND, different rail: #14121f background, flat #262235 border instead of
   the violet hairline, and ui-monospace group labels instead of Geist Mono.
   The tokens and the two faces are now declared HERE and scoped to .et-rail,
   so the rail is pixel-identical on every page and the page body is
   untouched. */

/* The two faces are self-hosted. Both local files are byte-identical in
   rendering to the Google-hosted Geist Mono / Outfit that picture A was
   painted with (verified by canvas + DOM raster diff), so the rail looks
   the same on every page — including pages that never load Google Fonts. */
@font-face {
  font-family: "ET Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: block;
  src: url("/fonts/geist-mono.woff2") format("woff2");
}
@font-face {
  font-family: "ET Outfit";
  font-style: normal;
  font-weight: 100 900;
  font-display: block;
  src: url("/fonts/outfit.woff2") format("woff2");
}

.et-rail {
  /* the rail's own theme — identical on every page */
  --rail: #0e0c17;
  --rail-border: #7858d63d;
  --line: #ffffff14;
  --line-soft: #ffffff0d;
  --text: #ece8fa;
  --text-2: #ffffff8c;
  --text-3: #ffffff59;
  --accent: #c7b8ff;
  --accent-deep: #6a5ae0;
  --font-ui: "ET Outfit", "Outfit", "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "ET Geist Mono", "Geist Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* the rail sets its own face — it must NOT inherit the page body's font
     stack, or the item labels change face from page to page */
  font-family: var(--font-ui);

  background: var(--rail, #0e0c17);
  border-right: 1px solid var(--rail-border, #7858d63d);
  display: flex;
  flex-direction: column;
  width: 236px;
  flex: 0 0 236px;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: hidden;
  z-index: 40;
}

.et-rail__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px 14px;
  flex: none;
}

.et-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 4px 6px;
  overflow: hidden;
  text-decoration: none;
}

/* the ribbon mark is 206x96 — never square-crop it */
.et-brand img {
  border-radius: 7px;
  flex: none;
  width: auto;
  height: 26px;
}

.et-wordmark {
  letter-spacing: 0.22em;
  color: var(--text, #ece8fa);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}

.et-iconbtn {
  width: 28px;
  height: 28px;
  color: var(--text-3, #ffffff59);
  cursor: pointer;
  background: 0 0;
  border: 1px solid transparent;
  border-radius: 7px;
  flex: none;
  justify-content: center;
  align-items: center;
  transition: all 0.12s;
  display: inline-flex;
}
.et-iconbtn:hover { color: var(--text, #ece8fa); background: #ffffff0d; }

.et-nav {
  scrollbar-width: none;
  display: flex;
  flex-direction: column;
  flex: auto;
  padding: 4px 0;
  overflow-y: auto;
}
.et-nav::-webkit-scrollbar { display: none; }

.et-group {
  font-family: var(--font-mono, ui-monospace);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3, #ffffff59);
  padding: 18px 20px 6px;
  font-size: 9px;
  font-weight: 600;
}

.et-item {
  height: 38px;
  color: var(--text-2, #ffffff8c);
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 11px;
  flex: none;
  min-width: 0;
  margin: 2px 12px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.12s;
}
.et-item:hover { color: var(--text, #ece8fa); background: #ffffff08; }
.et-item[aria-current="page"] {
  color: var(--text, #ece8fa);
  background: #7858d61f;
  border-color: #7858d64d;
  box-shadow: inset 0 0 12px #7858d629;
}
.et-item svg { width: 17px; height: 17px; flex: none; }
.et-txt { overflow: hidden; text-overflow: ellipsis; flex: auto; }

/* locked = greyed out (one locked idiom, no chips) */
.et-item--locked { opacity: 0.45; }
.et-item--locked:hover { opacity: 0.7; background: transparent; }
.et-item--locked .et-txt { color: var(--text-3, #ffffff59); }

.et-lock {
  font-family: var(--font-mono, ui-monospace);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3, #ffffff59);
  border: 1px solid var(--line-soft, #ffffff14);
  border-radius: 5px;
  opacity: 0.75;
  flex: none;
  margin-left: auto;
  padding: 1px 6px;
  font-size: 8px;
  font-weight: 600;
}

.et-rail__foot {
  border-top: 1px solid var(--line-soft, #ffffff14);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  flex: none;
}

.et-upgrade {
  border-radius: 12px;
  border: 1px solid var(--rail-border, #262235);
  background: #7858d612;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  transition: background 0.12s;
}
.et-upgrade__icon { color: var(--accent, #a855f7); }
.et-upgrade__text { color: var(--text, #ece8fa); font-size: 12.5px; font-weight: 600; }
.et-upgrade__cta {
  letter-spacing: 0.02em;
  background: var(--accent, #a855f7);
  color: #140f2b;
  border-radius: 7px;
  align-self: flex-start;
  padding: 6px 14px;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-block;
  text-decoration: none;
}
.et-upgrade__cta:hover { background: #d8ccff; }

.et-dock {
  position: relative;
  margin-top: 2px;
}
.et-dock__chip {
  border-radius: 12px;
  border: 1px solid var(--line-soft, #ffffff14);
  cursor: pointer;
  text-align: left;
  background: #ffffff08;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  transition: background 0.12s;
}
.et-dock__chip:hover { background: #ffffff0f; }
.et-dock__avatar {
  color: #140f2b;
  background: linear-gradient(180deg, var(--accent, #a855f7), var(--accent-deep, #6a5ae0));
  border-radius: 50%;
  flex: none;
  justify-content: center;
  align-items: center;
  width: 30px;
  height: 30px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
}
.et-dock__copy { display: flex; flex-direction: column; flex: auto; min-width: 0; }
.et-dock__name { color: var(--text, #ece8fa); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; }
.et-dock__plan { color: var(--text-2, #ffffff8c); font-size: 10.5px; }
.et-dock__chevron { color: var(--text-3, #ffffff59); flex: none; transition: transform 0.15s; }
.et-dock__chip[aria-expanded="true"] .et-dock__chevron { transform: rotate(180deg); }

.et-pop {
  z-index: 60;
  border: 1px solid var(--line, #2c2940);
  background: #14121f;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  box-shadow: 0 18px 44px #0000008c;
  display: none;
}
.et-pop[data-state="open"] { display: flex; }
.et-pop__head { display: flex; align-items: center; gap: 10px; }
.et-pop__name { color: var(--text, #ece8fa); font-size: 12.5px; font-weight: 600; }
.et-pop__plan { color: var(--text-2, #ffffff8c); font-size: 10.5px; }
.et-pop__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.et-pop__fact {
  border: 1px solid var(--line-soft, #ffffff14);
  background: #ffffff08;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
}
.et-pop__fact-label {
  font-family: var(--font-mono, ui-monospace);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3, #ffffff59);
  font-size: 9px;
  font-weight: 600;
}
.et-pop__fact-value { color: var(--text, #ece8fa); font-variant-numeric: tabular-nums; font-size: 12.5px; font-weight: 600; }
.et-pop__row {
  height: 32px;
  color: var(--text-2, #ffffff8c);
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
}
.et-pop__row:hover { color: var(--text, #ece8fa); background: #ffffff0d; }

/* the legacy sheets force 256px with !important — the unified rail is 236px */
html body .app:has(> [data-et-rail]) { grid-template-columns: 236px minmax(0, 1fr) !important; }

/* ── collapsed ─────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .et-rail {
    width: auto;
    height: auto;
    position: relative;
  }
  .et-nav { flex-flow: wrap; }
  .et-rail__foot { display: none; }
}
