.presentation-command {
  color: var(--arhix-ink-active);
  font-family: var(--arhix-font);
}

.presentation-command {
  position: fixed;
  z-index: var(--arhix-layer-command-bar);
  right: auto;
  bottom: var(--arhix-space-edge);
  left: 50%;
  display: none;
  gap: var(--arhix-space-gap);
  transform: translateX(-50%);
}

body.presentation-mode .presentation-command {
  display: flex;
}

body.presentation-mode [data-ui-surface="toolbar"] {
  display: none;
}

body[data-role="presentation"] .presentation-command {
  display: flex;
}

body[data-role="presentation"] :is(
  [data-ui-surface="rail"],
  [data-ui-surface="navigator"],
  [data-ui-surface="toolbar"],
  [data-ui-surface="inspector"],
  [data-ui-surface="secondary-inspector"]
) {
  display: none;
}

body[data-role="presentation"] .presentation-command__bar--mode {
  display: none;
}

.presentation-command__bar {
  display: flex;
  align-items: center;
  height: calc(var(--arhix-bar-zone-height) + 2 * var(--arhix-border-hairline));
  padding: var(--arhix-space-bar-inset);
  gap: var(--arhix-space-micro);
  border: var(--arhix-border-hairline) 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-active);
}

.presentation-command__button {
  display: grid;
  width: var(--arhix-control-height);
  min-width: var(--arhix-control-height);
  height: var(--arhix-control-height);
  min-height: var(--arhix-control-height);
  border-radius: var(--arhix-radius-control);
  padding: 0;
  border: 0;
  place-items: center;
  background: transparent;
  color: var(--arhix-ink-muted);
}

.presentation-command__button > svg {
  width: var(--arhix-icon-size);
  height: var(--arhix-icon-size);
}

.presentation-command__expand > [data-ui-presentation-expand-icon] {
  display: grid;
  place-items: center;
}

.presentation-command__expand > [data-ui-presentation-expand-icon][hidden] {
  display: none;
}

.presentation-command__expand > [data-ui-presentation-expand-icon] > svg {
  width: var(--arhix-icon-size);
  height: var(--arhix-icon-size);
}

:is([data-ui-surface="command-bar"], [data-ui-surface="free-form-command"]) .presentation-command__button--tool {
  background: transparent;
  color: var(--arhix-ink-muted);
}

:is([data-ui-surface="command-bar"], [data-ui-surface="free-form-command"]) .presentation-command__button--tool:is(:hover, :focus-visible) {
  background: var(--arhix-surface);
  color: var(--arhix-ink-active);
}

:is([data-ui-surface="command-bar"], [data-ui-surface="free-form-command"]) .presentation-command__button--tool:where(
  .active,
  ._active,
  [aria-pressed="true"]
) {
  --arhix-icon-secondary: color-mix(in srgb, var(--arhix-accent) 15%, transparent);
  background: var(--arhix-accent-tint);
  color: var(--arhix-accent);
}

:is([data-ui-surface="command-bar"], [data-ui-surface="free-form-command"]) .presentation-command__button--tool:where(
  .active,
  ._active,
  [aria-pressed="true"]
):is(:hover, :focus-visible) {
  background: var(--arhix-accent-tint);
  color: var(--arhix-accent);
}

.presentation-command__button:hover {
  background: var(--arhix-surface);
  color: var(--arhix-ink-active);
}

.presentation-command__button:where(.active, ._active, [aria-pressed="true"], [aria-checked="true"]) {
  background: var(--arhix-accent-tint);
  color: var(--arhix-accent);
}

.presentation-command__button--soft {
  background: var(--arhix-surface);
}

:is([data-ui-surface="command-bar"], [data-ui-surface="free-form-command"]) .presentation-command__button--tool:disabled {
  background: transparent;
  color: var(--arhix-ink-ghost);
  /* Keep the native title explaining unavailable tools reachable on hover. */
  pointer-events: auto;
}

[data-ui-surface="free-form-command"] .toolbar-drop__item:disabled,
[data-ui-surface="free-form-command"] .toolbar-drop__item:disabled .toolbar-drop__label {
  color: var(--arhix-ink-ghost);
}

[data-ui-surface="command-bar"] .presentation-command__button--soft {
  background: var(--arhix-surface);
}

[data-ui-surface] .presentation-command__separator {
  align-self: center;
  width: 1px;
  min-width: 1px;
  height: var(--arhix-notch-bar);
  margin: 0 var(--arhix-space-micro);
  background: var(--arhix-line);
}

.presentation-command__counter {
  display: inline-flex;
  min-width: var(--arhix-inspector-half-field-width);
  height: var(--arhix-control-height);
  align-items: center;
  justify-content: center;
  color: var(--arhix-ink-active);
  font: 500 var(--arhix-font-size-body)/1 var(--arhix-font);
  white-space: nowrap;
}

[data-ui-surface="notification"] {
  position: fixed;
  top: var(--arhix-space-edge);
  left: 50%;
  width: max-content;
  max-width: calc(100vw - 2 * var(--arhix-space-edge));
  transform: translateX(-50%);
  font-family: var(--arhix-font);
}

[data-ui-surface="notification"] .presentation-command__bar {
  flex-wrap: wrap;
  align-content: center;
}

[data-ui-surface="notification"] [hidden] {
  display: none;
}

[data-ui-surface="notification"] .presentation-command__bar {
  height: auto;
  min-height: calc(var(--arhix-bar-zone-height) + 2 * var(--arhix-border-hairline));
}

[data-ui-surface="notification"] [data-ui-notification-message] {
  min-width: 0;
  max-width: 100%;
  height: auto;
  min-height: var(--arhix-control-height);
  white-space: normal;
  line-height: 1.2;
}

@media (max-width: 360px) {
  [data-ui-surface="notification"] .presentation-command__bar {
    height: auto;
    min-height: calc(var(--arhix-bar-zone-height) + 2 * var(--arhix-border-hairline));
  }
}

.presentation-command__notice-icon {
  display: grid;
  width: var(--arhix-control-height);
  height: var(--arhix-control-height);
  place-items: center;
}

.presentation-command__notice-icon > svg {
  width: var(--arhix-icon-size);
  height: var(--arhix-icon-size);
}

.presentation-command__button--text {
  width: auto;
  padding-inline: var(--arhix-space-block);
  font: 500 var(--arhix-font-size-body)/1 var(--arhix-font);
}

.presentation-command__actions {
  display: flex;
  gap: calc(var(--arhix-space-micro) + var(--arhix-space-pill));
}

.presentation-command__progress {
  flex: 0 0 4ch;
  min-width: 4ch;
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
}

.presentation-command__page--prev > svg {
  transform: rotate(-90deg);
}

.presentation-command__page--next > svg {
  transform: rotate(90deg);
}

body[data-contour-edit="true"] [data-ui-surface="toolbar"] [data-contour-edit-disabled] {
  opacity: 0.22;
  filter: grayscale(1);
  pointer-events: none;
}

[data-ui-surface="notification"] [data-ui-notification-preview] {
  width: calc(var(--arhix-control-height) * 3);
  max-height: calc(var(--arhix-control-height) * 3);
  object-fit: contain;
  border-radius: var(--arhix-radius-control);
}

/* Navigator placement tools use the same command buttons and island as FreeForm. */
[data-ui-surface="command-bar"][data-ui-texture-tools] {
  position: fixed;
  overflow-y: auto;
  border-radius: var(--arhix-radius-island);
  box-shadow: var(--arhix-shadow-island);
}
[data-ui-surface="command-bar"][data-ui-texture-tools] .presentation-command__bar {
  height: auto;
  flex-direction: column;
  box-shadow: none;
}
[data-ui-surface="command-bar"][data-ui-texture-tools] .presentation-command__separator {
  width: var(--arhix-notch-bar);
  min-width: 0;
  height: var(--arhix-border-hairline);
  margin: calc(var(--arhix-space-bar-inset) - var(--arhix-space-micro)) 0;
}
[data-ui-surface="command-bar"] [data-ui-texture-tools-collapse] > svg {
  width: var(--arhix-icon-size-compact);
  height: var(--arhix-icon-size-compact);
}
