[data-ui-surface="shell"] .secondary-inspector {
  position: fixed;
  z-index: var(--arhix-layer-popover);
  display: flex;
  box-sizing: content-box;
  width: var(--arhix-inspector-width);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--arhix-island-border);
  border-radius: var(--arhix-radius-island);
  background: var(--arhix-surface-raised);
  box-shadow: var(--arhix-shadow-island);
  color: var(--arhix-ink);
  line-height: 1;
}

[data-ui-surface="shell"] .secondary-inspector[hidden] { display: none; }

[data-ui-surface="shell"] .secondary-inspector .inspector-panel__scroll > .inspector-panel__graphic-row:first-child {
  margin-top: var(--arhix-space-inset);
}

[data-ui-surface="shell"] .secondary-inspector button:focus {
  outline: 0;
}

:where([data-ui-surface="shell"] :is([data-inspector-color-menu], [data-inspector-weight-menu]) .menu__item) {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: inherit;
}

[data-ui-surface="shell"] :is([data-inspector-color-menu], [data-inspector-weight-menu]) {
  z-index: var(--arhix-layer-popover-menu);
}

[data-ui-surface="shell"] :is([data-inspector-color-menu], [data-inspector-weight-menu]) .menu__item:hover {
  background: var(--arhix-surface);
}

[data-ui-surface="shell"] .color-inspector__body {
  display: flex;
  flex-direction: column;
  padding: var(--arhix-space-inset);
}

[data-ui-surface="shell"] .color-inspector__body :is(.inspector-panel__chip, .inspector-panel__scope) {
  margin-left: 0;
  margin-right: 0;
}

[data-ui-surface="shell"] .secondary-inspector__field:is([aria-disabled="true"], :has(input:disabled)) {
  color: var(--arhix-ink-ghost);
}

[data-ui-surface="shell"] .color-picker__opacity input:disabled {
  --arhix-accent: var(--arhix-ink-ghost);
}

[data-ui-surface="shell"] .color-picker__area {
  position: relative;
  overflow: hidden;
  width: var(--arhix-inspector-content-width);
  height: 100px;
  flex: none;
  border-radius: var(--arhix-radius-control);
  background:
    linear-gradient(to top, #000, transparent),
    linear-gradient(to right, #fff, hsl(var(--inspector-picker-hue, 0) 100% 50%));
  cursor: pointer;
}

[data-ui-surface="shell"] .color-picker__hue {
  position: relative;
  width: var(--arhix-inspector-content-width);
  height: var(--arhix-picker-thumb-size);
  margin-top: var(--arhix-space-block);
  flex: none;
  border-radius: var(--arhix-radius-pill);
  background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  cursor: pointer;
}

[data-ui-surface="shell"] .color-picker__thumb {
  position: absolute;
  top: 50%;
  left: var(--arhix-picker-thumb-inset);
  box-sizing: border-box;
  width: var(--arhix-picker-thumb-size);
  height: var(--arhix-picker-thumb-size);
  border: 2px solid var(--arhix-picker-thumb-ring);
  border-radius: 50%;
  box-shadow: var(--arhix-shadow-picker-thumb);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

[data-ui-surface="shell"] .color-picker__area .color-picker__thumb {
  top: var(--arhix-picker-thumb-inset);
  left: calc(100% - var(--arhix-picker-thumb-inset));
}

[data-ui-surface="shell"] .secondary-inspector__field {
  display: flex;
  box-sizing: border-box;
  width: 100%;
  height: var(--arhix-control-height);
  min-height: var(--arhix-control-height);
  margin: var(--arhix-space-block) 0 0;
  padding: 0 var(--arhix-space-inset);
  align-items: center;
  border: 0;
  border-radius: var(--arhix-radius-control);
  background: var(--arhix-surface);
  color: var(--arhix-ink);
  font: inherit;
}

[data-ui-surface="shell"] .secondary-inspector__field--select {
  padding-right: 0;
  justify-content: space-between;
  cursor: pointer;
}

[data-ui-surface="shell"] [data-inspector-color-select="gradient"] {
  margin-top: var(--arhix-space-gap);
}

[data-ui-surface="shell"] .secondary-inspector__field-select-right {
  display: flex;
  height: 100%;
  flex: none;
  align-items: center;
}

[data-ui-surface="shell"] .secondary-inspector__field-select-divider {
  width: 1px;
  height: var(--arhix-notch-field);
  flex: none;
  background: var(--arhix-line);
}

[data-ui-surface="shell"] .secondary-inspector__field-select-chevron {
  display: grid;
  width: var(--arhix-control-height);
  height: 100%;
  place-items: center;
}

[data-ui-surface="shell"] .secondary-inspector__field-select-chevron > svg {
  width: var(--arhix-icon-size-compact);
  height: var(--arhix-icon-size-compact);
  color: var(--arhix-ink-muted);
}

[data-ui-surface="shell"] .secondary-inspector__field--hex {
  margin-top: 0;
  padding-left: var(--arhix-space-micro);
  padding-right: var(--arhix-space-inset);
  box-shadow: inset 0 0 0 1px transparent;
}

[data-ui-surface="shell"] .secondary-inspector__field--hex[data-active="true"] {
  box-shadow: inset 0 0 0 1px var(--arhix-accent);
}

[data-ui-surface="shell"] .secondary-inspector__field input {
  min-width: 0;
  flex: 1 1 auto;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: right;
}

[data-ui-surface="shell"] .secondary-inspector__field input[type="number"] {
  appearance: textfield;
}

[data-ui-surface="shell"] .secondary-inspector__field input[type="number"]::-webkit-inner-spin-button,
[data-ui-surface="shell"] .secondary-inspector__field input[type="number"]::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

[data-ui-surface="shell"] .secondary-inspector__swatch {
  width: var(--arhix-preview-width);
  height: var(--arhix-preview-height);
  flex: none;
  border-radius: var(--arhix-radius-chip);
  background: var(--inspector-color, var(--arhix-drawing-preview-bg));
}

[data-ui-surface="shell"] .color-picker__fill-row {
  display: flex;
  align-items: center;
  gap: var(--arhix-space-gap);
  margin-top: var(--arhix-space-block);
}

[data-ui-surface="shell"] .color-picker__fill-row .secondary-inspector__field {
  min-width: 0;
  flex: 1 1 auto;
}

[data-ui-surface="shell"] .inspector-panel__scope + .color-picker__fill-row { margin-top: var(--arhix-space-gap); }

[data-ui-surface="shell"] .secondary-inspector__toggle {
  display: grid;
  width: var(--arhix-control-height);
  height: var(--arhix-control-height);
  flex: none;
  padding: 0;
  border: 0;
  border-radius: var(--arhix-radius-control);
  place-items: center;
  background: transparent;
  color: var(--arhix-ink-muted);
  cursor: pointer;
}

[data-ui-surface="shell"] .secondary-inspector__toggle:hover { background: var(--arhix-surface); }
[data-ui-surface="shell"] .secondary-inspector__toggle > svg { width: var(--arhix-icon-size); height: var(--arhix-icon-size); }

[data-ui-surface="shell"] [data-inspector-gradient-stop] .secondary-inspector__field {
  margin-top: var(--arhix-space-gap);
}

[data-ui-surface="shell"] .color-picker__opacity {
  display: flex;
  align-items: center;
  gap: var(--arhix-space-gap);
  margin-top: var(--arhix-space-gap);
}

[data-ui-surface="shell"] .color-picker__opacity .secondary-inspector__field {
  width: var(--arhix-inspector-half-field-width);
  margin: 0;
}

[data-ui-surface="shell"] .color-picker__opacity input[type="range"] {
  appearance: none;
  width: var(--arhix-inspector-half-field-width);
  height: var(--arhix-picker-thumb-size);
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

[data-ui-surface="shell"] .color-picker__opacity input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: var(--arhix-radius-tick);
  background: var(--arhix-accent);
}

[data-ui-surface="shell"] .color-picker__opacity input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: var(--arhix-picker-thumb-size);
  height: var(--arhix-picker-thumb-size);
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: var(--arhix-accent);
}

[data-ui-surface="shell"] .color-picker__opacity input[type="range"]::-moz-range-track {
  height: 2px;
  border: 0;
  border-radius: var(--arhix-radius-tick);
  background: var(--arhix-accent);
}

[data-ui-surface="shell"] .color-picker__opacity input[type="range"]::-moz-range-thumb {
  width: var(--arhix-picker-thumb-size);
  height: var(--arhix-picker-thumb-size);
  border: 0;
  border-radius: 50%;
  background: var(--arhix-accent);
}

/* Bounded option lists reuse the secondary surface without extending beyond the viewport. */
[data-ui-surface="shell"] .secondary-inspector--scrollable {
  max-height: calc(100vh - 2 * var(--arhix-space-edge) - 2 * var(--arhix-border-hairline));
}
[data-ui-surface="shell"] .secondary-inspector--scrollable > .color-inspector__body { flex: none; }
[data-ui-surface="shell"] .secondary-inspector--scrollable > .hatch-inspector__body {
  min-height: 0;
  overflow-y: auto;
}
[data-ui-surface="shell"] .secondary-inspector--scrollable .menu__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
