/* BW4-A · All-White 0px Angular Brutalist Drafting (Instrument Studio) */
html[data-theme=instrument] {
  color-scheme: light;
  --bg: #f6f6f5;
  --panel: #ffffff;
  --text: #0a0a0a;
  --muted: #525252;
  --line: #dcdcdc;
  --edge: #0a0a0a;
  --accent: #0a0a0a;
  --danger: #b42318;
  --paper: #ffffff;
  --ink: #0a0a0a;
  --instrument-recess: #f6f6f5;
  --display: 'Oswald', sans-serif;
  --sans: 'Saira Condensed', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
  --pane-width: 344px;
  --header-height: 48px;
  --workspace-gap: 12px;
  --radius: 0px;
  --control-radius: 0px;
  --field-radius: 0px;
  --camera-radius: 0px;
  --surface-fill: var(--panel);
  --surface-fallback: var(--panel);
  --surface-filter: none;
  --surface-shadow: none;
  --surface-blur: 0px;
  --fader-track-albedo: #dcdcdc;
  --fader-cap-albedo: #0a0a0a;
  --fader-cap-edge: #0a0a0a;
  --fader-cap-index: #ffffff;
  --fader-fill: #0a0a0a;
  --fader-indicator: #0a0a0a;
  --range-track: #dcdcdc;
  --range-thumb: #0a0a0a;
  font-synthesis: none;
}

/* Zero-radius angular mandate across every surface, control, thumb, and pseudo-element */
html[data-theme=instrument],
html[data-theme=instrument] *,
html[data-theme=instrument] *::before,
html[data-theme=instrument] *::after {
  border-radius: 0;
}

html[data-theme=instrument] body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 var(--sans);
  scrollbar-width: thin;
  scrollbar-color: #0a0a0a #f0f0ef;
}

html[data-theme=instrument] ::selection {
  background: #0a0a0a;
  color: #ffffff;
}

html[data-theme=instrument] :is(input, textarea) {
  caret-color: #0a0a0a;
}

html[data-theme=instrument] :is(body, .controls-scroll, .layers, .select-popup > [role=listbox], .ui-dialog, dialog, #reference-dialog .reference-review-content, #reference-dialog .reference-inspection-viewport) {
  scrollbar-width: thin;
  scrollbar-color: #0a0a0a #f0f0ef;
}

html[data-theme=instrument] :is(body, .controls-scroll, .layers, .select-popup > [role=listbox], .ui-dialog, dialog, #reference-dialog .reference-review-content, #reference-dialog .reference-inspection-viewport)::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

html[data-theme=instrument] :is(body, .controls-scroll, .layers, .select-popup > [role=listbox], .ui-dialog, dialog, #reference-dialog .reference-review-content, #reference-dialog .reference-inspection-viewport)::-webkit-scrollbar-track {
  background: #f0f0ef;
  border-radius: 0;
}

html[data-theme=instrument] :is(body, .controls-scroll, .layers, .select-popup > [role=listbox], .ui-dialog, dialog, #reference-dialog .reference-review-content, #reference-dialog .reference-inspection-viewport)::-webkit-scrollbar-thumb {
  background: #0a0a0a;
  border-radius: 0;
}

html[data-theme=instrument] :where(.glass-surface) {
  background: var(--panel);
  border: 1.5px solid var(--edge);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html[data-theme=instrument] .skip-link {
  background: #0a0a0a;
  color: #ffffff;
  border: 1.5px solid #0a0a0a;
  border-radius: 0;
  font: 600 13px/1 var(--sans);
}

/* ── TOP ARCHITECTURAL BAR (48px flush #ffffff, 1.5px #0a0a0a bottom rule, 32px controls) ── */
html[data-theme=instrument] .masthead {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  min-height: 48px;
  padding: 0 max(14px, env(safe-area-inset-right, 0px)) 0 max(14px, env(safe-area-inset-left, 0px));
  background: #ffffff;
  border-bottom: 1.5px solid #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  z-index: 30;
  pointer-events: auto;
}

html[data-theme=instrument] .instrument-brand {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  height: 32px;
  padding-right: 0;
  margin-right: 2px;
  border-right: 0;
  flex: none;
  min-width: 0;
  color: #0a0a0a;
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  html[data-theme=instrument] .instrument-brand:hover {
    text-decoration: none;
  }
  html[data-theme=instrument] .instrument-brand:hover > span {
    opacity: 0.72;
  }
}

html[data-theme=instrument] .instrument-brand::after {
  content: '';
  width: 1px;
  height: 18px;
  background: var(--line);
  flex: none;
}

html[data-theme=instrument] .instrument-brand > span {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  white-space: nowrap;
  color: #0a0a0a;
  display: inline-flex;
  align-items: center;
  transform: translateY(-2.5px);
}

html[data-theme=instrument] .skinplot-glyphs {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}

html[data-theme=instrument] .skinplot-t {
  display: inline-block;
  height: 0.82em;
  width: auto;
  vertical-align: baseline;
  margin-left: 0.015em;
  flex: none;
}

html[data-theme=instrument] .instrument-brand > small {
  display: none;
}

html[data-theme=instrument] .study-card {
  --study-rail: 1;
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  max-width: none;
  height: 32px;
  padding: 0;
  gap: 8px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

html[data-theme=instrument] .study-picker {
  display: inline-flex;
  align-items: center;
  flex: 0 1 210px;
  width: auto;
  min-width: 148px;
  max-width: 240px;
  height: 32px;
  border: 0;
  margin: 0;
  padding: 0;
}

html[data-theme=instrument] #project-select {
  height: 32px;
  min-height: 32px;
  width: 100%;
  padding: 0 10px;
  background: #ffffff;
  color: #0a0a0a;
  border: 1px solid #0a0a0a;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: none;
}

html[data-theme=instrument] #project-select .select-value {
  transform: translateY(-0.5px);
}

html[data-theme=instrument] .study-card .study-save {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  flex: none;
  width: auto;
  max-width: none;
  height: 32px;
  padding-inline: 2px;
  gap: 5px;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--muted);
}

html[data-theme=instrument] .study-save[data-save-state=saved] {
  color: var(--muted);
  font-weight: 500;
}

html[data-theme=instrument] .study-save > svg {
  display: block;
  width: 13px;
  height: 13px;
  flex: none;
}

html[data-theme=instrument] .study-card .storage-scope {
  display: inline;
  flex-basis: auto;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--muted);
}

html[data-theme=instrument] .study-card .storage-scope::before {
  content: '· ';
}

html[data-theme=instrument] .masthead .project-menu-trigger {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid #0a0a0a;
  background: #ffffff;
  color: #0a0a0a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: none;
}

html[data-theme=instrument] .masthead:has(.save-recovery:not([hidden])) {
  height: auto;
  padding-block: 8px;
  flex-wrap: wrap;
}

html[data-theme=instrument] .masthead > .study-card:has(.save-recovery:not([hidden])) {
  height: auto;
  flex-wrap: wrap;
}

html[data-theme=instrument] .header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  height: 32px;
  gap: 8px;
  flex: none;
}

html[data-theme=instrument] .instrument-history {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

html[data-theme=instrument] .instrument-history .ui-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid #0a0a0a;
  background: #ffffff;
  color: #0a0a0a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: none;
}

html[data-theme=instrument] #compare-studies {
  height: 32px;
  min-height: 32px;
  width: auto;
  margin: 0;
  padding: 0 12px;
  gap: 6px;
  border: 1px solid #0a0a0a;
  background: #ffffff;
  color: #0a0a0a;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

html[data-theme=instrument] .header-right .save-image {
  height: 32px;
  min-height: 32px;
  min-width: 108px;
  padding: 0 14px;
  gap: 6px;
  background: #0a0a0a;
  border: 1px solid #0a0a0a;
  color: #ffffff;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

html[data-theme=instrument] :is(.instrument-history .ui-button, #compare-studies, .header-right .save-image, .masthead .project-menu-trigger) svg {
  width: 15px;
  height: 15px;
  flex: none;
}

@media (hover: hover) and (pointer: fine) {
  html[data-theme=instrument] #project-select:not(:disabled):hover {
    background: #f6f6f5;
    border-color: #0a0a0a;
  }
  html[data-theme=instrument] :is(.instrument-history .ui-button, #compare-studies, .masthead .project-menu-trigger):not(:disabled):hover {
    background: #0a0a0a;
    color: #ffffff;
    border-color: #0a0a0a;
  }
  html[data-theme=instrument] .header-right .save-image:not(:disabled):hover {
    background: #262626;
    color: #ffffff;
    border-color: #262626;
  }
}

html[data-theme=instrument] .header-right .save-image:not(:disabled):active {
  background: #0a0a0a;
  color: #ffffff;
  box-shadow: none;
}

html[data-theme=instrument] .header-right .save-image:disabled {
  color: #737373;
  border-color: #d4d4d4;
  background: #ebebea;
}

/* ── OPEN #F6F6F5 WORKSPACE & SEAMLESS 3D STAGE (ZERO RECESSED MONITOR-WELL BEZEL) ── */
html[data-theme=instrument]:not([data-preview-expanded]) .workspace {
  --instrument-workspace-top: 48px;
  --instrument-header-gap: 0px;
  position: absolute;
  inset: max(var(--instrument-workspace-top), calc(var(--recovery-header-bottom, 0px) + var(--instrument-header-gap))) 0 0 0;
  height: auto;
  background: var(--bg);
}

html[data-theme=instrument]:not([data-preview-expanded]) .stage {
  inset: 0;
  background: var(--bg);
  border: 0;
  box-shadow: none;
}

html[data-theme=instrument] .stage-top.sr-only {
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

html[data-theme=instrument]:not([data-preview-expanded]) #viewport {
  inset: 0;
  border: 0;
  background: var(--bg);
  box-shadow: none;
}

html[data-theme=instrument]:not([data-preview-expanded]) #viewport canvas:focus-visible {
  outline: 2px solid #0a0a0a;
  outline-offset: -4px;
}

html[data-theme=instrument]:not([data-preview-expanded]) .stage[data-placing=true] #viewport,
html[data-theme=instrument]:not([data-preview-expanded]) .workspace[data-placing=true] #viewport {
  outline: 1.5px dashed #0a0a0a;
  outline-offset: -10px;
  box-shadow: none;
  cursor: crosshair;
}

/* ── FLOATING 0px #FFFFFF BOTTOM CAMERA DOCK (1.5px #0A0A0A, 30px DESKTOP SEGMENTS) ── */
html[data-theme=instrument] .stage-bottom {
  inset: auto calc(var(--pane-width) + 24px) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  height: auto;
  min-height: 0;
  gap: 6px;
  align-items: center;
  flex-direction: column;
  justify-content: flex-end;
}

html[data-theme=instrument] .stage-toolbar {
  width: auto;
  max-width: 100%;
  display: flex;
  justify-content: center;
}

html[data-theme=instrument] .camera-bar {
  width: auto;
  max-width: 100%;
  display: inline-flex;
  align-items: stretch;
  justify-content: center;
  border: 1.5px solid #0a0a0a;
  background: #ffffff;
  padding: 0;
  gap: 0;
  box-shadow: none;
  pointer-events: auto;
}

html[data-theme=instrument] .camera-bar .ui-button {
  min-width: 0;
  height: 30px;
  min-height: 30px;
  flex: 0 1 auto;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  color: #0a0a0a;
  background: #ffffff;
  border: 0;
  border-right: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  box-shadow: none;
  white-space: nowrap;
}

html[data-theme=instrument] .camera-bar .ui-button svg,
html[data-theme=instrument] .camera-bar #camera-angle svg {
  width: 14px;
  height: 14px;
  flex: none;
}

@media (hover: hover) and (pointer: fine) {
  html[data-theme=instrument] .camera-bar .ui-button:not([aria-pressed=true]):not(:disabled):hover,
  html[data-theme=instrument] .camera-bar #camera-angle:not([data-open]):not(:disabled):hover {
    background: #f6f6f5;
    color: #0a0a0a;
  }
}

html[data-theme=instrument] .camera-bar .ui-button[aria-pressed=true] {
  background: #0a0a0a;
  color: #ffffff;
  font-weight: 600;
  border-right-color: #0a0a0a;
  box-shadow: none;
}

html[data-theme=instrument] .camera-bar #camera-angle {
  flex: 0 1 auto;
  width: auto;
  min-width: 96px;
  height: 30px;
  min-height: 30px;
  padding: 0 11px;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  pointer-events: auto;
  background: #ffffff;
  color: #0a0a0a;
  border: 0;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  box-shadow: none;
}

html[data-theme=instrument] .camera-bar #camera-angle[data-open] {
  background: #0a0a0a;
  color: #ffffff;
}

html[data-theme=instrument] #status,
html[data-theme=instrument] #status[data-idle=true] {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  padding: 5px 10px;
  max-width: 100%;
  max-height: none;
  clip-path: none;
  overflow: visible;
  white-space: normal;
  text-align: center;
  border: 1px solid var(--edge);
  background: #ffffff;
  color: #0a0a0a;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  box-shadow: none;
}

html[data-theme=instrument] :is(.stage[data-placing=true], .workspace[data-placing=true]) #status:not([data-idle=true]) {
  align-self: center;
  background: #0a0a0a;
  color: #ffffff;
  border: 1.5px solid #0a0a0a;
  padding: 5px 12px;
}

html[data-theme=instrument] #status[data-idle=true] {
  display: none;
}

html[data-theme=instrument] .interaction-hint {
  display: none;
}

html[data-theme=instrument] footer {
  display: none;
}

/* ── FLOATING 12px-INSET RIGHT DRAFTING SHEET (aside#study-controls) ── */
html[data-theme=instrument] .controls-panel {
  top: 12px;
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  width: var(--pane-width);
  height: auto;
  max-height: none;
  border: 1.5px solid #0a0a0a;
  background: #ffffff;
  box-shadow: none;
}

html[data-theme=instrument] .controls-top {
  background: #ffffff;
  padding: 0;
  border-bottom: 1.5px solid #0a0a0a;
  box-shadow: none;
}

html[data-theme=instrument] .surface-tabs {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr 1.18fr 0.88fr 0.94fr;
  padding: 0;
  border: 0;
  gap: 0;
}

html[data-theme=instrument] .surface-tabs [data-slot=tabs-indicator] {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  top: calc(var(--active-tab-top, 0px) + var(--active-tab-height, 38px) - 2px);
  left: var(--active-tab-left, 0px);
  width: var(--active-tab-width, 0px);
  height: 2px;
  background: #0a0a0a;
}

html[data-theme=instrument] .surface-tabs [data-slot=tabs-indicator][data-activation-direction=none] {
  transition: none;
}

html[data-theme=instrument] .surface-tabs .ui-button {
  position: relative;
  z-index: 1;
  min-height: 38px;
  height: 38px;
  padding: 0 8px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #ffffff;
  border: 0;
  border-right: 1px solid var(--line);
  box-shadow: none;
  color: var(--muted);
  white-space: nowrap;
}

html[data-theme=instrument] .surface-tabs [data-surface=artwork] {
  border-right: 0;
}

html[data-theme=instrument] .surface-tabs [data-surface=artwork] svg {
  width: 14px;
  height: 14px;
  flex: none;
}

@media (hover: hover) and (pointer: fine) {
  html[data-theme=instrument] .surface-tabs .ui-button:not([aria-selected=true]):not(:disabled):hover {
    background: #f6f6f5;
    color: #0a0a0a;
  }
}

html[data-theme=instrument] .surface-tabs .ui-button[aria-selected=true] {
  background: #0a0a0a;
  border-right-color: #0a0a0a;
  color: #ffffff;
  font-weight: 600;
  box-shadow: none;
}

html[data-theme=instrument] .surface-tabs span {
  margin-left: 2px;
  font: 500 11px/1 var(--mono);
  font-variant-numeric: tabular-nums;
  color: inherit;
}

html[data-theme=instrument] .surface-tabs button[aria-selected=true] span {
  color: #ffffff;
}

html[data-theme=instrument] .surface-tabs [data-surface=composition] span {
  display: none;
}

html[data-theme=instrument] .surface-tabs .add-art-label {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: 0;
}

html[data-theme=instrument] .controls-scroll {
  padding: 12px 14px 14px;
  scrollbar-gutter: auto;
}

html[data-theme=instrument] .history-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  gap: 8px;
  background: #f6f6f5;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 400 11px/1.2 var(--mono);
  padding: 6px 14px;
  box-shadow: none;
}

html[data-theme=instrument] #engine {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* Shared baseline overrides inside inspector panels */
html[data-theme=instrument] .library-import .upload {
  background: #0a0a0a;
  border: 1.5px solid #0a0a0a;
  color: #ffffff;
  box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
  html[data-theme=instrument] .library-import .upload:not(:has(input:disabled)):hover {
    background: #262626;
    border-color: #262626;
    color: #ffffff;
  }
}

html[data-theme=instrument] .library-import .upload > svg {
  color: currentColor;
}

html[data-theme=instrument] .art-card .add-art {
  width: 100%;
  min-width: 0;
}

html[data-theme=instrument] .study-layers .layer-index {
  display: none;
}

html[data-theme=instrument] .adjustment-tools,
html[data-theme=instrument] .context-camera {
  display: none;
}

html[data-theme=instrument] .primary-transforms {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

html[data-theme=instrument] .panel-intro {
  margin-bottom: 12px;
}

html[data-theme=instrument] .panel-intro h2 {
  font-size: 18px;
}

html[data-theme=instrument] .selection-preview {
  border: 0;
}

html[data-theme=instrument] .selection-unlock-inline {
  width: auto;
  min-height: 30px;
  height: 30px;
  margin: 6px 0 0;
  padding: 0 10px;
  border: 1px solid #0a0a0a;
  background: #ffffff;
  color: #0a0a0a;
  box-shadow: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

html[data-theme=instrument] .placement-row {
  margin-top: 10px;
}

html[data-theme=instrument] .advanced-tattoo {
  margin-top: 10px;
}

html[data-theme=instrument] .setup-guide h2 {
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.1;
  font-weight: 600;
}

html[data-theme=instrument] .setup-guide > p {
  margin-top: 10px;
  font-size: 13.5px;
}

html[data-theme=instrument] .setup-steps {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 14px;
}

html[data-theme=instrument] .setup-steps li {
  display: grid;
  gap: 6px;
}

html[data-theme=instrument] .setup-steps :is(button, .setup-future) {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  min-height: 36px;
}

html[data-theme=instrument] .setup-steps :is(button, .setup-future) > span {
  font: 12px var(--mono);
  flex: 0 0 20px;
}

html[data-theme=instrument] .setup-steps p {
  padding-left: 32px;
  text-wrap: pretty;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

html[data-theme=instrument] .setup-steps #browse-art {
  margin-top: 0;
}

html[data-theme=instrument] .setup-future {
  color: var(--muted);
}

html[data-theme=instrument] .body-reference-setup > h3 {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 10px;
}

html[data-theme=instrument] .body-reference-setup .hint {
  margin-block: 6px;
}

html[data-theme=instrument] .body-setup-next {
  width: 100%;
  margin-top: 10px;
}

html[data-theme=instrument] .collection-heading {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

html[data-theme=instrument] .collection-heading h2 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
}

html[data-theme=instrument] [data-surface-content=collection] .study-layers {
  border: 0;
  margin-top: 10px;
}

html[data-theme=instrument] [data-surface-content=collection] .study-layers > summary {
  display: none;
}

html[data-theme=instrument] [data-surface-content=collection] .layers {
  max-height: none;
  padding: 0;
  gap: 8px;
}

html[data-theme=instrument] [data-surface-content=collection] .layer {
  border: 1px solid #d0d0d0;
  padding: 8px 10px;
  background: #ffffff;
  grid-template-columns: auto minmax(0, 1fr);
}

html[data-theme=instrument] [data-surface-content=collection] .layer.selected {
  background: #f6f6f5;
  border: 1.5px solid #0a0a0a;
}

html[data-theme=instrument] [data-surface-content=collection] .layer-selection {
  grid-column: 1;
  grid-row: 1;
}

html[data-theme=instrument] [data-surface-content=collection] .layer-description {
  grid-column: 2;
}

html[data-theme=instrument] [data-surface-content=collection] .layer-title {
  min-height: 30px;
  padding: 2px 0;
  justify-content: flex-start;
  text-align: left;
  width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

html[data-theme=instrument] [data-surface-content=collection] .layer small {
  font-size: 11.5px;
}

html[data-theme=instrument] [data-surface-content=collection] .study-layers .layer .layer-actions {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
}

html[data-theme=instrument] [data-surface-content=collection] .layer-order {
  margin-left: auto;
}

html[data-theme=instrument] [data-surface-content=collection] .layer-order > summary {
  gap: 6px;
  border: 1px solid #0a0a0a;
  background: #ffffff;
  color: #0a0a0a;
}

html[data-theme=instrument] [data-surface-content=collection] .layer-order[open] > summary svg {
  rotate: 180deg;
}

html[data-theme=instrument] [data-surface-content=collection] .layer-order-actions {
  margin-top: 4px;
}

html[data-theme=instrument] .collection-adjust {
  position: sticky;
  bottom: 0;
  width: 100%;
  margin-top: 12px;
}

/* Captured comparison and reference review dialogs */
html[data-theme=instrument] .journey-dialog {
  width: min(1120px, calc(100vw - 40px));
  padding: 26px;
}

html[data-theme=instrument] .journey-dialog h2 {
  font-family: var(--display);
  margin-bottom: 8px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

html[data-theme=instrument] .journey-dialog [data-slot=dialog-description] {
  max-width: 66ch;
  padding-right: 36px;
}

html[data-theme=instrument] .comparison-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0 14px;
}

html[data-theme=instrument] .comparison-choices > div {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 0 8px;
  min-width: 0;
}

html[data-theme=instrument] .comparison-choices strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

html[data-theme=instrument] .comparison-choices small {
  grid-column: 2;
  color: var(--muted);
}

html[data-theme=instrument] .comparison-letter {
  font: 500 15px/1 var(--mono);
}

html[data-theme=instrument] .comparison-images {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 18px;
}

html[data-theme=instrument] .comparison-images figure {
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

html[data-theme=instrument] .comparison-images img {
  width: 100%;
  height: min(48svh, 460px);
  object-fit: contain;
  background: var(--bg);
  border: 1px solid var(--line);
}

html[data-theme=instrument] .comparison-images figcaption {
  display: grid;
  gap: 4px;
  overflow-wrap: anywhere;
  font-size: 13.5px;
}

html[data-theme=instrument] .comparison-images figcaption span {
  color: var(--muted);
  font-size: 12px;
}

html[data-theme=instrument] .comparison-images figure > button {
  align-self: start;
  width: auto;
  margin-top: auto;
}

html[data-theme=instrument] .comparison-switch {
  display: none;
}

html[data-theme=instrument] .comparison-empty {
  margin-top: 24px;
  max-width: 60ch;
}

html[data-theme=instrument] .comparison-empty :is(p, button) {
  margin-top: 14px;
}

html[data-theme=instrument] .review-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

html[data-theme=instrument] .review-actions > button {
  width: auto;
  margin-top: 0;
  min-height: 34px;
}

html[data-theme=instrument] .review-error {
  color: var(--danger);
  margin-top: 14px;
}

html[data-theme=instrument] #capture-comparison {
  width: auto;
  min-width: 180px;
}

/* ── RESPONSIVE LAYOUT & SHEET STOP CONTRACTS (exact flat selectors kept for PostCSS regression suite) ── */
@media (min-width: 701px) and (max-width: 1050px) {
  html[data-theme=instrument] {
    --pane-width: 312px;
  }
  html[data-theme=instrument] .masthead {
    gap: 8px;
  }
  html[data-theme=instrument] .study-card .storage-scope {
    display: none;
  }
  html[data-theme=instrument] #compare-studies > span {
    display: none;
  }
  html[data-theme=instrument] #compare-studies {
    width: 32px;
    min-width: 32px;
    padding: 0;
  }
}

@media (min-width: 701px) and (max-width: 860px) {
  html[data-theme=instrument] .instrument-brand {
    display: none;
  }
  html[data-theme=instrument] .study-picker {
    min-width: 120px;
  }
}

@media (max-width: 700px) and (min-height: 501px), (max-width: 700px) and (orientation: portrait) {
  html[data-theme=instrument] {
    --header-height: 52px;
    --sheet-height: min(252px,calc(50svh - 24px));
    --expanded-height: min(50svh,340px);
    --collapsed-height: 60px;
  }
  html[data-theme=instrument] .masthead {
    inset: 0 0 auto 0;
    height: calc(52px + env(safe-area-inset-top, 0px));
    min-height: calc(52px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) max(8px, env(safe-area-inset-right, 0px)) 0 max(8px, env(safe-area-inset-left, 0px));
    display: flex;
    align-items: center;
    gap: 6px;
  }
  html[data-theme=instrument] .instrument-brand,
  html[data-theme=instrument] .instrument-history {
    display: none;
  }
  html[data-theme=instrument] .study-card {
    flex: 1;
    width: auto;
    height: 44px;
    padding: 0;
    gap: 6px;
    min-width: 0;
    max-width: none;
  }
  html[data-theme=instrument] .study-picker {
    flex: 1;
    min-width: 0;
    max-width: none;
    height: 44px;
  }
  html[data-theme=instrument] #project-select {
    height: 44px;
    min-height: 44px;
    padding: 0 10px;
    font-size: 14px;
  }
  html[data-theme=instrument] #project-select .select-value {
  transform: translateY(-0.5px);
}

html[data-theme=instrument] .study-card .study-save {
    height: 44px;
    gap: 4px;
  }
  html[data-theme=instrument] .study-card .storage-scope {
    display: none;
  }
  html[data-theme=instrument] .masthead .project-menu-trigger {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }
  html[data-theme=instrument] .save-recovery {
    flex-direction: column;
    align-items: stretch;
  }
  html[data-theme=instrument] .save-recovery-copy {
    flex: auto;
    max-height: 6lh;
    overflow-y: auto;
  }
  html[data-theme=instrument] #retry-save {
    align-self: flex-start;
    min-height: 44px;
  }
  html[data-theme=instrument] .masthead > .header-right {
    height: 44px;
    gap: 6px;
  }
  html[data-theme=instrument] #compare-studies {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
  }
  html[data-theme=instrument] #compare-studies > span {
    display: none;
  }
  html[data-theme=instrument] .header-right .save-image {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
  }
  html[data-theme=instrument] .save-label-wide,
  html[data-theme=instrument] .save-label-compact {
    display: none;
  }
  html[data-theme=instrument]:not([data-preview-expanded]) .workspace {
    --instrument-workspace-top: 52px;
    --instrument-header-gap: 0px;
    inset: max(calc(52px + env(safe-area-inset-top, 0px)), var(--recovery-header-bottom, 0px)) 0 0 0;
  }
  html[data-theme=instrument] .masthead:has(.save-recovery:not([hidden])) + .workspace {
    --sheet-height: min(252px,max(60px,calc(100svh - var(--recovery-header-bottom,58px) - 88px)));
    --expanded-height: min(340px,max(var(--sheet-height),calc(100svh - var(--recovery-header-bottom,58px) - 16px)));
  }
  html[data-theme=instrument]:not([data-preview-expanded]) .stage {
    inset: 0;
  }
  html[data-theme=instrument]:not([data-preview-expanded]) #viewport,
  html[data-theme=instrument]:not([data-preview-expanded]) .workspace:has(.controls-panel.expanded) #viewport {
    top: 0;
    left: 0;
    right: 0;
    bottom: var(--sheet-live-height, var(--sheet-height));
  }
  html[data-theme=instrument] .stage-bottom,
  html[data-theme=instrument] .workspace:has(.controls-panel:is(.collapsed, .expanded)) .stage-bottom {
    bottom: calc(var(--sheet-live-height,var(--sheet-height)) + 8px);
    left: 8px;
    right: 8px;
    height: auto;
    min-height: 44px;
    gap: 4px;
  }
  html[data-theme=instrument] .workspace:has(.controls-panel.expanded) .stage-bottom,
  html[data-theme=instrument] .stage-bottom[data-contextual=true] {
    min-height: 0;
  }
  html[data-theme=instrument] .stage-toolbar {
    width: 100%;
  }
  html[data-theme=instrument] .camera-bar {
    width: 100%;
    height: auto;
    min-height: 44px;
    gap: 0;
    padding: 0;
  }
  html[data-theme=instrument] .camera-bar .ui-button {
    flex: 1;
    height: 44px;
    min-height: 44px;
    flex-direction: row;
    gap: 5px;
    font-size: 12px;
    padding-inline: 8px;
  }
  html[data-theme=instrument] .camera-bar #camera-angle {
    flex: 1;
    min-width: 84px;
    height: 44px;
    min-height: 44px;
    font-size: 12.5px;
    padding-inline: 8px;
  }
  html[data-theme=instrument] #status {
    font-size: 12px;
  }
  html[data-theme=instrument] #status:not([data-idle=true]) {
    padding: 4px 8px;
  }
  html[data-theme=instrument] .controls-top {
    padding: 0;
    gap: 0;
    display: flex;
    align-items: stretch;
  }
  html[data-theme=instrument] .surface-tabs {
    grid-template-columns: 1fr 1.2fr 0.9fr 44px;
    gap: 0;
    flex: 1;
  }
  html[data-theme=instrument] .surface-tabs .ui-button {
    min-height: 44px;
    height: 44px;
    font-size: 11.5px;
    padding: 0 4px;
  }
  html[data-theme=instrument] .surface-tabs .add-art-label {
    display: none;
  }
  html[data-theme=instrument] .surface-tabs [data-slot=tabs-indicator] {
    top: calc(var(--active-tab-top, 0px) + var(--active-tab-height, 44px) - 2px);
  }
  html[data-theme=instrument] #controls-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    min-height: 44px;
    height: 44px;
    margin: 0;
    padding: 0 8px;
    border: 0;
    border-left: 1px solid var(--line);
    background: #f6f6f5;
    color: #0a0a0a;
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-shadow: none;
  }
  html[data-theme=instrument] .sheet-drag-handle {
    display: flex;
    height: 14px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
  html[data-theme=instrument] .sheet-drag-handle > span {
    width: 36px;
    height: 2px;
    border-radius: 0;
    background: #0a0a0a;
    opacity: 1;
  }
  html[data-theme=instrument] .controls-panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: var(--sheet-height);
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-top: 1.5px solid #0a0a0a;
    box-shadow: none;
  }
  html[data-theme=instrument] .controls-scroll {
    padding: 10px 12px 14px;
  }
  html[data-theme=instrument] .panel-intro {
    margin-bottom: 6px;
    min-height: 36px;
  }
  html[data-theme=instrument] .panel-intro h2 {
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  html[data-theme=instrument] .selection-description {
    min-width: 0;
  }
  html[data-theme=instrument] .selection-description > p {
    font-size: 12px;
  }
  html[data-theme=instrument] .selection-preview {
    height: 36px;
    width: 28px;
  }
  html[data-theme=instrument] .selection-actions > button {
    min-height: 44px;
    width: 44px;
    height: 44px;
  }
  html[data-theme=instrument] .selection-unlock-inline {
    min-height: 44px;
    height: 44px;
  }

  /* Mobile sub-tool selector: sharp 0px segmented architectural strip */
  html[data-theme=instrument] .adjustment-tools {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    padding: 0;
    margin-bottom: 8px;
    background: #ffffff;
    border: 1px solid #0a0a0a;
    box-shadow: none;
  }
  html[data-theme=instrument] .adjustment-tools button.ui-button {
    min-height: 40px;
    padding: 0 4px;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    border: 0;
    border-right: 1px solid var(--line);
    background: #ffffff;
    box-shadow: none;
  }
  html[data-theme=instrument] .adjustment-tools button.ui-button:last-child {
    border-right: 0;
  }
  html[data-theme=instrument] .adjustment-tools button.ui-button:is([aria-pressed=true], [data-pressed]) {
    background: #0a0a0a;
    color: #ffffff;
    border-right-color: #0a0a0a;
    box-shadow: none;
    font-weight: 600;
  }
  html[data-theme=instrument] .primary-transforms {
    display: block;
  }
  html[data-theme=instrument] [data-adjustment=view] .context-camera {
    display: flex;
    gap: 6px;
    padding-block: 6px;
  }
  html[data-theme=instrument] .context-camera > * {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    font-size: 13px;
  }
  html[data-theme=instrument] .context-camera > button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding-inline: 6px;
  }
  html[data-theme=instrument] .context-camera button[aria-pressed=true] {
    background: #0a0a0a;
    color: #ffffff;
    border-color: #0a0a0a;
  }
  html[data-theme=instrument] .primary-transform .range-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto 44px;
    margin: 0;
    gap: 4px 8px;
  }
  html[data-theme=instrument] .primary-transform .range-control > label {
    align-self: center;
    margin: 0;
  }
  html[data-theme=instrument] [data-adjustment] .primary-transform,
  html[data-theme=instrument] [data-adjustment] .placement-row,
  html[data-theme=instrument] [data-adjustment] .advanced-tattoo {
    display: none;
  }
  html[data-theme=instrument] [data-adjustment=size] [data-tool=size],
  html[data-theme=instrument] [data-adjustment=rotate] [data-tool=rotate],
  html[data-theme=instrument] [data-adjustment=more] .advanced-tattoo {
    display: block;
  }
  html[data-theme=instrument] [data-adjustment=place] .placement-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0;
    align-items: end;
  }
  html[data-theme=instrument] [data-adjustment=more] .advanced-tattoo {
    border: 0;
    margin: 0;
  }
  html[data-theme=instrument] [data-adjustment=more] .advanced-tattoo > summary {
    display: none;
  }
  html[data-theme=instrument] .placement-row .field {
    flex: 1;
    flex-basis: auto;
    min-width: 0;
    margin: 0;
    gap: 3px;
  }
  html[data-theme=instrument] .placement-action {
    flex: none;
    min-width: 44px;
    min-height: 44px;
    height: 44px;
    padding-inline: 10px;
  }
  html[data-theme=instrument] .placement-action > span {
    display: none;
  }
  html[data-theme=instrument] .history-bar {
    display: none;
  }
  html[data-theme=instrument] .setup-guide h2 {
    font-size: 20px;
  }
  html[data-theme=instrument] .setup-guide > p {
    margin-top: 6px;
    font-size: 13px;
  }
  html[data-theme=instrument] .setup-steps {
    gap: 12px;
    margin-top: 12px;
  }
  html[data-theme=instrument] .setup-steps p {
    display: none;
  }
  html[data-theme=instrument] .journey-dialog {
    width: calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    max-height: calc(100svh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    padding: 20px 16px;
  }
  html[data-theme=instrument] .journey-dialog h2 {
    font-size: 22px;
  }
  html[data-theme=instrument] .comparison-choices {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-block: 16px 12px;
  }
  html[data-theme=instrument] .comparison-images {
    display: block;
    margin-top: 12px;
  }
  html[data-theme=instrument] .comparison-images img {
    height: 42svh;
  }
  html[data-theme=instrument] .comparison-images[data-side=a] [data-comparison-side=b],
  html[data-theme=instrument] .comparison-images[data-side=b] [data-comparison-side=a] {
    display: none;
  }
  html[data-theme=instrument] .comparison-switch {
    display: flex;
    gap: 0;
    margin-top: 14px;
    border: 1px solid #0a0a0a;
  }
  html[data-theme=instrument] .comparison-switch button {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-right: 1px solid var(--line);
  }
  html[data-theme=instrument] .comparison-switch button:last-child {
    border-right: 0;
  }
  html[data-theme=instrument] .comparison-switch button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  html[data-theme=instrument] .comparison-switch button[aria-pressed=true] {
    background: #0a0a0a;
    color: #ffffff;
  }
}

@media (max-width: 360px) {
  html[data-theme=instrument] .study-save .save-status-short {
    display: none;
  }
  html[data-theme=instrument] .study-save[data-save-state=error] .save-status-short {
    display: inline;
  }
}

@media (max-width: 700px) and (max-height: 600px) and (orientation: portrait) {
  html[data-theme=instrument] {
    --sheet-height: 252px;
    --expanded-height: max(284px,46svh);
  }
  html[data-theme=instrument] .controls-scroll {
    padding-top: 6px;
  }
  html[data-theme=instrument] .panel-intro {
    min-height: 32px;
  }
  html[data-theme=instrument] .selection-description > p {
    font-size: 12px;
    line-height: 1.25;
  }
  html[data-theme=instrument] .adjustment-tools {
    margin-bottom: 4px;
  }
  html[data-theme=instrument] .primary-transform .range-control {
    grid-template-rows: auto 44px;
  }
}

@media (max-width: 700px) and (max-height: 500px) and (orientation: portrait) {
  html[data-theme=instrument] {
    --sheet-height: calc(100svh - 270px);
    --expanded-height: calc(100svh - 246px);
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  html[data-theme=instrument] {
    --pane-width: 300px;
    --header-height: 48px;
  }
  html[data-theme=instrument] .masthead {
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    min-height: 48px;
    padding-inline: max(8px, env(safe-area-inset-left, 0px)) max(8px, env(safe-area-inset-right, 0px));
    gap: 8px;
  }
  html[data-theme=instrument] .instrument-brand,
  html[data-theme=instrument] .study-card .storage-scope {
    display: none;
  }
  html[data-theme=instrument] .study-card {
    flex: 1;
    max-width: none;
    gap: 6px;
  }
  html[data-theme=instrument]:not([data-preview-expanded]) .workspace {
    --instrument-workspace-top: 48px;
    --instrument-header-gap: 0px;
    inset: max(48px, var(--recovery-header-bottom, 0px)) 0 0 0;
  }
  html[data-theme=instrument] .controls-panel,
  html[data-theme=instrument] .controls-panel:is(.collapsed, .expanded, [data-panel-state]) {
    top: 8px;
    left: auto;
    right: max(8px, env(safe-area-inset-right, 0px));
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    width: var(--pane-width);
    height: auto;
    max-height: none;
    border: 1.5px solid #0a0a0a;
  }
  html[data-theme=instrument] .controls-panel.collapsed .controls-scroll {
    display: block;
  }
  html[data-theme=instrument] .sheet-drag-handle,
  html[data-theme=instrument] #controls-toggle,
  html[data-theme=instrument] .history-bar {
    display: none;
  }
  html[data-theme=instrument] .stage-bottom,
  html[data-theme=instrument] .workspace:has(.controls-panel:is(.collapsed, .expanded)) .stage-bottom {
    left: 8px;
    right: calc(var(--pane-width) + 16px);
    bottom: 8px;
    min-height: 44px;
  }
  html[data-theme=instrument]:not([data-preview-expanded]) #viewport,
  html[data-theme=instrument]:not([data-preview-expanded]) .workspace:has(.controls-panel.expanded) #viewport {
    inset: 0 0 calc(var(--dock-live-height,48px) + 8px);
  }
  html[data-theme=instrument] .camera-bar {
    height: auto;
    min-height: 44px;
    gap: 0;
  }
  html[data-theme=instrument] .camera-bar .ui-button,
  html[data-theme=instrument] .camera-bar #camera-angle {
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    font-size: 12px;
  }
  html[data-theme=instrument] #status:not([data-idle=true]) {
    position: static;
  }
  html[data-theme=instrument] .controls-scroll {
    padding: 10px 12px;
  }
}

@media (pointer: coarse) {
  html[data-theme=instrument] .masthead {
    min-height: calc(54px + env(safe-area-inset-top, 0px));
    height: auto;
    padding-top: max(5px, env(safe-area-inset-top, 0px));
    padding-bottom: 5px;
  }
  html[data-theme=instrument] :is(.study-card, .study-picker, #project-select, .masthead .project-menu-trigger, .header-right, .instrument-history .ui-button, #compare-studies, .header-right .save-image) {
    min-height: 44px;
    height: 44px;
  }
  html[data-theme=instrument] :is(.masthead .project-menu-trigger, .instrument-history .ui-button) {
    min-width: 44px;
    width: 44px;
  }
  html[data-theme=instrument] :is(.camera-bar, .surface-tabs) {
    height: auto;
  }
  html[data-theme=instrument] :is(.camera-bar .ui-button, .camera-bar #camera-angle, .surface-tabs .ui-button, .adjustment-tools button) {
    min-height: 44px;
    height: 44px;
  }
}
@media (pointer: coarse) and (max-height: 500px) and (orientation: landscape) {
  html[data-theme=instrument] .masthead {
    min-height: 48px;
    height: 48px;
    padding-block: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html[data-theme=instrument] .surface-tabs [data-slot=tabs-indicator]:not([data-activation-direction=none]) {
    transition: left 180ms ease-out, top 180ms ease-out, width 180ms ease-out;
  }
  html[data-theme=instrument] .surface-tabs .ui-button,
  html[data-theme=instrument] .adjustment-tools button,
  html[data-theme=instrument] .camera-bar .ui-button {
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
  }
}

@media (prefers-reduced-transparency: reduce) {
  html[data-theme=instrument] :is(.ui-dialog-backdrop, dialog::backdrop) {
    background: rgb(10 10 10 / 0.85);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (forced-colors: active) {
  html[data-theme=instrument] :is(.glass-surface, .study-card, .controls-panel, .stage, .journey-dialog, .masthead) {
    background: Canvas;
    color: CanvasText;
    border-color: CanvasText;
    box-shadow: none;
  }
  html[data-theme=instrument] :is(.camera-bar .ui-button, .header-right .save-image, .instrument-history .ui-button, .surface-tabs .ui-button, .adjustment-tools button, #compare-studies, #project-select, .masthead .project-menu-trigger) {
    background: ButtonFace;
    color: ButtonText;
    border-color: ButtonText;
    box-shadow: none;
  }
  html[data-theme=instrument] :is(.surface-tabs button[aria-selected=true], .adjustment-tools button:is([aria-pressed=true], [data-pressed]), .camera-bar .ui-button[aria-pressed=true], .comparison-switch button[aria-pressed=true]) {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
    border-color: Highlight;
  }
  html[data-theme=instrument] .surface-tabs [data-slot=tabs-indicator] {
    display: none;
  }
  html[data-theme=instrument] :is(.ui-dialog-backdrop, dialog::backdrop) {
    background: Canvas;
    opacity: .75;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme=instrument] {
    scroll-behavior: auto;
  }
  html[data-theme=instrument] .surface-tabs [data-slot=tabs-indicator] {
    transition: none;
  }
}

@media (hover: hover) and (pointer: fine) {
  html[data-theme=instrument] .adjustment-tools button:is([aria-pressed=true], [data-pressed]):not(:disabled):hover,
  html[data-theme=instrument] .surface-tabs button[aria-selected=true]:not(:disabled):hover {
    background: #262626;
    color: #ffffff;
  }
}
