/* =========================================================
   layout.css — app shell, sidebar, topbar, bottom nav.
========================================================= */

#app-root { position: relative; z-index: 1; }

.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh; min-height: 100dvh;
}

/* ── Sidebar ─────────────────────────────────────────── */
.shell-side {
  display: flex; flex-direction: column;
  gap: 4px;
  padding: 18px 14px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--bg-1) 92%, transparent),
    color-mix(in srgb, var(--bg-2) 92%, transparent));
  border-right: 1px solid var(--border);
  position: sticky; top: 0;
  height: 100vh; height: 100dvh;
}
.shell-logo {
  display: flex; align-items: center; justify-content: center;
  padding: 6px 0 14px;
}
.shell-logo img {
  width: 42px; height: 42px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}

.shell-nav {
  display: flex; flex-direction: column; gap: 2px;
}
.shell-nav {
  overflow-y: auto;
  min-height: 0;
}
.shell-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.shell-nav-item {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px 9px 13px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  text-align: left;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.shell-nav-item::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px; height: 18px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
  transition: transform var(--dur-fast) var(--ease-out);
}
.shell-nav-item:hover {
  background: var(--accent-soft);
  color: var(--text-1);
}
.shell-nav-item.active {
  background: color-mix(in srgb, var(--accent-soft) 70%, transparent);
  color: var(--text-1);
}
.shell-nav-item.active::before { transform: translateY(-50%) scaleY(1); }
.shell-nav-ico {
  width: 22px; text-align: center;
  font-size: 15px;
  color: var(--accent);
}

/* ── Main ─────────────────────────────────────────────── */
.shell-main {
  display: flex; flex-direction: column;
  min-width: 0;
  background: transparent;
}

.shell-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 16px var(--pad-page);
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--bg-1) 65%, transparent) 0%,
      color-mix(in srgb, var(--bg-1) 0%, transparent) 100%);
  backdrop-filter: blur(6px);
  position: sticky; top: 0;
  z-index: 10;
}
.shell-topbar-title {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-1);
}
.shell-topbar-title::before {
  content: '~/ ';
  color: var(--accent);
  font-weight: 500;
}
.shell-topbar-actions { display: flex; align-items: center; gap: 8px; }

.shell-route {
  padding: var(--pad-page);
  flex: 1;
  display: block;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Bottom mobile nav ────────────────────────────────── */
.shell-bottom {
  display: none;
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 60px;
  padding: 7px 8px max(7px, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg-0) 94%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  backdrop-filter: blur(18px) saturate(1.1);
  border-top: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  box-shadow: 0 -16px 42px rgba(2, 6, 23, 0.18);
  z-index: 20;
}
.shell-bottom-item {
  flex: 1;
  min-width: 52px;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 2px;
  font-size: 11px;
  color: var(--text-3);
  text-decoration: none;
  transition: color var(--dur-fast), transform var(--dur-fast);
}
.shell-bottom-item.active {
  color: var(--accent);
}
.shell-bottom-item:active { transform: scale(0.95); }
.shell-bottom-ico {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
}
.shell-bottom-ico svg {
  width: 22px;
  height: 22px;
  transition: transform var(--dur-fast), stroke-width var(--dur-fast);
}
.shell-bottom-item.active .shell-bottom-ico svg {
  stroke-width: 2.35;
  transform: translateY(-1px);
}
.shell-bottom-label {
  max-width: 100%;
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shell-bottom-item.active .shell-bottom-label { font-weight: 700; }

@media (max-width: 880px) {
  .app-shell { grid-template-columns: 1fr; }
  .shell-side { display: none; }
  .shell-bottom { display: flex; }
  .shell-route {
    padding: var(--pad-page) var(--pad-page) calc(64px + var(--pad-page));
  }
  .shell-topbar { padding: 12px var(--pad-page); }
  .shell-topbar-title { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .shell-bottom-item,
  .shell-bottom-ico svg { transition: none; }
}

/* ── Toast ────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom, 24px));
  left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text-1);
  color: var(--bg-1);
  padding: 10px 18px;
  border-radius: var(--r-pill);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur), transform var(--dur);
  z-index: 100;
}
.toast.show {
  opacity: 0.95;
  transform: translateX(-50%) translateY(0);
}

/* ── Buttons ──────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px;
  background: var(--accent);
  color: var(--accent-fg);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  transition: background var(--dur-fast), transform var(--dur-fast), box-shadow var(--dur-fast);
}
.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, white);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.btn-primary:active { transform: translateY(1px); }
.btn-primary[disabled] { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

.btn-soft {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--border-accent);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.btn-soft:hover { background: var(--accent); color: var(--accent-fg); }

.field {
  display: flex; flex-direction: column; gap: 6px;
}
.field span { font-size: 13px; color: var(--text-2); font-weight: 500; }

/* ── Bare shell (unauthed: no sidebar/topbar/bottom-nav) ── */
.bare-shell {
  min-height: 100vh; min-height: 100dvh;
  position: relative;
}
.bare-route { min-height: 100vh; min-height: 100dvh; }

.shell-account {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-2) 84%, transparent);
}
.shell-account-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 4px;
  border-radius: var(--r-sm);
  color: var(--text-1);
  text-decoration: none;
}
.shell-account-main:hover,
.shell-account-main.active {
  background: var(--accent-soft);
}
.shell-account-avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--text-1);
  font-family: var(--font-serif);
  font-weight: 600;
  overflow: hidden;
}
.shell-account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.shell-account-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}
.shell-account-copy b,
.shell-account-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shell-account-copy b {
  font-size: 13px;
  font-weight: 600;
}
.shell-account-copy small {
  color: var(--text-3);
  font-size: 11px;
}
.shell-account-action {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  color: var(--text-2);
  background: var(--bg-1);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: color var(--dur-fast), border-color var(--dur-fast), background var(--dur-fast);
}
.shell-account-action:hover,
.shell-account-action.active {
  color: var(--text-1);
  border-color: var(--border-accent);
  background: var(--accent-soft);
}

/* =========================================================
   v22 observatory app shell.
========================================================= */

html[data-design="observatory"] #app-root { z-index: 3; }

html[data-design="observatory"] .app-shell {
  grid-template-columns: 242px minmax(0, 1fr);
}

html[data-design="observatory"] .shell-side {
  gap: 16px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(3, 7, 18, 0.92), rgba(8, 16, 30, 0.78)),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
  border-right: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: inset -1px 0 0 hsl(var(--hue), var(--sat), 69%, 0.08);
}

.shell-logo {
  justify-content: flex-start;
  gap: 12px;
  padding: 0 0 12px;
}

.shell-logo-orbit {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  border: 1px solid rgba(226, 232, 240, 0.42);
  background:
    radial-gradient(circle at 50% 50%, rgba(94, 234, 212, 0.95) 0 3px, transparent 4px),
    radial-gradient(circle at 50% 50%, hsl(var(--hue), var(--sat), 69%, 0.2), transparent 60%);
  box-shadow: 0 0 26px hsl(var(--hue), var(--sat), 69%, 0.24), inset 0 0 18px rgba(226, 232, 240, 0.08);
  position: relative;
}

.shell-logo-orbit::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1px solid rgba(167, 139, 250, 0.52);
  border-left-color: transparent;
  animation: spin 4s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.shell-logo-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.shell-logo-copy b {
  color: #f8fbff;
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: 0.04em;
  line-height: 1;
}
.shell-logo-copy small {
  margin-top: 4px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
  white-space: nowrap;
}

.shell-nav-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
}
.shell-nav-title {
  padding: 0 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

html[data-design="observatory"] .shell-nav-item {
  gap: 12px;
  min-height: 52px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: var(--r);
  background: transparent;
}
html[data-design="observatory"] .shell-nav-item:hover,
html[data-design="observatory"] .shell-nav-item.active {
  color: var(--text-1);
  background: hsl(var(--hue), var(--sat), 69%, 0.08);
  border-color: hsl(var(--hue), var(--sat), 69%, 0.28);
}
html[data-design="observatory"] .shell-nav-item.active {
  box-shadow: 0 0 22px hsl(var(--hue), var(--sat), 69%, 0.12);
}
.shell-nav-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.shell-nav-copy small {
  color: var(--text-3);
  font-size: 10px;
  letter-spacing: 0.16em;
}
html[data-design="observatory"] .shell-nav-ico {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid hsl(var(--hue), var(--sat), 69%, 0.32);
  color: var(--accent);
  background: rgba(8, 16, 30, 0.8);
}

.shell-system-card {
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: rgba(8, 16, 30, 0.64);
}
.shell-system-head,
.shell-system-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.shell-system-head {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
}
.shell-system-close {
  color: var(--text-3);
  font-family: var(--font-mono);
}
.shell-system-line {
  padding: 4px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}
.shell-system-line b { color: var(--text-1); font-weight: 600; }
.shell-system-line.ok b { color: var(--giverny-leaf); }
.shell-system-line.warn b { color: var(--giverny-sun); }
.shell-system-line.idle b { color: var(--text-2); }
.shell-mini-spark {
  height: 30px;
  margin-top: 8px;
  display: flex;
  align-items: end;
  gap: 3px;
}
.shell-mini-spark span {
  flex: 1;
  min-width: 4px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--accent), hsl(var(--hue), var(--sat), 69%, 0.14));
}
.shell-mini-spark span:nth-child(1) { height: 28%; }
.shell-mini-spark span:nth-child(2) { height: 42%; }
.shell-mini-spark span:nth-child(3) { height: 35%; }
.shell-mini-spark span:nth-child(4) { height: 62%; }
.shell-mini-spark span:nth-child(5) { height: 48%; }
.shell-mini-spark span:nth-child(6) { height: 76%; }
.shell-mini-spark span:nth-child(7) { height: 55%; }

html[data-design="observatory"] .shell-account {
  grid-template-columns: 1fr;
  background: rgba(11, 22, 39, 0.78);
}

html[data-design="observatory"] .shell-topbar {
  min-height: 66px;
  border-bottom-color: rgba(148, 163, 184, 0.18);
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(18px);
}
.shell-title-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.shell-topbar-sub {
  margin-top: 3px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
}
html[data-design="observatory"] .shell-route {
  max-width: 1360px;
}

.command-trigger,
.live-chip,
.clock,
.sync-stamp,
.health-pill {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: rgba(8, 16, 30, 0.62);
  color: var(--text-2);
  padding: 6px 11px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.command-trigger:hover,
.health-pill.ok {
  border-color: var(--border-accent);
  color: var(--accent);
  box-shadow: 0 0 18px hsl(var(--hue), var(--sat), 69%, 0.12);
}
.live-chip {
  color: #fff;
  font-weight: 800;
}
.live-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 7px;
  background: var(--giverny-leaf);
  box-shadow: 0 0 14px var(--giverny-leaf);
}

.command-palette {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
}
.command-palette.open { display: block; }
.command-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.54);
  backdrop-filter: blur(10px);
}
.command-box {
  position: relative;
  width: min(680px, calc(100vw - 32px));
  margin: 11vh auto 0;
  border: 1px solid var(--border-accent);
  border-radius: var(--r-lg);
  background: rgba(5, 11, 21, 0.94);
  box-shadow: var(--shadow-lg), 0 0 42px hsl(var(--hue), var(--sat), 69%, 0.14);
  overflow: hidden;
}
.command-input-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}
.command-input-row span {
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
}
.command-input-row input {
  width: 100%;
  border: 0;
  background: transparent;
  font-size: 15px;
}
.command-results {
  max-height: min(520px, 62vh);
  overflow: auto;
  padding: 8px;
}
.command-row {
  width: 100%;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: var(--r);
  color: var(--text-1);
  text-align: left;
}
.command-row:hover {
  background: var(--accent-soft);
}
.command-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  color: var(--accent);
}
.command-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.command-copy small {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
}

@media (max-width: 880px) {
  html[data-design="observatory"] .app-shell { grid-template-columns: 1fr; }
  html[data-design="observatory"] .shell-side { display: none; }
  html[data-design="observatory"] .shell-main {
    width: 100%;
    min-width: 0;
  }
  html[data-design="observatory"] .shell-topbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 8px;
  }
  html[data-design="observatory"] .shell-topbar-title {
    white-space: nowrap;
    font-size: 15px;
  }
  html[data-design="observatory"] .shell-topbar-actions {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  html[data-design="observatory"] .shell-topbar-actions::-webkit-scrollbar {
    display: none;
  }
  html[data-design="observatory"] .shell-route {
    max-width: none;
    padding-bottom: calc(72px + var(--pad-page));
  }
  .clock,
  .sync-stamp { display: none; }
  .shell-topbar-sub { display: none; }
}

/* =========================================================
   v23 Pulse mirror shell.
========================================================= */

.pulse-app {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

.loading-line {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #60a5fa, #67e8f9, #a78bfa);
  box-shadow: 0 0 22px hsl(var(--hue), var(--sat), 69%, 0.82);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s ease;
}

.ambient-grid {
  position: fixed;
  inset: -20vh -10vw;
  z-index: 0;
  pointer-events: none;
  background:
    conic-gradient(from 180deg at 50% 50%, transparent, hsl(var(--hue), var(--sat), 69%, 0.05), transparent 22%, rgba(167, 139, 250, 0.05), transparent 44%),
    repeating-linear-gradient(120deg, transparent 0 44px, hsl(var(--hue), var(--sat), 69%, 0.03) 44px 45px);
  filter: blur(0.2px);
  animation: fieldDrift 28s linear infinite;
}

@keyframes fieldDrift {
  to { transform: translate3d(-36px, 24px, 0) rotate(0.001deg); }
}

.topbar {
  position: relative;
  z-index: 5;
  width: min(1580px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 16px 0 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  color: var(--text-1);
}

.brand-mark {
  position: relative;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(226, 232, 240, 0.48);
  background:
    radial-gradient(circle at 50% 50%, hsl(var(--hue), var(--sat), 69%, 0.8) 0 2px, transparent 3px),
    radial-gradient(circle at 50% 50%, hsl(var(--hue), var(--sat), 69%, 0.17), transparent 58%);
  box-shadow: 0 0 28px hsl(var(--hue), var(--sat), 69%, 0.28), inset 0 0 18px rgba(226, 232, 240, 0.08);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1px solid rgba(167, 139, 250, 0.44);
  border-left-color: transparent;
  animation: spin 4s linear infinite;
}

.brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.brand-name {
  color: #f8fbff;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 0.28em;
  line-height: 1;
  text-shadow: 0 0 24px hsl(var(--hue), var(--sat), 69%, 0.3);
}

.brand-sub {
  margin-top: 5px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.pulse-app .observatory-shell {
  position: relative;
  z-index: 2;
  width: min(1580px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 0 0 72px;
}

.pulse-app .shell-route {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

.pulse-app .command-trigger,
.pulse-app .live-chip,
.pulse-app .clock,
.pulse-app .sync-stamp,
.pulse-app .health-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  background: rgba(8, 16, 30, 0.56);
  backdrop-filter: blur(18px);
  color: var(--text-2);
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.09em;
  white-space: nowrap;
}

.pulse-app .health-pill { justify-content: center; min-width: 118px; }
.pulse-app .command-trigger { color: var(--text-1); }
.pulse-app .command-trigger:hover {
  border-color: hsl(var(--hue), var(--sat), 69%, 0.7);
  box-shadow: 0 0 20px hsl(var(--hue), var(--sat), 69%, 0.18);
}
.pulse-app .live-chip {
  color: #fff;
  font-weight: 800;
}
.pulse-app .live-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 7px;
  background: var(--giverny-leaf);
  box-shadow: 0 0 16px var(--giverny-leaf);
  animation: pulseLight 1.6s steps(2, end) infinite;
}
.pulse-app .health-pill.ok {
  color: var(--giverny-leaf);
  border-color: rgba(94, 234, 212, 0.45);
}
.pulse-app .health-pill.watch {
  color: var(--giverny-sun);
  border-color: rgba(251, 191, 36, 0.42);
}

@keyframes pulseLight { 50% { opacity: 0.32; } }

.pulse-app .command-row {
  grid-template-columns: 34px minmax(0, 1fr) 72px;
}
.command-route {
  justify-self: end;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
}
.command-code {
  position: relative;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 900;
}

@media (max-width: 760px) {
  .topbar,
  .pulse-app .observatory-shell {
    width: calc(100vw - 20px);
  }
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
  }
  .brand {
    gap: 9px;
  }
  .brand-name {
    font-size: 20px;
    letter-spacing: 0.22em;
  }
  .brand-sub { display: none; }
  .brand-mark {
    width: 28px;
    height: 28px;
  }
  .topbar-right {
    gap: 6px;
    max-width: 58vw;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  .topbar-right::-webkit-scrollbar { display: none; }
  .pulse-app .clock,
  .pulse-app .sync-stamp {
    display: none;
  }
  .pulse-app .command-trigger,
  .pulse-app .live-chip,
  .pulse-app .health-pill {
    min-height: 28px;
    padding: 5px 8px;
    font-size: 10px;
  }
  .pulse-app .health-pill { min-width: auto; }
  .pulse-app .shell-route {
    padding-bottom: calc(72px + var(--pad-page));
  }
}

@media (max-width: 430px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .brand-name {
    font-size: 18px;
    letter-spacing: 0.18em;
  }
  .pulse-app .live-chip {
    display: none;
  }
  .topbar-right {
    max-width: 46vw;
  }
}

/* v49 Star Map fidelity shell: the map owns the whole visual field. */
.brand-image {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(226, 232, 240, 0.36);
}
.pulse-app .health-pill.health-dot {
  width: 30px;
  min-width: 30px;
  padding: 0;
}
.pulse-app .health-pill.health-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}
html[data-route="universe"] .pulse-app > .topbar,
html[data-route="universe"] .pulse-app > .ambient-grid {
  display: none;
}
html[data-route="universe"] .pulse-app .observatory-shell {
  width: 100%;
  margin: 0;
  padding: 0;
}
html[data-route="universe"] .pulse-app .shell-route {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
}

@media (max-width: 760px) {
  .brand-image { width: 28px; height: 28px; }
}
