/* GLEE Matrix Shell — Cinnamon-inspired browser OS */

:root {
  --glee-desktop-min: 1024px;
  --glee-cinnamon-panel: #1a1d24;
  --glee-cinnamon-panel-top: #12151a;
  --glee-cinnamon-accent: #6ebf5b;
  --glee-cinnamon-highlight: #e7c384;
  --glee-cinnamon-text: #e8eaed;
  --glee-cinnamon-dim: #9aa3b4;
  --glee-desktop-top: 48px;
  --glee-desktop-bottom: 36px;
}

body.glee-surface-loading {
  overflow: hidden;
}

body.glee-surface-loading .glee-desktop-surface,
body.glee-surface-loading .glee-legacy-deck,
body.glee-surface-loading .glee-mobile-portal {
  visibility: hidden;
}

.glee-desktop-surface.is-boot-hidden,
.glee-legacy-deck.is-legacy-hidden {
  display: none !important;
}

/* ── Global boot ── */
.glee-boot-global {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(231, 195, 132, 0.06), transparent),
    #08090d;
  color: #f4efe4;
  animation: glee-boot-fade 0.32s ease 0.9s forwards;
}

.glee-boot-global.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes glee-boot-fade {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

.glee-boot-global .boot-mark {
  font-family: var(--glee-font-serif, Georgia, serif);
  font-weight: 800;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  font-size: clamp(32px, 5vw, 56px);
}

.glee-boot-global .boot-mark b {
  color: var(--glee-cinnamon-highlight);
}

.glee-boot-global .boot-sub {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #5e6678;
}

.glee-boot-global .boot-log {
  width: min(480px, 88vw);
  font-family: ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.8;
}

.glee-boot-global .boot-row {
  display: flex;
  gap: 10px;
  opacity: 0;
  animation: glee-boot-row-in 0.18s ease forwards;
}

@keyframes glee-boot-row-in {
  to { opacity: 1; }
}

.glee-boot-global .boot-row .ok { color: #4fca7a; }
.glee-boot-global .boot-row .go { color: var(--glee-cinnamon-highlight); }

/* ── Desktop: canvas is the OS ── */
body.glee-desktop-active {
  overflow: hidden;
  margin: 0;
}

body.glee-desktop-active .glee-legacy-deck,
body.glee-desktop-active .glee-mobile-portal {
  display: none !important;
}

body.glee-desktop-active .glee-desktop-surface {
  display: block !important;
  position: fixed;
  inset: 0;
  z-index: 100;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #0a0a0c;
}

/* Hide dev/prototype chrome in production desktop mode */
body.glee-desktop-active .dev-chrome,
body.glee-desktop-active .world-table-note,
body.glee-desktop-active #boundary-label-left,
body.glee-desktop-active #boundary-label-right,
body.glee-desktop-active #boundary-divider,
body.glee-desktop-active #private-zone-field,
body.glee-desktop-active .world-status-hint {
  display: none !important;
}

body.glee-desktop-active .glee-desktop-surface .world-status {
  display: flex !important;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 200;
  pointer-events: auto;
  min-height: var(--glee-desktop-top);
  height: var(--glee-desktop-top);
  padding: 0 14px;
  overflow-x: auto;
  overflow-y: hidden;
  background: linear-gradient(180deg, #1a1e26 0%, var(--glee-cinnamon-panel-top) 100%);
  border-bottom: 1px solid #2a3140;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

body.glee-desktop-active .world-status-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

body.glee-desktop-active .world-exit-btn {
  display: none;
}

body.glee-desktop-active .world-brand-lockup strong {
  font-family: var(--glee-font-serif, Georgia, serif);
  color: var(--glee-cinnamon-highlight);
  letter-spacing: 0.12em;
}

body.glee-desktop-active .world-breadcrumb {
  flex: 1 1 auto;
  text-align: center;
  max-width: 320px;
  min-width: 120px;
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #2a3140;
  background: rgba(10, 12, 16, 0.6);
  color: var(--glee-cinnamon-dim);
  font-family: ui-monospace, monospace;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.glee-desktop-active .world-hud-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

body.glee-desktop-active .world-hud-actions .world-tool-btn,
body.glee-desktop-active .world-hud-actions a.world-tool-btn {
  flex-shrink: 0;
  pointer-events: auto;
}

body.glee-desktop-active .world-hud-actions .world-tool-btn[data-mode-toggle] {
  border-color: transparent;
  background: transparent;
  color: var(--glee-cinnamon-dim);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.glee-desktop-active .world-hud-actions .world-tool-btn[data-mode-toggle]:hover,
body.glee-desktop-active .world-hud-actions .world-tool-btn[data-mode-toggle][aria-pressed="true"] {
  color: var(--glee-cinnamon-highlight);
}

body.glee-desktop-active .world-account-signin {
  border: 0;
  background: transparent;
  color: var(--glee-cinnamon-dim);
}

body.glee-desktop-active .world-account-signin:hover {
  color: var(--glee-cinnamon-text);
}

body.glee-desktop-active .world-account-create {
  background: var(--glee-cinnamon-highlight);
  border-color: var(--glee-cinnamon-highlight);
  color: #08090d;
  font-weight: 700;
  padding: 7px 14px;
}

body.glee-desktop-active .world-account-create:hover {
  background: #f0d49a;
  border-color: #f0d49a;
}

body.glee-desktop-active .glee-desktop-surface #world-viewport {
  height: calc(100vh - var(--glee-desktop-top) - var(--glee-desktop-bottom)) !important;
  min-height: 0 !important;
  border-bottom: 0 !important;
}

body.glee-desktop-active .glee-cinnamon-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--glee-desktop-bottom);
  padding: 0 12px;
  background: linear-gradient(0deg, #141820 0%, var(--glee-cinnamon-panel) 100%);
  border-top: 1px solid #2a3140;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--glee-cinnamon-dim);
}

body.glee-desktop-active .cinnamon-menu-btn {
  border: 0;
  background: transparent;
  color: var(--glee-cinnamon-text);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}

body.glee-desktop-active .cinnamon-menu-btn:hover,
body.glee-desktop-active .cinnamon-menu-btn[aria-expanded="true"] {
  background: rgba(110, 191, 91, 0.15);
  color: var(--glee-cinnamon-accent);
}

body.glee-desktop-active .cinnamon-workspace {
  flex: 1;
  text-align: center;
  color: var(--glee-cinnamon-text);
}

body.glee-desktop-active .cinnamon-tray {
  display: flex;
  align-items: center;
  gap: 12px;
}

body.glee-desktop-active .cinnamon-zoom {
  display: flex;
  align-items: center;
  gap: 4px;
}

body.glee-desktop-active .cinnamon-zoom button {
  border: 1px solid #3d4656;
  background: #1a1f28;
  color: var(--glee-cinnamon-dim);
  width: 24px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

body.glee-desktop-active .cinnamon-zoom button:hover {
  color: var(--glee-cinnamon-highlight);
  border-color: var(--glee-cinnamon-highlight);
}

body.glee-desktop-active .cinnamon-zoom span {
  min-width: 36px;
  text-align: center;
  color: var(--glee-cinnamon-text);
}

/* Simple mode: hide the floating guide. The bottom HUD now lives permanently
   in .matrix-bottom-bar, so it stays visible in every mode. */
body.glee-desktop-active .glee-world-root[data-mode="simple"] .star-smile-guide {
  display: none !important;
}

body.glee-desktop-active .glee-world-root[data-mode="simple"] .advanced-world-control {
  display: none !important;
}

/* App launcher menu */
.glee-app-menu {
  position: fixed;
  left: 12px;
  bottom: calc(var(--glee-desktop-bottom) + 8px);
  z-index: 200;
  width: min(300px, calc(100vw - 24px));
  padding: 14px;
  border: 1px solid #2a3140;
  border-radius: 12px;
  background: rgba(14, 17, 22, 0.97);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  transform: translateY(12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.glee-app-menu.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.glee-app-menu .menu-label {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #5e6678;
  margin-bottom: 10px;
}

.glee-app-menu .menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.glee-app-menu a,
.glee-app-menu button {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  text-decoration: none;
  padding: 10px 12px;
  border: 1px solid #222a38;
  border-radius: 8px;
  background: #10141c;
  color: var(--glee-cinnamon-text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.glee-app-menu a:hover,
.glee-app-menu button:hover {
  border-color: var(--glee-cinnamon-highlight);
  background: #151a24;
}

.glee-app-menu a span,
.glee-app-menu button span {
  color: var(--glee-cinnamon-dim);
  font-size: 11px;
}

.glee-app-menu .menu-legacy {
  margin-top: 10px;
  width: 100%;
  text-align: center;
  font-size: 11px;
  color: #6b5428;
  border-color: #3a3020;
  background: #1a1510;
}

/* Welcome overlay — first moment orientation */
.glee-welcome-overlay {
  position: fixed;
  inset: var(--glee-desktop-top) 0 var(--glee-desktop-bottom) 0;
  z-index: 90;
  /* below .world-status (z-index 200) so Sign in / Get started stay clickable */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 5, 8, 0.72);
  backdrop-filter: blur(6px);
  transition: opacity 0.35s ease, visibility 0.35s;
  pointer-events: none;
}

.glee-welcome-overlay .welcome-card {
  pointer-events: auto;
}

.glee-welcome-overlay.is-dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.welcome-card {
  width: min(520px, 100%);
  padding: 28px 30px 24px;
  border: 1px solid #2a3140;
  border-radius: 14px;
  background:
    radial-gradient(ellipse 100% 80% at 50% 0%, rgba(231, 195, 132, 0.08), transparent 55%),
    linear-gradient(180deg, #12151c, #0c0e14);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
}

.welcome-card .welcome-kicker {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #5e6678;
  margin-bottom: 8px;
}

.welcome-card h2 {
  margin: 0 0 10px;
  font-family: var(--glee-font-serif, Georgia, serif);
  font-size: clamp(26px, 4vw, 34px);
  color: #f4efe4;
  line-height: 1.1;
}

.welcome-card h2 b {
  color: var(--glee-cinnamon-highlight);
}

.welcome-card .welcome-lead {
  margin: 0 0 14px;
  color: var(--glee-cinnamon-dim);
  font-size: 15px;
  line-height: 1.55;
}

.welcome-card .welcome-lead strong {
  color: var(--glee-cinnamon-text);
}

.welcome-steps {
  margin: 0 0 18px;
  padding-left: 20px;
  color: var(--glee-cinnamon-dim);
  font-size: 12px;
  line-height: 1.5;
}

.welcome-steps li {
  margin-bottom: 8px;
}

.welcome-steps strong {
  color: var(--glee-cinnamon-text);
}

.welcome-steps em {
  color: var(--glee-cinnamon-highlight);
  font-style: normal;
}

.welcome-paths {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.welcome-path {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid #222a38;
  border-radius: 10px;
  background: rgba(8, 10, 14, 0.8);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.welcome-path:hover {
  border-color: var(--glee-cinnamon-highlight);
}

.welcome-path strong {
  font-size: 13px;
  color: var(--glee-cinnamon-text);
}

.welcome-path span {
  font-size: 11px;
  color: #6f7a8c;
  line-height: 1.4;
}

.welcome-enter {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: var(--glee-cinnamon-highlight);
  color: #08090d;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.welcome-enter:hover {
  background: #f0d49a;
}

/* Legacy lens */
body.glee-legacy-active .glee-desktop-surface {
  display: none !important;
}

body.glee-legacy-active .glee-legacy-deck {
  display: block !important;
}

body.glee-legacy-active .glee-mobile-portal {
  display: none !important;
}

body.glee-legacy-active .glee-cinnamon-panel {
  display: none;
}

.glee-legacy-banner {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: #1a1510;
  border-bottom: 1px solid #4a3a20;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: #c9a86a;
}

.glee-legacy-banner button {
  border: 1px solid #6b5428;
  background: #2a2014;
  color: #e7c384;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 11px;
}

/* ── Mobile portal ── */
body.glee-mobile-active {
  overflow-x: hidden;
  background: #08090d;
  color: #e8eaed;
}

body.glee-mobile-active .glee-desktop-surface,
body.glee-mobile-active .glee-legacy-deck {
  display: none !important;
}

body.glee-mobile-active .glee-mobile-portal {
  display: block;
}

.glee-mobile-portal {
  display: none;
  min-height: 100vh;
  font-family: system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(ellipse 120% 50% at 50% -10%, rgba(231, 195, 132, 0.12), transparent),
    #08090d;
}

.mobile-portal-hero {
  position: relative;
  padding: 28px 20px 20px;
  overflow: hidden;
}

.mobile-portal-hero::after {
  content: "";
  position: absolute;
  right: -20px;
  top: 10px;
  width: 120px;
  height: 120px;
  background: url("/assets/glee-phoenix-character.svg") center / contain no-repeat;
  opacity: 0.35;
  pointer-events: none;
}

.mobile-portal-header h1 {
  margin: 0 0 8px;
  font-family: var(--glee-font-serif, Georgia, serif);
  font-size: 28px;
  letter-spacing: 0.06em;
}

.mobile-portal-header h1 b {
  color: #e7c384;
}

.mobile-portal-header p {
  margin: 0;
  color: #9aa3b4;
  font-size: 15px;
  line-height: 1.55;
  max-width: 28em;
}

.mobile-portal-tagline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 5px 10px;
  border: 1px solid rgba(79, 202, 122, 0.35);
  border-radius: 999px;
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4fca7a;
}

.mobile-portal-tagline::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4fca7a;
  box-shadow: 0 0 8px rgba(79, 202, 122, 0.6);
}

.mobile-portal-note {
  margin: 0 16px 16px;
  padding: 14px 16px;
  border-left: 3px solid #6ebf5b;
  background: rgba(78, 175, 100, 0.07);
  color: #b8c4d4;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 0 10px 10px 0;
}

.mobile-window-frame {
  margin: 0 16px 18px;
  border: 1px solid #3a4455;
  border-radius: 14px;
  background: #0c1016;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.mobile-window-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #1e2430, #151a22);
  border-bottom: 1px solid #2a3140;
  font-family: ui-monospace, monospace;
  font-size: 10px;
  color: #9aa3b4;
}

.mobile-window-titlebar .dots {
  display: flex;
  gap: 5px;
}

.mobile-window-titlebar .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3d4656;
}

.mobile-window-titlebar .dot.live {
  background: #4fca7a;
  box-shadow: 0 0 6px rgba(79, 202, 122, 0.5);
}

.mobile-window-viewport {
  position: relative;
  min-height: 200px;
  max-height: 260px;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 40%, rgba(231, 195, 132, 0.06), transparent 50%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    #0a0c10;
  background-size: auto, 20px 20px, 20px 20px, auto;
}

.mobile-window-viewport .peek-objects {
  position: absolute;
  inset: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-content: start;
}

.mobile-peek-object {
  padding: 10px 11px;
  border-radius: 8px;
  border: 1px solid #2a3548;
  background: rgba(14, 18, 26, 0.94);
  font-size: 11px;
}

.mobile-peek-object strong {
  display: block;
  color: #e8eaed;
  font-size: 12px;
  margin-bottom: 3px;
  line-height: 1.25;
}

.mobile-peek-object span {
  color: #6ebf5b;
  font-family: ui-monospace, monospace;
  font-size: 9px;
}

.mobile-portal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px 18px;
}

.mobile-portal-actions a {
  text-align: center;
  text-decoration: none;
  padding: 14px 12px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
}

.mobile-portal-actions .primary {
  grid-column: 1 / -1;
  background: #e7c384;
  color: #08090d;
  box-shadow: 0 8px 24px rgba(231, 195, 132, 0.2);
}

.mobile-portal-actions .ghost {
  border: 1px solid #3a4455;
  color: #e8eaed;
  background: rgba(16, 20, 28, 0.6);
}

.mobile-feed {
  padding: 0 16px 32px;
}

.mobile-feed h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #5e6678;
  margin: 0 0 12px;
  font-family: ui-monospace, monospace;
}

.mobile-feed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-feed-item {
  display: block;
  text-decoration: none;
  padding: 14px;
  border: 1px solid #222a38;
  border-radius: 12px;
  background: #10141c;
  color: inherit;
}

.mobile-feed-item strong {
  display: block;
  color: #e8eaed;
  font-size: 14px;
  margin-bottom: 4px;
}

.mobile-feed-item span {
  color: #9aa3b4;
  font-size: 13px;
  line-height: 1.4;
}

.mobile-feed-item em {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-family: ui-monospace, monospace;
  font-size: 10px;
  color: #4fca7a;
}

@media (min-width: 1024px) {
  .glee-mobile-portal {
    display: none !important;
  }
}

@media (max-width: 520px) {
  .welcome-paths {
    grid-template-columns: 1fr;
  }
}

/* ── Lens segment (primary OS mode) ── */
body.glee-desktop-active .world-status {
  flex-wrap: nowrap;
}

body.glee-desktop-active .glee-lens-segment {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid #2a3140;
  background: rgba(8, 10, 14, 0.72);
  flex-shrink: 0;
}

body.glee-desktop-active .glee-lens-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--glee-cinnamon-dim);
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
}

body.glee-desktop-active .glee-lens-btn:hover {
  color: var(--glee-cinnamon-text);
}

body.glee-desktop-active .glee-lens-btn.is-active,
body.glee-desktop-active .glee-lens-btn[aria-pressed="true"] {
  background: rgba(231, 195, 132, 0.14);
  color: var(--glee-cinnamon-highlight);
}

body.glee-desktop-active .glee-lens-icon {
  font-size: 11px;
  line-height: 1;
}

body.glee-desktop-active .world-breadcrumb {
  flex: 0 1 200px;
  min-width: 120px;
}

/* ── Cluster lens zoom bands ── */
.glee-world-root.zoom-far .glee-object {
  display: none !important;
  pointer-events: none !important;
}

.glee-world-root.zoom-far .semantic-room-zone {
  pointer-events: auto;
  cursor: pointer;
  border-width: 2px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.glee-world-root.zoom-far .semantic-room-zone:hover,
.glee-world-root.zoom-far .semantic-room-zone:focus-visible {
  transform: translateY(-2px);
  box-shadow:
    inset 0 0 0 1px rgba(230, 228, 223, 0.08),
    0 0 32px color-mix(in srgb, var(--room-accent, var(--glee-receipt-amber)) 22%, transparent);
}

.glee-world-root.zoom-far .cluster-path,
.glee-world-root.zoom-far .cluster-subtitle {
  display: none;
}

.glee-world-root.zoom-far .cluster-primary {
  font-size: 15px !important;
  letter-spacing: 0.08em;
}

.glee-world-root.zoom-mid .cluster-subtitle {
  display: none;
}

.glee-world-root.zoom-mid .cluster-primary {
  font-size: 12px !important;
}

.glee-world-root.zoom-mid .cluster-path {
  display: block;
  font-size: 9px;
  color: #6e7681;
  text-transform: lowercase;
}

.glee-world-root .semantic-room-zone.lens-prominent {
  box-shadow:
    inset 0 0 0 1px rgba(230, 228, 223, 0.1),
    0 0 calc(28px * var(--cluster-lens-weight, 1)) color-mix(in srgb, var(--room-accent, var(--glee-receipt-amber)) 18%, transparent);
}

.glee-world-root .semantic-room-zone.lens-dimmed {
  opacity: 0.55;
}

.glee-world-root .semantic-room-zone.cluster-sealed {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--glee-intelligence-blue) 45%, rgba(230, 228, 223, 0.2));
}

.glee-world-root .cluster-sealed-badge {
  position: absolute;
  left: 14px;
  bottom: 12px;
  z-index: 2;
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7aa2ff;
}

/* ── Sealed ship boundary card ── */
.glee-sealed-boundary {
  position: fixed;
  inset: 0;
  z-index: 10050;
  pointer-events: auto;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 6, 10, 0.62);
  backdrop-filter: blur(4px);
}

.glee-sealed-boundary.is-open {
  display: flex;
}

.glee-sealed-boundary-card {
  width: min(420px, 100%);
  padding: 22px 24px;
  border-radius: 14px;
  border: 1px solid #2a3140;
  background: linear-gradient(180deg, #151922 0%, #10141c 100%);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  color: var(--glee-cinnamon-text);
}

.glee-sealed-kicker {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7aa2ff;
  margin-bottom: 8px;
}

.glee-sealed-boundary-card h3 {
  margin: 0 0 10px;
  font-family: var(--glee-font-serif, Georgia, serif);
  color: var(--glee-cinnamon-highlight);
  font-size: 22px;
}

.glee-sealed-boundary-card p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--glee-cinnamon-dim);
}

.glee-sealed-note {
  font-size: 12px !important;
  color: #9aa3b4 !important;
}

.glee-sealed-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.glee-sealed-cta {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--glee-cinnamon-highlight);
  color: #08090d;
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
}

.glee-sealed-dismiss {
  border: 1px solid #2a3140;
  background: transparent;
  color: var(--glee-cinnamon-dim);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 12px;
  cursor: pointer;
}

body.glee-lens-review .glee-object.lens-review-expanded .receipt-strip,
body.glee-lens-review .glee-object.lens-review-expanded .proof-tier {
  color: var(--glee-verified-green, #22d19a);
}

body.glee-lens-build .glee-object.lens-build-expanded .glance-hover span:first-child {
  color: var(--glee-cinnamon-highlight);
}

/* ── Notification drawer + badge ── */
body.glee-desktop-active .glee-notify-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid #2a3140;
  border-radius: 8px;
  background: rgba(8, 10, 14, 0.72);
  color: var(--glee-cinnamon-text);
  cursor: pointer;
}

body.glee-desktop-active .glee-notify-btn:hover {
  border-color: var(--glee-cinnamon-highlight);
}

.glee-notify-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--glee-cinnamon-highlight);
  color: #08090d;
  font-family: ui-monospace, monospace;
  font-size: 9px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

.glee-notification-drawer {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 95;
  width: min(360px, calc(100% - 24px));
  max-height: min(420px, 55vh);
  display: none;
  flex-direction: column;
  border: 1px solid #2a3140;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(18, 22, 30, 0.97) 0%, rgba(10, 12, 16, 0.98) 100%);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.glee-notification-drawer.is-open {
  display: flex;
}

.glee-notification-drawer-head,
.glee-notification-sheet-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #2a3140;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--glee-cinnamon-dim);
}

.glee-notification-drawer-head strong,
.glee-notification-sheet-head strong {
  flex: 1;
  color: var(--glee-cinnamon-text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.glee-notification-drawer-head button,
.glee-notification-sheet-head button {
  border: 0;
  background: transparent;
  color: var(--glee-cinnamon-dim);
  cursor: pointer;
  font-size: 12px;
}

.glee-notification-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  overflow: auto;
  flex: 1;
}

.glee-notification-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 10px;
  cursor: pointer;
  color: inherit;
}

.glee-notification-item:hover {
  border-color: #2a3140;
  background: rgba(231, 195, 132, 0.06);
}

.glee-notification-item.is-unread {
  border-color: rgba(231, 195, 132, 0.18);
}

.glee-notification-item strong {
  display: block;
  font-size: 12px;
  color: var(--glee-cinnamon-text);
  margin-bottom: 4px;
}

.glee-notification-item span {
  display: block;
  font-size: 11px;
  line-height: 1.4;
  color: var(--glee-cinnamon-dim);
}

.glee-notification-item em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6e7681;
}

.glee-notification-empty {
  padding: 16px 12px;
  font-size: 12px;
  color: var(--glee-cinnamon-dim);
}

/* ── Workspace chrome (HUD + dock + helper) ── */
.glee-workspace-chrome {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 88;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  opacity: 0.62;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.glee-workspace-chrome:hover,
.glee-workspace-chrome:focus-within {
  opacity: 0.94;
}

body.inspector-open .glee-workspace-chrome {
  right: min(404px, 38vw);
  opacity: 0.5;
}

body.inspector-open .glee-workspace-chrome:hover,
body.inspector-open .glee-workspace-chrome:focus-within {
  opacity: 0.82;
}

body.glee-how-open .glee-workspace-chrome {
  opacity: 0.45;
}

.glee-chrome-hud,
.glee-chrome-dock,
.glee-chrome-helper {
  pointer-events: auto;
}

.glee-chrome-hud {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(42, 49, 64, 0.5);
  background: rgba(8, 10, 14, 0.55);
  backdrop-filter: blur(10px);
  font-family: ui-monospace, monospace;
  min-width: 0;
}

.glee-chrome-hud-location {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.glee-cluster-hud-kicker {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6e7681;
}

.glee-cluster-hud-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--glee-cinnamon-highlight);
}

.glee-cluster-hud-meta {
  font-size: 10px;
  color: var(--glee-cinnamon-dim);
}

.glee-chrome-hud-hint {
  margin: 6px 0 0;
  padding-top: 6px;
  border-top: 1px solid rgba(42, 49, 64, 0.38);
  font-size: 11px;
  line-height: 1.4;
  color: rgba(230, 228, 223, 0.7);
  font-family: system-ui, sans-serif;
}

.glee-chrome-hud-hint strong {
  color: rgba(244, 239, 228, 0.92);
  font-weight: 600;
}

.glee-workspace-chrome.glee-chrome-hint-hidden .glee-chrome-hud-hint {
  display: none;
}

body.glee-helper-operate .glee-chrome-hud-hint {
  display: none;
}

body.glee-helper-operate .glee-workspace-chrome:hover .glee-chrome-hud-hint,
body.glee-helper-operate .glee-workspace-chrome:focus-within .glee-chrome-hud-hint {
  display: block;
}

/* ── Layout toast ── */
.glee-layout-toast {
  position: absolute;
  left: 50%;
  top: 68px;
  transform: translateX(-50%);
  z-index: 92;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid #2a3140;
  background: rgba(12, 16, 22, 0.94);
  color: var(--glee-cinnamon-text);
  font-size: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.glee-layout-toast.is-visible {
  display: block;
}

/* ── Object activity pulse ── */
.glee-object.has-activity::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 10px;
  border: 1px solid rgba(34, 209, 154, 0.45);
  pointer-events: none;
  animation: glee-activity-ring 2.2s ease-out infinite;
}

@keyframes glee-activity-ring {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.02); }
}

/* ── Mobile notification sheet ── */
.mobile-notify-btn {
  margin-top: 10px;
}

.glee-notification-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12000;
  max-height: 55vh;
  display: none;
  flex-direction: column;
  border-top: 1px solid #2a3140;
  background: #10141c;
}

.glee-notification-sheet.is-open {
  display: flex;
}

@media (max-width: 1180px) {
  body.glee-desktop-active .glee-lens-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .glee-object.has-activity::after {
    animation: none;
    opacity: 0.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .glee-boot-global {
    animation: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  .glee-boot-global .boot-row {
    opacity: 1;
    animation: none;
  }
  .glee-welcome-overlay,
  .glee-app-menu {
    transition: none;
  }
  .glee-world-root.zoom-far .semantic-room-zone:hover,
  .glee-world-root.zoom-far .semantic-room-zone:focus-visible {
    transform: none;
  }
}

/* ── Inspector glass rail (Wave 3) ── */
.glee-inspector-backdrop {
  position: absolute;
  inset: 0;
  z-index: 82;
  background: rgba(0, 0, 0, 0.36);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.glee-inspector-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.glee-inspector-rail {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 96;
  width: min(400px, 38vw);
  display: none;
  flex-direction: column;
  border-left: 1px solid #2a3140;
  background: linear-gradient(180deg, rgba(18, 22, 30, 0.97) 0%, rgba(10, 12, 16, 0.98) 100%);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.glee-inspector-rail.is-open {
  display: flex;
}

.glee-inspector-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid #2a3140;
  flex-shrink: 0;
}

.glee-inspector-head-main {
  min-width: 0;
  flex: 1;
}

.glee-inspector-type {
  display: inline-block;
  font-size: 10px;
  font-family: ui-monospace, monospace;
  background: #1f2428;
  color: #8b949e;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #30363d;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.glee-inspector-title {
  font-family: var(--glee-font-serif, Georgia, serif);
  color: var(--glee-cinnamon-highlight, #e7c384);
  font-size: 18px;
  margin: 6px 0 0;
  line-height: 1.25;
  word-break: break-word;
}

.glee-inspector-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.glee-inspector-state {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.glee-inspector-minimize,
.glee-inspector-close {
  border: 0;
  background: transparent;
  color: #8b949e;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}

.glee-inspector-minimize:hover,
.glee-inspector-close:hover {
  color: var(--glee-cinnamon-text);
  background: rgba(231, 195, 132, 0.08);
}

.glee-inspector-body {
  flex: 1;
  overflow: auto;
  padding: 12px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.glee-inspector-section h3 {
  margin: 0 0 6px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8b949e;
  font-weight: 700;
}

.glee-inspector-copy {
  font-size: 13px;
  line-height: 1.45;
  color: #e6edf3;
  margin-bottom: 12px;
}

.glee-inspector-accent {
  color: #d2a8ff;
}

.glee-inspector-boundary {
  font-size: 12px;
  font-family: ui-monospace, monospace;
  background: #161b22;
  padding: 8px;
  border-left: 3px solid #f0883e;
  color: #ffa657;
  margin-bottom: 4px;
}

.glee-inspector-contract-pre {
  font-size: 10px;
  font-family: ui-monospace, monospace;
  background: #0c1016;
  color: #c9d1d9;
  padding: 6px 8px;
  border-left: 3px solid var(--glee-receipt-amber, #ffb000);
  border-radius: 3px;
  margin: 0 0 6px;
  white-space: pre-wrap;
}

.glee-inspector-connections {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.glee-inspector-conn-btn {
  background: #161b22;
  border: 1px solid #30363d;
  color: #e6edf3;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}

.glee-inspector-conn-btn:hover {
  border-color: #484f58;
}

.glee-inspector-receipts {
  margin-bottom: 12px;
}

.glee-inspector-receipt {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  background: #161b22;
  color: #3fb950;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #234b2b;
  margin-bottom: 4px;
}

.glee-inspector-next {
  font-size: 12px;
  color: #3fb950;
  background: #0c1c11;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #1a3b22;
  margin-bottom: 12px;
}

.glee-inspector-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.glee-inspector-btn {
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #30363d;
  background: #21262d;
  color: #e6edf3;
}

.glee-inspector-btn.is-attest {
  background: #0f2d1c;
  color: #3fb950;
  border-color: #234b2b;
}

.glee-inspector-btn.is-trace {
  color: #58a6ff;
}

.glee-inspector-btn.is-route {
  background: #1f6feb;
  color: #fff;
  border-color: #1f6feb;
  text-decoration: none;
  display: inline-block;
}

body.inspector-open.panel-open #world-viewport #world {
  filter: brightness(0.9) saturate(0.92);
  transition: filter 180ms ease;
}

.glee-object.inspector-target {
  z-index: 12 !important;
  box-shadow: 0 0 0 2px var(--glee-receipt-amber, #ffb000), 0 0 22px rgba(255, 176, 0, 0.28) !important;
}

.glee-object.is-minimized {
  display: none !important;
}

/* ── Minimized dock (chrome center) ── */
.glee-chrome-dock {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-height: 0;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(42, 49, 64, 0.45);
  background: rgba(8, 10, 14, 0.5);
  backdrop-filter: blur(8px);
}

.glee-chrome-dock[hidden] {
  display: none !important;
}

.glee-dock-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #30363d;
  border-radius: 999px;
  background: #161b22;
  color: #e6edf3;
  padding: 4px 10px 4px 8px;
  font-size: 11px;
  cursor: pointer;
  max-width: 180px;
}

.glee-dock-chip:hover {
  border-color: rgba(231, 195, 132, 0.35);
  background: rgba(231, 195, 132, 0.08);
}

.glee-dock-chip-glyph {
  color: var(--glee-cinnamon-highlight);
  font-size: 10px;
}

.glee-dock-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1023px) {
  .glee-inspector-rail {
    width: min(100%, 360px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .glee-inspector-backdrop,
  body.inspector-open.panel-open #world-viewport #world {
    transition: none;
  }
}

/* ── Orientation: How it works + context hints ── */
.glee-how-btn {
  font-size: 11px !important;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.glee-how-panel {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 97;
  width: min(440px, calc(100% - 24px));
  max-height: min(560px, 72vh);
  display: none;
  flex-direction: column;
  border: 1px solid #2a3140;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(18, 22, 30, 0.98) 0%, rgba(10, 12, 16, 0.99) 100%);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.glee-how-panel.is-open {
  display: flex;
}

.glee-how-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #2a3140;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--glee-cinnamon-dim);
}

.glee-how-panel-head strong {
  flex: 1;
  color: var(--glee-cinnamon-text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.glee-how-panel-head button {
  border: 0;
  background: transparent;
  color: var(--glee-cinnamon-dim);
  cursor: pointer;
  font-size: 16px;
}

.glee-how-panel-body {
  overflow: auto;
  padding: 12px 14px 16px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--glee-cinnamon-dim);
}

.glee-how-lead {
  margin: 0 0 12px;
  color: var(--glee-cinnamon-text);
  font-size: 13px;
}

.glee-how-panel-body section {
  margin-bottom: 14px;
}

.glee-how-panel-body h3 {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--glee-cinnamon-highlight);
}

.glee-how-panel-body ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.glee-how-panel-body li {
  margin-bottom: 5px;
}

.glee-how-panel-body strong {
  color: var(--glee-cinnamon-text);
}

.glee-how-replay-welcome {
  margin-top: 8px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #2a3140;
  border-radius: 8px;
  background: rgba(231, 195, 132, 0.08);
  color: var(--glee-cinnamon-text);
  font-size: 11px;
  cursor: pointer;
}

.glee-how-replay-welcome:hover {
  border-color: rgba(231, 195, 132, 0.35);
}

.glee-panel-explainer {
  margin: 0;
  padding: 8px 12px 4px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--glee-cinnamon-dim);
  border-bottom: 1px solid #222a38;
}

.glee-how-btn-icon {
  min-width: 32px !important;
  padding: 4px 10px !important;
  font-weight: 700;
}

.glee-inspector-explainer {
  margin: 0;
  padding: 10px 14px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--glee-cinnamon-dim);
  border-bottom: 1px solid #2a3140;
  flex-shrink: 0;
}

/* ── GLEE Helper (Veela) ── */
.glee-chrome-helper {
  position: relative;
  align-self: end;
}

.glee-helper-glyph {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(231, 195, 132, 0.38);
  background: radial-gradient(circle at 35% 30%, rgba(231, 195, 132, 0.18), rgba(8, 10, 14, 0.72));
  color: var(--glee-cinnamon-highlight);
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.glee-helper-glyph:hover {
  border-color: var(--glee-cinnamon-highlight);
}

.glee-helper-glyph[data-helper-mode="operate"] {
  opacity: 0.72;
  font-size: 14px;
}

.glee-helper-menu {
  position: absolute;
  right: 0;
  bottom: 44px;
  width: min(280px, calc(100vw - 40px));
  display: none;
  flex-direction: column;
  border: 1px solid #2a3140;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(18, 22, 30, 0.92), rgba(10, 12, 16, 0.96));
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.glee-helper-menu.is-open {
  display: flex;
}

.glee-helper-menu-head {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #2a3140;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--glee-cinnamon-dim);
}

.glee-helper-menu-head strong {
  flex: 1;
  color: var(--glee-cinnamon-text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.glee-helper-menu-head button {
  border: 0;
  background: transparent;
  color: var(--glee-cinnamon-dim);
  cursor: pointer;
  font-size: 16px;
}

.glee-helper-menu-lead {
  margin: 0;
  padding: 10px 12px 6px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--glee-cinnamon-dim);
}

.glee-helper-proficiency {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 10px 10px;
}

.glee-helper-proficiency button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 8px 10px;
  cursor: pointer;
  color: inherit;
}

.glee-helper-proficiency button strong {
  font-size: 12px;
  color: var(--glee-cinnamon-text);
}

.glee-helper-proficiency button span {
  font-size: 10px;
  color: var(--glee-cinnamon-dim);
}

.glee-helper-proficiency button.is-active {
  border-color: rgba(231, 195, 132, 0.35);
  background: rgba(231, 195, 132, 0.08);
}

.glee-helper-how-link {
  margin: 0 10px 10px;
  padding: 8px 10px;
  border: 1px solid #2a3140;
  border-radius: 8px;
  background: rgba(8, 10, 14, 0.6);
  color: var(--glee-cinnamon-text);
  font-size: 11px;
  cursor: pointer;
}

.glee-coach-mark {
  position: fixed;
  z-index: 10055;
  width: min(280px, calc(100% - 24px));
  padding: 10px 12px;
  border: 1px solid rgba(231, 195, 132, 0.32);
  border-radius: 10px;
  background: rgba(12, 16, 22, 0.88);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
}

.glee-coach-mark[hidden] {
  display: none !important;
}

.glee-coach-mark.is-visible {
  display: block;
}

.glee-coach-mark p {
  margin: 0 0 8px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--glee-cinnamon-dim);
}

.glee-coach-mark button {
  border: 0;
  border-radius: 6px;
  padding: 5px 10px;
  background: var(--glee-cinnamon-highlight);
  color: #08090d;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 900px) {
  .glee-workspace-chrome {
    grid-template-columns: 1fr auto;
  }
  .glee-chrome-dock {
    grid-column: 1 / -1;
    justify-self: center;
  }
}

/* ── Canvas-space navigation (C1–C5) ── */
body.glee-desktop-active .world-breadcrumb.glee-canvas-path {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  max-width: min(480px, 72vw);
  overflow-x: auto;
  overflow-y: hidden;
  text-overflow: unset;
  white-space: nowrap;
  scrollbar-width: none;
}

body.glee-desktop-active .world-breadcrumb.glee-canvas-path::-webkit-scrollbar {
  display: none;
}

.glee-path-sep {
  color: rgba(231, 195, 132, 0.35);
  font-size: 10px;
  padding: 0 1px;
  user-select: none;
}

.glee-path-segment {
  border: 0;
  background: transparent;
  color: var(--glee-cinnamon-dim);
  font-family: ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.glee-path-segment:hover,
.glee-path-segment:focus-visible {
  color: var(--glee-cinnamon-highlight);
  background: rgba(231, 195, 132, 0.08);
  outline: none;
}

.glee-path-segment.is-current {
  color: var(--glee-cinnamon-highlight);
  font-weight: 700;
  cursor: default;
}

body.glee-canvas-root .semantic-room-zone.is-below-app {
  pointer-events: auto;
  cursor: pointer;
  border-width: 2px;
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}

body.glee-canvas-root .semantic-room-zone.is-below-app:hover,
body.glee-canvas-root .semantic-room-zone.is-below-app:focus-visible {
  transform: translateY(-3px);
  box-shadow:
    inset 0 0 0 1px rgba(230, 228, 223, 0.1),
    0 0 36px color-mix(in srgb, var(--room-accent, var(--glee-receipt-amber)) 24%, transparent);
}

body.glee-canvas-root .canvas-space-enter-hint {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--room-accent, var(--glee-receipt-amber)) 30%, rgba(230, 228, 223, 0.12));
  color: color-mix(in srgb, var(--room-accent, var(--glee-receipt-amber)) 70%, #b8c0c9);
  background: rgba(7, 8, 11, 0.78);
  font-family: ui-monospace, monospace;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.18s ease;
}

body.glee-canvas-root .semantic-room-zone.is-below-app:hover .canvas-space-enter-hint,
body.glee-canvas-root .semantic-room-zone.is-below-app:focus-visible .canvas-space-enter-hint {
  opacity: 1;
}

.canvas-space-category {
  display: inline-block;
  margin-top: 2px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(230, 228, 223, 0.12);
  color: #8b949e;
  font-size: 8px;
  letter-spacing: 0.1em;
}

body.glee-canvas-in-space .semantic-room-zone.is-current-space {
  pointer-events: none;
  border-style: solid;
  border-width: 2px;
  border-color: color-mix(in srgb, var(--room-accent, var(--glee-receipt-amber)) 42%, rgba(230, 228, 223, 0.18));
  box-shadow:
    inset 0 0 0 1px rgba(230, 228, 223, 0.06),
    0 0 48px color-mix(in srgb, var(--room-accent, var(--glee-receipt-amber)) 14%, transparent);
}

body.glee-canvas-in-space .semantic-room-zone.canvas-space-hidden {
  display: none !important;
}

body.glee-canvas-root .glee-object,
body.glee-canvas-root .glee-object.canvas-space-compressed {
  display: none !important;
  pointer-events: none !important;
}

.glee-space-placement {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
}

.glee-space-placement-card {
  position: fixed;
  min-width: 168px;
  padding: 10px;
  border: 1px solid rgba(231, 195, 132, 0.28);
  border-radius: 12px;
  background: rgba(10, 12, 16, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.48);
  display: grid;
  gap: 6px;
  pointer-events: auto;
}

.glee-space-placement-title {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--glee-cinnamon-highlight);
  padding: 2px 4px 4px;
}

.glee-space-placement-btn {
  border: 1px solid rgba(230, 228, 223, 0.14);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(18, 22, 28, 0.88);
  color: var(--glee-cinnamon-dim);
  font-family: ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.glee-space-placement-btn:hover,
.glee-space-placement-btn:focus-visible {
  border-color: var(--glee-cinnamon-highlight);
  color: var(--glee-cinnamon-highlight);
  background: rgba(231, 195, 132, 0.08);
  outline: none;
}

.glee-space-placement-btn[data-placement="below"]::after {
  content: " — descend into space";
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #6e7681;
}

.glee-space-placement-btn[data-placement="here"]::after {
  content: " — replace current canvas";
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #6e7681;
}

.glee-space-placement-btn[data-placement="above"]::after {
  content: " — view from parent";
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #6e7681;
}

/* ── Canvas guide + back affordances ── */
.glee-canvas-back {
  flex-shrink: 0;
  border: 1px solid rgba(231, 195, 132, 0.28);
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(10, 12, 16, 0.72);
  color: var(--glee-cinnamon-highlight);
  font-family: ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.glee-canvas-back:hover,
.glee-canvas-back:focus-visible {
  background: rgba(231, 195, 132, 0.1);
  border-color: var(--glee-cinnamon-highlight);
  outline: none;
}

.glee-canvas-back[hidden] {
  display: none !important;
}

.glee-canvas-guide {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 24;
  display: grid;
  gap: 2px;
  max-width: min(360px, calc(100% - 28px));
  padding: 10px 12px;
  border: 1px solid rgba(231, 195, 132, 0.34);
  border-radius: 10px;
  background: rgba(10, 12, 16, 0.9);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
  pointer-events: none;
}

.glee-canvas-guide[hidden] {
  display: none !important;
}

.glee-canvas-guide strong {
  color: var(--glee-cinnamon-highlight);
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.glee-canvas-guide span {
  color: var(--glee-cinnamon-dim);
  font-size: 11px;
  line-height: 1.45;
}

body.glee-canvas-root .canvas-space-enter-hint {
  opacity: 1;
}

body.glee-canvas-in-space .glee-canvas-guide {
  display: none !important;
}

body.glee-desktop-active .world-status {
  gap: 8px;
}

/* ── UI skin: Familiar vs Spatial (not legacy brochure) ── */
.glee-ui-skin-segment {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid #2a3140;
  background: rgba(10, 12, 16, 0.72);
  flex-shrink: 0;
}

.glee-ui-skin-btn {
  border: 0;
  border-radius: 999px;
  padding: 5px 10px;
  background: transparent;
  color: var(--glee-cinnamon-dim);
  font-family: ui-monospace, monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.glee-ui-skin-btn:hover,
.glee-ui-skin-btn.is-active,
.glee-ui-skin-btn[aria-pressed="true"] {
  color: var(--glee-cinnamon-highlight);
  background: rgba(231, 195, 132, 0.1);
}

.glee-familiar-shell {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 240px;
  gap: 12px;
  height: calc(100vh - var(--glee-desktop-top) - var(--glee-desktop-bottom));
  min-height: 0;
  padding: 12px;
  background: var(--glee-void-black, #08090d);
}

.glee-familiar-shell[hidden] {
  display: none !important;
}

.glee-familiar-dock {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  border: 1px solid #2a3140;
  border-radius: 12px;
  background: rgba(14, 17, 22, 0.94);
  height: max-content;
  position: sticky;
  top: 12px;
}

.glee-familiar-dock-label {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #5e6678;
  margin-bottom: 6px;
}

.glee-familiar-dock-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--glee-cinnamon-dim);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.glee-familiar-dock-item:hover,
.glee-familiar-dock-item.is-active {
  background: rgba(231, 195, 132, 0.08);
  color: var(--glee-cinnamon-highlight);
  border-left-color: var(--glee-cinnamon-highlight);
}

.glee-familiar-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.glee-familiar-head {
  padding: 18px 20px;
  border: 1px solid #2a3140;
  border-radius: 12px;
  background: rgba(14, 17, 22, 0.88);
}

.glee-familiar-kicker {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #5e6678;
}

.glee-familiar-head h2 {
  margin: 8px 0 6px;
  font-size: clamp(22px, 3vw, 32px);
  color: var(--glee-cinnamon-highlight);
}

.glee-familiar-head p {
  margin: 0;
  color: var(--glee-cinnamon-dim);
  font-size: 13px;
  line-height: 1.5;
  max-width: 640px;
}

.glee-familiar-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.glee-familiar-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 108px;
  padding: 14px;
  border: 1px solid #2a3140;
  border-radius: 10px;
  background: rgba(14, 17, 22, 0.92);
  color: var(--glee-cinnamon-text);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.glee-familiar-tile:hover {
  border-color: var(--glee-cinnamon-highlight);
  transform: translateY(-2px);
}

.glee-familiar-tile-glyph {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--glee-cinnamon-highlight), #75a7ff);
}

.glee-familiar-tile strong {
  font-size: 14px;
}

.glee-familiar-tile span {
  font-size: 11px;
  color: var(--glee-cinnamon-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.glee-familiar-tile-spatial {
  border-color: color-mix(in srgb, var(--glee-cinnamon-highlight) 40%, #2a3140);
}

.glee-familiar-modules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.glee-familiar-modules-label {
  grid-column: 1 / -1;
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5e6678;
}

.glee-familiar-module {
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #2a3140;
  border-radius: 8px;
  background: rgba(10, 12, 16, 0.88);
  color: var(--glee-cinnamon-dim);
  text-decoration: none;
  font-size: 12px;
}

.glee-familiar-module:hover {
  border-color: var(--glee-cinnamon-highlight);
  color: var(--glee-cinnamon-highlight);
}

.glee-familiar-rail {
  padding: 16px;
  border: 1px solid #2a3140;
  border-radius: 12px;
  background: rgba(14, 17, 22, 0.94);
  height: max-content;
  position: sticky;
  top: 12px;
}

.glee-familiar-path-label {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5e6678;
}

.glee-familiar-path {
  margin: 8px 0 12px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  color: var(--glee-cinnamon-highlight);
  word-break: break-word;
}

.glee-familiar-rail-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--glee-cinnamon-dim);
}

body.glee-ui-familiar .glee-canvas-guide {
  display: none !important;
}

@media (max-width: 900px) {
  .glee-familiar-shell {
    grid-template-columns: 1fr;
  }
  .glee-familiar-dock {
    flex-direction: row;
    flex-wrap: wrap;
    position: static;
  }
  .glee-familiar-rail {
    position: static;
  }
}

/* ── Space frame: real UI inside app-spaces (not sticky notes) ── */
.glee-space-frame {
  position: absolute;
  inset: 0;
  z-index: 42;
  display: flex;
  flex-direction: column;
  background: #08090d;
  border-top: 1px solid rgba(42, 49, 64, 0.65);
}

.glee-space-frame[hidden] {
  display: none !important;
}

.glee-space-frame-chrome {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.2fr);
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #2a3140;
  background: linear-gradient(180deg, #151922 0%, #10141c 100%);
}

body.glee-space-mode-canvas .glee-space-frame-chrome {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 44;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.glee-space-frame-kicker {
  display: block;
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6e7a90;
}

.glee-space-frame-label {
  font-family: var(--glee-font-serif, Georgia, serif);
  font-size: 16px;
  color: var(--glee-cinnamon-highlight);
}

.glee-space-frame-modes {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid #2a3140;
  background: rgba(8, 10, 14, 0.7);
}

.glee-space-mode-btn {
  border: 0;
  border-radius: 999px;
  padding: 5px 10px;
  background: transparent;
  color: var(--glee-cinnamon-dim);
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.glee-space-mode-btn.is-active {
  background: rgba(231, 195, 132, 0.16);
  color: var(--glee-cinnamon-highlight);
}

.glee-space-module-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  justify-content: flex-end;
  min-width: 0;
}

.glee-space-module-tab {
  border: 1px solid #2f3848;
  border-radius: 8px;
  padding: 5px 10px;
  background: rgba(10, 12, 16, 0.85);
  color: var(--glee-cinnamon-text);
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
}

.glee-space-module-tab.is-active {
  border-color: rgba(231, 195, 132, 0.42);
  background: rgba(231, 195, 132, 0.1);
  color: var(--glee-cinnamon-highlight);
}

.glee-space-module-tab em {
  font-style: normal;
  color: #6e7a90;
  font-size: 9px;
  text-transform: uppercase;
}

.glee-space-frame-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.glee-space-module-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.glee-space-module-panel[hidden] {
  display: none !important;
}

.glee-space-iframe,
.glee-browser-iframe {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #0a0c10;
}

.glee-browser-chrome {
  display: grid;
  grid-template-columns: auto auto auto auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #2a3140;
  background: #0d1016;
}

.glee-browser-btn {
  border: 1px solid #303848;
  border-radius: 6px;
  width: 30px;
  height: 28px;
  background: #141820;
  color: var(--glee-cinnamon-text);
  cursor: pointer;
  font-size: 14px;
}

.glee-browser-btn:hover {
  border-color: var(--glee-cinnamon-highlight);
  color: var(--glee-cinnamon-highlight);
}

.glee-browser-url-form {
  display: flex;
  gap: 6px;
  min-width: 0;
}

.glee-browser-url {
  flex: 1;
  min-width: 0;
  border: 1px solid #303848;
  border-radius: 6px;
  padding: 6px 10px;
  background: #080a0f;
  color: var(--glee-cinnamon-text);
  font-family: ui-monospace, monospace;
  font-size: 11px;
}

.glee-browser-go {
  border: 0;
  border-radius: 6px;
  padding: 6px 12px;
  background: var(--glee-cinnamon-highlight);
  color: #08090d;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.glee-browser-note {
  margin: 0;
  padding: 6px 10px;
  font-size: 10px;
  color: #6e7a90;
  border-top: 1px solid #222833;
  background: #0a0c10;
}

.glee-space-empty {
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--glee-cinnamon-dim);
  font-size: 13px;
  text-align: center;
}

.glee-space-workspace-split {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 0;
}

.glee-space-live-column {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.glee-space-object-rail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid #2a3140;
  background: #0c0e13;
  overflow: hidden;
}

.glee-space-object-rail-head {
  padding: 10px 12px 4px;
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6e7a90;
}

.glee-space-object-rail-lead {
  margin: 0;
  padding: 0 12px 8px;
  font-size: 10px;
  line-height: 1.4;
  color: #5e6678;
  border-bottom: 1px solid #222833;
}

.glee-space-object-rail-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  gap: 6px;
  align-content: start;
}

.glee-space-object-chip {
  display: grid;
  gap: 3px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid #2a3140;
  border-radius: 8px;
  background: rgba(12, 14, 18, 0.92);
  color: var(--glee-cinnamon-dim);
  cursor: pointer;
  font: inherit;
}

.glee-space-object-chip:hover,
.glee-space-object-chip:focus-visible {
  border-color: var(--glee-cinnamon-highlight);
  color: var(--glee-cinnamon-text);
}

.glee-space-object-chip strong {
  font-size: 11px;
  color: var(--glee-cinnamon-text);
}

.glee-space-object-chip span {
  font-size: 9px;
  font-family: ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.glee-space-object-rail-empty {
  margin: 0;
  padding: 8px 4px;
  font-size: 10px;
  line-height: 1.45;
  color: #5e6678;
}

.glee-space-mode-hint {
  grid-column: 1 / -1;
  margin: 0;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(231, 195, 132, 0.28);
  background: rgba(231, 195, 132, 0.08);
  color: var(--glee-cinnamon-highlight);
  font-size: 11px;
}

body.glee-space-mode-workspace.glee-space-live #world,
body.glee-space-mode-live.glee-space-live #world {
  visibility: hidden;
  pointer-events: none;
}

body.glee-space-mode-canvas #world {
  visibility: visible;
  pointer-events: auto;
  padding-top: 54px;
  box-sizing: border-box;
}

body.glee-space-mode-canvas .glee-space-frame-body {
  display: none;
}

body.glee-space-mode-live .glee-space-object-rail {
  display: none;
}

body.glee-space-mode-live .glee-space-workspace-split {
  grid-template-columns: 1fr;
}

body.glee-space-live .glee-workspace-chrome {
  opacity: 0.72;
}

@media (max-width: 900px) {
  .glee-space-frame-chrome {
    grid-template-columns: 1fr;
  }
  .glee-space-module-tabs {
    justify-content: flex-start;
  }
}

/* ── Compositor: dynamic user layout + always-on overlay ── */
.glee-compositor-glyph {
  position: fixed;
  right: 14px;
  bottom: calc(var(--glee-desktop-bottom, 36px) + 52px);
  z-index: 10060;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(231, 195, 132, 0.38);
  border-radius: 10px;
  background: rgba(10, 12, 16, 0.94);
  color: var(--glee-cinnamon-highlight);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
}

.glee-compositor-glyph:hover,
.glee-compositor-glyph:focus-visible {
  border-color: var(--glee-cinnamon-highlight);
  background: rgba(231, 195, 132, 0.12);
}

.glee-compositor-overlay {
  position: fixed;
  inset: 0;
  z-index: 10058;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 16px 16px calc(var(--glee-desktop-bottom, 36px) + 58px);
  background: rgba(4, 5, 8, 0.42);
  backdrop-filter: blur(3px);
}

.glee-compositor-overlay[hidden] {
  display: none !important;
}

.glee-compositor-overlay-card {
  width: min(360px, calc(100vw - 32px));
  max-height: min(72vh, 520px);
  overflow: auto;
  padding: 14px 16px 16px;
  border: 1px solid #2a3140;
  border-radius: 12px;
  background: linear-gradient(180deg, #151922 0%, #10141c 100%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.glee-compositor-overlay-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.glee-compositor-overlay-kicker {
  display: block;
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6e7a90;
}

.glee-compositor-overlay-head strong {
  font-size: 16px;
  color: var(--glee-cinnamon-highlight);
}

.glee-compositor-overlay-close {
  border: 0;
  background: transparent;
  color: #8b949e;
  font-size: 22px;
  cursor: pointer;
}

.glee-compositor-overlay-lead {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--glee-cinnamon-dim);
}

.glee-compositor-overlay-status {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #2a3140;
  background: rgba(8, 10, 14, 0.7);
  font-family: ui-monospace, monospace;
  font-size: 10px;
  color: var(--glee-cinnamon-text);
}

.glee-compositor-overlay-actions,
.glee-compositor-overlay-add {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.glee-compositor-action {
  border: 1px solid #303848;
  border-radius: 8px;
  padding: 6px 10px;
  background: #141820;
  color: var(--glee-cinnamon-dim);
  font-size: 11px;
  cursor: pointer;
}

.glee-compositor-action:hover:not(:disabled) {
  border-color: var(--glee-cinnamon-highlight);
  color: var(--glee-cinnamon-highlight);
}

.glee-compositor-action.is-primary {
  border-color: rgba(231, 195, 132, 0.42);
  color: var(--glee-cinnamon-highlight);
}

.glee-compositor-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.glee-compositor-editor-pane {
  display: grid;
  gap: 6px;
  padding: 8px 0;
  border-top: 1px solid #222833;
}

.glee-compositor-editor-label {
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6e7a90;
}

.glee-compositor-editor-field {
  display: grid;
  gap: 4px;
  font-size: 10px;
  color: var(--glee-cinnamon-dim);
}

.glee-compositor-editor-field select,
.glee-compositor-editor-field input[type="range"] {
  width: 100%;
}

.glee-compositor-root {
  position: absolute;
  inset: 0;
  z-index: 42;
  display: flex;
  flex-direction: column;
  background: rgba(8, 9, 13, 0.58);
  backdrop-filter: blur(14px) saturate(1.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  opacity: 0;
  transition: opacity 0.42s ease;
  pointer-events: none;
}

.glee-compositor-root.is-entering {
  opacity: 0.22;
  pointer-events: none;
}

.glee-compositor-root.is-revealed {
  opacity: 1;
  pointer-events: auto;
}

.glee-compositor-root[hidden] {
  display: none !important;
}

.glee-compositor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid #2a3140;
  background: linear-gradient(180deg, #151922 0%, #10141c 100%);
}

.glee-compositor-kicker {
  display: block;
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6e7a90;
}

.glee-compositor-path {
  font-family: var(--glee-font-serif, Georgia, serif);
  font-size: 15px;
  color: var(--glee-cinnamon-highlight);
}

.glee-compositor-profile-badge {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #2f3848;
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8b949e;
}

.glee-compositor-profile-badge.is-custom {
  border-color: rgba(231, 195, 132, 0.38);
  color: var(--glee-cinnamon-highlight);
}

.glee-compositor-briefing {
  flex-shrink: 0;
  border-bottom: 1px solid rgba(42, 49, 64, 0.72);
  background: linear-gradient(180deg, rgba(16, 20, 28, 0.92) 0%, rgba(12, 14, 20, 0.78) 100%);
}

.glee-compositor-briefing[hidden] {
  display: none !important;
}

.glee-compositor-brief-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 14px;
  padding: 12px 14px 10px;
}

.glee-compositor-brief-kicker {
  display: block;
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7d8798;
}

.glee-compositor-brief-title {
  margin: 4px 0 6px;
  font-family: var(--glee-font-serif, Georgia, serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--glee-cinnamon-highlight);
}

.glee-compositor-brief-tagline {
  margin: 0 0 4px;
  font-size: 12px;
  line-height: 1.45;
  color: #c5cad3;
}

.glee-compositor-brief-intent,
.glee-compositor-brief-count {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: #7d8798;
}

.glee-compositor-brief-chips {
  display: grid;
  gap: 8px;
  align-content: start;
}

.glee-compositor-brief-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.glee-compositor-brief-label {
  width: 100%;
  font-family: ui-monospace, monospace;
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6e7681;
}

.glee-compositor-brief-chip {
  border: 1px solid rgba(42, 49, 64, 0.9);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(14, 17, 24, 0.82);
  color: #aeb6c2;
  font-size: 10px;
  line-height: 1.2;
}

.glee-compositor-brief-chip.is-module {
  font-family: ui-monospace, monospace;
  letter-spacing: 0.04em;
}

.glee-compositor-brief-chip.is-object {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.glee-compositor-brief-chip.is-object span {
  font-family: ui-monospace, monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6e7681;
}

.glee-compositor-brief-chip.is-object:hover,
.glee-compositor-brief-chip.is-object:focus-visible {
  border-color: rgba(231, 195, 132, 0.42);
  background: rgba(231, 195, 132, 0.08);
  outline: none;
}

.glee-compositor-module-fallback {
  padding: 14px;
  display: grid;
  gap: 10px;
  overflow: auto;
}

.glee-compositor-module-fallback h4 {
  margin: 0;
  font-size: 14px;
  color: var(--glee-cinnamon-highlight);
}

.glee-compositor-module-fallback-lead {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #c5cad3;
}

.glee-compositor-module-fallback-note {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: #7d8798;
}

.glee-compositor-module-fallback-note code {
  font-family: ui-monospace, monospace;
  font-size: 10px;
}

.glee-compositor-module-fallback-link {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--glee-cinnamon-highlight);
  text-decoration: none;
}

.glee-compositor-module-fallback-link:hover {
  text-decoration: underline;
}

.glee-compositor-panes {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.38s ease, transform 0.38s ease;
}

.glee-compositor-root.is-revealed .glee-compositor-panes {
  opacity: 1;
  transform: none;
}

.glee-compositor-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #222833;
}

.glee-compositor-pane:last-child {
  border-right: 0;
}

.glee-compositor-pane-head {
  padding: 6px 10px;
  border-bottom: 1px solid #222833;
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6e7a90;
}

.glee-compositor-pane-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.glee-compositor-iframe,
.glee-compositor-pane .glee-browser-iframe {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #0a0c10;
}

.glee-compositor-browser {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.glee-compositor-rail,
.glee-compositor-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  gap: 6px;
  align-content: start;
}

.glee-compositor-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.glee-compositor-object {
  display: grid;
  gap: 3px;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid #2a3140;
  border-radius: 8px;
  background: rgba(12, 14, 18, 0.92);
  color: var(--glee-cinnamon-dim);
  cursor: pointer;
  font: inherit;
}

.glee-compositor-object.is-compact {
  padding: 6px 8px;
}

.glee-compositor-object.is-bound {
  border-color: rgba(231, 195, 132, 0.48);
  box-shadow: inset 0 0 0 1px rgba(231, 195, 132, 0.2);
}

.glee-compositor-inspector,
.glee-compositor-inspector-empty {
  padding: 12px;
  overflow-y: auto;
}

.glee-compositor-inspector h4 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--glee-cinnamon-highlight);
}

.glee-compositor-inspector-meta {
  margin: 0 0 8px;
  font-family: ui-monospace, monospace;
  font-size: 9px;
  text-transform: uppercase;
  color: #6e7a90;
}

.glee-compositor-inspector-summary {
  margin: 0 0 12px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--glee-cinnamon-dim);
}

.glee-compositor-object strong {
  font-size: 11px;
  color: var(--glee-cinnamon-text);
}

.glee-compositor-object span {
  font-size: 9px;
  font-family: ui-monospace, monospace;
  text-transform: uppercase;
}

.glee-compositor-empty {
  padding: 16px;
  font-size: 11px;
  color: #5e6678;
  text-align: center;
}

body.glee-compositor-entering #world,
body.glee-canvas-space-mounted #world,
body.glee-compositor-exiting #world {
  visibility: visible !important;
  pointer-events: auto;
  opacity: 1;
  filter: none;
}

body.glee-microscope-enter #world,
body.glee-microscope-exit #world {
  transition: opacity 0.42s ease;
}

body.glee-canvas-space-mounted .semantic-room-zone.is-current-space {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--room-accent, var(--glee-receipt-amber)) 28%, rgba(230, 228, 223, 0.14));
  background: color-mix(in srgb, var(--room-accent, var(--glee-receipt-amber)) 4%, rgba(8, 9, 13, 0.2));
}

body.glee-canvas-space-mounted .glee-object.is-space-detail,
body.glee-canvas-space-mounted .glee-surface-object,
body.glee-canvas-space-mounted .glee-space-signpost {
  display: flex !important;
  pointer-events: auto !important;
  opacity: 1 !important;
  z-index: 32;
}

.glee-space-signpost {
  position: absolute;
  border: 1px solid rgba(231, 195, 132, 0.28);
  border-radius: 10px;
  background: rgba(10, 12, 16, 0.88);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  overflow: hidden;
}

.glee-space-signpost-inner {
  display: grid;
  gap: 2px;
  padding: 8px 12px;
}

.glee-space-signpost-kicker {
  font-family: ui-monospace, monospace;
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7d8798;
}

.glee-space-signpost-title {
  font-family: var(--glee-font-serif, Georgia, serif);
  font-size: 15px;
  color: var(--glee-cinnamon-highlight);
}

.glee-space-signpost-tagline {
  font-size: 10px;
  line-height: 1.35;
  color: #aeb6c2;
}

.glee-space-signpost-hint {
  font-family: ui-monospace, monospace;
  font-size: 8px;
  letter-spacing: 0.06em;
  color: #6e7681;
}

.glee-surface-object {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(42, 49, 64, 0.95);
  border-radius: 10px;
  background: rgba(8, 9, 13, 0.94);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(230, 228, 223, 0.04);
  overflow: hidden;
}

.glee-surface-object-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 5px 8px;
  border-bottom: 1px solid #222833;
  background: linear-gradient(180deg, #151922 0%, #10141c 100%);
  font-family: ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7d8798;
}

.glee-surface-object-grip {
  color: #4f5866;
  font-size: 11px;
  line-height: 1;
}

.glee-surface-object-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #aeb6c2;
}

.glee-surface-object-kind {
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid #2a3140;
  color: #6e7681;
  font-size: 8px;
}

.glee-surface-object-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.glee-surface-object .glee-compositor-iframe,
.glee-surface-object .glee-browser-iframe {
  flex: 1;
  width: 100%;
  min-height: 120px;
  border: 0;
  background: #0a0c10;
}

.glee-surface-object .glee-compositor-rail,
.glee-surface-object .glee-compositor-grid {
  flex: 1;
  overflow: auto;
  padding: 8px;
}

@media (max-width: 900px) {
  .glee-compositor-brief-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .glee-compositor-panes {
    flex-direction: column;
  }
  .glee-compositor-pane {
    border-right: 0;
    border-bottom: 1px solid #222833;
    min-height: 200px;
  }
}