/* ═══════════════════════════════════════════════════════════════
   Rising Company Design System
   https://design-system.rising.company  ·  spec: /llms.txt

   Drop-in token + component layer. Two themes, one set of variable
   names: set data-theme="mission" (dark, default) or "daylight"
   (light) on <html>.

   Requires the fonts:
   <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Rajdhani:wght@300;500;700&display=swap">
   ═══════════════════════════════════════════════════════════════ */

/* ══════════════ THEME TOKENS ══════════════ */
  /* Mission — dark, mission-control HUD. Operator-facing surfaces. Default. */
  :root, [data-theme="mission"] {
    --bg-base: #0a0c10;
    --bg-surface: #0d1117;
    --bg-surface-hover: #0f1520;
    --bg-inset: #0a1410;

    --border: #1a2a20;
    --border-hover: #2a4a38;
    --border-subtle: #1a3020;
    --border-grid: #111820;

    --text-heading: #e8f4ff;
    --text-body: #c8d8e8;
    --text-muted: #84a89a;
    --text-subtle: #7d9b8c;
    --text-label: #6e8f80;
    --text-dim: #61856d;

    --accent: #3af0a0;
    --accent-hover: #6ff7be;
    --accent-ink: #3af0a0;
    --accent-on: #08150f;
    --accent-wash: #3af0a014;
    --accent-line: #3af0a050;
    --accent-bracket: #3af0a040;

    --accent-2: #2a7adf;
    --accent-2-ink: #2a7adf;
    --danger: #ff4a24;
    --danger-ink: #ff4a24;
    --danger-wash: #ff4a2414;
    --danger-line: #ff4a2450;
    --warning: #f5b83d;
    --warning-ink: #f5b83d;
    --warning-wash: #f5b83d14;
    --warning-line: #f5b83d50;

    --gradient: linear-gradient(90deg, #3af0a0, #2a7adf);
    --card-shadow: none;

    --chrome-scanline: rgba(0, 0, 0, 0.04);
    --chrome-bracket-display: block;
    --chrome-glow: rgba(58, 240, 160, 0.05);
    --chrome-grid-line: rgba(17, 24, 32, 0.7);
  }

  /* Daylight — light, same system. User-facing and public surfaces. */
  [data-theme="daylight"] {
    --bg-base: #f6f8f7;
    --bg-surface: #ffffff;
    --bg-surface-hover: #eef3f0;
    --bg-inset: #e8f5ee;

    --border: #dde5e0;
    --border-hover: #9dc4b0;
    --border-subtle: #e6ede9;
    --border-grid: #e9efeb;

    --text-heading: #0b1a14;
    --text-body: #26332d;
    --text-muted: #43564c;
    --text-subtle: #4a5d54;
    --text-label: #52655b;
    --text-dim: #61746b;

    --accent: #3af0a0;
    --accent-hover: #22dc8c;
    --accent-ink: #0b7a4e;
    --accent-on: #08150f;
    --accent-wash: #0b7a4e12;
    --accent-line: #0b7a4e45;
    --accent-bracket: #0b7a4e30;

    --accent-2: #2a7adf;
    --accent-2-ink: #1f5fbf;
    --danger: #ff4a24;
    --danger-ink: #c02a10;
    --danger-wash: #c02a1012;
    --danger-line: #c02a1045;
    --warning: #f5b83d;
    --warning-ink: #8a5a00;
    --warning-wash: #8a5a0012;
    --warning-line: #8a5a0045;

    --gradient: linear-gradient(90deg, #0b7a4e, #1f5fbf);
    --card-shadow: 0 1px 2px rgba(11, 26, 20, 0.04);

    --chrome-scanline: transparent;
    --chrome-bracket-display: none;
    --chrome-glow: rgba(11, 122, 78, 0.04);
    --chrome-grid-line: rgba(11, 26, 20, 0.035);
  }

/* ══════════════ BASE ══════════════ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text-body);
  font-family: "Rajdhani", sans-serif;
  min-height: 100vh;
  transition: background 0.25s ease, color 0.25s ease;
}

::selection { background: var(--accent); color: var(--accent-on); }

:focus-visible {
  outline: 1px solid var(--accent-ink);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Scanlines — inert in Daylight, where --chrome-scanline is transparent */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(to bottom, transparent 0px, transparent 3px, var(--chrome-scanline) 3px, var(--chrome-scanline) 4px);
  pointer-events: none;
  z-index: 100;
}

/* Atmosphere — faint structural grid + accent glow. Reads as texture in
   Mission; in Daylight the tokens flatten it to a barely-there grid.
   Requires <div class="atmosphere"></div> as the first child of <body>. */
.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(ellipse 70% 45% at 18% -8%, var(--chrome-glow), transparent 60%),
    linear-gradient(var(--chrome-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--chrome-grid-line) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  mask-image: linear-gradient(to bottom, black 0%, rgba(0,0,0,0.35) 70%, rgba(0,0,0,0.15) 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, rgba(0,0,0,0.35) 70%, rgba(0,0,0,0.15) 100%);
}

/* Corner brackets — Mission only, via --chrome-bracket-display */
.corner { position: fixed; width: 32px; height: 32px; z-index: 90; pointer-events: none; display: var(--chrome-bracket-display); }
.corner.tl { top: 16px; left: 16px; border-top: 1px solid var(--accent-bracket); border-left: 1px solid var(--accent-bracket); }
.corner.tr { top: 16px; right: 16px; border-top: 1px solid var(--accent-bracket); border-right: 1px solid var(--accent-bracket); }
.corner.bl { bottom: 16px; left: 16px; border-bottom: 1px solid var(--accent-bracket); border-left: 1px solid var(--accent-bracket); }
.corner.br { bottom: 16px; right: 16px; border-bottom: 1px solid var(--accent-bracket); border-right: 1px solid var(--accent-bracket); }

/* ══════════════ TEXT STYLES ══════════════ */
.eyebrow {
  font-family: "Share Tech Mono", monospace;
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent-ink);
}

.section-label {
  font-family: "Share Tech Mono", monospace;
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-label);
}

.page-title {
  font-size: 36px; font-weight: 700; letter-spacing: 3px;
  text-transform: uppercase; color: var(--text-heading); line-height: 1.1;
}

.hero-title {
  font-family: "Rajdhani", sans-serif; font-weight: 700;
  font-size: clamp(36px, 7vw, 56px); letter-spacing: 2px; line-height: 1.1;
  text-transform: uppercase; color: var(--text-heading);
}

.sec-title { font-size: 28px; font-weight: 700; letter-spacing: 2px; color: var(--text-heading); line-height: 1.1; }
.card-title { font-size: 20px; font-weight: 700; letter-spacing: 1px; color: var(--text-heading); }
.lede { font-size: 18px; font-weight: 500; line-height: 1.5; color: var(--text-muted); }
.body { font-size: 15px; font-weight: 500; line-height: 1.6; color: var(--text-muted); }

.subtitle {
  font-family: "Share Tech Mono", monospace;
  font-size: 13px; letter-spacing: 0.1em; color: var(--text-subtle);
}

.stat-label {
  font-family: "Share Tech Mono", monospace;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-label);
}

.stat-value {
  font-family: "Share Tech Mono", monospace;
  font-size: 17px; letter-spacing: 0.06em; color: var(--accent-ink);
}

/* ══════════════ BUTTONS ══════════════ */
  .btn {
    font-family: "Share Tech Mono", monospace;
    font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
    padding: 13px 26px; border-radius: 4px; border: 1px solid transparent;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background 0.2s, border-color 0.2s, color 0.2s, opacity 0.2s;
  }
  .btn-sm { font-size: 12px; padding: 9px 18px; letter-spacing: 0.075em; }
  .btn-lg { font-size: 13px; padding: 17px 34px; letter-spacing: 0.15em; }
  .btn-block { display: flex; width: 100%; }

  .btn-primary { background: var(--accent); color: var(--accent-on); border-color: var(--accent); }
  .btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

  .btn-secondary { background: var(--accent-wash); color: var(--accent-ink); border-color: var(--accent-line); }
  .btn-secondary:hover { background: var(--bg-surface-hover); border-color: var(--accent-ink); }

  .btn-ghost { background: transparent; color: var(--text-body); border-color: var(--border); }
  .btn-ghost:hover { background: var(--bg-surface-hover); border-color: var(--border-hover); color: var(--text-heading); }

  .btn-danger { background: transparent; color: var(--danger-ink); border-color: var(--danger-ink); }
  .btn-danger:hover { background: var(--danger-ink); color: var(--bg-base); }

  .btn[disabled], .btn[aria-busy="true"] {
    color: var(--text-label); background: transparent;
    border-color: var(--border-subtle); cursor: not-allowed;
  }

  .btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ══════════════ FORM FIELDS ══════════════ */
.field { display: flex; flex-direction: column; gap: 8px; }

.field-label {
  font-family: "Share Tech Mono", monospace; font-size: 12px;
  letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-label);
}

.input {
  font-family: "Rajdhani", sans-serif; font-size: 16px; font-weight: 500;
  color: var(--text-body); background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 13px 14px; width: 100%;
  transition: border-color 0.2s, background 0.2s;
}
.input::placeholder { color: var(--text-label); font-weight: 400; }
.input:hover { border-color: var(--border-hover); }
.input:focus { outline: none; border-color: var(--accent-ink); background: var(--bg-surface-hover); }
.input:focus-visible { outline: 1px solid var(--accent-ink); outline-offset: 2px; }
.input[disabled] { color: var(--text-label); border-color: var(--border-subtle); cursor: not-allowed; }

.field-help { font-size: 14px; font-weight: 500; color: var(--text-muted); line-height: 1.5; }

.field-error {
  font-family: "Share Tech Mono", monospace; font-size: 12px;
  letter-spacing: 0.05em; color: var(--danger-ink);
}
.field.is-error .input { border-color: var(--danger-ink); }

.control-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px; padding: 24px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--bg-surface); box-shadow: var(--card-shadow);
}

/* ══════════════ CARD ══════════════ */
.card {
  position: relative; overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px; padding: 24px;
  box-shadow: var(--card-shadow);
  transition: border-color 0.2s, background 0.2s;
}

.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--gradient); opacity: 0; transition: opacity 0.2s;
}

a.card { color: inherit; text-decoration: none; }

a.card:hover, .card.is-interactive:hover { border-color: var(--border-hover); background: var(--bg-surface-hover); }
a.card:hover::before, .card.is-interactive:hover::before { opacity: 1; }

.card-tag {
  font-family: "Share Tech Mono", monospace;
  font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--accent-ink);
}

/* ══════════════ BADGE ══════════════ */
.badge {
  display: inline-block;
  font-family: "Share Tech Mono", monospace;
  font-size: 12px; letter-spacing: 0.05em;
  background: var(--bg-inset); color: var(--text-label);
  border: 1px solid var(--border-subtle); border-radius: 3px;
  padding: 4px 8px;
}

/* ══════════════ GRID ══════════════ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ══════════════ SHELL ══════════════ */
.shell {
  position: relative; z-index: 1;
  max-width: 1080px; margin: 0 auto;
  padding-inline: 48px;
}

@media (max-width: 768px) { .shell { padding-inline: 24px; } }

/* ══════════════ NAV ══════════════ */
.nav {
  position: sticky; top: 0; z-index: 60;
  height: 64px; display: flex; align-items: center;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
}

.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; width: 100%; }

.wordmark {
  font-size: 20px; font-weight: 700; letter-spacing: 3px;
  text-transform: uppercase; color: var(--text-heading);
  text-decoration: none;
}

/* Brand group: the wordmark and, 12px after it, the same "by rising.company"
   byline the app bar carries — the way home from a landing page too. The
   byline hides below 640px with the rest of the nav's small text. */
.nav-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nav-brand .wordmark { white-space: nowrap; }

.nav-links { display: flex; align-items: center; gap: 28px; }

.nav-links a {
  font-family: "Share Tech Mono", monospace;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-label); text-decoration: none; transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent-ink); }

@media (max-width: 640px) { .nav-links a:not(.btn) { display: none; } }

/* ══════════════ APP SHELL ══════════════ */
/* Chrome for the signed-in product — the surface behind the auth boundary.
   Distinct from .nav / .site-footer, which belong to the landing page.

   <body class="app">
     <header class="app-bar">   brand · byline · nav · session   </header>
     <main class="app-main">    .page-header + content   </main>
     <footer class="app-footer"> ident · links · backlink </footer>
   </body>

   Chrome sits on --bg-surface; content sits on --bg-base. Both bars are
   full-bleed with the 48px page gutter (24px below 768px) — an app is not
   width-limited the way a landing page is. Put .shell inside .app-main if
   a view wants the 1080px column. */
.app { display: flex; flex-direction: column; min-height: 100vh; }

.app-main { flex: 1; position: relative; z-index: 1; padding: 48px; }

/* ── App bar ── */
.app-bar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 32px;
  min-height: 56px; padding-inline: 48px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

/* Brand: the favicon mark + product name, linking to the product's home.
   The mark carries the Rising identity so the name can be the product's
   own. The .app-byline after it is the way back to rising.company;
   .app-context after that names a real tenant / workspace / environment
   and is omitted when there is none. */
.app-brand {
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
  color: var(--text-heading); text-decoration: none;
}
.app-brand img, .app-brand svg { width: 24px; height: 24px; border-radius: 4px; flex-shrink: 0; }
.app-brand .wordmark { font-size: 18px; letter-spacing: 3px; }

/* Byline: the way home. "by rising.company" after the wordmark, in the
   label voice, and it is the link — same tab, this is navigation. The
   negative margin pulls it from the bar's 32px gap to the brand's 12px. */
.app-byline {
  font-family: "Share Tech Mono", monospace;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim); text-decoration: none; white-space: nowrap;
  transition: color 0.2s;
}
.app-brand + .app-byline { margin-left: -20px; }
.app-byline span { color: var(--text-label); transition: color 0.2s; }
.app-byline:hover, .app-byline:hover span { color: var(--accent-ink); }

.app-context {
  font-family: "Share Tech Mono", monospace;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-label); white-space: nowrap;
}
.app-context::before { content: "·"; margin-right: 12px; color: var(--text-dim); }

/* Primary navigation: mono links, active one carries a 1px accent rule
   sitting on the bar's bottom border. */
.app-nav { display: flex; align-items: center; gap: 24px; flex: 1; min-width: 0; }

.app-nav a {
  font-family: "Share Tech Mono", monospace;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-label); text-decoration: none; white-space: nowrap;
  padding-block: 6px; border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.app-nav a:hover { color: var(--accent-ink); }
.app-nav a[aria-current="page"] { color: var(--text-heading); border-bottom-color: var(--accent-ink); }

/* Session cluster: status · user menu. Always right-aligned. Status is
   system state and stays outside the menu; everything about the person
   (who they are, their settings, the exit) lives inside it. */
.app-session { display: flex; align-items: center; gap: 20px; margin-left: auto; flex-shrink: 0; }

/* User menu — <details>/<summary> so it works without JS; a framework may
   swap in its own popover (a button with aria-expanded and a Motion panel)
   but keeps the classes and the item order. */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; }
.user-menu > summary::-webkit-details-marker { display: none; }

.user-menu-trigger {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 0; cursor: pointer; border-radius: 4px;
  color: var(--text-subtle); transition: color 0.2s;
}
.user-menu-trigger:hover, .user-menu[open] > .user-menu-trigger,
.user-menu-trigger[aria-expanded="true"] { color: var(--text-heading); }

.user-menu-email {
  font-family: "Share Tech Mono", monospace;
  font-size: 12px; letter-spacing: 0.05em;
  max-width: 24ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Initials chip: the identity that survives when the email hides. */
.user-initials {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 4px; flex-shrink: 0;
  font-family: "Share Tech Mono", monospace; font-size: 12px; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--accent-ink);
  background: var(--accent-wash); border: 1px solid var(--accent-line);
}

.user-menu-chevron {
  width: 8px; height: 8px; flex-shrink: 0;
  border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform 0.2s;
}
.user-menu[open] .user-menu-chevron,
.user-menu-trigger[aria-expanded="true"] .user-menu-chevron { transform: translateY(2px) rotate(225deg); }

.user-menu-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 70;
  min-width: 240px; padding: 6px;
  background: var(--bg-surface); border: 1px solid var(--border-hover);
  border-radius: 6px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}
[data-theme="daylight"] .user-menu-panel { box-shadow: 0 12px 32px rgba(11, 26, 20, 0.12); }

.user-menu-head {
  padding: 8px 10px 10px; margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.user-menu-head .section-label { font-size: 12px; letter-spacing: 0.15em; margin-bottom: 4px; }
.user-menu-head .user-menu-email { max-width: none; color: var(--text-body); }

.user-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px; border-radius: 4px; text-align: left;
  font-family: "Share Tech Mono", monospace;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-label); background: none; border: 0; cursor: pointer;
  text-decoration: none; transition: background 0.2s, color 0.2s;
}
.user-menu-item:hover { background: var(--bg-surface-hover); color: var(--text-heading); }

/* Sign out is always the last item, ruled off from the rest. */
.user-menu-signout { margin-top: 6px; border-top: 1px solid var(--border); border-radius: 0 0 4px 4px; padding-top: 12px; }
.user-menu-signout:hover { color: var(--danger-ink); }

/* Plain links in the session cluster (help, docs) share the nav-link voice. */
.app-session > a {
  font-family: "Share Tech Mono", monospace;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-label); text-decoration: none; transition: color 0.2s;
}
.app-session > a:hover { color: var(--accent-ink); }

/* Status readout: 6px dot + mono label. Live by default; .is-degraded and
   .is-down recolour the dot and stop the pulse. */
.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: "Share Tech Mono", monospace;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-label); white-space: nowrap;
}
.status::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
  animation: status-pulse 2.4s ease-out infinite;
}
.status.is-degraded::before { background: var(--warning); animation: none; }
.status.is-down::before { background: var(--danger); animation: none; }

@keyframes status-pulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-line); }
  70%  { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ── Page header ── */
/* Per-view heading inside .app-main. One per page, directly under the bar.
   eyebrow → title (+ actions on the same baseline) → subtitle. */
.page-header {
  padding-bottom: 24px; margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.page-header .eyebrow { margin-bottom: 8px; }
.page-header .subtitle { margin-top: 8px; }
.page-header-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px 24px; flex-wrap: wrap;
}

/* ── App footer ── */
/* A status strip, not a sitemap: product ident + build on the left, a few
   links and the required rising.company backlink on the right. 16px
   vertical padding — it is chrome, so it sits tighter than the 24px
   landing footer. */
.app-footer {
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 24px; padding: 16px 48px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  font-family: "Share Tech Mono", monospace;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim);
}
.app-footer a { color: inherit; text-decoration: none; transition: color 0.2s; }
.app-footer a:hover { color: var(--accent-ink); }
.app-footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }

/* ── Sidebar products ── */
/* os and safe navigate by module, so they keep a 260px sidebar instead of
   the nav row. The slots are the same, relocated: brand + byline + context
   at the top, modules in the middle, session + build + backlink at the
   bottom — the sidebar bottom is the app footer.

   <body class="app has-sidebar">
     <nav class="app-sidebar"> top · nav · bottom </nav>
     <header class="app-bar app-bar-mobile">   …   </header>   phone only
     <main class="app-main"> … </main>
     <footer class="app-footer app-footer-mobile"> … </footer> phone only
   </body>

   The sidebar is desktop chrome. Below 768px it hides and the product
   renders the ordinary .app-bar and .app-footer instead — the same mobile
   form as every other product, modules as the scrolling nav row and the
   org switcher inside the user menu. No drawer. */
.app.has-sidebar { flex-direction: row; }
.app.has-sidebar > .app-main { min-width: 0; }

.app-sidebar {
  display: flex; flex-direction: column; flex-shrink: 0;
  width: 260px; position: sticky; top: 0; height: 100vh;
  background: var(--bg-surface); border-right: 1px solid var(--border);
}
.app-sidebar-top { padding: 40px 32px 28px; display: flex; flex-direction: column; gap: 12px; }
.app-sidebar-top .app-brand .wordmark { font-size: 24px; letter-spacing: 2px; }
.app-sidebar-top .app-brand + .app-byline { margin: -4px 0 0; }
.app-sidebar-top .app-context::before { content: none; }
.app-sidebar-top .app-context { margin-right: 0; }

.app-sidebar-rule { height: 1px; margin: 0 24px; background: var(--border); flex-shrink: 0; }

.app-sidebar-nav { padding: 28px 20px; flex: 1; min-height: 0; overflow-y: auto; }
.app-sidebar-nav .section-label { margin: 0 4px 20px; }
.app-sidebar-nav a {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 6px; text-decoration: none;
  color: var(--text-muted); transition: background 0.2s, color 0.2s;
}
.app-sidebar-nav a + a { margin-top: 4px; }
.app-sidebar-nav a:hover { color: var(--text-heading); background: color-mix(in srgb, var(--bg-surface-hover) 50%, transparent); }
.app-sidebar-nav a[aria-current="page"] { color: var(--text-heading); background: var(--bg-surface-hover); }
.app-sidebar-nav a[aria-current="page"]::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 2px; height: 16px; border-radius: 1px; background: var(--accent);
}
.app-sidebar-nav .tag {
  font-family: "Share Tech Mono", monospace; font-size: 12px; letter-spacing: 1px;
  width: 28px; flex-shrink: 0; color: var(--text-subtle); transition: color 0.2s;
}
.app-sidebar-nav a:hover .tag { color: var(--text-muted); }
.app-sidebar-nav a[aria-current="page"] .tag { color: var(--accent-ink); }
.app-sidebar-nav .label { font-family: "Rajdhani", sans-serif; font-size: 14px; font-weight: 500; letter-spacing: 1px; }

/* Bottom: session, then a rule, then build + backlink. Sign out last. */
.app-sidebar-bottom { padding: 20px 32px; display: flex; flex-direction: column; gap: 8px; }
.app-sidebar-bottom .section-label { letter-spacing: 0.15em; }
.app-sidebar-bottom .user-menu-email { max-width: none; color: var(--text-subtle); }
.app-sidebar-bottom a, .app-sidebar-bottom button {
  align-self: flex-start; padding: 0; background: none; border: 0; cursor: pointer;
  font-family: "Share Tech Mono", monospace; font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-label); text-decoration: none; transition: color 0.2s;
}
.app-sidebar-bottom a:hover, .app-sidebar-bottom button:hover { color: var(--text-heading); }
.app-sidebar-bottom .user-menu-signout { margin: 0; border: 0; padding: 0; width: auto; }
.app-sidebar-bottom .user-menu-signout:hover { color: var(--danger-ink); }
.app-sidebar-bottom .app-sidebar-rule { margin: 12px 0; }
.app-sidebar-bottom .build { font-family: "Share Tech Mono", monospace; font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-dim); white-space: nowrap; }
.app-sidebar-bottom .rising-backlink { color: var(--text-dim); }
.app-sidebar-bottom .rising-backlink:hover { color: var(--accent-ink); }

/* The phone chrome of a sidebar product: hidden until the sidebar hides. */
.app-bar-mobile, .app-footer-mobile { display: none; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .app-main { padding: 24px; }
  .app-footer { padding-inline: 24px; }

  /* Sidebar products swap the sidebar for the bar and the footer. */
  .app.has-sidebar { flex-direction: column; }
  .app-sidebar { display: none; }
  .app-bar-mobile, .app-footer-mobile { display: flex; }

  /* The bar becomes two rows: brand + session on the first, nav on the
     second, scrolling sideways rather than wrapping. */
  .app-bar { flex-wrap: wrap; gap: 0 24px; padding-inline: 24px; min-height: 0; }
  .app-brand, .app-session { min-height: 56px; }
  .app-brand + .app-byline { margin-left: -12px; }
  /* The nav row is a 44px touch row. It bleeds to the viewport edges so
     the links scroll under the gutters, and a 24px fade at each edge says
     there is more; the active rule sits on the bar's bottom border. */
  .app-nav {
    order: 3; flex-basis: 100%; gap: 24px;
    overflow-x: auto; scrollbar-width: none;
    margin-inline: -24px; padding-inline: 24px;
    mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 24px), transparent);
  }
  .app-nav::-webkit-scrollbar { display: none; }
  .app-nav a { padding: 16px 0 15px; line-height: 1; }
}

@media (max-width: 640px) {
  .app-byline, .app-context, .user-menu-trigger .user-menu-email { display: none; }
  .app-footer { justify-content: center; text-align: center; }
}

/* ══════════════ LANDING BANDS ══════════════ */
.band { padding-block: 96px; }
@media (max-width: 768px) { .band { padding-block: 64px; } }

.band-inset {
  background: var(--bg-inset);
  border-block: 1px solid var(--border-subtle);
}

.hero { text-align: center; max-width: 720px; margin: 0 auto; padding: 96px 0 64px; }
.hero .lede { margin: 16px auto 0; max-width: 52ch; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 32px; }

.hero-trust {
  font-family: "Share Tech Mono", monospace;
  font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--text-label); margin-top: 24px;
}

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; }

.step-num {
  font-family: "Share Tech Mono", monospace;
  font-size: 13px; letter-spacing: 0.1em; color: var(--accent-ink);
  padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ══════════════ AUTH ══════════════ */
.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }

.auth-pitch, .auth-panel {
  display: flex; flex-direction: column; justify-content: center; padding: 48px;
}

.auth-pitch { background: var(--bg-inset); border-right: 1px solid var(--border-subtle); }

.auth-points {
  list-style: none; padding: 0; margin: 32px 0 0;
  display: flex; flex-direction: column; gap: 12px;
  font-family: "Share Tech Mono", monospace; font-size: 12px;
  letter-spacing: 0.05em; color: var(--text-subtle);
}
.auth-points li::before { content: "+"; color: var(--accent-ink); margin-right: 10px; }

.auth-card { max-width: 400px; width: 100%; display: flex; flex-direction: column; gap: 24px; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; min-height: 0; }
  .auth-pitch { border-right: none; border-bottom: 1px solid var(--border-subtle); padding: 64px 24px 48px; }
  .auth-panel { padding: 48px 24px 64px; align-items: center; }
}

/* ══════════════ EMPTY STATE ══════════════ */
.empty-state { text-align: center; max-width: 420px; margin: 0 auto; padding-block: 96px; }
.empty-state .body { margin: 12px 0 24px; }

/* ══════════════ FOOTER ══════════════ */
.site-footer {
  font-family: "Share Tech Mono", monospace;
  font-size: 12px; letter-spacing: 0.1em; color: var(--text-dim);
  border-top: 1px solid var(--border);
  padding-block: 24px;
}

.site-footer a { color: inherit; text-decoration: none; transition: color 0.2s; }
.site-footer a:hover { color: var(--accent-ink); }

.rising-backlink {
  font-family: "Share Tech Mono", monospace;
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-dim); text-decoration: none; transition: color 0.2s;
}
.rising-backlink:hover { color: var(--accent-ink); }

/* ══════════════ MOTION ══════════════ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
