/* surface-nav · the cross-cut tool shell (2026-06-02)
   ────────────────────────────────────────────────────────────────
   A persistent left rail + ⌘K palette injected into every live cut by
   surface-nav.js. Turns the standalone cuts into one navigable app.
   Consumes canon tokens (--frame-bg, --p-accent, --mono…); redefines
   nothing. Positioned fixed so it overlays each cut's own .wrap without
   disturbing the cut's internal layout. */

:root {
  --sn-w: 56px;            /* collapsed rail width */
  --sn-w-open: 208px;      /* expanded on hover */
}

/* push nothing — the rail floats over the left gutter the artboards
   already leave empty. Cuts keep their own 1920 layout untouched. */
.sn-rail {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sn-w);
  z-index: 9000;
  background: color-mix(in oklch, var(--frame-bg-2, #0C0C0F) 92%, transparent);
  backdrop-filter: blur(8px);
  border-right: 1px solid var(--frame-border, #1F1F23);
  display: flex;
  flex-direction: column;
  padding: 14px 0;
  gap: 2px;
  transition: width 180ms cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
  font-family: var(--mono, "Geist Mono", monospace);
}
.sn-rail:hover { width: var(--sn-w-open); }

.sn-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 0 14px 18px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--frame-border, #1F1F23);
  white-space: nowrap;
}
.sn-brand .sn-glyph { color: var(--p-accent, #8E66FB); font-size: 16px; flex-shrink: 0; }
.sn-brand .sn-name {
  font-family: var(--display, Georgia, serif);
  font-size: 15px; color: var(--text, #E8E8EA);
  opacity: 0; transition: opacity 160ms;
}
.sn-rail:hover .sn-name { opacity: 1; }

.sn-item {
  display: flex; align-items: center; gap: 14px;
  padding: 9px 0 9px 18px;
  text-decoration: none;
  color: var(--text-dim, #7A7A82);
  white-space: nowrap;
  border-left: 2px solid transparent;
  transition: color 140ms, background 140ms, border-color 140ms;
  cursor: pointer;
}
.sn-item:hover { color: var(--text, #E8E8EA); background: rgba(255,255,255,0.03); }
.sn-item.is-current {
  color: var(--text, #E8E8EA);
  border-left-color: var(--p-accent, #8E66FB);
}
.sn-item .sn-ico {
  flex-shrink: 0; width: 18px; text-align: center;
  font-size: 13px;
  color: inherit;
}
.sn-item.is-current .sn-ico { color: var(--p-accent, #8E66FB); }
.sn-item .sn-label {
  font-size: 11px; letter-spacing: 0.04em;
  opacity: 0; transition: opacity 160ms;
}
.sn-rail:hover .sn-label { opacity: 1; }

.sn-spacer { flex: 1; }

.sn-hint {
  padding: 0 0 0 18px;
  font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-faint, #4A4A52);
  white-space: nowrap;
  opacity: 0; transition: opacity 160ms;
}
.sn-rail:hover .sn-hint { opacity: 1; }

/* ── ⌘K command palette ── */
.sn-palette {
  position: fixed; inset: 0;
  z-index: 9500;
  display: none;
  align-items: flex-start; justify-content: center;
  padding-top: 18vh;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(3px);
}
.sn-palette.is-open { display: flex; }
.sn-pal-box {
  width: min(520px, 92vw);
  background: var(--frame-bg, #0E0E11);
  border: 1px solid var(--card-border, #232327);
  border-radius: 10px;
  box-shadow: 0 40px 90px rgba(0,0,0,0.7);
  overflow: hidden;
  font-family: var(--mono, "Geist Mono", monospace);
}
.sn-pal-input {
  width: 100%;
  background: transparent; border: 0; outline: 0;
  padding: 16px 18px;
  color: var(--text, #E8E8EA);
  font-family: var(--mono, "Geist Mono", monospace);
  font-size: 14px; letter-spacing: 0.01em;
  border-bottom: 1px solid var(--frame-border, #1F1F23);
}
.sn-pal-input::placeholder { color: var(--text-faint, #4A4A52); }
.sn-pal-list { max-height: 320px; overflow-y: auto; padding: 6px; }
.sn-pal-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 6px;
  color: var(--text-dim, #7A7A82);
  cursor: pointer;
}
.sn-pal-row .sn-ico { width: 18px; text-align: center; }
.sn-pal-row .sn-pal-name { font-size: 13px; color: var(--text, #E8E8EA); }
.sn-pal-row .sn-pal-sub {
  margin-left: auto; font-size: 10px; letter-spacing: 0.08em;
  color: var(--text-faint, #4A4A52); text-transform: uppercase;
}
.sn-pal-row.is-active, .sn-pal-row:hover {
  background: var(--p-accent-bg, rgba(142,102,251,0.08));
  color: var(--text, #E8E8EA);
}
.sn-pal-row.is-active .sn-ico, .sn-pal-row:hover .sn-ico { color: var(--p-accent, #8E66FB); }

@media (prefers-reduced-motion: reduce) {
  .sn-rail, .sn-name, .sn-label, .sn-hint { transition: none; }
}
