/* The production architecture owns rail and navigator as independent
   surfaces. The reference wrapper starts after the exact 44 px rail. */
[data-ui-surface="navigator"].navigator {
  left: var(--arhix-rail-width, 44px);
}

[data-ui-surface="navigator"] > .navigator__panel {
  display: none;
}

[data-ui-surface="navigator"] > .navigator__panel._open {
  display: flex;
}

/* Hidden always wins over layout classes from the literal reference. */
[data-ui-surface="navigator"] [hidden] {
  display: none;
}

/* View mode is account data. On a new device the three switchable
   collections stay visually quiet until the server preference arrives;
   on a known device the local mirror removes this gate synchronously. */
[data-ui-surface="navigator"][data-ui-navigator-preferences="pending"]
  > :is(
    [data-left-panel="pages"],
    [data-left-panel="properties"],
    [data-left-panel="projects"]
  ) [data-ui-panel-collection] {
  visibility: hidden;
}

/* Folder colour is authored data, but its palette is a theme contract rather
   than permanent inline presentation. One data attribute now drives both the
   folder tab and its menu sample. */
[data-ui-surface="navigator"] .folder__tab[data-color="none"],
[data-ui-surface="navigator"] [data-ui-folder-color="none"] .menu__color {
  background: var(--arhix-surface);
}

[data-ui-surface="navigator"] .folder__tab[data-color="blue"],
[data-ui-surface="navigator"] [data-ui-folder-color="blue"] .menu__color {
  background: var(--arhix-folder-blue);
}

[data-ui-surface="navigator"] .folder__tab[data-color="green"],
[data-ui-surface="navigator"] [data-ui-folder-color="green"] .menu__color {
  background: var(--arhix-folder-green);
}

[data-ui-surface="navigator"] .folder__tab[data-color="yellow"],
[data-ui-surface="navigator"] [data-ui-folder-color="yellow"] .menu__color {
  background: var(--arhix-folder-yellow);
}

[data-ui-surface="navigator"] .folder__tab[data-color="red"],
[data-ui-surface="navigator"] [data-ui-folder-color="red"] .menu__color {
  background: var(--arhix-folder-red);
}

/* The literal reference keeps canvas rows directly after the divider. The
   production projection wraps each tab body so hidden sibling tabs stay out
   of reorder scope; carry the same 12 px first-row rhythm through that one
   structural wrapper. Card lists already own their 12 px top padding. */
[data-ui-surface="navigator"] .navigator__panel--tab-list > .folder__tab:first-child {
  margin-top: var(--arhix-space-block);
}

/* Semantic buttons must behave like the reference div controls without
   overpowering component states later in the cascade. */
:where(
  :is(
    [data-ui-surface="navigator"],
    [data-ui-surface="table-workspace"],
    [data-ui-surface="document-workspace"]
  )
  :is(button, input)
) {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: inherit;
  letter-spacing: inherit;
}

/* The reference search hint is a span. The production surface uses a real
   search input, so neutralise every browser-owned inset and placeholder fade. */
[data-ui-surface="navigator"] .panel__input-text {
  appearance: none;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

[data-ui-surface="navigator"] .panel__input-text::placeholder {
  color: var(--arhix-ink-muted);
  opacity: 1;
}

[data-ui-surface="navigator"] .panel__input-text::-webkit-search-cancel-button {
  display: none;
}

[data-ui-surface="navigator"] [data-ui-preview-slot] {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  pointer-events: none;
}

[data-ui-surface="navigator"] [data-ui-preview-slot] > :is(svg, img) {
  width: 100%;
  height: 100%;
}

/* Hatch library cards belong to navigator UI. During the navigator-only dark
   stage they use its local soft surface rather than the canvas surface. */
[data-ui-surface="navigator"][data-ui-theme-scope="dark"] [data-ui-hatch-pattern-card] {
  --arhix-drawing-preview-bg: var(--arhix-surface-soft);
  --arhix-canvas-ink: var(--arhix-scene-card-ink);
}

[data-ui-surface="navigator"] .pill-btn {
  height: var(--arhix-control-height);
  margin: var(--arhix-space-block) var(--arhix-space-inset) 0;
  border-radius: var(--arhix-radius-control);
  background: var(--arhix-surface);
  padding: var(--arhix-space-pill);
  box-sizing: border-box;
  display: flex;
  cursor: pointer;
}

[data-ui-surface="navigator"] .pill-btn__pill {
  flex: 1 1 auto;
  border-radius: var(--arhix-radius-pill);
  background: var(--arhix-surface-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--arhix-font);
  font-weight: var(--arhix-font-weight-body);
  font-size: var(--arhix-font-size-body);
  line-height: 1;
  color: var(--arhix-ink);
}

[data-ui-surface="navigator"] .inspector__chip {
  display: inline-flex;
  align-items: center;
  height: var(--arhix-chip-height);
  border-radius: var(--arhix-radius-chip);
  background: var(--arhix-surface);
  padding: 0 var(--arhix-space-gap);
  margin: var(--arhix-space-block) 0 0 var(--arhix-space-inset);
  align-self: flex-start;
}

[data-ui-surface="navigator"] .inspector__chip-text {
  font-family: var(--arhix-font);
  font-weight: var(--arhix-font-weight-body);
  font-size: var(--arhix-font-size-small);
  color: var(--arhix-ink-muted);
  line-height: 1;
  white-space: nowrap;
}

[data-ui-surface="navigator"] .inspector__field {
  height: var(--arhix-control-height);
  margin: var(--arhix-space-block) var(--arhix-space-inset) 0;
  border-radius: var(--arhix-radius-control);
  background: var(--arhix-surface);
  display: flex;
  align-items: center;
  padding-left: var(--arhix-space-inset);
  box-sizing: border-box;
  flex: none;
}

[data-ui-surface="navigator"] .inspector__field--editable {
  padding-right: var(--arhix-space-inset);
  box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow var(--arhix-motion-quick) ease;
}

[data-ui-surface="navigator"] .inspector__field--editable:hover {
  box-shadow: inset 0 0 0 1px var(--arhix-ink-ghost);
}

[data-ui-surface="navigator"] .inspector__field--editable:focus-within {
  box-shadow: inset 0 0 0 1px var(--arhix-accent);
}

[data-ui-surface="navigator"] .inspector__field-input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--arhix-ink);
  font-family: var(--arhix-font);
  font-weight: var(--arhix-font-weight-body);
  font-size: var(--arhix-font-size-body);
  line-height: 1;
}

[data-ui-surface="navigator"] .menu__sub-chevron svg {
  transform: rotate(-90deg);
}

/* Canvas and table status columns have fixed geometry. Missing semantic
   indicators stay transparent instead of collapsing their layout slot. */
[data-ui-surface="navigator"] .item__dot--empty {
  background: transparent;
}
