:root {
  --field-bg: #030307;
  --field-fg: #f2eee7;
  --field-muted: #9a958c;
  --field-line: rgba(242, 238, 231, 0.14);
  --field-line-strong: rgba(242, 238, 231, 0.24);
  --field-surface: rgba(10, 10, 14, 0.72);
  --field-surface-strong: rgba(12, 12, 16, 0.88);
  --field-accent: #c9d2de;
  --field-live: #7ad9ff;
  --field-radius-sm: 10px;
  --field-radius-md: 16px;
  --field-radius-lg: 24px;
  --field-space-2: 8px;
  --field-space-3: 12px;
  --field-space-4: 16px;
  --field-shadow: 0 18px 60px rgba(0, 0, 0, 0.38);
}

.field-shell {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  background: var(--field-bg);
  color: var(--field-fg);
  font-family: Manrope, system-ui, sans-serif;
}
.field-shell__field {
  position: absolute;
  inset: 0;
  transform: scale(1);
  transition: filter 280ms ease, transform 550ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.field-shell__field > .universe-shell {
  min-height: 100%;
  height: 100%;
  width: 100%;
}
.field-shell__chrome {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
}
.field-shell__brand,
.field-shell__search,
.field-shell__commands,
.field-shell__investigation,
.field-shell__close {
  pointer-events: auto;
}
.field-shell__top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto;
}
.field-shell__brand {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--field-line);
  border-radius: 999px;
  background: var(--field-surface);
  color: var(--field-fg);
  box-shadow: var(--field-shadow);
  backdrop-filter: blur(18px);
  font: 600 11px/1 Sora, sans-serif;
  letter-spacing: 0.16em;
}
.field-shell__search {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--field-line-strong);
  border-radius: 999px;
  background: var(--field-surface);
  box-shadow: var(--field-shadow);
  backdrop-filter: blur(18px);
}
.field-shell__search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--field-fg);
  font: 500 14px/1 Manrope, sans-serif;
}
.field-shell__search input::placeholder { color: var(--field-muted); }
.field-shell__live {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--field-muted);
  font: 600 9px/1 Sora, sans-serif;
  letter-spacing: 0.14em;
}
.field-shell__live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--field-live);
  box-shadow: 0 0 12px var(--field-live);
}
.field-shell__live[data-state='partial']::before {
  background: #d7b56d;
  box-shadow: 0 0 12px #d7b56d;
}
.field-shell__commands {
  position: absolute;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  max-width: min(560px, calc(100vw - 24px));
  padding: 4px;
  border: 1px solid var(--field-line);
  border-radius: 999px;
  background: var(--field-surface-strong);
  box-shadow: var(--field-shadow);
  backdrop-filter: blur(18px);
}
.field-shell__command {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--field-muted);
  min-height: 42px;
  padding: 0 16px;
  font: 600 10px/1 Sora, sans-serif;
  letter-spacing: 0.1em;
  white-space: nowrap;
  transition: background 180ms ease, color 180ms ease;
}
.field-shell__command:hover,
.field-shell__command[aria-pressed='true'] {
  background: rgba(242, 238, 231, 0.08);
  color: var(--field-fg);
}
.field-shell__command[hidden] { display: none !important; }
.field-shell__investigation {
  position: absolute;
  left: 50%;
  bottom: calc(68px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(420px, calc(100vw - 24px));
  max-height: min(38vh, 320px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--field-line);
  border-radius: var(--field-radius-lg);
  background: var(--field-surface-strong);
  box-shadow: var(--field-shadow);
  backdrop-filter: blur(22px);
}
.field-shell__investigation[hidden] { display: none; }
.field-shell__investigation-title {
  font: 600 10px/1 Sora, sans-serif;
  letter-spacing: 0.16em;
  color: var(--field-fg);
}
.field-shell__investigation-id {
  margin-top: 6px;
  color: var(--field-accent);
  font: 500 13px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.02em;
}
.field-shell__investigation-count {
  margin-top: 6px;
  color: var(--field-muted);
  font: 500 11px/1.4 Manrope, sans-serif;
}
.field-shell__investigation-actions,
.field-shell__investigation-connected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.field-shell__investigation-action {
  border: 1px solid var(--field-line);
  border-radius: 999px;
  background: rgba(242, 238, 231, 0.05);
  color: var(--field-fg);
  min-height: 36px;
  padding: 0 12px;
  font: 600 10px/1 Sora, sans-serif;
  letter-spacing: 0.08em;
}
.field-shell__investigation-action:hover {
  background: rgba(242, 238, 231, 0.12);
}
.field-shell__investigation-action[data-simulation='true'] {
  border-style: dashed;
  color: var(--field-muted);
}
.field-shell__workspace {
  position: absolute;
  z-index: 25;
  inset: 72px 16px 84px;
  overflow: hidden;
  border: 1px solid var(--field-line);
  border-radius: var(--field-radius-lg);
  background: rgba(8, 8, 12, 0.92);
  backdrop-filter: blur(22px);
  box-shadow: var(--field-shadow);
}
.field-shell__workspace[hidden] { display: none; }
.field-shell__workspace-head {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--field-line);
}
.field-shell__workspace-head strong {
  font: 600 11px/1 Sora, sans-serif;
  letter-spacing: 0.14em;
}
.field-shell__close {
  border: 0;
  background: transparent;
  color: var(--field-muted);
  min-height: 36px;
  font: 600 10px/1 Sora, sans-serif;
  letter-spacing: 0.1em;
}
.field-shell__workspace-body {
  height: calc(100% - 52px);
  overflow: auto;
}
.field-shell--workspace-open .field-shell__field {
  filter: saturate(0.78) brightness(0.55);
  transform: scale(1.012);
}
.field-shell--workspace-open .field-shell__investigation,
.field-shell--workspace-open .field-shell__commands {
  opacity: 0;
  pointer-events: none;
}
.field-shell--inspecting .field-shell__field {
  filter: saturate(0.92) brightness(0.78);
}

@media (max-width: 760px) {
  .field-shell__chrome {
    padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
  }
  .field-shell__top {
    max-width: none;
    gap: 8px;
  }
  .field-shell__brand {
    min-height: 44px;
    padding: 0 10px;
    font-size: 9px;
    letter-spacing: 0.12em;
  }
  .field-shell__search {
    height: 44px;
    padding: 0 12px;
  }
  .field-shell__search input { font-size: 13px; }
  .field-shell__live { display: none; }
  .field-shell__commands {
    left: 8px;
    right: 8px;
    width: auto;
    max-width: none;
    transform: none;
    justify-content: space-between;
    border-radius: 18px;
    padding: 4px;
  }
  .field-shell__command {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 6px;
    font-size: 9px;
  }
  .field-shell__investigation {
    left: 8px;
    right: 8px;
    width: auto;
    transform: none;
    bottom: calc(64px + env(safe-area-inset-bottom));
    max-height: 34vh;
    border-radius: 18px;
    padding: 12px;
  }
  .field-shell__investigation-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .field-shell__investigation-action { white-space: nowrap; }
  .field-shell__workspace {
    inset: 58px 8px 72px;
    border-radius: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .field-shell__field,
  .field-shell__command {
    transform: none !important;
    transition: none !important;
  }
}
