:root {
  color-scheme: dark;
  --paper: #e8e2d4;
  --muted: #98978f;
  --ink: #111110;
  --panel: #171716;
  --line: rgba(255, 255, 255, 0.1);
  --app-accent: #639cff;
  --app-accent-bright: #91baff;
  --app-rgb: 99, 156, 255;
  --brand-eyebrow-size: 0.57rem;
  --brand-eyebrow-weight: 750;
  --brand-eyebrow-spacing: 0.14em;
  --macro-accent: #54ccff;
  --macro-rgb: 84, 204, 255;
  --candidate-accent: #78bfff;
  --candidate-rgb: 120, 191, 255;
  --lime: #c7ff45;
  --move-journal-accent: #f2b84b;
  --move-journal-rgb: 242, 184, 75;
  --projections-accent: #b58cff;
  --projections-rgb: 181, 140, 255;
  --scratchpad: #ff3bd4;
  --scratchpad-rgb: 255, 59, 212;
  --topbar-height: 104px;
  --projection-tray-height: 190px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 1024px;
  height: 100%;
  min-height: 680px;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.svg-symbols {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.net-face use {
  fill: #171716;
  stroke: var(--app-accent);
  stroke-linejoin: round;
  stroke-width: 0.82;
}

.net-face text {
  fill: var(--app-accent-bright);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 4.8px;
  font-weight: 900;
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: central;
}

.startup-screen {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 43%, rgba(var(--app-rgb), 0.095), transparent 28rem),
    #10100f;
  opacity: 1;
  transition: opacity 240ms ease, visibility 240ms ease;
}

.startup-screen.finished {
  opacity: 0;
  visibility: hidden;
}

.startup-card {
  width: min(440px, calc(100vw - 80px));
  padding: 2.2rem 2.35rem 2rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  background: rgba(23, 23, 22, 0.94);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.startup-mark {
  display: block;
  width: 156px;
  height: 82px;
  margin: -0.35rem 0 0.8rem -0.9rem;
  filter: drop-shadow(0 0 10px rgba(var(--app-rgb), 0.28));
}

.startup-card p {
  margin: 0 0 0.42rem;
  color: var(--app-accent-bright);
  font-size: var(--brand-eyebrow-size);
  font-weight: var(--brand-eyebrow-weight);
  letter-spacing: var(--brand-eyebrow-spacing);
  line-height: 1.3;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(var(--app-rgb), 0.16);
}

.startup-card h2 {
  margin: 0 0 1.65rem;
  color: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.75rem;
  font-weight: 400;
}

.startup-progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.startup-progress-track span {
  display: block;
  width: 2%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #376fd6, var(--app-accent-bright));
  box-shadow: 0 0 16px rgba(var(--app-rgb), 0.34);
  transition: width 220ms ease;
}

.startup-progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.8rem;
  color: #aaa8a0;
  font-size: 0.72rem;
}

.startup-progress-copy strong {
  flex: 0 0 auto;
  color: var(--app-accent-bright);
  font-variant-numeric: tabular-nums;
}

.startup-screen.failed .startup-progress-track span {
  width: 100% !important;
  background: #ff5f70;
}

.startup-screen.failed .startup-progress-copy strong {
  color: #ff8793;
}

button,
canvas {
  -webkit-tap-highlight-color: transparent;
}

button {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.68rem 1rem;
  background: rgba(255, 255, 255, 0.07);
  color: var(--paper);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, opacity 140ms ease;
}

button:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
}

button:focus-visible {
  outline: 2px solid var(--app-accent);
  outline-offset: 3px;
}

button:disabled {
  opacity: 0.3;
  cursor: default;
}

button.scratchpad-toggle[aria-pressed="true"],
.app-shell.scratchpad-active #reset {
  border-color: rgba(var(--scratchpad-rgb), 0.66);
  background: rgba(var(--scratchpad-rgb), 0.13);
  color: #ffb9ef;
  box-shadow:
    inset 0 0 0 1px rgba(var(--scratchpad-rgb), 0.09),
    0 0 13px rgba(var(--scratchpad-rgb), 0.24);
}

button.scratchpad-toggle[aria-pressed="true"]:hover:not(:disabled),
.app-shell.scratchpad-active #reset:hover:not(:disabled) {
  border-color: rgba(var(--scratchpad-rgb), 0.9);
  background: rgba(var(--scratchpad-rgb), 0.19);
  color: #ffd8f6;
}

button.pause-toggle[aria-pressed="true"] {
  border-color: rgba(var(--app-rgb), 0.68);
  background: rgba(var(--app-rgb), 0.16);
  color: #dbe7ff;
  box-shadow: 0 0 13px rgba(var(--app-rgb), 0.22);
}

button.pause-toggle:focus-visible,
.pause-screen button:focus-visible {
  outline-color: var(--app-accent-bright);
}

.pause-toggle-icon {
  margin-right: 0.34rem;
  color: var(--app-accent-bright);
  font-size: 0.72rem;
  font-style: normal;
  letter-spacing: -0.12em;
}

button.quiet {
  background: transparent;
}

#solve-summary[hidden] {
  display: none;
}

#solve-summary:not([hidden]) {
  border-color: rgba(199, 255, 69, 0.3);
  color: #d8f49b;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

button.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
}

.sticker-guide-controls {
  display: inline-flex;
  align-items: stretch;
}

.sticker-guide-controls button {
  border-radius: 999px 0 0 999px;
}

.sticker-guide-controls select {
  appearance: none;
  min-width: 84px;
  margin-left: -1px;
  border: 1px solid var(--line);
  border-radius: 0 999px 999px 0;
  padding: 0 1.65rem 0 0.65rem;
  background-color: rgba(255, 255, 255, 0.07);
  background-image:
    linear-gradient(45deg, transparent 50%, #8f8e87 50%),
    linear-gradient(135deg, #8f8e87 50%, transparent 50%);
  background-position:
    calc(100% - 13px) 50%,
    calc(100% - 9px) 50%;
  background-repeat: no-repeat;
  background-size: 4px 4px, 4px 4px;
  color: var(--paper);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 650;
  cursor: pointer;
}

.sticker-guide-controls select:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.24);
  background-color: rgba(255, 255, 255, 0.12);
}

.sticker-guide-controls select:focus-visible {
  position: relative;
  outline: 2px solid var(--app-accent);
  outline-offset: 2px;
}

.sticker-guide-controls select:disabled {
  opacity: 0.3;
  cursor: default;
}

.sticker-guide-controls option {
  background: var(--panel);
  color: var(--paper);
}

button.convention-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}

.turn-convention-icon {
  color: var(--app-accent-bright);
  font-size: 0.9rem;
  font-style: normal;
  line-height: 0;
}

button.convention-toggle[aria-pressed="false"] .turn-convention-icon {
  color: #ffad42;
}

button.inventory-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

button.color-scheme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
}

.color-scheme-toggle-icon {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 28%, #f2524b 0 20%, transparent 22%),
    radial-gradient(circle at 72% 28%, #ffd323 0 20%, transparent 22%),
    radial-gradient(circle at 30% 72%, #2491e8 0 20%, transparent 22%),
    radial-gradient(circle at 72% 72%, #9b58d0 0 20%, transparent 22%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

button.color-scheme-toggle[aria-expanded="true"] {
  border-color: rgba(var(--app-rgb), 0.4);
  background: rgba(var(--app-rgb), 0.1);
}

button.inventory-toggle small {
  display: inline-block;
  flex: 0 0 2rem;
  width: 2rem;
  min-width: 2rem;
  padding: 0.16rem 0.3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #aaa89f;
  font-size: 0.57rem;
  letter-spacing: 0.06em;
  text-align: center;
}

button.inventory-toggle[aria-expanded="true"] {
  border-color: rgba(199, 255, 69, 0.34);
  background: rgba(199, 255, 69, 0.09);
}

button.inventory-toggle[aria-expanded="true"] small {
  background: rgba(199, 255, 69, 0.13);
  color: var(--lime);
}

.inventory-toggle-icon {
  width: 12px;
  height: 12px;
  background:
    linear-gradient(currentColor 0 0) 0 0 / 5px 5px,
    linear-gradient(currentColor 0 0) 100% 0 / 5px 5px,
    linear-gradient(currentColor 0 0) 0 100% / 5px 5px,
    linear-gradient(currentColor 0 0) 100% 100% / 5px 5px;
  background-repeat: no-repeat;
  color: var(--lime);
  filter: drop-shadow(0 0 4px rgba(199, 255, 69, 0.24));
}

button.inventory-toggle[aria-expanded="true"] .inventory-toggle-icon {
  color: var(--lime);
  filter: drop-shadow(0 0 6px rgba(199, 255, 69, 0.5));
}

button.status-card-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-width: 28px;
  gap: 0.44rem;
  padding-right: 0.36rem;
  padding-left: 0.36rem;
}

button.status-card-toggle > span {
  display: none;
}

.status-card-toggle-icon {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px rgba(199, 255, 69, 0.52);
}

button.status-card-toggle[aria-pressed="false"] .status-card-toggle-icon {
  background: #66665f;
  box-shadow: none;
}

.toggle-indicator {
  width: 7px;
  height: 7px;
  border: 1px solid #77776f;
  border-radius: 50%;
  background: transparent;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.view-snap-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  color: var(--app-accent-bright);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
  filter: drop-shadow(0 0 6px rgba(var(--app-rgb), 0.28));
}

.view-snap-center {
  fill: currentColor;
  stroke: none;
}

#view-snap[aria-pressed="true"] .view-snap-icon {
  color: var(--app-accent-bright);
  filter: drop-shadow(0 0 8px rgba(var(--app-rgb), 0.56));
}

button.view-toggle[aria-pressed="true"] {
  border-color: rgba(var(--app-rgb), 0.38);
  background: rgba(var(--app-rgb), 0.1);
}

button.view-toggle[aria-pressed="true"] .toggle-indicator {
  border-color: var(--app-accent-bright);
  background: var(--app-accent-bright);
  box-shadow: 0 0 9px rgba(var(--app-rgb), 0.6);
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-rows: var(--topbar-height) minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  transition: grid-template-rows 220ms ease;
}

.app-shell.top-controls-collapsed {
  --topbar-height: 0px;
}

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 2rem;
  height: var(--topbar-height);
  min-height: 0;
  overflow: hidden;
  padding: 0.65rem max(4.25rem, 3vw) 0.65rem clamp(1rem, 3vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: rgba(17, 17, 16, 0.9);
  backdrop-filter: blur(18px);
  transition:
    height 220ms ease,
    padding 220ms ease,
    border-color 180ms ease,
    opacity 160ms ease,
    transform 220ms ease;
}

.app-shell.top-controls-collapsed .topbar {
  padding-top: 0;
  padding-bottom: 0;
  border-bottom-width: 0;
  border-bottom-color: transparent;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
}

.identity {
  position: relative;
  z-index: 0;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
  pointer-events: none;
}

.identity > div {
  flex: 0 0 auto;
}

.mark {
  flex: 0 0 auto;
  width: 122px;
  height: 64px;
  filter: drop-shadow(0 0 9px rgba(var(--app-rgb), 0.25));
}

.eyebrow {
  margin: 0;
  color: var(--app-accent-bright);
  font-size: var(--brand-eyebrow-size);
  font-weight: var(--brand-eyebrow-weight);
  letter-spacing: var(--brand-eyebrow-spacing);
  line-height: 1.3;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(var(--app-rgb), 0.16);
  white-space: nowrap;
}

.actions {
  /* The logo's filtered SVG has its own stacking context. Keep the entire
     settings layer above it when crowded controls extend into the branding. */
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  min-width: 0;
}

#undo span:first-child,
#redo span:first-child {
  display: none;
}

.control-group {
  display: flex;
  flex: 0 0 auto;
  align-self: center;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 10px;
  /* Opaque so overlapped branding cannot show through labels or buttons. */
  background: #161615;
  transition: background 140ms ease, border-color 140ms ease;
}

.control-group:has(.control-group-toggle:hover),
.control-group:not(.collapsed):focus-within {
  border-color: rgba(255, 255, 255, 0.14);
}

button.control-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  width: 100%;
  min-height: 20px;
  padding: 0.17rem 0.42rem 0.14rem;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.025);
  color: #8f8d84;
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  line-height: 1;
  text-transform: uppercase;
}

button.control-group-toggle:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(var(--app-rgb), 0.065);
  color: #c3c0b6;
}

button.control-group-toggle i {
  color: rgba(var(--app-rgb), 0.82);
  font-size: 0.72rem;
  font-style: normal;
  line-height: 0.7;
}

.control-group-body {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  min-width: 0;
  padding: 0.28rem 0.34rem 0.34rem;
}

.control-group.collapsed {
  align-self: center;
  background: #141413;
}

.control-group.collapsed .control-group-toggle {
  min-height: 34px;
  border-bottom: 0;
  padding: 0.38rem 0.48rem;
}

.control-group.collapsed .control-group-body {
  display: none;
}

.control-group-panels #piece-inventory-toggle {
  flex: 0 0 auto;
  align-self: center;
  justify-content: center;
  width: 112px;
}

.control-group-session #session-export,
.control-group-session #session-import {
  padding-right: 0.55rem;
  padding-left: 0.55rem;
}

.app-notification {
  position: fixed;
  z-index: 80;
  top: calc(var(--topbar-height) + 12px);
  left: 50%;
  max-width: min(38rem, calc(100vw - 3rem));
  padding: 0.58rem 0.82rem;
  border: 1px solid rgba(112, 213, 255, 0.42);
  border-radius: 9px;
  background: rgba(12, 20, 24, 0.94);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.36), 0 0 14px rgba(84, 204, 255, 0.12);
  color: #c8efff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.app-notification[data-tone="error"] {
  border-color: rgba(255, 105, 105, 0.52);
  background: rgba(30, 13, 13, 0.95);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.38), 0 0 14px rgba(255, 86, 86, 0.12);
  color: #ffc6c0;
}

.app-notification[data-tone="success"] {
  border-color: rgba(129, 238, 124, 0.52);
  background: rgba(13, 31, 17, 0.95);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.38), 0 0 16px rgba(101, 239, 112, 0.15);
  color: #c9ffc4;
}

.app-notification[hidden] {
  display: none;
}

.top-controls-toggle {
  position: fixed;
  z-index: 30;
  top: 10px;
  right: 10px;
  display: grid;
  width: 36px;
  height: 32px;
  padding: 0;
  place-items: center;
  border-radius: 8px;
  background: rgba(24, 24, 22, 0.88);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  color: #aaa89f;
  font-size: 1.25rem;
  line-height: 1;
  backdrop-filter: blur(12px);
}

.top-controls-gear {
  display: none;
  font-size: 0.94rem;
}

.top-controls-chevron {
  line-height: 1;
}

.app-shell.top-controls-collapsed .top-controls-toggle {
  grid-template-columns: auto auto;
  gap: 0.2rem;
  top: 0;
  right: auto;
  width: 58px;
  height: 34px;
  border-radius: 0 0 8px 8px;
  border-color: rgba(var(--app-rgb), 0.38);
  background: rgba(22, 22, 20, 0.92);
  color: var(--app-accent-bright);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.app-shell.top-controls-collapsed .top-controls-toggle.is-dragging {
  cursor: grabbing;
}

.app-shell.top-controls-collapsed .top-controls-gear {
  display: inline;
}

.global-view-controls {
  --view-slider-min-width: 7rem;
  display: inline-grid;
  grid-template-columns: repeat(4, max-content);
  align-items: center;
  gap: 0.65rem;
  padding: 0.22rem 0.48rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.global-view-controls .view-slider-control > span,
.global-view-controls .render-quality-control > span {
  color: #77776f;
  font-size: 0.56rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

button.key-hints-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.key-hints-toggle-icon {
  display: grid !important;
  width: 16px;
  height: 16px;
  place-items: center;
  border: 1px solid #77776f;
  border-radius: 4px;
  color: #aaa89f;
  font-size: 0.61rem;
  line-height: 1;
}

button.key-hints-toggle[aria-pressed="true"] {
  border-color: rgba(var(--app-rgb), 0.38);
  background: rgba(var(--app-rgb), 0.08);
}

button.key-hints-toggle[aria-pressed="true"] .key-hints-toggle-icon {
  border-color: rgba(var(--app-rgb), 0.58);
  color: var(--app-accent-bright);
}

button.move-history-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
}

.move-history-toggle-icon {
  color: var(--move-journal-accent);
  font-size: 0.92rem;
  line-height: 0.7;
}

button.move-history-toggle[aria-pressed="true"] {
  border-color: rgba(var(--move-journal-rgb), 0.34);
  background: rgba(var(--move-journal-rgb), 0.08);
}

#undo-blocks > span:first-child,
#move-history-undo-blocks > span:first-child {
  color: var(--move-journal-accent);
}

#undo-blocks[aria-pressed="true"],
#move-history-undo-blocks[aria-pressed="true"] {
  border-color: rgba(var(--move-journal-rgb), 0.48);
  background: rgba(var(--move-journal-rgb), 0.13);
  box-shadow: 0 0 12px rgba(var(--move-journal-rgb), 0.13);
  color: #ffe3a4;
}

button.macro-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
}

.macro-toggle-icon {
  color: var(--macro-accent);
  font-size: 0.88rem;
  line-height: 0.7;
}

button.macro-toggle[aria-pressed="true"] {
  border-color: rgba(var(--macro-rgb), 0.34);
  background: rgba(var(--macro-rgb), 0.085);
  box-shadow: 0 0 10px rgba(var(--macro-rgb), 0.08);
}

button.candidate-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
}

.candidate-toggle-icon {
  color: var(--candidate-accent);
  font-size: 0.9rem;
}

button.candidate-toggle[aria-expanded="true"] {
  border-color: rgba(var(--candidate-rgb), 0.4);
  background: rgba(var(--candidate-rgb), 0.1);
  box-shadow: 0 0 12px rgba(var(--candidate-rgb), 0.09);
  color: #d8efff;
}

.stage {
  /* Sidebar order, left to right: Explorer, Candidates, Macros, Plan, Moves,
     Pieces (or Colors). Each panel's right inset sums its open neighbors. */
  --inventory-pane-width: min(430px, 38vw);
  --color-scheme-pane-width: min(390px, 36vw);
  --move-history-side-pane-width: clamp(316px, 21vw, 350px);
  --macro-side-pane-width: clamp(300px, 20vw, 340px);
  --plan-side-pane-width: clamp(330px, 23vw, 390px);
  --candidate-side-pane-width: clamp(350px, 24vw, 420px);
  --sequence-explorer-side-pane-width: clamp(390px, 27vw, 470px);
  --workspace-primary-side-width: 0px;
  --workspace-move-history-side-width: 0px;
  --workspace-macro-side-width: 0px;
  --workspace-plan-side-width: 0px;
  --workspace-candidate-side-width: 0px;
  --workspace-sequence-explorer-side-width: 0px;
  --workspace-side-width: calc(
    var(--workspace-primary-side-width)
    + var(--workspace-move-history-side-width)
    + var(--workspace-macro-side-width)
    + var(--workspace-plan-side-width)
    + var(--workspace-candidate-side-width)
    + var(--workspace-sequence-explorer-side-width)
  );
  --projection-tray-height: 190px;
  --key-hints-height: 2.6rem;
  position: relative;
  min-height: 0;
  /* Hidden overflow is still scrollable by caret/focus handling. The workspace
     must never scroll: only its individual lists, editors and tray may do so.
     Offscreen translated panels otherwise leave room for a sideways shift. */
  overflow: clip;
  isolation: isolate;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 72px 72px,
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 72px 72px,
    radial-gradient(circle at 25% 48%, #292924 0, #181817 27%, transparent 55%),
    radial-gradient(circle at 75% 48%, #292924 0, #181817 27%, #111110 64%);
}

.stage.inventory-open {
  --workspace-primary-side-width: var(--inventory-pane-width);
}

.stage.color-scheme-open {
  --workspace-primary-side-width: var(--color-scheme-pane-width);
}

.stage.move-history-side-open {
  --workspace-move-history-side-width: var(--move-history-side-pane-width);
}

.stage.macro-side-open {
  --workspace-macro-side-width: var(--macro-side-pane-width);
}

.stage.plan-side-open {
  --workspace-plan-side-width: var(--plan-side-pane-width);
}

.stage.candidate-side-open {
  --workspace-candidate-side-width: var(--candidate-side-pane-width);
}

.stage.sequence-explorer-side-open {
  --workspace-sequence-explorer-side-width: var(--sequence-explorer-side-pane-width);
}

.stage.projection-library-expanded {
  --projection-tray-height: clamp(330px, 52vh, 520px);
}

.stage.projection-library-collapsed {
  --projection-tray-height: 0px;
}

.stage.pane-focus-active {
  --projection-tray-height: 0px;
}

/* Magnification is a temporary one-pane projection layout, not a modal layer.
   Only the Projection Library recedes; ordinary tools and side panels keep
   their normal stacking, width contribution, and interaction behavior. */
.stage.pane-focus-active .projection-tray,
.stage.pane-focus-active .projection-tray-backdrop,
.stage.pane-focus-active .projection-library-dock {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

#puzzle {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  cursor: grab;
}

#puzzle:focus {
  outline: none;
}

#puzzle.is-dragging {
  cursor: grabbing;
}

#puzzle.can-turn {
  cursor: pointer;
}

/* Move entry is modeless only for trackball orientation. All ordinary UI and
   face-turn hit targets remain locked until the editor closes. */
.app-shell.move-text-orientation-mode,
.app-shell.move-text-orientation-mode * {
  pointer-events: none;
}

.app-shell.move-text-orientation-mode #puzzle {
  pointer-events: auto;
  cursor: grab;
}

.app-shell.move-text-orientation-mode #puzzle.is-dragging {
  cursor: grabbing;
}

.ambient {
  position: absolute;
  z-index: 1;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(3px);
}

.ambient-one {
  top: 11%;
  right: 9%;
  width: min(24vw, 380px);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(199, 255, 69, 0.07), transparent 68%);
}

.ambient-two {
  right: 32%;
  bottom: -18%;
  width: min(31vw, 520px);
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(78, 145, 255, 0.08), transparent 70%);
}

.main-view {
  position: absolute;
  inset: 0 0 calc(var(--projection-tray-height) + var(--key-hints-height));
  transition: right 220ms ease, bottom 220ms ease;
}

.pane-backgrounds,
.pane-overlays {
  position: absolute;
  inset: 0;
  display: grid;
}

.pane-backgrounds {
  z-index: 2;
  pointer-events: none;
}

.pane-overlays {
  z-index: 4;
  pointer-events: none;
}

.pane-layout-one {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.pane-layout-focused {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.pane-layout-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
}

.pane-layout-three {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.pane-layout-three > :first-child {
  grid-row: 1 / span 2;
}

.pane-layout-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.pane-background,
.pane-overlay {
  position: relative;
  min-width: 0;
  min-height: 0;
}

/* Heading sizes follow each pane, not the browser window. Four small panes
   alongside sidebars can otherwise inherit desktop-sized projection names. */
.pane-overlay {
  container-type: inline-size;
}

.app-shell.scratchpad-active .pane-overlay::before {
  position: absolute;
  z-index: 20;
  inset: 4px;
  border: 2px solid rgba(var(--scratchpad-rgb), 0.72);
  border-radius: 12px;
  box-shadow:
    inset 0 0 14px rgba(var(--scratchpad-rgb), 0.12),
    0 0 14px rgba(var(--scratchpad-rgb), 0.16);
  content: "";
  pointer-events: none;
}

.app-shell.sequence-explorer-active .pane-overlay::before {
  position: absolute;
  z-index: 20;
  inset: 4px;
  border: 2px solid rgba(84, 204, 255, 0.78);
  border-radius: 12px;
  box-shadow:
    inset 0 0 18px rgba(84, 204, 255, 0.13),
    0 0 18px rgba(84, 204, 255, 0.2);
  content: "";
  pointer-events: none;
}

.pane-overlay.projection-locator-highlight::after {
  position: absolute;
  z-index: 25;
  inset: 5px;
  border: 3px solid rgba(var(--pane-rgb), 0.96);
  border-radius: 12px;
  box-shadow:
    inset 0 0 30px rgba(var(--pane-rgb), 0.13),
    0 0 24px rgba(var(--pane-rgb), 0.38);
  content: "";
  pointer-events: none;
  animation: pane-projection-locator 5s ease-out both;
}

.piece-protection-status {
  --piece-protection-fade-duration: 5000ms;
  position: absolute;
  z-index: 32;
  top: 0.78rem;
  right: 0.82rem;
  display: inline-grid;
  grid-template-columns: 1.42rem minmax(1.25rem, auto);
  align-items: center;
  min-height: 2rem;
  padding: 0.24rem 0.48rem 0.24rem 0.28rem;
  border: 1px solid rgba(199, 255, 69, 0.5);
  border-radius: 999px;
  background: rgba(10, 12, 9, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 15px rgba(199, 255, 69, 0.12);
  color: var(--lime);
  opacity: 1;
  pointer-events: none;
  transition:
    opacity var(--piece-protection-fade-duration) ease,
    border-color 240ms ease,
    box-shadow 240ms ease,
    color 240ms ease;
  backdrop-filter: blur(12px);
}

.piece-protection-status[hidden] {
  display: none;
}

.piece-protection-status.working {
  opacity: 0;
}

.piece-protection-status[data-state="broken"] {
  border-color: rgba(255, 75, 86, 0.7);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32), 0 0 18px rgba(255, 75, 86, 0.2);
  color: #ff4b56;
  opacity: 0;
}

.piece-protection-status strong {
  display: grid;
  width: 1.42rem;
  height: 1.42rem;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
  color: #10110e;
  font-size: 1rem;
  font-weight: 950;
  line-height: 1;
}

.piece-protection-status[data-state="broken"] strong {
  background: #ff4b56;
  color: #fff5f6;
}

.piece-protection-status span {
  min-width: 2ch;
  color: currentColor;
  font: 850 0.63rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
}

.pane-current-move-mark {
  position: absolute;
  z-index: 31;
  top: 0.86rem;
  left: 50%;
  max-width: min(58%, 30rem);
  min-height: 1.72rem;
  padding: 0.35rem 0.72rem;
  overflow: hidden;
  border: 1px solid rgba(126, 185, 211, 0.36);
  border-radius: 999px;
  background: rgba(9, 14, 17, 0.82);
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.28);
  color: #bed6df;
  font: 730 0.66rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.025em;
  opacity: 0.9;
  pointer-events: none;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

.pane-current-move-mark[hidden] {
  display: none;
}

.pane-current-move-mark.certification {
  border-color: rgba(199, 255, 69, 0.45);
  background: rgba(12, 18, 9, 0.86);
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.28), 0 0 13px rgba(199, 255, 69, 0.08);
  color: #d8ff75;
}

.piece-type-inspection-scope {
  position: absolute;
  z-index: 34;
  left: clamp(1rem, 2vw, 1.8rem);
  bottom: calc(clamp(0.9rem, 2vh, 1.5rem) + 2.85rem);
  display: grid;
  grid-template-columns: repeat(3, max-content);
  padding: 0.2rem;
  border: 1px solid rgba(199, 255, 69, 0.32);
  border-radius: 999px;
  background: rgba(9, 12, 8, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34), 0 0 14px rgba(199, 255, 69, 0.07);
  pointer-events: auto;
  backdrop-filter: blur(11px);
}

.piece-type-inspection-scope[hidden] {
  display: none;
}

.piece-type-inspection-scope button {
  min-width: 3.8rem;
  padding: 0.34rem 0.58rem;
  border-color: transparent;
  border-radius: 999px;
  background: transparent;
  color: #7f8277;
  font-size: 0.57rem;
  font-weight: 800;
  letter-spacing: 0.035em;
}

.piece-type-inspection-scope button:hover:not(:disabled) {
  border-color: rgba(199, 255, 69, 0.16);
  background: rgba(199, 255, 69, 0.06);
  color: #d8e7bd;
}

.piece-type-inspection-scope button.selected {
  border-color: rgba(199, 255, 69, 0.48);
  background: rgba(199, 255, 69, 0.14);
  box-shadow: 0 0 10px rgba(199, 255, 69, 0.08);
  color: #e9ffba;
}

.pane-layout-grid .pane-current-move-mark,
.pane-layout-three .pane-overlay:not(:first-child) .pane-current-move-mark {
  top: 0.68rem;
  max-width: 52%;
  min-height: 1.55rem;
  padding: 0.29rem 0.58rem;
  font-size: 0.59rem;
}

.piece-protection-pane-warning {
  --piece-protection-fade-duration: 5000ms;
  position: absolute;
  z-index: 32;
  top: 0.9rem;
  right: 1rem;
  display: inline-grid;
  grid-template-columns: 2rem minmax(1.25rem, auto);
  align-items: center;
  min-width: 4.1rem;
  min-height: 2.7rem;
  padding: 0.3rem 0.55rem 0.3rem 0.3rem;
  border: 2px solid rgba(255, 75, 86, 0.88);
  border-radius: 999px;
  background: rgba(35, 4, 7, 0.88);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.38),
    0 0 24px rgba(255, 75, 86, 0.32),
    inset 0 0 16px rgba(255, 75, 86, 0.09);
  color: #ff4b56;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--piece-protection-fade-duration) ease;
  backdrop-filter: blur(10px);
}

.piece-protection-pane-warning[hidden] {
  display: none;
}

.piece-protection-pane-warning[data-active="true"] {
  opacity: 1;
}

.piece-protection-pane-warning[data-state="healthy"] {
  border-color: rgba(199, 255, 69, 0.78);
  background: rgba(12, 24, 8, 0.88);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.38),
    0 0 22px rgba(199, 255, 69, 0.22),
    inset 0 0 16px rgba(199, 255, 69, 0.08);
  color: var(--lime);
}

.piece-protection-pane-warning.working {
  opacity: 0;
}

.piece-protection-pane-warning strong {
  display: grid;
  width: 1.78rem;
  height: 1.78rem;
  place-items: center;
  border-radius: 50%;
  background: #ff4b56;
  color: #fff5f6;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 650;
  line-height: 1;
  text-shadow: 0 0 14px rgba(255, 75, 86, 0.45);
}

.piece-protection-pane-warning[data-state="healthy"] strong {
  background: var(--lime);
  color: #10150a;
  font-size: 1.1rem;
  font-weight: 900;
  text-shadow: 0 0 13px rgba(199, 255, 69, 0.38);
}

.piece-protection-pane-warning span {
  color: currentColor;
  font-size: 0.74rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.pane-layout-grid .piece-protection-pane-warning,
.pane-layout-three .pane-overlay:not(:first-child) .piece-protection-pane-warning {
  top: 0.7rem;
  right: 0.75rem;
  grid-template-columns: 1.7rem minmax(1.1rem, auto);
  min-width: 3.65rem;
  min-height: 2.35rem;
  padding: 0.25rem 0.45rem 0.25rem 0.25rem;
}

.pane-layout-grid .piece-protection-pane-warning strong,
.pane-layout-three .pane-overlay:not(:first-child) .piece-protection-pane-warning strong {
  width: 1.5rem;
  height: 1.5rem;
  font-size: 1.15rem;
}

.pane-layout-grid .piece-protection-pane-warning[data-state="healthy"] strong,
.pane-layout-three .pane-overlay:not(:first-child)
  .piece-protection-pane-warning[data-state="healthy"] strong {
  font-size: 0.96rem;
}

/* The collapsed settings gear owns the extreme viewport corner. Keep the
   warning in that same pane's visual corner without stacking the two icons. */
.app-shell.top-controls-collapsed .stage:not(.workspace-side-open)
  .pane-layout-one .pane-overlay:first-child .piece-protection-pane-warning,
.app-shell.top-controls-collapsed .stage:not(.workspace-side-open)
  .pane-layout-two .pane-overlay:nth-child(2) .piece-protection-pane-warning,
.app-shell.top-controls-collapsed .stage:not(.workspace-side-open)
  .pane-layout-grid .pane-overlay:nth-child(2) .piece-protection-pane-warning {
  right: 4.35rem;
}

.app-shell.top-controls-collapsed .stage:not(.workspace-side-open)
  .pane-layout-three .pane-overlay:nth-child(2) .piece-protection-pane-warning {
  right: 4.35rem;
}

@keyframes pane-projection-locator {
  0%, 12% {
    border-color: rgba(var(--pane-rgb), 0.98);
    box-shadow:
      inset 0 0 34px rgba(var(--pane-rgb), 0.17),
      0 0 28px rgba(var(--pane-rgb), 0.48);
    opacity: 1;
  }
  100% {
    border-color: rgba(var(--pane-rgb), 0.05);
    box-shadow: none;
    opacity: 0;
  }
}

.app-shell.scratchpad-active .status-card {
  border-color: rgba(var(--scratchpad-rgb), 0.48);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.34),
    0 0 13px rgba(var(--scratchpad-rgb), 0.16);
}

.app-shell.scratchpad-active .status-dot {
  background: var(--scratchpad);
  box-shadow: 0 0 10px rgba(var(--scratchpad-rgb), 0.58);
}

.pane-background {
  border-right: 1px solid rgba(255, 255, 255, 0.075);
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  background:
    radial-gradient(circle at 50% 52%, rgba(var(--pane-rgb), 0.105), transparent 58%),
    linear-gradient(145deg, rgba(var(--pane-rgb), 0.028), transparent 55%);
}

.pane-background.opposite-camera {
  background:
    radial-gradient(circle at 50% 48%, rgba(var(--pane-rgb), 0.12), transparent 58%),
    linear-gradient(135deg, rgba(var(--pane-rgb), 0.045), transparent 42%),
    linear-gradient(315deg, rgba(var(--pane-rgb), 0.025), transparent 48%);
}

.pane-layout-two .pane-background:last-child,
.pane-layout-grid .pane-background:nth-child(even) {
  border-right: 0;
}

.pane-layout-three .pane-background:first-child,
.pane-layout-three .pane-background:last-child {
  border-bottom: 0;
}

.pane-layout-three .pane-background:not(:first-child) {
  border-right: 0;
}

.pane-layout-grid .pane-background:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.pane-overlay.empty::after {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(17rem, 70%);
  color: rgba(232, 226, 212, 0.28);
  content: "Choose another projection below";
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
  transform: translate(-50%, -50%);
}

.pane-layout-one .pane-overlay.empty::after {
  content: none;
}

.projection-heading {
  position: absolute;
  top: clamp(1rem, 2.5vh, 1.8rem);
  left: clamp(1.1rem, 2.2vw, 2.2rem);
  width: min(25rem, calc(100% - 3rem));
}

.projection-heading p {
  margin: 0 0 0.32rem;
  color: rgb(var(--pane-rgb, 199, 255, 69));
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
}

.projection-heading-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.18rem;
}

.projection-heading strong {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 3.2vw, 3.2rem);
  font-size: clamp(1.35rem, 4.5cqw, 3.2rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1;
}

.projection-heading strong.projection-heading-name {
  font-size: clamp(1.52rem, 2.56vw, 2.56rem);
  font-size: clamp(1.08rem, 3.6cqw, 2.56rem);
  line-height: 1.04;
}

.pane-view-controls {
  position: absolute;
  left: clamp(1rem, 2vw, 1.8rem);
  bottom: clamp(0.9rem, 2vh, 1.5rem);
  display: flex;
  align-items: center;
  gap: 0.34rem;
  pointer-events: auto;
}

.surface-atlas-caption {
  position: absolute;
  top: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  max-width: 38%;
  color: rgba(195, 209, 218, 0.75);
  font-size: 0.63rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  line-height: 1.35;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
}

.surface-atlas-face-labels {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.surface-atlas-face-label {
  position: absolute;
  display: grid;
  place-items: center;
  width: clamp(1.05rem, 1.65vw, 1.45rem);
  height: clamp(1.05rem, 1.65vw, 1.45rem);
  transform: translate(-50%, -50%);
  border: 1px solid rgba(220, 234, 245, 0.46);
  border-radius: 50%;
  background: rgba(7, 15, 24, 0.8);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
  color: #f3f8fb;
  font-size: clamp(0.56rem, 0.9vw, 0.75rem);
  font-weight: 800;
  line-height: 1;
}

@media (max-width: 800px) {
  .surface-atlas-caption { display: none; }
}

button.pane-view-control {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  min-height: 28px;
  padding: 0.32rem 0.58rem;
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(13, 13, 12, 0.62);
  color: #aaa89f;
  font-size: 0.59rem;
  font-weight: 750;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  backdrop-filter: blur(5px);
}

button.pane-view-control:hover:not(:disabled) {
  border-color: rgba(var(--pane-rgb), 0.46);
  background: rgba(var(--pane-rgb), 0.1);
  color: var(--paper);
}

.pane-surface-projection {
  --surface-selector-width: 6rem;
  width: var(--surface-selector-width);
  min-width: var(--surface-selector-width);
  flex-shrink: 0;
  max-width: 100%;
  min-height: 28px;
  padding: 0.25rem 0.3rem;
  border: 1px solid rgba(var(--pane-rgb), 0.35);
  border-radius: 6px;
  background: #101820;
  color: rgb(var(--pane-rgb));
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 750;
  line-height: 1.2;
  cursor: pointer;
}

.pane-surface-projection:focus-visible {
  outline: 2px solid rgb(var(--pane-rgb));
  outline-offset: 2px;
}

button.pane-view-control[aria-pressed="true"] {
  border-color: rgba(var(--pane-rgb), 0.54);
  background: rgba(var(--pane-rgb), 0.16);
  color: rgb(var(--pane-rgb));
  box-shadow: inset 0 0 0 1px rgba(var(--pane-rgb), 0.08);
}

.pane-view-control-icon {
  color: rgb(var(--pane-rgb));
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 0.8;
}

.magnify-pane-control .pane-view-control-icon svg {
  display: block;
  width: 0.92rem;
  height: 0.92rem;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.65;
}

.app-shell.pane-focus-active button.magnify-pane-control {
  border-color: rgba(var(--pane-rgb), 0.58);
  background: rgba(13, 13, 12, 0.78);
  color: var(--paper);
  box-shadow: 0 0 18px rgba(var(--pane-rgb), 0.13);
}

.pane-piece-catalog {
  position: absolute;
  right: clamp(1rem, 2vw, 1.8rem);
  bottom: 4rem;
  display: flex;
  flex-direction: column;
  width: min(22rem, calc(100% - 2rem));
  max-height: calc(100% - 5rem);
  overflow: hidden;
  border: 1px solid rgba(var(--pane-rgb), 0.2);
  border-radius: 10px;
  background: rgba(10, 10, 9, 0.8);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  color: #aaa89f;
  pointer-events: auto;
  transition: max-height 180ms ease, width 180ms ease, bottom 180ms ease;
}

.pane-piece-catalog-heading,
button.pane-piece-catalog-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: 100%;
  gap: 0.8rem;
  padding: 0.5rem 0.62rem 0.42rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  border-top: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  background: rgba(var(--pane-rgb), 0.045);
  text-align: left;
}

button.pane-piece-catalog-heading:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.075);
  background: rgba(var(--pane-rgb), 0.09);
}

.pane-piece-catalog-heading strong {
  min-width: 0;
  overflow: hidden;
  color: #d9d4c8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pane-piece-catalog-heading span {
  color: rgba(var(--pane-rgb), 0.7);
  font-size: 0.49rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pane-piece-catalog-heading-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.34rem;
}

.pane-piece-catalog-heading-status i {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin: 0 2px 2px 1px;
  border-right: 1px solid rgb(var(--pane-rgb));
  border-bottom: 1px solid rgb(var(--pane-rgb));
  transform: rotate(45deg);
}

.pane-piece-catalog.collapsed .pane-piece-catalog-heading-status i {
  margin-top: 3px;
  margin-bottom: 0;
  transform: rotate(225deg);
}

.pane-piece-catalog-list {
  flex: 0 1 auto;
  min-height: 0;
  overflow: auto;
  scrollbar-color: rgba(var(--pane-rgb), 0.32) transparent;
  scrollbar-width: thin;
  opacity: 1;
  transition: max-height 180ms ease, opacity 110ms ease;
}

.pane-piece-completion-dimming {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.32rem;
  padding: 0.34rem 0.42rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  background: rgba(0, 0, 0, 0.13);
}

button.pane-piece-completion-dimming-button {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.25rem 0.32rem;
  border-color: rgba(var(--pane-rgb), 0.16);
  border-radius: 5px;
  background: rgba(var(--pane-rgb), 0.035);
  color: #aaa89f;
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.pane-piece-completion-dimming-button svg {
  width: 0.78rem;
  height: 0.78rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.25;
}

.pane-piece-completion-dimming-button .piece-eye-pupil {
  fill: currentColor;
  stroke: none;
}

.pane-piece-completion-dimming-button .piece-eye-slash {
  opacity: 0;
}

button.pane-piece-completion-dimming-button:hover:not(:disabled),
button.pane-piece-completion-dimming-button:focus-visible {
  border-color: rgba(var(--pane-rgb), 0.48);
  background: rgba(var(--pane-rgb), 0.1);
  color: #e3e0d7;
}

button.pane-piece-completion-dimming-button.dimmed {
  border-color: rgba(var(--pane-rgb), 0.52);
  background: rgba(var(--pane-rgb), 0.13);
  color: rgb(var(--pane-rgb));
}

.pane-piece-completion-dimming-button.dimmed .piece-eye-pupil {
  opacity: 0;
}

.pane-piece-completion-dimming-button.dimmed .piece-eye-slash {
  opacity: 1;
}

.pane-piece-catalog.collapsed {
  bottom: 0.7rem;
  width: min(12rem, calc(100% - 1.5rem));
  max-height: 2.1rem;
}

.pane-piece-catalog.collapsed .pane-piece-catalog-heading {
  gap: 0.3rem;
  padding-right: 0.48rem;
  padding-left: 0.48rem;
  border-bottom-color: transparent;
}

.pane-piece-catalog.collapsed .pane-piece-catalog-heading-status {
  gap: 0.22rem;
}

.pane-piece-catalog.collapsed .pane-piece-catalog-heading-status > span {
  font-size: 0.44rem;
  letter-spacing: 0.055em;
}

.pane-piece-catalog.collapsed .pane-piece-catalog-list {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.pane-piece-catalog-row-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(2, 1.65rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.pane-piece-catalog-row-shell:last-child {
  border-bottom: 0;
}

button.pane-piece-catalog-row {
  display: grid;
  grid-template-columns:
    minmax(4.2rem, 1fr)
    repeat(3, max-content)
    minmax(3rem, max-content);
  align-items: baseline;
  column-gap: 0.3rem;
  padding: 0.4rem 0.5rem;
  color: #9f9d95;
  font-size: 0.59rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.025em;
  line-height: 1.2;
  white-space: nowrap;
  width: 100%;
  border: 0;
  border-bottom: 0;
  border-radius: 0;
  background: transparent;
  font-weight: 400;
  text-align: left;
}

.pane-piece-catalog-type {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pane-piece-catalog-metric {
  display: grid;
  grid-template-columns: 2ch max-content;
  align-items: baseline;
  column-gap: 0.22em;
  min-width: 0;
  text-align: left;
}

.pane-piece-catalog-metric-number {
  width: 2ch;
  text-align: right;
}

.pane-piece-catalog-metric-unit {
  color: rgba(var(--pane-rgb), 0.78);
  font-weight: 800;
  text-align: left;
}

.pane-piece-catalog-chirality {
  color: rgba(var(--pane-rgb), 0.78);
  font-weight: 800;
}

button.pane-piece-catalog-row:hover:not(:disabled) {
  background: rgba(var(--pane-rgb), 0.065);
  color: #c4c0b7;
}

button.pane-piece-catalog-row.selected,
button.pane-piece-catalog-row.selected:hover:not(:disabled) {
  background: rgba(var(--pane-rgb), 0.18);
  color: #f5f3ec;
  box-shadow: inset 3px 0 0 rgba(var(--pane-rgb), 0.92);
}

button.pane-piece-catalog-row.modifier-inspected,
button.pane-piece-catalog-row.modifier-inspected:hover:not(:disabled) {
  background: rgba(166, 255, 41, 0.12);
  color: #f3ffe2;
  box-shadow: inset 3px 0 0 rgba(166, 255, 41, 0.92);
}

button.pane-piece-catalog-row.modifier-inspected.piece-inspected,
button.pane-piece-catalog-row.modifier-inspected.piece-inspected:hover:not(:disabled) {
  background: rgba(41, 239, 255, 0.12);
  color: #e3fdff;
  box-shadow: inset 3px 0 0 rgba(41, 239, 255, 0.94);
}

button.pane-piece-catalog-row:focus-visible {
  position: relative;
  z-index: 1;
  outline-color: rgba(var(--pane-rgb), 0.95);
  outline-offset: -2px;
}

.pane-piece-catalog-solved {
  display: block;
  min-width: 3rem;
  color: #ffb066;
  font-weight: 800;
  text-align: right;
}

.pane-piece-catalog-row.complete .pane-piece-catalog-solved {
  color: var(--lime);
}

button.piece-protection-toggle {
  display: grid;
  min-width: 0;
  padding: 0;
  place-items: center;
  border-color: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.025);
  color: #77766f;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  opacity: 0.72;
}

button.piece-protection-toggle:hover:not(:disabled) {
  border-color: rgba(199, 255, 69, 0.45);
  background: rgba(199, 255, 69, 0.09);
  color: #dcefae;
  opacity: 1;
}

button.piece-protection-toggle.protected {
  border-color: rgba(199, 255, 69, 0.72);
  background: rgba(199, 255, 69, 0.15);
  box-shadow: 0 0 10px rgba(199, 255, 69, 0.11);
  color: var(--lime);
  opacity: 1;
}

button.piece-protection-toggle:disabled {
  color: #4e4d48;
  opacity: 0.38;
}

button.piece-dimming-toggle {
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0;
  gap: 0.12rem;
  border-color: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.025);
  color: #8b8981;
  opacity: 0.76;
}

button.piece-dimming-toggle svg {
  width: 0.86rem;
  height: 0.86rem;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.25;
}

button.piece-dimming-toggle .piece-eye-pupil {
  fill: currentColor;
  stroke: none;
}

button.piece-dimming-toggle .piece-eye-slash {
  opacity: 0;
  stroke-width: 1.8;
}

button.piece-dimming-toggle:hover:not(:disabled) {
  border-color: rgba(84, 204, 255, 0.5);
  background: rgba(84, 204, 255, 0.09);
  color: #bcecff;
  opacity: 1;
}

button.piece-dimming-toggle.dimmed {
  border-color: rgba(84, 204, 255, 0.48);
  background: rgba(84, 204, 255, 0.11);
  color: #7dcce9;
  opacity: 1;
}

button.piece-dimming-toggle.dimmed .piece-eye-shape,
button.piece-dimming-toggle.dimmed .piece-eye-pupil {
  opacity: 0.46;
}

button.piece-dimming-toggle.dimmed .piece-eye-slash {
  opacity: 1;
}

.piece-state-handedness {
  font: 800 0.5rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

button.pane-piece-protection-toggle {
  width: 100%;
  height: 100%;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 0;
  background: transparent;
}

button.pane-piece-protection-toggle.protected {
  border-left-color: rgba(var(--pane-rgb), 0.32);
  background: rgba(var(--pane-rgb), 0.12);
  box-shadow: none;
  color: rgb(var(--pane-rgb));
}

button.pane-piece-dimming-toggle {
  width: 100%;
  height: 100%;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 0;
  background: transparent;
}

button.pane-piece-dimming-toggle.dimmed {
  border-left-color: rgba(var(--pane-rgb), 0.24);
  background: rgba(var(--pane-rgb), 0.095);
  color: rgb(var(--pane-rgb));
}

.pane-layout-grid .projection-heading,
.pane-layout-three .pane-overlay:not(:first-child) .projection-heading {
  top: 0.85rem;
  left: 1rem;
}

.pane-layout-grid .projection-heading strong,
.pane-layout-three .pane-overlay:not(:first-child) .projection-heading strong {
  font-size: clamp(1.55rem, 2.3vw, 2.35rem);
  font-size: clamp(1.05rem, 4.1cqw, 2.35rem);
}

.pane-layout-grid .projection-heading strong.projection-heading-name,
.pane-layout-three .pane-overlay:not(:first-child)
  .projection-heading strong.projection-heading-name {
  font-size: clamp(1.24rem, 1.84vw, 1.88rem);
  font-size: clamp(0.88rem, 3.28cqw, 1.88rem);
}

.pane-layout-grid .pane-view-controls,
.pane-layout-three .pane-overlay:not(:first-child) .pane-view-controls {
  left: 0.75rem;
  bottom: 0.7rem;
}

.pane-layout-grid .pane-piece-type-inspection-scope,
.pane-layout-three .pane-overlay:not(:first-child) .pane-piece-type-inspection-scope {
  left: 0.75rem;
  bottom: 3.3rem;
}

.pane-layout-grid .pane-piece-type-inspection-scope button,
.pane-layout-three .pane-overlay:not(:first-child) .pane-piece-type-inspection-scope button {
  min-width: 3.35rem;
  padding-right: 0.42rem;
  padding-left: 0.42rem;
  font-size: 0.52rem;
}

.pane-layout-grid .pane-piece-catalog,
.pane-layout-three .pane-overlay:not(:first-child) .pane-piece-catalog {
  right: 0.75rem;
  bottom: 0.7rem;
  width: min(19.25rem, calc(100% - 1.5rem));
  max-height: calc(100% - 1.4rem);
}

.stage.workspace-side-open .pane-layout-grid .pane-piece-catalog:not(.collapsed),
.stage.workspace-side-open .pane-layout-three .pane-overlay:not(:first-child)
  .pane-piece-catalog:not(.collapsed) {
  bottom: 3.2rem;
  max-height: calc(100% - 4.2rem);
}

.pane-layout-grid .pane-piece-catalog.collapsed,
.pane-layout-three .pane-overlay:not(:first-child) .pane-piece-catalog.collapsed {
  bottom: 0.7rem;
  width: min(12rem, calc(100% - 1.5rem));
  max-height: 2.1rem;
}

.pane-layout-grid .pane-piece-catalog-heading,
.pane-layout-three .pane-overlay:not(:first-child) .pane-piece-catalog-heading {
  padding: 0.34rem 0.48rem 0.3rem;
}

.pane-layout-grid .pane-piece-catalog-heading strong,
.pane-layout-three .pane-overlay:not(:first-child) .pane-piece-catalog-heading strong {
  font-size: 0.68rem;
}

.pane-layout-grid .pane-piece-catalog-row,
.pane-layout-three .pane-overlay:not(:first-child) .pane-piece-catalog-row {
  padding: 0.2rem 0.48rem;
  font-size: 0.52rem;
}

/* Pane overlays are grid cells, but browser layout transitions can briefly
   report their containing grid rather than their own track to a container
   query. JavaScript measures the actual control/catalog rectangles and sets
   these classes only when the two groups would collide. */
.pane-overlay.pane-controls-compact
  .pane-view-controls button.pane-view-control {
  justify-content: center;
  width: 27px;
  min-width: 27px;
  min-height: 25px;
  padding: 0.27rem;
  font-size: 0.53rem;
}

.pane-overlay.pane-controls-compact .pane-view-control > span:last-child {
  display: none;
}

.pane-overlay.pane-controls-wrapped .pane-view-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(27px, 1fr));
  width: var(--surface-selector-width, 6rem);
  justify-items: center;
}

.pane-overlay.pane-controls-wrapped .pane-surface-projection {
  grid-column: 1 / -1;
  width: 100%;
  min-width: var(--surface-selector-width);
}

.pane-overlay.pane-controls-stacked .pane-piece-catalog.collapsed {
  bottom: var(--pane-stacked-catalog-bottom, 3.35rem);
}

.pane-overlay.pane-controls-stacked .pane-piece-type-inspection-scope {
  bottom: calc(var(--pane-stacked-catalog-bottom, 3.35rem) + 2.65rem);
}

.projection-tray-backdrop {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: var(--key-hints-height);
  left: 0;
  height: var(--projection-tray-height);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(24, 24, 22, 0.94), rgba(12, 12, 11, 0.98)),
    radial-gradient(circle at 20% 30%, rgba(199, 255, 69, 0.05), transparent 42%);
  pointer-events: none;
  transition:
    right 220ms ease,
    height 220ms ease,
    opacity 160ms ease,
    transform 220ms ease;
}

.projection-tray {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: var(--key-hints-height);
  left: 0;
  display: grid;
  grid-template-rows: 27px minmax(0, 1fr);
  height: var(--projection-tray-height);
  padding: 0.75rem clamp(1.25rem, 3vw, 3rem);
  pointer-events: none;
  transition:
    right 220ms ease,
    height 220ms ease,
    opacity 160ms ease,
    transform 220ms ease;
}

.stage.projection-library-collapsed .projection-tray-backdrop,
.stage.projection-library-collapsed .projection-tray {
  opacity: 0;
  transform: translateX(100%);
}

.stage.projection-library-collapsed .projection-tray {
  display: none;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

.projection-tray-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 27px;
  color: var(--muted);
}

.projection-tray-title,
.projection-tray-tools {
  display: flex;
  align-items: center;
}

.projection-tray-title {
  align-items: baseline;
  gap: 0.75rem;
}

.projection-tray-tools {
  gap: 1.15rem;
  pointer-events: auto;
}

button.projection-library-layout-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 26px;
  padding: 0.28rem 0.58rem;
  border-color: rgba(255, 255, 255, 0.13);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: #929189;
  font-size: 0.59rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

button.projection-library-collapse {
  display: grid;
  width: 27px;
  min-width: 27px;
  height: 27px;
  min-height: 27px;
  padding: 0;
  place-items: center;
  border-color: rgba(255, 255, 255, 0.13);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: #929189;
  font-size: 1rem;
  line-height: 1;
}

button.projection-library-collapse:hover:not(:disabled) {
  color: var(--lime);
}

button.projection-library-layout-toggle:hover {
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--paper);
}

button.projection-library-layout-toggle[aria-pressed="true"] {
  border-color: rgba(199, 255, 69, 0.42);
  background: rgba(199, 255, 69, 0.08);
  color: var(--lime);
}

.projection-library-layout-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.projection-tray-heading p {
  margin: 0;
  color: var(--projections-accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1;
  text-shadow: 0 1px 12px rgba(var(--projections-rgb), 0.16);
}

.projection-tray-heading span,
.projection-tray-heading small {
  color: #77776f;
  font-size: 0.59rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.view-slider-control,
.render-quality-control {
  display: grid;
  grid-template-rows: minmax(12px, max-content) 20px;
  align-items: center;
  gap: 0.15rem 0.25rem;
  min-width: 0;
}

.view-slider-control {
  /* Fit actual text metrics, including browser minimum font sizes. */
  grid-template-columns: max-content max-content;
  justify-content: space-between;
  column-gap: 0.5rem;
  min-width: var(--view-slider-min-width);
  cursor: ew-resize;
}

.view-slider-control > span {
  grid-row: 1;
  grid-column: 1;
  white-space: nowrap;
}

.view-slider-control input {
  grid-row: 2;
  grid-column: 1 / -1;
  /* Let the heading size this column, not the range input's intrinsic width. */
  width: 0;
  min-width: 100%;
  height: 18px;
  margin: 0;
  accent-color: var(--lime);
  cursor: ew-resize;
}

.view-slider-control output {
  grid-row: 1;
  grid-column: 2;
  min-width: 7ch;
  color: #aaa89f;
  font-size: 0.58rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  text-align: right;
  white-space: nowrap;
}

.render-quality-control select {
  min-width: 72px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 7px;
  padding: 0 1.45rem 0 0.5rem;
  appearance: none;
  background-color: rgba(255, 255, 255, 0.025);
  background-image:
    linear-gradient(45deg, transparent 50%, #8f8e87 50%),
    linear-gradient(135deg, #8f8e87 50%, transparent 50%);
  background-position:
    calc(100% - 11px) 50%,
    calc(100% - 7px) 50%;
  background-repeat: no-repeat;
  background-size: 4px 4px, 4px 4px;
  color: #aaa89f;
  font: inherit;
  font-size: 0.62rem;
  font-weight: 750;
  cursor: pointer;
}

.render-quality-control select:hover,
.render-quality-control select:focus-visible {
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--paper);
}

.render-quality-control select:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 2px;
}

.render-quality-control option {
  background: var(--panel);
  color: var(--paper);
}

#projection-selection-count.limit {
  color: #ffb158;
}

.projection-thumbnails {
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
  min-height: 0;
  height: auto;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0 0.45rem;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  scrollbar-width: thin;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.projection-library-dock {
  position: absolute;
  z-index: 8;
  top: calc(100% - 88px);
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.36rem 0.38rem 0.36rem 0.5rem;
  border: 1px solid rgba(var(--projections-rgb), 0.3);
  border-right: 0;
  border-radius: 10px 0 0 10px;
  background: rgba(18, 18, 16, 0.91);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% - 8px));
  transition: right 220ms ease, opacity 140ms ease, transform 190ms ease;
  backdrop-filter: blur(12px);
}

.stage.workspace-side-open .projection-library-dock {
  right: var(--workspace-side-width);
}

.stage.projection-library-collapsed .projection-library-dock {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.projection-library-dock > span {
  color: rgba(var(--projections-rgb), 0.68);
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.projection-library-dock-handle {
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
}

.projection-library-dock.is-dragging {
  cursor: ns-resize;
}

.projection-library-dock button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 25px;
  min-width: 25px;
  height: 58px;
  min-height: 58px;
  overflow: hidden;
  padding: 0.32rem 0.22rem;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: #aaa89f;
  font-size: 0.56rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.projection-library-dock button:hover:not(:disabled) {
  border-color: rgba(var(--projections-rgb), 0.48);
  background: rgba(var(--projections-rgb), 0.09);
  color: var(--projections-accent);
}

.projection-library-dock button > span:first-child {
  display: none;
}

.projection-library-dock button > span:last-child {
  width: auto;
  color: var(--projections-accent);
  line-height: 1;
  overflow-wrap: normal;
  text-align: center;
  white-space: nowrap;
  word-break: normal;
  transform: rotate(-90deg);
}

.projection-thumbnails.is-dragging,
.projection-thumbnails.is-dragging button.projection-thumbnail {
  cursor: grabbing;
}

.projection-thumbnails.is-dragging button.projection-thumbnail {
  transform: none;
}

.stage.projection-library-expanded .projection-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
  grid-auto-rows: 100px;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
}

.stage.projection-library-expanded button.projection-thumbnail {
  width: 100%;
  min-width: 0;
  height: 100%;
}

button.projection-thumbnail {
  position: relative;
  flex: 0 0 182px;
  min-width: 182px;
  height: 100%;
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.11);
  border-radius: 11px;
  padding: 0;
  background: rgba(7, 7, 6, 0.32);
  box-shadow: inset 0 0 0 1px rgba(var(--pane-rgb, 255, 255, 255), 0);
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

button.projection-thumbnail::after {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--pane-stripe, transparent);
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

button.projection-thumbnail.projection-locator-highlight::before {
  position: absolute;
  z-index: 5;
  inset: 3px;
  border: 3px solid rgba(199, 255, 69, 0.98);
  border-radius: 8px;
  box-shadow:
    inset 0 0 24px rgba(199, 255, 69, 0.15),
    0 0 22px rgba(199, 255, 69, 0.42);
  content: "";
  pointer-events: none;
  animation: thumbnail-projection-locator 5s ease-out both;
}

@keyframes thumbnail-projection-locator {
  0%, 12% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

button.projection-thumbnail:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.035);
  transform: translateY(-1px);
}

button.projection-thumbnail[aria-pressed="true"] {
  border-color: rgba(var(--pane-rgb), 0.58);
  background: rgba(var(--pane-rgb), 0.09);
  box-shadow:
    inset 0 0 0 1px rgba(var(--pane-rgb), 0.16),
    0 0 18px rgba(var(--pane-rgb), 0.08);
}

button.projection-thumbnail[aria-pressed="true"]::after {
  opacity: 0.9;
}

.thumbnail-render-slot {
  position: absolute;
  inset: 0 0 34px;
  pointer-events: none;
}

.thumbnail-label {
  position: absolute;
  right: 0.58rem;
  bottom: 0.34rem;
  left: 0.58rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #9d9b92;
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

.thumbnail-label strong {
  color: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.05;
  text-transform: none;
}

.thumbnail-pane-badge {
  position: absolute;
  top: 0.48rem;
  left: 0.48rem;
  display: grid;
  width: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 0.34rem;
  place-items: center;
  border: 1px solid rgba(var(--pane-rgb), 0.65);
  border-radius: 999px;
  background: rgba(10, 10, 9, 0.78);
  color: rgb(var(--pane-rgb));
  font-size: 0.55rem;
  font-weight: 800;
  opacity: 0;
  white-space: nowrap;
}

.thumbnail-solved-badge {
  position: absolute;
  z-index: 3;
  top: 0.48rem;
  left: 0.48rem;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid rgba(139, 235, 126, 0.72);
  border-radius: 999px;
  background: rgba(12, 38, 18, 0.9);
  box-shadow: 0 0 10px rgba(112, 239, 125, 0.18);
  color: #a9f4a4;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.thumbnail-solved-badge[hidden] {
  display: none;
}

button.projection-thumbnail[aria-pressed="true"] .thumbnail-solved-badge {
  top: 1.9rem;
}

.thumbnail-catalog-number {
  position: absolute;
  z-index: 3;
  top: 0.48rem;
  right: 0.48rem;
  display: grid;
  min-width: 28px;
  height: 18px;
  padding: 0 0.32rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  background: rgba(10, 10, 9, 0.78);
  color: rgba(232, 226, 212, 0.72);
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  pointer-events: none;
}

button.projection-thumbnail[aria-pressed="true"] .thumbnail-pane-badge {
  opacity: 1;
}

.empty-selection-hint {
  position: absolute;
  z-index: 4;
  inset: calc((100% - var(--projection-tray-height) - var(--key-hints-height)) / 2) auto auto 50%;
  width: min(36rem, calc(100% - 4rem));
  color: rgba(232, 226, 212, 0.5);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.15rem, 2vw, 1.7rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.25;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, -50%);
  transition: left 220ms ease, opacity 140ms ease;
}

.empty-selection-hint.visible {
  opacity: 1;
}

.status-card {
  position: absolute;
  z-index: 5;
  top: clamp(1.25rem, 3.5vh, 2.4rem);
  right: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 126px;
  padding: 0.72rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(17, 17, 16, 0.62);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(14px);
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  transition: left 160ms ease, top 160ms ease, opacity 120ms ease, transform 120ms ease;
}

.status-card.is-dragging {
  cursor: grabbing;
  transition: none;
}

.status-card.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.94);
}

.status-card strong,
.status-card span {
  display: block;
}

.status-card strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  font-weight: 500;
}

.status-card span:not(.status-dot) {
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.move-history-panel {
  --move-row-height: 32px;
  position: absolute;
  z-index: 12;
  top: 5.5rem;
  left: 1.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: 316px;
  height: min(650px, calc(100% - 1.5rem));
  min-height: 214px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(14, 14, 13, 0.96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(0, 0, 0, 0.28);
  color: #e4ded2;
  backdrop-filter: blur(18px);
  pointer-events: auto;
  transition: opacity 130ms ease, transform 150ms ease, visibility 130ms ease;
}

.move-history-panel.hidden,
.move-history-panel.collapsed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(12px) scale(0.97);
  /* Collapsing a sidebar also removes its side-panel geometry. Hide it in
     that same frame, before its old visibility transition can expose the
     intermediate floating-window position. */
  transition: none;
}

.move-history-panel:not(.side-panel),
.macro-panel:not(.side-panel) {
  /* Normally JS clamps floating tools beside the sidebar stack. If the window
     is narrower than the combined panels, keep the float reachable above the
     stack instead of silently opening it behind an opaque sidebar. */
  z-index: 18;
}

.move-history-panel.side-panel {
  top: 0;
  right: var(--workspace-primary-side-width);
  bottom: 0;
  left: auto;
  grid-template-rows: auto minmax(0, 1fr) auto 54px;
  width: var(--move-history-side-pane-width);
  height: auto;
  min-height: 0;
  max-height: none;
  border-width: 0 0 0 1px;
  border-radius: 0;
  box-shadow: -18px 0 52px rgba(0, 0, 0, 0.28);
  backdrop-filter: none;
  transition: right 220ms ease;
}

.move-history-panel.side-panel .move-history-header {
  cursor: default;
}

.move-history-panel.side-panel .move-history-progress[hidden] {
  display: grid;
  visibility: hidden;
  pointer-events: none;
}

.move-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  padding: 0.58rem 0.62rem 0.52rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(110deg, rgba(var(--move-journal-rgb), 0.065), transparent 54%);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.move-history-header > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.move-history-panel.is-dragging .move-history-header {
  cursor: grabbing;
}

.move-history-header p {
  margin: 0 0 0.25rem;
  color: var(--move-journal-accent);
  font-size: 0.54rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.move-history-header h2 {
  margin: 0;
  color: #eee8dc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.48rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.42);
}

.move-history-window-actions {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  gap: 0.18rem;
  min-width: 0;
}

.move-history-window-actions button {
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
  color: #aaa79d;
  font-size: 1rem;
}

.move-history-window-actions button:hover:not(:disabled) {
  color: var(--move-journal-accent);
}

.move-history-window-actions .move-history-quick-toggle {
  flex: 0 1 82px;
  width: 82px;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  padding: 0 0.25rem;
  border-color: rgba(var(--move-journal-rgb), 0.27);
  background: rgba(var(--move-journal-rgb), 0.07);
  color: var(--move-journal-accent);
  font-size: 0.59rem;
  font-weight: 750;
  white-space: nowrap;
}

.move-history-quick-toggle span {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  white-space: nowrap;
}

.move-history-quick-toggle[aria-pressed="true"] {
  border-color: rgba(var(--move-journal-rgb), 0.55);
  background: rgba(var(--move-journal-rgb), 0.17);
  box-shadow: 0 0 12px rgba(var(--move-journal-rgb), 0.11);
}

#move-history-side[aria-pressed="true"] {
  border-color: rgba(var(--move-journal-rgb), 0.38);
  background: rgba(var(--move-journal-rgb), 0.1);
  color: var(--move-journal-accent);
}

.move-history-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 94px;
  min-height: 0;
  overflow: hidden;
}

.move-history-scroll {
  position: relative;
  min-height: 0;
  overflow: auto;
  outline: none;
  scrollbar-color: rgba(var(--move-journal-rgb), 0.3) rgba(255, 255, 255, 0.025);
  scrollbar-width: thin;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.move-history-scroll.is-dragging,
.move-history-scroll.is-dragging .move-history-row {
  cursor: grabbing;
}

.move-history-scroll:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(var(--move-journal-rgb), 0.4);
}

.move-history-spacer {
  width: 1px;
  pointer-events: none;
}

.move-history-rows {
  position: absolute;
  inset: 0 0 auto;
}

.move-history-start-row {
  position: absolute;
  left: 0;
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr);
  align-items: center;
  width: 100%;
  height: var(--move-row-height);
  padding: 0 0.62rem;
  border: 0;
  border-bottom: 1px solid rgba(var(--move-journal-rgb), 0.12);
  border-radius: 0;
  background: linear-gradient(90deg, rgba(var(--move-journal-rgb), 0.075), transparent);
  color: #a9a397;
  text-align: left;
  cursor: pointer;
}

.move-history-start-row:hover:not(:disabled) {
  border-bottom-color: rgba(var(--move-journal-rgb), 0.2);
  background: linear-gradient(90deg, rgba(var(--move-journal-rgb), 0.14), rgba(var(--move-journal-rgb), 0.025));
  color: #eee7da;
}

.move-history-start-row.current {
  background: linear-gradient(90deg, rgba(var(--move-journal-rgb), 0.22), rgba(var(--move-journal-rgb), 0.055));
  box-shadow: inset 3px 0 0 var(--move-journal-accent);
  color: #fff2d5;
}

.move-history-start-marker {
  color: var(--move-journal-accent);
  font: 700 1rem/1 Georgia, "Times New Roman", serif;
  text-align: center;
}

.move-history-start-row strong {
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.move-history-row {
  position: absolute;
  left: 0;
  display: grid;
  /* Reserve the three small glyph columns in pixels. rem-based minima could
     exceed the list's width once its vertical scrollbar appeared. */
  grid-template-columns: minmax(0, 1fr) 34px 40px 26px;
  align-items: center;
  width: 100%;
  height: var(--move-row-height);
  padding: 0 0.48rem;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.042);
  border-radius: 0;
  background: transparent;
  color: #c9c4b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.71rem;
  text-align: left;
  cursor: pointer;
  transition: none;
}

.move-history-row:hover:not(:disabled) {
  border-color: rgba(var(--move-journal-rgb), 0.14);
  background: rgba(var(--move-journal-rgb), 0.07);
  color: #f2ede2;
}

.move-history-row.imported {
  background: linear-gradient(90deg, rgba(130, 105, 210, 0.105), rgba(130, 105, 210, 0.025));
}

.move-history-row.imported:hover:not(:disabled) {
  background: linear-gradient(90deg, rgba(151, 125, 231, 0.16), rgba(151, 125, 231, 0.05));
}

.move-history-row.current {
  background: linear-gradient(90deg, rgba(var(--move-journal-rgb), 0.22), rgba(var(--move-journal-rgb), 0.055));
  box-shadow: inset 3px 0 0 var(--move-journal-accent);
  color: #fff2d5;
}

.move-history-row.range-selected {
  border-bottom-color: rgba(84, 204, 255, 0.2);
  background: linear-gradient(90deg, rgba(84, 204, 255, 0.24), rgba(84, 204, 255, 0.075));
  box-shadow: inset 3px 0 0 #54ccff;
  color: #effaff;
}

.move-history-row.range-selected.selection-endpoint {
  background: linear-gradient(90deg, rgba(84, 204, 255, 0.34), rgba(84, 204, 255, 0.105));
}

.move-history-row.current.range-selected {
  box-shadow: inset 3px 0 0 #54ccff, inset -3px 0 0 var(--move-journal-accent);
}

.move-history-row.future {
  color: #6d6b65;
}

.move-history-row.future .move-history-face {
  filter: saturate(0.45) brightness(0.68);
  opacity: 0.72;
}

.move-history-row.loading {
  color: #5d5c56;
}

.move-history-comment-row {
  position: absolute;
  left: 0;
  display: grid;
  grid-template-columns: 1.55rem minmax(0, 1fr) 2.1rem;
  column-gap: 0.28rem;
  align-items: center;
  width: 100%;
  height: var(--move-row-height);
  padding: 0 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  background: linear-gradient(90deg, rgba(84, 204, 255, 0.085), rgba(84, 204, 255, 0.018));
  color: #a9c9d4;
  font-size: 0.61rem;
}

.move-history-comment-row.text-block {
  background: linear-gradient(90deg, rgba(var(--move-journal-rgb), 0.095), rgba(var(--move-journal-rgb), 0.018));
  color: #d8c69f;
}

.move-history-comment-row.certification {
  background: linear-gradient(90deg, rgba(199, 255, 69, 0.105), rgba(199, 255, 69, 0.018));
  color: #d8ff75;
}

.move-history-comment-row.certification .move-history-comment-marker {
  color: #c7ff45;
  font-size: 0.72rem;
}

.move-history-comment-row.navigation-target {
  background: linear-gradient(90deg, rgba(var(--move-journal-rgb), 0.2), rgba(var(--move-journal-rgb), 0.045));
  box-shadow: inset 3px 0 0 var(--move-journal-accent);
}

.move-history-block-toggle {
  display: grid;
  width: 20px;
  height: 20px;
  padding: 0;
  place-items: center;
  border-color: rgba(var(--move-journal-rgb), 0.26);
  background: rgba(0, 0, 0, 0.2);
  color: var(--move-journal-accent);
  font: 800 0.78rem/1 ui-monospace, monospace;
}

.move-history-block-toggle-glyph {
  display: block;
  line-height: 1;
  transform: translateY(-0.5px);
}

.move-history-comment-marker {
  color: #54ccff;
  font-size: 0.55rem;
  text-align: center;
}

.move-history-comment-copy {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.move-history-comment-delete {
  display: grid;
  justify-self: end;
  width: 23px;
  height: 22px;
  padding: 3px;
  place-items: center;
  border-color: transparent;
  background: transparent;
  color: #77736d;
}

.move-history-comment-delete svg {
  width: 16px;
  height: 16px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.45;
}

.move-history-comment-delete:hover:not(:disabled),
.move-history-comment-delete:focus-visible {
  border-color: rgba(255, 105, 105, 0.28);
  background: rgba(255, 105, 105, 0.08);
  color: #ff9d9d;
}

.move-history-number {
  padding-left: 0.38rem;
  overflow: hidden;
  color: #77756e;
  font-variant-numeric: tabular-nums;
  text-align: right;
  text-overflow: ellipsis;
}

.move-history-direction {
  color: #aba89e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1;
  text-align: center;
}

.move-history-turn {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.move-history-face {
  display: grid;
  width: 23px;
  height: 22px;
  place-items: center;
  clip-path: polygon(50% 0, 98% 35%, 80% 96%, 20% 96%, 2% 35%);
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.72);
}

.move-history-footer {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 32px;
  padding: 0.35rem 0.78rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 7, 7, 0.32);
}

.move-history-footer > span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: #77756d;
  font-size: 0.55rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.move-history-target,
.quick-undo-target {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #b2aa9d;
  font-size: 0.55rem;
  font-weight: 750;
  white-space: nowrap;
}

.move-history-target {
  flex: 0 0 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 0.18rem;
  width: 100%;
  padding: 0.1rem 0.05rem 0.2rem;
}

.move-history-target select {
  width: 100%;
  min-width: 0;
}

.move-history-target select,
.quick-undo-target select {
  height: 23px;
  padding: 0 0.25rem;
  border: 1px solid rgba(255, 174, 91, 0.3);
  border-radius: 5px;
  background: #28211a;
  color: #f5deca;
  font-size: 0.58rem;
}

.move-history-progress {
  display: grid;
  gap: 0.42rem;
  min-height: 54px;
  padding: 0.58rem 0.78rem 0.68rem;
  border-top: 1px solid rgba(var(--move-journal-rgb), 0.17);
  background: linear-gradient(105deg, rgba(var(--move-journal-rgb), 0.085), rgba(7, 7, 7, 0.58) 58%);
  box-shadow: inset 0 1px 16px rgba(var(--move-journal-rgb), 0.03);
}

.move-history-progress[hidden] {
  display: none;
}

.move-history-progress-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
  min-width: 0;
}

.move-history-progress-copy strong {
  min-width: 0;
  overflow: hidden;
  color: #d9e4c0;
  font-size: 0.63rem;
  font-weight: 760;
  letter-spacing: 0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.move-history-progress-copy span {
  flex: none;
  color: #8d9580;
  font: 650 0.58rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.move-history-progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.48);
}

.move-history-progress-track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffdc75, var(--move-journal-accent));
  box-shadow: 0 0 10px rgba(var(--move-journal-rgb), 0.24);
  transition: width 80ms linear;
}

.move-history-progress.failed {
  border-top-color: rgba(255, 105, 105, 0.25);
  background: linear-gradient(105deg, rgba(255, 105, 105, 0.08), rgba(7, 7, 7, 0.58) 58%);
}

.move-history-progress.failed .move-history-progress-copy strong {
  color: #ffaaaa;
}

.move-history-comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.3rem;
  width: 100%;
}

.move-history-comment-form[hidden] {
  display: none;
}

.move-history-comment-form input {
  min-width: 0;
  height: 24px;
  padding: 0.22rem 0.42rem;
  border: 1px solid rgba(84, 204, 255, 0.3);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.34);
  color: #eefaff;
  font-size: 0.62rem;
}

.move-history-comment-form button {
  min-height: 24px;
  padding: 0.2rem 0.4rem;
  font-size: 0.55rem;
}

.move-history-page-controls,
.move-history-mark-controls {
  display: flex;
  gap: 2px;
}

.move-history-step-controls {
  display: flex;
  gap: 2px;
}

.move-history-selection-controls,
.move-history-navigation-controls,
.move-history-execution-controls {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 0.2rem;
}

.move-history-selection-controls,
.move-history-navigation-controls {
  padding-bottom: 0.38rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}

.move-history-page-controls button,
.move-history-step-controls button {
  width: 25px;
  padding-inline: 0;
}

.move-history-mark-controls button {
  width: 30px;
  padding-inline: 0;
  color: var(--move-journal-accent);
  font-size: 0.52rem;
}

.move-history-command-rail {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.25rem;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 0.35rem 0.45rem;
  border-left: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(255, 255, 255, 0.018);
  scrollbar-color: rgba(var(--move-journal-rgb), 0.28) transparent;
  scrollbar-width: thin;
}

.move-history-command-rail .move-history-page-controls,
.move-history-command-rail .move-history-mark-controls,
.move-history-command-rail .move-history-step-controls {
  justify-content: center;
}

.move-history-command-rail .move-history-selection-controls > button {
  width: 100%;
}

.move-history-command-rail .move-history-navigation-controls > button,
.move-history-command-rail .move-history-execution-controls > button {
  width: 100%;
}

#move-history-undo-blocks {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.24rem;
  padding-inline: 0.28rem;
  white-space: nowrap;
}

#move-history-undo-blocks > span:first-child {
  font-size: 0.68rem;
}

.move-history-certification-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding-inline: 0.2rem;
  white-space: nowrap;
}

.move-history-certification-control > span:first-child {
  color: #c7ff45;
  font-size: 0.58rem;
}

#move-history-auto-certify[aria-pressed="true"] {
  border-color: rgba(199, 255, 69, 0.38);
  background: rgba(199, 255, 69, 0.09);
  box-shadow: 0 0 10px rgba(199, 255, 69, 0.08);
}

#move-history-auto-scroll[aria-pressed="true"] {
  border-color: rgba(var(--move-journal-rgb), 0.48);
  background: rgba(var(--move-journal-rgb), 0.13);
  color: var(--move-journal-accent);
}

#move-history-select[aria-pressed="true"] {
  border-color: rgba(84, 204, 255, 0.55);
  background: rgba(84, 204, 255, 0.2);
  box-shadow: 0 0 14px rgba(84, 204, 255, 0.12);
  color: #dff7ff;
}

#move-history-copy.copied,
#move-history-copy-absolute.copied {
  border-color: rgba(var(--move-journal-rgb), 0.46);
  color: var(--move-journal-accent);
}

#move-history-copy.failed,
#move-history-copy-absolute.failed {
  border-color: rgba(255, 105, 105, 0.5);
  color: #ff9d9d;
}

.move-history-command-rail > button {
  width: 100%;
}

.move-history-command-rail button {
  min-height: 24px;
  padding: 0.22rem 0.34rem;
  font-size: 0.58rem;
}

#move-history-redo-all {
  padding-inline: 0.22rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.move-history-dock {
  position: absolute;
  z-index: 12;
  top: 44%;
  right: 0;
  display: none;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 0.42rem;
  min-width: 0;
  padding: 0.68rem 0.38rem 0.68rem 0.52rem;
  border-right: 0;
  border-radius: 10px 0 0 10px;
  background: rgba(14, 14, 13, 0.9);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
  color: #aaa79e;
  backdrop-filter: blur(14px);
  touch-action: none;
  transition: right 220ms ease;
}

.stage.workspace-side-open .move-history-dock,
.stage.workspace-side-open .macro-dock,
.stage.workspace-side-open .piece-inventory-dock {
  right: var(--workspace-side-width);
}

.move-history-dock.is-dragging {
  cursor: ns-resize;
}

.move-history-dock.visible {
  display: grid;
}

.move-history-dock > span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: #8c8a82;
  font-size: 0.52rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.move-history-dock strong {
  display: grid;
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  height: 22px;
  padding: 0;
  overflow: hidden;
  place-items: center;
  border-radius: 999px;
  background: rgba(var(--move-journal-rgb), 0.13);
  color: var(--move-journal-accent);
  font: 750 0.58rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-overflow: clip;
  white-space: nowrap;
}

.macro-panel {
  position: absolute;
  z-index: 13;
  top: 5.5rem;
  left: calc(100% - 352px);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  width: 320px;
  min-height: 250px;
  max-height: min(560px, calc(100% - 1.5rem));
  overflow: hidden;
  border: 1px solid rgba(var(--macro-rgb), 0.2);
  border-radius: 14px;
  background: rgba(14, 14, 16, 0.965);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42), 0 0 28px rgba(var(--macro-rgb), 0.035);
  color: #e4ded2;
  backdrop-filter: blur(18px);
  pointer-events: auto;
  transition: opacity 130ms ease, transform 150ms ease, visibility 130ms ease;
}

.macro-panel.hidden,
.macro-panel.collapsed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(12px) scale(0.97);
}

.macro-panel.side-panel {
  top: 0;
  right: calc(
    var(--workspace-primary-side-width)
    + var(--workspace-move-history-side-width)
    + var(--workspace-plan-side-width)
  );
  bottom: 0;
  left: auto;
  grid-template-rows: auto auto auto minmax(0, 1fr) 52px;
  width: var(--macro-side-pane-width);
  height: auto;
  min-height: 0;
  max-height: none;
  border-width: 0 0 0 1px;
  border-radius: 0;
  box-shadow: -18px 0 52px rgba(0, 0, 0, 0.28);
  backdrop-filter: none;
  transition: right 220ms ease;
}

.macro-panel.side-panel .macro-panel-header {
  cursor: default;
}

.macro-panel.side-panel .macro-operation-status[hidden] {
  display: grid;
  visibility: hidden;
  pointer-events: none;
}

.sequence-explorer-panel {
  position: absolute;
  z-index: 15;
  top: 0;
  right: calc(
    var(--workspace-primary-side-width)
    + var(--workspace-macro-side-width)
    + var(--workspace-move-history-side-width)
    + var(--workspace-plan-side-width)
    + var(--workspace-candidate-side-width)
  );
  bottom: 0;
  display: grid;
  grid-template-rows: auto minmax(0, auto) minmax(12rem, 1fr);
  width: var(--sequence-explorer-side-pane-width);
  min-width: 0;
  overflow: hidden;
  border-left: 1px solid rgba(var(--macro-rgb), 0.28);
  background:
    linear-gradient(145deg, rgba(var(--macro-rgb), 0.055), transparent 32%),
    rgba(11, 13, 16, 0.985);
  box-shadow: -20px 0 55px rgba(0, 0, 0, 0.34);
  color: #e5f7ff;
  pointer-events: auto;
  transition: right 220ms ease;
}

.sequence-explorer-panel.candidate-load-blocked {
  animation: sequence-explorer-blocked-panel 520ms ease-out both;
}

.sequence-explorer-panel.candidate-load-blocked .sequence-explorer-dirty.dirty {
  animation: sequence-explorer-blocked-pill 300ms ease-in-out 560ms 3 both;
}

@keyframes sequence-explorer-blocked-panel {
  0%, 100% {
    border-color: rgba(var(--macro-rgb), 0.28);
    box-shadow: -20px 0 55px rgba(0, 0, 0, 0.34);
  }

  32%, 68% {
    border-color: rgba(255, 58, 86, 0.98);
    box-shadow:
      inset 0 0 0 2px rgba(255, 45, 75, 0.88),
      inset 0 0 28px rgba(255, 35, 67, 0.18),
      -20px 0 55px rgba(0, 0, 0, 0.34),
      0 0 30px rgba(255, 35, 67, 0.32);
  }
}

@keyframes sequence-explorer-blocked-pill {
  0%, 100% {
    border-color: rgba(255, 77, 105, 0.58);
    background: rgba(255, 45, 78, 0.11);
    box-shadow: 0 0 12px rgba(255, 45, 78, 0.08);
    color: #ff8c9f;
  }

  50% {
    border-color: #ff2e54;
    background: rgba(255, 30, 67, 0.34);
    box-shadow:
      0 0 0 2px rgba(255, 45, 78, 0.34),
      0 0 24px rgba(255, 30, 67, 0.72);
    color: #fff2f5;
  }
}

.candidate-panel {
  position: absolute;
  z-index: 15;
  top: 0;
  right: calc(
    var(--workspace-primary-side-width)
    + var(--workspace-move-history-side-width)
    + var(--workspace-plan-side-width)
    + var(--workspace-macro-side-width)
  );
  bottom: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: var(--candidate-side-pane-width);
  min-width: 0;
  overflow: hidden;
  border-left: 1px solid rgba(var(--candidate-rgb), 0.24);
  background:
    linear-gradient(145deg, rgba(var(--candidate-rgb), 0.055), transparent 34%),
    rgba(11, 13, 16, 0.988);
  box-shadow: -18px 0 52px rgba(0, 0, 0, 0.3);
  color: #e5f4ff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(100%);
  transition: right 220ms ease, opacity 150ms ease, transform 220ms ease,
    visibility 150ms ease;
}

.stage.candidate-side-open .candidate-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

.candidate-panel [hidden],
.candidate-editor-dialog[hidden] {
  display: none !important;
}

.candidate-panel-header {
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.58rem 0.62rem 0.52rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(110deg, rgba(var(--candidate-rgb), 0.085), transparent 58%);
}

.candidate-panel-header p,
.candidate-panel-header h2 {
  margin: 0;
}

.candidate-panel-header p {
  margin-bottom: 0.25rem;
  color: var(--candidate-accent);
  font-size: 0.54rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.candidate-panel-header h2 {
  color: #e8f5ff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.48rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
}

.candidate-window-actions {
  display: flex;
  gap: 0.25rem;
}

.candidate-window-actions button {
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
  color: #8ea9b9;
}

.candidate-window-actions button:hover:not(:disabled) {
  color: #d8f2ff;
}

.candidate-panel-actions {
  display: grid;
  gap: 0.42rem;
  padding: 0.58rem 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(7, 9, 12, 0.42);
}

.candidate-view-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.34rem;
}

.candidate-transfer-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.34rem;
}

.candidate-analysis-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.34rem;
}

#candidate-orientations {
  white-space: nowrap;
}

#candidate-orientations[aria-pressed="true"] {
  border-color: rgba(var(--candidate-rgb), 0.4);
  background: rgba(var(--candidate-rgb), 0.11);
  color: #d7f0ff;
}

#candidate-orientations[aria-pressed="true"] .toggle-indicator {
  border-color: var(--candidate-accent);
  background: var(--candidate-accent);
  box-shadow: 0 0 8px rgba(var(--candidate-rgb), 0.35);
}

.candidate-plan-scope {
  margin: 0;
  padding: 0.6rem 0.7rem 0;
  color: var(--candidate-accent);
  font-size: 0.65rem;
}

#candidate-delete-all {
  white-space: nowrap;
}

.candidate-panel-actions button {
  min-height: 29px;
  padding: 0.35rem 0.45rem;
  font-size: 0.6rem;
}

.candidate-view-tabs button[aria-pressed="true"],
#candidate-analyze:not(:disabled) {
  border-color: rgba(var(--candidate-rgb), 0.4);
  background: rgba(var(--candidate-rgb), 0.11);
  color: #d7f0ff;
}

.candidate-library-view,
.candidate-plan-view {
  min-height: 0;
  overflow: auto;
  scrollbar-color: rgba(var(--candidate-rgb), 0.24) transparent;
}

.candidate-list {
  display: grid;
  gap: 0.42rem;
  padding: 0.68rem;
}

.candidate-row {
  --candidate-color: var(--candidate-accent);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  min-width: 0;
  align-items: center;
  padding: 0.55rem 0.52rem;
  border: 1px solid color-mix(in srgb, var(--candidate-color) 22%, rgba(255, 255, 255, 0.07));
  border-radius: 9px;
  background: color-mix(in srgb, var(--candidate-color) 5%, rgba(255, 255, 255, 0.018));
}

.candidate-row.covered {
  border-color: rgba(var(--candidate-rgb), 0.18);
  background: rgba(var(--candidate-rgb), 0.025);
}

.candidate-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.candidate-row-assignment {
  max-width: 7.2rem;
  min-height: 26px;
  padding: 0.3rem 0.46rem;
  overflow: hidden;
  border-color: rgba(var(--candidate-rgb), 0.28);
  background: rgba(var(--candidate-rgb), 0.09);
  color: #a7ddf4;
  font: 760 0.54rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-row-assignment:hover:not(:disabled) {
  border-color: rgba(255, 123, 134, 0.48);
  background: rgba(255, 123, 134, 0.09);
  color: #ffabb2;
}

.candidate-row-link {
  min-height: 26px;
  padding: 0.3rem 0.46rem;
  border-color: rgba(84, 204, 255, 0.38);
  background: rgba(84, 204, 255, 0.1);
  color: #92dcff;
  font-size: 0.54rem;
  font-weight: 800;
  white-space: nowrap;
}

.candidate-row-macro {
  min-height: 26px;
  padding: 0.3rem 0.44rem;
  border: 1px solid rgba(84, 204, 255, 0.36);
  border-radius: 999px;
  background: rgba(84, 204, 255, 0.1);
  color: #92dcff;
  font: 800 0.5rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.candidate-row-macro:hover:not(:disabled) {
  border-color: rgba(112, 213, 255, 0.66);
  background: rgba(84, 204, 255, 0.17);
}

.candidate-row-macro.missing {
  border-color: rgba(255, 123, 134, 0.34);
  background: rgba(255, 123, 134, 0.08);
  color: #ffabb2;
}

.candidate-row-covered {
  padding: 0.3rem 0.42rem;
  border: 1px solid rgba(var(--candidate-rgb), 0.24);
  border-radius: 999px;
  background: rgba(var(--candidate-rgb), 0.07);
  color: #83a9c3;
  font: 800 0.5rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.candidate-row:hover {
  border-color: color-mix(in srgb, var(--candidate-color) 47%, rgba(255, 255, 255, 0.08));
  background: color-mix(in srgb, var(--candidate-color) 9%, rgba(255, 255, 255, 0.024));
}

.candidate-row-load {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.5rem;
  min-width: 0;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.candidate-row-load:hover:not(:disabled) {
  border: 0;
  background: transparent;
}

.candidate-row-swatch {
  width: 0.48rem;
  height: 2.25rem;
  border-radius: 999px;
  background: var(--candidate-color);
  box-shadow: 0 0 12px color-mix(in srgb, var(--candidate-color) 42%, transparent);
}

.candidate-row-copy {
  display: grid;
  min-width: 0;
  gap: 0.18rem;
}

.candidate-row-copy strong,
.candidate-row-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-row-copy strong {
  color: #dcecf5;
  font-size: 0.74rem;
}

.candidate-row-copy small {
  color: #71818a;
  font: 650 0.56rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}

.candidate-row-edit {
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  color: #8095a1;
}

.candidate-empty,
.candidate-plan-intro {
  display: grid;
  min-height: 150px;
  padding: 1.4rem;
  place-content: center;
  text-align: center;
}

.candidate-empty strong,
.candidate-plan-intro strong {
  color: #c8d7df;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
}

.candidate-empty span,
.candidate-plan-intro span {
  max-width: 18rem;
  margin-top: 0.42rem;
  color: #6f7c83;
  font-size: 0.65rem;
  line-height: 1.45;
}

.candidate-plan-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0.68rem;
  overflow: hidden;
  border: 1px solid rgba(var(--candidate-rgb), 0.14);
  border-radius: 9px;
  background: rgba(var(--candidate-rgb), 0.1);
}

.candidate-plan-summary > div {
  display: grid;
  gap: 0.2rem;
  padding: 0.58rem 0.35rem;
  background: rgba(10, 13, 17, 0.96);
  text-align: center;
}

.candidate-plan-summary > div:last-child {
  grid-column: 1 / -1;
}

.candidate-plan-summary strong {
  color: #d9f1ff;
  font: 850 0.8rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.candidate-plan-summary span {
  color: #70808a;
  font-size: 0.48rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.candidate-plan-coverage {
  display: grid;
  gap: 0.5rem;
  margin: 0.68rem;
}

.candidate-coverage-group {
  --quality-color: #656c70;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--quality-color) 24%, rgba(255, 255, 255, 0.06));
  border-radius: 9px;
  background: color-mix(in srgb, var(--quality-color) 3%, rgba(255, 255, 255, 0.012));
}

.candidate-coverage-group.good { --quality-color: #78dca4; }
.candidate-coverage-group.assigned { --quality-color: var(--candidate-accent); }
.candidate-coverage-group.workable { --quality-color: #ffd166; }
.candidate-coverage-group.poor { --quality-color: #ff7b86; }
.candidate-coverage-group.missing { --quality-color: #737a7e; }

.candidate-coverage-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.46rem 0.58rem;
  border-bottom: 1px solid color-mix(in srgb, var(--quality-color) 15%, transparent);
}

.candidate-coverage-group > header strong {
  color: var(--quality-color);
  font-size: 0.56rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.candidate-coverage-group > header span {
  color: #7d898f;
  font: 750 0.56rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.candidate-coverage-types {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.1rem, 1fr));
  gap: 0.3rem;
  padding: 0.48rem;
}

.candidate-coverage-types button {
  display: grid;
  grid-template-columns: 1.45rem minmax(0, 1fr) 0.8rem;
  gap: 0.28rem;
  align-items: center;
  min-width: 0;
  padding: 0.38rem 0.25rem;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--quality-color) 22%, rgba(255, 255, 255, 0.06));
  background: color-mix(in srgb, var(--quality-color) 6%, rgba(0, 0, 0, 0.18));
  color: color-mix(in srgb, var(--quality-color) 72%, #dce8ed);
  font: 800 0.59rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: left;
}

.candidate-coverage-types button b,
.candidate-coverage-types button em {
  overflow: visible;
  font: inherit;
  font-style: normal;
  white-space: nowrap;
}

.candidate-coverage-types button b {
  color: color-mix(in srgb, var(--quality-color) 88%, #eef7fa);
}

.candidate-coverage-types button span {
  min-width: 0;
  overflow: hidden;
  color: color-mix(in srgb, var(--quality-color) 48%, #b9c7cd);
  font-size: 0.53rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-coverage-types button em {
  color: var(--quality-color);
  text-align: right;
}

.candidate-coverage-types button:hover {
  border-color: color-mix(in srgb, var(--quality-color) 58%, white 5%);
  background: color-mix(in srgb, var(--quality-color) 13%, rgba(0, 0, 0, 0.16));
}

.candidate-plan-view [data-planning-type-index] {
  transition: opacity 150ms ease, filter 150ms ease, background-color 150ms ease;
}

.candidate-plan-view [data-planning-type-index].orientation-filter-mismatch {
  opacity: 0.16;
  filter: saturate(0.3);
}

.candidate-plan-view [data-planning-type-index].piece-inspection-mismatch {
  opacity: 0.1;
  filter: saturate(0.2) brightness(0.72);
}

.candidate-plan-view [data-planning-type-index].orientation-filter-mismatch:hover,
.candidate-plan-view [data-planning-type-index].piece-inspection-mismatch:hover,
.candidate-plan-view [data-planning-type-index].orientation-filter-mismatch:focus-visible,
.candidate-plan-view [data-planning-type-index].piece-inspection-mismatch:focus-visible {
  opacity: 0.34;
}

.candidate-plan-view [data-planning-type-index].piece-inspection-match {
  opacity: 1;
  outline: 1px solid rgba(var(--candidate-rgb), 0.72);
  outline-offset: -2px;
  background-color: rgba(var(--candidate-rgb), 0.14);
  filter: brightness(1.18) saturate(1.12);
}

.candidate-plan-section {
  margin: 0.68rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 9px;
}

.candidate-plan-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.56rem 0.68rem;
  background: rgba(var(--candidate-rgb), 0.055);
}

.candidate-plan-section > header strong {
  color: var(--candidate-accent);
  font-size: 0.57rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.candidate-plan-section > header span {
  color: #8ca2ae;
  font: 750 0.58rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.candidate-plan-list {
  display: grid;
}

.candidate-plan-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.58rem;
  padding: 0.58rem 0.68rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

button.candidate-plan-row {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
}

button.candidate-plan-row:hover {
  border: 0;
  background: rgba(var(--candidate-rgb), 0.055);
}

button.candidate-plan-row.type-solved {
  background: rgba(111, 210, 145, 0.105);
}

button.candidate-plan-row.type-solved:hover {
  background: rgba(111, 210, 145, 0.17);
}

.candidate-plan-row-compact {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.candidate-plan-row-compact strong {
  overflow: hidden;
  color: #d4e4ec;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-plan-row-compact span {
  flex: none;
  color: #8fa3ad;
  font: 750 0.57rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.candidate-plan-row:first-child {
  border-top: 0;
}

.candidate-plan-row > b {
  color: #708694;
  font: 800 0.59rem/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.candidate-plan-row.quality-good {
  box-shadow: inset 3px 0 #78dca4;
}

.candidate-plan-row.quality-assigned {
  box-shadow: inset 3px 0 var(--candidate-accent);
  background: rgba(var(--candidate-rgb), 0.035);
}

.candidate-plan-assigned-check {
  display: grid;
  width: 1.15rem;
  height: 1.15rem;
  align-self: center;
  border: 1px solid rgba(var(--candidate-rgb), 0.38);
  border-radius: 999px;
  background: rgba(var(--candidate-rgb), 0.12);
  color: #a8dcff;
  font: 900 0.7rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  place-items: center;
}

.candidate-plan-row.quality-workable {
  box-shadow: inset 3px 0 #ffd166;
}

.candidate-plan-row.quality-poor {
  box-shadow: inset 3px 0 #ff7b86;
}

.candidate-plan-row.quality-missing {
  box-shadow: inset 3px 0 #656c70;
}

.candidate-plan-gap-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  padding-block: 0.46rem;
}

.candidate-plan-gap-title {
  display: flex;
  min-width: 0;
  align-items: baseline;
}

.candidate-plan-gap-title strong {
  flex: none;
  color: #d4e4ec;
  font-size: 0.66rem;
}

.candidate-plan-gap-title span {
  overflow: hidden;
  min-width: 0;
  color: #d4e4ec;
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-plan-gap-capabilities {
  display: flex;
  align-items: center;
  gap: 0.42rem;
}

.candidate-plan-gap-capability {
  display: inline-flex;
  align-items: center;
  gap: 0.19rem;
  color: #b6c4ca;
  font: 800 0.59rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.candidate-plan-gap-capability i {
  display: grid;
  width: 0.92rem;
  height: 0.92rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font: 900 0.67rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-style: normal;
  place-items: center;
}

.candidate-plan-gap-capability.available i {
  border-color: rgba(120, 220, 164, 0.62);
  background: rgba(120, 220, 164, 0.13);
  color: #8de6b4;
}

.candidate-plan-gap-capability.missing i {
  border-color: rgba(255, 123, 134, 0.67);
  background: rgba(255, 123, 134, 0.14);
  color: #ff929c;
}

.candidate-plan-detail {
  min-height: 100%;
}

.candidate-plan-detail > header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  padding: 0.62rem 0.68rem;
  border-bottom: 1px solid rgba(var(--candidate-rgb), 0.13);
  background: rgba(var(--candidate-rgb), 0.045);
}

.candidate-plan-detail > header button {
  padding: 0.36rem 0.48rem;
  font-size: 0.59rem;
}

.candidate-plan-detail > header div {
  display: grid;
  min-width: 0;
  gap: 0.18rem;
}

.candidate-plan-detail > header strong {
  overflow: hidden;
  color: #d9effb;
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-plan-detail > header span {
  color: #7d929e;
  font: 700 0.54rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}

.candidate-plan-detail > header .candidate-plan-detail-type {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.2rem 0.25rem;
  border-color: transparent;
  background: transparent;
  text-align: left;
}

.candidate-plan-detail > header .candidate-plan-detail-type:hover,
.candidate-plan-detail > header .candidate-plan-detail-type:focus-visible {
  border-color: rgba(var(--candidate-rgb), 0.3);
  background: rgba(var(--candidate-rgb), 0.1);
}

#candidate-plan-detail-counts {
  color: var(--candidate-accent);
  white-space: nowrap;
}

#candidate-plan-detail-copy {
  padding: 0.65rem 0.72rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  color: #7d8c94;
  font-size: 0.61rem;
  line-height: 1.45;
}

#candidate-plan-detail-lists {
  display: grid;
  gap: 0.65rem;
  padding: 0.68rem;
}

.candidate-detail-group {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 9px;
}

.candidate-detail-group > header {
  display: flex;
  justify-content: space-between;
  padding: 0.48rem 0.58rem;
  background: rgba(var(--candidate-rgb), 0.05);
  color: var(--candidate-accent);
  font-size: 0.55rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.candidate-detail-list {
  display: grid;
}

.candidate-detail-option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.candidate-detail-option-row:first-child {
  border-top: 0;
}

.candidate-detail-option {
  --candidate-color: var(--candidate-accent);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.45rem;
  min-width: 0;
  align-items: center;
  padding: 0.52rem 0.58rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.candidate-detail-option:hover {
  border-color: transparent;
  background: rgba(var(--candidate-rgb), 0.05);
}

.candidate-detail-option > i {
  width: 0.44rem;
  height: 1.8rem;
  border-radius: 99px;
  background: var(--candidate-color);
}

.candidate-detail-option > span {
  display: grid;
  min-width: 0;
  gap: 0.18rem;
}

.candidate-detail-option strong,
.candidate-detail-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-detail-option strong {
  color: #cfdee6;
  font-size: 0.65rem;
}

.candidate-detail-option small {
  color: #73838b;
  font: 650 0.53rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.candidate-detail-option > em {
  padding: 0.22rem 0.34rem;
  border-radius: 99px;
  color: #aab9c0;
  font: 800 0.5rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-style: normal;
  text-transform: uppercase;
}

.candidate-detail-option.quality-good > em { background: rgba(120, 220, 164, 0.13); color: #8ee7b4; }
.candidate-detail-option.quality-workable > em { background: rgba(255, 209, 102, 0.13); color: #ffe097; }
.candidate-detail-option.quality-poor > em { background: rgba(255, 123, 134, 0.13); color: #ff9da5; }
.candidate-detail-option.blocked { opacity: 0.45; }

.candidate-detail-assign {
  align-self: center;
  min-width: 5.15rem;
  margin-right: 0.48rem;
  padding: 0.38rem 0.48rem;
  border-color: rgba(var(--candidate-rgb), 0.28);
  background: rgba(var(--candidate-rgb), 0.085);
  color: #9edff4;
  font-size: 0.54rem;
  white-space: nowrap;
}

.candidate-detail-assign:hover:not(:disabled) {
  border-color: rgba(var(--candidate-rgb), 0.58);
  background: rgba(var(--candidate-rgb), 0.16);
}

.candidate-detail-assign.reassign {
  border-color: rgba(255, 209, 102, 0.3);
  color: #ffe097;
}

.candidate-detail-assign.assigned {
  border-color: rgba(120, 220, 164, 0.24);
  background: rgba(120, 220, 164, 0.08);
  color: #8ee7b4;
  opacity: 0.8;
}

.candidate-detail-empty {
  padding: 0.7rem;
  color: #747e83;
  font-size: 0.59rem;
  line-height: 1.4;
}

.candidate-progress {
  display: grid;
  gap: 0.42rem;
  min-height: 52px;
  padding: 0.55rem 0.72rem 0.65rem;
  border-top: 1px solid rgba(var(--candidate-rgb), 0.13);
  background: rgba(7, 10, 14, 0.95);
}

.candidate-progress[hidden] {
  display: grid;
  visibility: hidden;
}

.candidate-progress > div {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  font-size: 0.56rem;
}

.candidate-progress > div span {
  color: #74858e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.candidate-progress > i {
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
}

.candidate-progress > i > span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #4b8fc8, var(--candidate-accent));
  box-shadow: 0 0 10px rgba(var(--candidate-rgb), 0.35);
}

.candidate-progress.error {
  color: #ff8b9d;
  border-top-color: rgba(255, 91, 116, 0.3);
}

.candidate-progress.error > i > span {
  background: #ff5b74;
  box-shadow: 0 0 10px rgba(255, 91, 116, 0.35);
}

.candidate-dock {
  position: absolute;
  z-index: 15;
  top: 74%;
  right: 0;
  display: none;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 0.42rem;
  padding: 0.68rem 0.38rem 0.68rem 0.52rem;
  border-right: 0;
  border-radius: 10px 0 0 10px;
  background: rgba(11, 14, 18, 0.94);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
  color: #8fa9b8;
  backdrop-filter: blur(14px);
  touch-action: none;
  transition: right 220ms ease;
}

.candidate-dock.visible {
  display: grid;
}

.candidate-dock.is-dragging {
  cursor: ns-resize;
}

.candidate-dock > span {
  writing-mode: vertical-rl;
  color: #7ca9c4;
  font-size: 0.52rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: rotate(180deg);
}

.candidate-dock strong {
  display: grid;
  width: 40px;
  min-width: 40px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: rgba(var(--candidate-rgb), 0.13);
  color: var(--candidate-accent);
  font: 750 0.58rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.stage.workspace-side-open .candidate-dock {
  right: var(--workspace-side-width);
}

.candidate-editor-dialog {
  --candidate-color: var(--candidate-accent);
  position: absolute;
  z-index: 897;
  top: 12px;
  left: 12px;
  width: min(440px, calc(100vw - 1.6rem));
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--candidate-color) 42%, transparent);
  border-radius: 13px;
  background: rgba(11, 13, 17, 0.992);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.62),
    0 0 30px color-mix(in srgb, var(--candidate-color) 8%, transparent);
}

.candidate-editor-dialog[hidden] {
  display: none;
}

.candidate-editor-dialog > header {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.7rem 0.6rem 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--candidate-color) 18%, transparent);
  background: linear-gradient(110deg, color-mix(in srgb, var(--candidate-color) 9%, transparent), transparent 62%);
  cursor: grab;
}

.candidate-editor-dialog > header p,
.candidate-editor-dialog > header h2 {
  margin: 0;
}

.candidate-editor-dialog > header p {
  margin-bottom: 0.22rem;
  color: var(--candidate-color);
  font-size: 0.52rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.candidate-editor-dialog > header h2 {
  font: 600 1.15rem/1 Georgia, "Times New Roman", serif;
}

.candidate-editor-dialog > header button {
  width: 30px;
  height: 30px;
  padding: 0;
}

.candidate-editor-dialog form {
  display: grid;
  gap: 0.72rem;
  padding: 0.8rem;
}

.candidate-editor-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
}

.candidate-editor-dialog label {
  display: grid;
  gap: 0.3rem;
  color: #80929d;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.candidate-editor-dialog label small {
  color: #64737c;
  font-size: 0.5rem;
}

.candidate-editor-macro-link > small {
  min-height: 1.2em;
  color: #71858f;
  font-size: 0.52rem;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
}

.candidate-editor-dialog input[type="text"],
.candidate-editor-dialog select,
.candidate-editor-dialog textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.28);
  color: #e4f2f8;
  font: 650 0.68rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.candidate-editor-dialog select {
  min-height: 34px;
  padding: 0.42rem 1.8rem 0.42rem 0.55rem;
}

.candidate-editor-dialog input[type="text"] {
  min-height: 34px;
  padding: 0.45rem 0.55rem;
}

.candidate-editor-dialog input[type="color"] {
  width: 42px;
  height: 34px;
  padding: 2px;
}

.candidate-editor-dialog textarea {
  resize: vertical;
  padding: 0.52rem;
  color: #9fb3bd;
}

.candidate-editor-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.sequence-explorer-panel[hidden] {
  display: none;
}

.sequence-explorer-header,
.sequence-explorer-analysis-heading,
.sequence-explorer-language-row,
.sequence-explorer-feedback,
.sequence-explorer-actions,
.sequence-explorer-heading-status,
.sequence-explorer-progress > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sequence-explorer-header {
  min-height: 60px;
  padding: 0.58rem 0.62rem 0.52rem 1rem;
  border-bottom: 1px solid rgba(var(--macro-rgb), 0.16);
  background: linear-gradient(110deg, rgba(var(--macro-rgb), 0.1), transparent 62%);
}

.sequence-explorer-header p,
.sequence-explorer-header h2,
.sequence-explorer-analysis-heading h3 {
  margin: 0;
}

.sequence-explorer-header p {
  margin: 0 0 0.25rem;
  color: var(--macro-accent);
  font-size: 0.54rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sequence-explorer-header h2 {
  margin: 0;
  color: #eee8dc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.48rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.42);
}

.sequence-explorer-heading-status {
  justify-content: flex-end;
  gap: 0.48rem;
}

.sequence-explorer-heading-status time {
  color: #a9dff4;
  font: 700 0.67rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.sequence-explorer-dirty {
  padding: 0.23rem 0.45rem;
  border: 1px solid rgba(84, 204, 255, 0.25);
  border-radius: 999px;
  color: #8cbdcf;
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sequence-explorer-dirty.dirty {
  border-color: rgba(255, 77, 105, 0.58);
  background: rgba(255, 45, 78, 0.11);
  box-shadow: 0 0 12px rgba(255, 45, 78, 0.08);
  color: #ff8c9f;
}

.sequence-explorer-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: max-content;
  align-content: start;
  min-height: 0;
  overflow: auto;
  gap: 0.52rem;
  padding: 0.75rem;
  border-bottom: 1px solid rgba(84, 204, 255, 0.13);
}

.sequence-explorer-language-row {
  gap: 0.5rem;
}

.sequence-explorer-language {
  display: flex;
  gap: 0.22rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.sequence-explorer-language legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.sequence-explorer-language label {
  cursor: pointer;
}

.sequence-explorer-language input {
  position: absolute;
  opacity: 0;
}

.sequence-explorer-language span {
  display: block;
  padding: 0.32rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 7px;
  color: #8f9da3;
  font-size: 0.62rem;
  font-weight: 780;
}

.sequence-explorer-language input:checked + span {
  border-color: rgba(84, 204, 255, 0.48);
  background: rgba(84, 204, 255, 0.11);
  color: #c9efff;
}

.sequence-explorer-source-label {
  color: #7695a2;
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sequence-explorer-source-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.sequence-explorer-hover-face {
  --hover-face-color: #60717a;
  display: inline-flex;
  min-width: 8.2rem;
  align-items: center;
  justify-content: flex-end;
  gap: 0.36rem;
  color: #617780;
  font: 780 0.51rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.075em;
  white-space: nowrap;
  text-transform: uppercase;
  transition: color 120ms ease, filter 120ms ease;
}

.sequence-explorer-hover-face i {
  display: block;
  width: 0.82rem;
  height: 0.78rem;
  flex: none;
  background: #60717a;
  clip-path: polygon(50% 0%, 97% 35%, 79% 100%, 21% 100%, 3% 35%);
  opacity: 0.34;
  transition: background 120ms ease, opacity 120ms ease, filter 120ms ease;
}

.sequence-explorer-hover-face strong {
  box-sizing: border-box;
  width: 1.5rem;
  padding: 0.18rem 0.28rem;
  border: 1px solid rgba(var(--macro-rgb), 0.13);
  border-radius: 5px;
  color: #718891;
  font-size: 0.68rem;
  line-height: 1;
  text-align: center;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease,
    box-shadow 120ms ease;
}

.sequence-explorer-hover-face.active {
  color: #a5dff4;
}

.sequence-explorer-hover-face.active i {
  background: var(--hover-face-color);
  opacity: 1;
  filter: drop-shadow(0 0 4px var(--hover-face-color));
}

.sequence-explorer-hover-face.active strong {
  border-color: rgba(var(--macro-rgb), 0.5);
  background: rgba(var(--macro-rgb), 0.12);
  box-shadow: 0 0 9px rgba(var(--macro-rgb), 0.12);
  color: #e6f8ff;
}

.sequence-explorer-source-field {
  display: grid;
  min-width: 0;
  gap: 0.3rem;
}

.sequence-explorer-editing-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: #92bdce;
  font-size: 0.6rem;
  line-height: 1.4;
  /* Reserve the row so focusing the editor never shifts the puzzle/actions. */
  visibility: hidden;
}

.sequence-explorer-source-field:focus-within .sequence-explorer-editing-tools {
  visibility: visible;
}

.sequence-explorer-editing-tools strong {
  color: var(--macro-accent);
}

.sequence-explorer-editing-tools button {
  flex: none;
  padding: 0.34rem 0.65rem;
  border-color: rgba(var(--macro-rgb), 0.48);
  background: rgba(var(--macro-rgb), 0.12);
  color: #d9f6ff;
  font-size: 0.66rem;
}

#sequence-explorer-source {
  box-sizing: border-box;
  width: 100%;
  min-height: 8.1rem;
  resize: vertical;
  border: 1px solid rgba(84, 204, 255, 0.19);
  border-radius: 9px;
  background: rgba(3, 7, 9, 0.72);
  color: #e6f8ff;
  font: 650 0.72rem/1.48 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  tab-size: 2;
}

.sequence-explorer-source-field:focus-within #sequence-explorer-source {
  border-color: var(--macro-accent);
  outline: 1px solid rgba(var(--macro-rgb), 0.55);
  outline-offset: 1px;
  box-shadow: 0 0 12px rgba(var(--macro-rgb), 0.18);
}

#sequence-explorer-source[aria-invalid="true"] {
  border-color: rgba(255, 91, 104, 0.62);
  outline-color: rgba(255, 91, 104, 0.62);
}

.sequence-explorer-feedback {
  min-width: 0;
  gap: 0.5rem;
  color: #77929d;
  font-size: 0.61rem;
}

.sequence-explorer-feedback strong {
  flex: none;
  color: #9fdcf4;
  font: 720 0.61rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.sequence-explorer-error {
  max-height: 3.1rem;
  margin: 0;
  overflow: auto;
  color: #ff8791;
  font-size: 0.62rem;
  line-height: 1.35;
}

.sequence-explorer-actions {
  min-height: min-content;
  display: grid;
  grid-auto-rows: max-content;
  align-items: stretch;
  justify-content: stretch;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(var(--macro-rgb), 0.12);
  border-radius: 9px;
  background: rgba(2, 8, 11, 0.28);
}

.sequence-explorer-action-group {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.32rem 0.38rem;
}

.sequence-explorer-action-group + .sequence-explorer-action-group {
  border-top: 1px solid rgba(var(--macro-rgb), 0.085);
}

.sequence-explorer-candidates-row {
  padding: 0.38rem;
  border-top: 1px solid rgba(var(--macro-rgb), 0.085);
}

.sequence-explorer-actions button.sequence-explorer-candidates-launch {
  display: flex;
  width: 100%;
  min-height: 2.15rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.42rem 0.72rem;
  border-color: rgba(var(--candidate-rgb), 0.38);
  border-radius: 7px;
  background: linear-gradient(100deg, rgba(var(--candidate-rgb), 0.18), rgba(var(--candidate-rgb), 0.06));
  box-shadow: inset 0 0 16px rgba(var(--candidate-rgb), 0.035);
  color: #ccecff;
  font-size: 0.65rem;
  letter-spacing: 0.035em;
  text-align: left;
}

.sequence-explorer-actions button.sequence-explorer-candidates-launch b {
  color: var(--candidate-accent);
  font-size: 1.05rem;
  line-height: 0.8;
}

.sequence-explorer-actions button.sequence-explorer-candidates-launch:hover:not(:disabled) {
  border-color: rgba(var(--candidate-rgb), 0.68);
  background: linear-gradient(100deg, rgba(var(--candidate-rgb), 0.26), rgba(var(--candidate-rgb), 0.09));
}

.sequence-explorer-candidates-row + .sequence-explorer-action-group {
  border-top: 1px solid rgba(var(--macro-rgb), 0.085);
}

.sequence-explorer-action-label {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding-left: 0.12rem;
  overflow: hidden;
  color: #688793;
  font-size: 0.51rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  white-space: nowrap;
  text-transform: uppercase;
}

.sequence-explorer-action-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.34rem;
  min-width: 0;
  padding-left: 0.48rem;
  border-left: 1px solid rgba(var(--macro-rgb), 0.1);
}

.sequence-explorer-actions button {
  padding: 0.38rem 0.54rem;
  font-size: 0.63rem;
}

.sequence-explorer-actions button.compact-icon {
  box-sizing: border-box;
  width: 1.78rem;
  padding-inline: 0;
}

#sequence-explorer-mixed-anti[aria-pressed="true"] {
  border-color: rgba(var(--macro-rgb), 0.58);
  background: rgba(var(--macro-rgb), 0.14);
  box-shadow: 0 0 11px rgba(var(--macro-rgb), 0.12);
  color: var(--macro-accent);
}

#sequence-explorer-rebase.needs-rebase {
  border-color: rgba(199, 255, 69, 0.48);
  background: rgba(199, 255, 69, 0.13);
  box-shadow: 0 0 12px rgba(199, 255, 69, 0.14);
  color: var(--lime);
}

.sequence-explorer-progress {
  display: grid;
  gap: 0.35rem;
  min-height: 2.25rem;
  padding-top: 0.18rem;
  color: #a8def3;
  font-size: 0.59rem;
}

.sequence-explorer-progress[hidden] {
  visibility: hidden;
}

.sequence-explorer-progress i {
  display: block;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(84, 204, 255, 0.1);
}

.sequence-explorer-progress i span {
  display: block;
  width: 0;
  height: 100%;
  background: #54ccff;
  box-shadow: 0 0 9px rgba(84, 204, 255, 0.8);
}

.sequence-explorer-analysis {
  min-height: 0;
  overflow: auto;
  padding: 0.75rem;
  scrollbar-color: rgba(84, 204, 255, 0.35) transparent;
}

.sequence-explorer-analysis-heading {
  margin-bottom: 0.58rem;
}

.sequence-explorer-analysis-heading h3 {
  color: #70d5ff;
  font-size: 0.78rem;
}

.sequence-explorer-analysis-heading small {
  color: #65777e;
  font-size: 0.56rem;
}

.sequence-explorer-analysis-group {
  margin-bottom: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px;
  overflow: hidden;
}

.sequence-explorer-target {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem 0.6rem;
  margin-bottom: 0.7rem;
  font-size: 0.65rem;
}

.sequence-explorer-target label {
  color: var(--macro-accent);
  font-weight: 750;
}

.sequence-explorer-target select {
  width: 100%;
  min-width: 0;
  padding: 0.35rem;
  font-size: 0.65rem;
}

.sequence-explorer-target small,
.sequence-explorer-target button {
  grid-column: 1 / -1;
}

.sequence-explorer-target small {
  color: #9eafb7;
  line-height: 1.45;
}

.sequence-explorer-target button {
  justify-self: start;
}

.sequence-explorer-preserve-empty {
  margin: 0;
  padding: 0.55rem;
  color: #9eafb7;
  font-size: 0.65rem;
}

.sequence-explorer-analysis-group > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.39rem 0.55rem;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.027);
  color: #a8b9c0;
  font-size: 0.61rem;
  font-weight: 820;
  text-align: left;
  text-transform: uppercase;
}

.sequence-explorer-analysis-group > button:hover {
  background: rgba(84, 204, 255, 0.065);
  color: #d8eaf1;
}

.sequence-explorer-analysis-group > button span:last-child {
  display: flex;
  align-items: center;
  gap: 0.48rem;
}

.sequence-explorer-analysis-toggle {
  width: 0.72rem;
  color: #698590;
  font-size: 0.75rem;
  text-align: center;
}

.sequence-explorer-analysis-group.useful > button {
  color: #c9ff72;
  background: rgba(199, 255, 69, 0.045);
}

.sequence-explorer-analysis-group.visible {
  border-color: rgba(var(--macro-rgb), 0.22);
  box-shadow: 0 0 15px rgba(var(--macro-rgb), 0.035);
}

.sequence-explorer-analysis-group.visible > button {
  color: var(--macro-accent);
  background: linear-gradient(90deg, rgba(var(--macro-rgb), 0.12), rgba(var(--macro-rgb), 0.035));
}

.sequence-explorer-analysis-list {
  display: grid;
}

.sequence-explorer-analysis-list[hidden] {
  display: none;
}

.sequence-explorer-analysis-row {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0.5rem;
  align-items: center;
  min-width: 0;
  padding: 0.37rem 0.55rem;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 0;
  background: transparent;
  color: #b6c2c7;
  font: 650 0.62rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: left;
}

.sequence-explorer-analysis-row:hover,
.sequence-explorer-analysis-row.selected {
  background: rgba(84, 204, 255, 0.09);
  color: #e3f7ff;
}

.sequence-explorer-analysis-row.in-view {
  box-shadow: inset 3px 0 rgba(var(--macro-rgb), 0.62);
}

.sequence-explorer-analysis-row.in-view > strong {
  color: #b9eaff;
}

.sequence-explorer-analysis-row.in-view-priority {
  background: linear-gradient(90deg, rgba(var(--macro-rgb), 0.105), rgba(var(--macro-rgb), 0.025));
}

.sequence-explorer-analysis-row.in-view-priority:hover,
.sequence-explorer-analysis-row.in-view-priority.selected {
  background: linear-gradient(90deg, rgba(var(--macro-rgb), 0.2), rgba(var(--macro-rgb), 0.07));
}

.sequence-explorer-analysis-row span:last-child {
  overflow: hidden;
  color: #80949c;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sequence-explorer-analysis-row.orientation-filter-mismatch {
  opacity: 0.16;
  filter: saturate(0.35);
}

.sequence-explorer-analysis-row.orientation-filter-mismatch:hover,
.sequence-explorer-analysis-row.orientation-filter-mismatch:focus-visible {
  opacity: 0.34;
}

.sequence-explorer-analysis-row.piece-inspection-mismatch {
  opacity: 0.1;
  filter: saturate(0.2) brightness(0.72);
}

.sequence-explorer-analysis-row.piece-inspection-mismatch:hover,
.sequence-explorer-analysis-row.piece-inspection-mismatch:focus-visible {
  opacity: 0.34;
}

.sequence-explorer-analysis-row.piece-inspection-match {
  opacity: 1;
  outline: 1px solid rgba(var(--macro-rgb), 0.78);
  outline-offset: -2px;
  background: linear-gradient(90deg, rgba(var(--macro-rgb), 0.25), rgba(var(--macro-rgb), 0.08));
  color: #effbff;
  filter: brightness(1.16) saturate(1.15);
}

.sequence-explorer-analysis-row.target-type {
  outline: 1px solid var(--macro-accent);
  outline-offset: -1px;
}

/* Required-prefix warnings must remain readable even when catalog filters,
   inspection, or persistent dimming hide unrelated pieces elsewhere. */
.sequence-explorer-analysis-row.must-preserve,
.sequence-explorer-analysis-row.must-preserve:hover,
.sequence-explorer-analysis-row.must-preserve:focus-visible {
  opacity: 1;
  filter: none;
}

.sequence-explorer-analysis-row.must-preserve.preserved {
  color: #a8efa3;
  background: rgba(99, 218, 131, 0.065);
}

.sequence-explorer-analysis-row.must-preserve.disturbed {
  color: #ff9d9f;
  background: rgba(255, 80, 94, 0.11);
}

.sequence-explorer-analysis-row.must-preserve:hover,
.sequence-explorer-analysis-row.must-preserve.selected {
  box-shadow: inset 0 0 0 1px currentColor;
}

.sequence-explorer-analysis-row.must-preserve > strong,
.sequence-explorer-analysis-row.must-preserve > span {
  color: inherit;
}

.sequence-explorer-analysis-group.preserve > button {
  color: #a8efa3;
}

.sequence-explorer-analysis-group.preserve.has-disturbance > button {
  color: #ff9d9f;
}

.target-unsettled .sequence-explorer-analysis-group.preserve > button,
.target-unsettled .sequence-explorer-analysis-row.must-preserve {
  color: #9eafb7;
  background: rgba(255, 255, 255, 0.03);
}

button.sequence-explorer-toggle[aria-pressed="true"] {
  border-color: rgba(var(--macro-rgb), 0.48);
  background: rgba(var(--macro-rgb), 0.12);
  box-shadow: 0 0 13px rgba(var(--macro-rgb), 0.13);
  color: #b8eaff;
}

.sequence-explorer-exit-confirmation {
  position: fixed;
  z-index: 1002;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(3, 7, 10, 0.78);
  backdrop-filter: blur(16px);
}

.sequence-explorer-exit-confirmation[hidden] {
  display: none;
}

.sequence-explorer-exit-card {
  width: min(31rem, calc(100vw - 2rem));
  padding: 1.35rem;
  border: 1px solid rgba(84, 204, 255, 0.28);
  border-radius: 15px;
  background: #111519;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58), 0 0 32px rgba(84, 204, 255, 0.07);
}

.sequence-explorer-exit-card p,
.sequence-explorer-exit-card h2,
.sequence-explorer-exit-card span {
  display: block;
  margin: 0;
}

.sequence-explorer-exit-card p {
  color: #54ccff;
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sequence-explorer-exit-card h2 {
  margin-top: 0.25rem;
  color: #effaff;
}

.sequence-explorer-exit-card > span {
  margin-top: 0.72rem;
  color: #99a8ae;
  font-size: 0.76rem;
  line-height: 1.5;
}

.sequence-explorer-exit-card > div {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.macro-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  padding: 0.58rem 0.62rem 0.52rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(110deg, rgba(var(--macro-rgb), 0.08), transparent 58%);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.macro-panel.is-dragging .macro-panel-header {
  cursor: grabbing;
}

.macro-panel-header p,
.macro-editor-heading p {
  margin: 0 0 0.25rem;
  color: var(--macro-accent);
  font-size: 0.54rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.macro-panel-header h2 {
  margin: 0;
  color: #eee8dc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.48rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
}

.macro-window-actions {
  display: flex;
  gap: 0.25rem;
}

.macro-window-actions button {
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
  color: #aaa79d;
}

.macro-window-actions button:hover:not(:disabled) {
  color: #72d7f5;
}

#macro-panel-side[aria-pressed="true"] {
  border-color: rgba(84, 204, 255, 0.4);
  background: rgba(84, 204, 255, 0.1);
  color: #72d7f5;
}

.macro-list {
  grid-row: 4;
  min-height: 0;
  overflow: auto;
  scrollbar-color: rgba(84, 204, 255, 0.3) rgba(255, 255, 255, 0.025);
  scrollbar-width: thin;
}

.macro-list[hidden],
.macro-empty[hidden],
.macro-operation-status[hidden] {
  display: none;
}

.macro-row-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  background: transparent;
  transition: background 110ms ease, box-shadow 110ms ease;
}

.macro-row {
  --macro-color: #54ccff;
  display: grid;
  grid-template-columns: 2.25rem 0.55rem minmax(0, 1fr);
  gap: 0.52rem;
  align-items: center;
  width: 100%;
  min-height: 54px;
  padding: 0.58rem 0.78rem;
  border: 0;
  border-bottom: 0;
  border-radius: 0;
  background: transparent;
  color: #cbc6bb;
  text-align: left;
}

.macro-row-number {
  overflow: hidden;
  color: color-mix(in srgb, var(--macro-color) 72%, #b9c2c4);
  font: 800 0.66rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.macro-row:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.08);
  background: color-mix(in srgb, var(--macro-color) 8%, transparent);
  color: #f2ede2;
}

.macro-row.selected {
  background: linear-gradient(90deg, color-mix(in srgb, var(--macro-color) 20%, transparent), color-mix(in srgb, var(--macro-color) 4%, transparent));
  box-shadow: inset 3px 0 0 var(--macro-color);
  color: #f5f0e6;
}

.macro-row-reorder {
  display: none;
  width: 38px;
  min-width: 38px;
  padding: 0;
  place-items: center;
  border: 0;
  border-left: 1px solid rgba(84, 204, 255, 0.1);
  border-radius: 0;
  background: rgba(84, 204, 255, 0.025);
  color: rgba(112, 213, 255, 0.62);
  font-size: 1rem;
  cursor: grab;
  touch-action: none;
}

.macro-list.reorganizing .macro-row-shell {
  grid-template-columns: minmax(0, 1fr) 38px;
}

.macro-list.reorganizing .macro-row-reorder {
  display: grid;
}

.macro-list.reorganizing .macro-row {
  pointer-events: none;
  cursor: default;
}

.macro-row-reorder:hover:not(:disabled),
.macro-row-reorder:focus-visible {
  background: rgba(84, 204, 255, 0.1);
  color: #8ce3ff;
}

.macro-list.reorder-dragging {
  cursor: grabbing;
  user-select: none;
}

.macro-list.reorder-dragging .macro-row-reorder {
  cursor: grabbing;
}

.macro-row-shell.reorder-dragging {
  position: relative;
  z-index: 2;
  background: rgba(84, 204, 255, 0.1);
  box-shadow: inset 3px 0 0 #70d5ff, 0 5px 18px rgba(0, 0, 0, 0.28);
}

.macro-row-swatch {
  width: 0.52rem;
  height: 1.9rem;
  border-radius: 999px;
  background: var(--macro-color);
  box-shadow: 0 0 12px color-mix(in srgb, var(--macro-color) 45%, transparent);
}

.macro-row-copy {
  min-width: 0;
}

.macro-row-copy strong,
.macro-row-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.macro-row-copy strong {
  font-size: 0.76rem;
  font-weight: 760;
}

.macro-row-copy small {
  margin-top: 0.2rem;
  color: #777a78;
  font: 650 0.57rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}

.macro-empty {
  grid-row: 4;
  display: grid;
  min-height: 0;
  overflow: auto;
  padding: 1.4rem;
  place-content: center;
  align-content: safe center;
  text-align: center;
}

.macro-empty strong {
  color: #cac5bb;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
}

.macro-empty span {
  max-width: 15rem;
  margin-top: 0.42rem;
  color: #74746e;
  font-size: 0.65rem;
  line-height: 1.45;
}

.macro-panel-actions {
  grid-row: 2;
  display: grid;
  gap: 0.45rem;
  padding: 0.62rem 0.7rem 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(7, 7, 8, 0.38);
}

.macro-primary-actions,
.macro-management-actions,
.macro-retirement-actions,
.macro-transfer-actions {
  display: grid;
  gap: 0.35rem;
}

.macro-new-explore {
  width: 100%;
  border-color: rgba(var(--macro-rgb), 0.42);
  background:
    linear-gradient(110deg, rgba(var(--macro-rgb), 0.19), rgba(var(--macro-rgb), 0.075));
  box-shadow: 0 0 18px rgba(var(--macro-rgb), 0.065);
  color: #c9f1ff;
  font-weight: 760;
  letter-spacing: 0.015em;
}

.macro-new-explore:hover:not(:disabled),
.macro-new-explore[aria-pressed="true"] {
  border-color: rgba(var(--macro-rgb), 0.62);
  background:
    linear-gradient(110deg, rgba(var(--macro-rgb), 0.27), rgba(var(--macro-rgb), 0.11));
  box-shadow: 0 0 20px rgba(var(--macro-rgb), 0.11);
  color: #ecfaff;
}

.macro-primary-actions {
  grid-template-columns: 1fr 1fr;
}

.macro-management-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.macro-retirement-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#macro-show-retired[aria-pressed="true"] {
  color: var(--macro-accent);
  border-color: rgba(var(--macro-rgb), 0.5);
  background: rgba(var(--macro-rgb), 0.13);
}

#macro-unretire-all.confirming {
  color: #ffe0a2;
  border-color: #cda860;
  background: rgba(205, 168, 96, 0.12);
}

.macro-row.retired {
  opacity: 0.62;
}

.macro-row.retired:hover,
.macro-row.retired.selected {
  opacity: 1;
}

.macro-quick-slots button.retired,
.quick-macro-grid button.retired {
  filter: saturate(0.25);
}

.macro-transfer-actions {
  grid-template-columns: 1fr 1fr;
}

.macro-panel-actions button {
  min-height: 29px;
  padding: 0.35rem 0.42rem;
  font-size: 0.6rem;
}

.macro-quick-assignment {
  grid-row: 3;
  display: grid;
  gap: 0.42rem;
  padding: 0.52rem 0.7rem 0.58rem;
  border-bottom: 1px solid rgba(84, 204, 255, 0.11);
  background: rgba(84, 204, 255, 0.025);
}

.macro-quick-assignment-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.macro-quick-assignment-heading strong {
  color: #86d9f1;
  font-size: 0.57rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.macro-quick-assignment-heading button {
  min-height: 25px;
  padding: 0.28rem 0.48rem;
  font-size: 0.55rem;
}

#quick-macro-breakout[aria-pressed="true"] {
  border-color: rgba(84, 204, 255, 0.42);
  background: rgba(84, 204, 255, 0.11);
  color: #bceeff;
}

.macro-quick-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.32rem;
}

.macro-quick-slots button {
  --macro-color: #696b6c;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.28rem;
  align-items: center;
  min-width: 0;
  min-height: 30px;
  padding: 0.25rem 0.34rem;
  border-color: color-mix(in srgb, var(--macro-color) 34%, rgba(255, 255, 255, 0.08));
  background: color-mix(in srgb, var(--macro-color) 7%, rgba(255, 255, 255, 0.025));
  color: #858681;
}

.macro-quick-slots button[data-assigned="true"] {
  background: color-mix(in srgb, var(--macro-color) 14%, rgba(7, 7, 9, 0.86));
  color: #d9d7d0;
}

.macro-quick-slots button[aria-pressed="true"] {
  border-color: var(--macro-color);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--macro-color) 45%, transparent),
    0 0 11px color-mix(in srgb, var(--macro-color) 18%, transparent);
}

.macro-quick-slots b {
  color: var(--macro-color);
  font: 850 0.66rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.macro-quick-slots span {
  overflow: hidden;
  font-size: 0.54rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#macro-quick-help {
  overflow: hidden;
  color: #686c6c;
  font-size: 0.53rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.macro-reorganize[aria-pressed="true"] {
  border-color: rgba(84, 204, 255, 0.48);
  background: rgba(84, 204, 255, 0.14);
  box-shadow: 0 0 12px rgba(84, 204, 255, 0.09);
  color: #c7f1ff;
}

.danger-subtle:hover:not(:disabled) {
  border-color: rgba(255, 105, 105, 0.42);
  background: rgba(255, 105, 105, 0.1);
  color: #ffaaaa;
}

.macro-operation-status {
  grid-row: 5;
  display: grid;
  gap: 0.38rem;
  padding: 0.55rem 0.75rem 0.62rem;
  border-top: 1px solid rgba(84, 204, 255, 0.16);
  background: rgba(84, 204, 255, 0.055);
}

.macro-operation-status > div {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  min-width: 0;
}

.macro-operation-status strong {
  overflow: hidden;
  color: #bde9f5;
  font-size: 0.6rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.macro-operation-status div span {
  color: #7798a1;
  font: 600 0.56rem/1 ui-monospace, monospace;
  white-space: nowrap;
}

.macro-operation-status > i {
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
}

.macro-operation-status > i > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #54ccff, #c7ff45);
  transition: width 80ms linear;
}

.macro-operation-status.error {
  border-top-color: rgba(255, 105, 105, 0.2);
  background: rgba(255, 105, 105, 0.055);
}

.macro-operation-status.error strong {
  color: #ffb2b2;
}

.macro-operation-status.error > i > span {
  background: #ff7474;
}

.macro-dock {
  position: absolute;
  z-index: 13;
  top: 68%;
  right: 0;
  display: none;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 0.42rem;
  padding: 0.68rem 0.38rem 0.68rem 0.52rem;
  border-right: 0;
  border-radius: 10px 0 0 10px;
  background: rgba(14, 14, 16, 0.92);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
  color: #aaa79e;
  backdrop-filter: blur(14px);
  touch-action: none;
  transition: right 220ms ease;
}

.macro-dock.visible {
  display: grid;
}

.macro-dock.is-dragging {
  cursor: ns-resize;
}

.macro-dock > span {
  writing-mode: vertical-rl;
  color: #7da5b0;
  font-size: 0.52rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: rotate(180deg);
}

.macro-dock strong {
  display: grid;
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  height: 22px;
  padding: 0;
  overflow: hidden;
  place-items: center;
  border-radius: 999px;
  background: rgba(84, 204, 255, 0.13);
  color: #70d5ff;
  font: 750 0.58rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-overflow: clip;
  white-space: nowrap;
}

.plan-panel {
  position: absolute;
  z-index: 14;
  top: 0;
  right: calc(
    var(--workspace-primary-side-width)
    + var(--workspace-move-history-side-width)
  );
  bottom: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: var(--plan-side-pane-width);
  min-width: 0;
  overflow: hidden;
  border-left: 1px solid rgba(255, 209, 102, 0.2);
  background:
    linear-gradient(145deg, rgba(255, 209, 102, 0.045), transparent 30%),
    rgba(14, 13, 11, 0.988);
  box-shadow: -18px 0 52px rgba(0, 0, 0, 0.3);
  color: #e8e2d6;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(100%);
  transition: right 220ms ease, opacity 150ms ease, transform 220ms ease,
    visibility 150ms ease;
}

.stage.plan-side-open .plan-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

.plan-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 60px;
  padding: 0.58rem 0.62rem 0.52rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(110deg, rgba(255, 209, 102, 0.075), transparent 58%);
}

.plan-panel-header p,
.plan-panel-header h2 {
  margin: 0;
}

.plan-panel-header p {
  margin-bottom: 0.25rem;
  color: #ffd166;
  font-size: 0.54rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.plan-panel-header h2 {
  color: #eee8dc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.48rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
}

.plan-window-actions {
  display: flex;
  gap: 0.25rem;
}

.plan-window-actions button {
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
  color: #aaa79d;
}

.plan-window-actions button:hover:not(:disabled) {
  color: #ffe09a;
}

.plan-panel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  padding: 0.58rem 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(7, 7, 6, 0.38);
}

.plan-panel-actions button,
.plan-note-editor-actions button {
  min-height: 29px;
  padding: 0.35rem 0.45rem;
  font-size: 0.6rem;
}

#plan-reorganize[aria-pressed="true"] {
  border-color: rgba(255, 209, 102, 0.48);
  background: rgba(255, 209, 102, 0.12);
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.08);
  color: #ffe7aa;
}

.plan-note-dialog {
  --note-color: #ffd166;
  position: absolute;
  z-index: 895;
  top: 12px;
  left: 12px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(540px, calc(100vw - 1.6rem));
  max-height: calc(100% - 24px);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--note-color) 42%, transparent);
  border-radius: 13px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--note-color) 5%, transparent), transparent 34%),
    rgba(13, 13, 11, 0.992);
  box-shadow:
    0 18px 55px rgba(0, 0, 0, 0.62),
    0 0 30px color-mix(in srgb, var(--note-color) 8%, transparent);
  color: #eee8dc;
}

.plan-note-dialog[hidden] {
  display: none;
}

.plan-note-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 56px;
  padding: 0.7rem 0.72rem 0.65rem 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--note-color) 18%, transparent);
  background: linear-gradient(110deg, color-mix(in srgb, var(--note-color) 8%, transparent), transparent 62%);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.plan-note-dialog.is-dragging .plan-note-dialog-heading {
  cursor: grabbing;
}

.plan-note-dialog-actions,
.plan-note-dialog-actions button {
  cursor: pointer;
}

.plan-note-dialog-heading > div:first-child {
  display: grid;
  min-width: 0;
  gap: 0.28rem;
}

.plan-note-dialog-heading strong {
  overflow: hidden;
  color: color-mix(in srgb, var(--note-color) 76%, #fff0c9);
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-note-dialog-heading span {
  color: #9d8e6e;
  font: 700 0.54rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}

.plan-note-dialog-actions {
  display: flex;
  gap: 0.3rem;
}

.plan-note-dialog-actions button {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
  color: #b9b2a4;
  font-size: 1rem;
}

.plan-note-dialog-actions button:hover:not(:disabled) {
  color: color-mix(in srgb, var(--note-color) 78%, white);
}

.plan-note-piece-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0.62rem 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--note-color) 14%, transparent);
  background: color-mix(in srgb, var(--note-color) 3.5%, transparent);
}

.plan-note-piece-meta[hidden] {
  display: none;
}

.plan-note-piece-meta > div {
  display: grid;
  gap: 0.24rem;
  min-width: 0;
  text-align: center;
}

.plan-note-piece-meta > div + div {
  border-left: 1px solid rgba(255, 255, 255, 0.075);
}

.plan-note-piece-meta dt {
  color: #827969;
  font-size: 0.48rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plan-note-piece-meta dd {
  margin: 0;
  color: color-mix(in srgb, var(--note-color) 72%, #eee8dc);
  font: 800 0.68rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.plan-note-view {
  min-height: 10rem;
  max-height: calc(100vh - 10rem);
  padding: 1.05rem 1.15rem 1.25rem;
  overflow: auto;
}

.plan-note-view[hidden] {
  display: none;
}

.plan-note-view h3 {
  margin: 0 0 0.85rem;
  color: #f4efe4;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
}

.plan-note-view p {
  margin: 0;
  color: #d2ccc0;
  font-size: 0.76rem;
  line-height: 1.58;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.plan-note-view p.empty {
  color: #777269;
  font-style: italic;
}

.plan-note-editor {
  display: grid;
  gap: 0.55rem;
  max-height: calc(100vh - 10rem);
  padding: 0.9rem 1rem 1rem;
  overflow-y: auto;
  background: color-mix(in srgb, var(--note-color) 3.5%, transparent);
}

.plan-note-editor[hidden] {
  display: none;
}

.plan-note-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3.3rem;
  gap: 0.5rem;
}

.plan-note-fields label,
.plan-note-text-field {
  display: grid;
  gap: 0.25rem;
  color: #8f8879;
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plan-note-fields input[type="text"],
.plan-note-text-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(5, 5, 4, 0.62);
  color: #eee8dc;
  font: 600 0.68rem/1.35 system-ui, sans-serif;
}

.plan-note-fields input[type="text"] {
  height: 31px;
  padding: 0.35rem 0.48rem;
}

.plan-note-color-field input {
  width: 100%;
  height: 31px;
  padding: 2px;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(5, 5, 4, 0.62);
}

.plan-note-text-field textarea {
  min-height: 7.2rem;
  padding: 0.48rem 0.55rem;
  resize: vertical;
  text-transform: none;
}

.plan-note-editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.4rem;
}

.plan-sections {
  min-height: 0;
  overflow-y: auto;
  scrollbar-color: rgba(255, 209, 102, 0.26) transparent;
  scrollbar-width: thin;
}

.plan-section > header {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  padding: 0.42rem 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  background: rgba(17, 16, 13, 0.97);
  color: #b8ac91;
  font-size: 0.57rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.plan-section > header span {
  color: #887c63;
  font: 750 0.56rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.plan-note-list {
  display: grid;
}

.plan-panel [data-plan-piece-type-index] {
  transition: opacity 150ms ease, filter 150ms ease, background-color 150ms ease,
    outline-color 150ms ease;
}

.plan-panel [data-plan-piece-type-index].orientation-filter-mismatch {
  opacity: 0.16;
  filter: saturate(0.3);
}

.plan-panel [data-plan-piece-type-index].piece-inspection-mismatch {
  opacity: 0.1;
  filter: saturate(0.2) brightness(0.72);
}

.plan-panel [data-plan-piece-type-index].orientation-filter-mismatch:hover,
.plan-panel [data-plan-piece-type-index].orientation-filter-mismatch:focus-visible,
.plan-panel [data-plan-piece-type-index].piece-inspection-mismatch:hover,
.plan-panel [data-plan-piece-type-index].piece-inspection-mismatch:focus-visible {
  opacity: 0.34;
}

.plan-panel [data-plan-piece-type-index].piece-inspection-match {
  position: relative;
  z-index: 1;
  opacity: 1;
  outline: 1px solid rgba(255, 209, 102, 0.74);
  outline-offset: -2px;
  background-color: rgba(255, 209, 102, 0.12);
  filter: brightness(1.18) saturate(1.12);
}

.plan-note-row-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.plan-note-row {
  --note-color: #ffd166;
  display: grid;
  grid-template-columns: 2rem 0.52rem minmax(0, 1fr);
  gap: 0.48rem;
  align-items: center;
  min-width: 0;
  min-height: 48px;
  padding: 0.5rem 0.72rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #cbc6bb;
  text-align: left;
}

.plan-note-row:hover:not(:disabled) {
  background: color-mix(in srgb, var(--note-color) 7%, transparent);
}

.plan-note-row.selected {
  background: linear-gradient(90deg, color-mix(in srgb, var(--note-color) 18%, transparent), transparent);
  box-shadow: inset 3px 0 0 var(--note-color);
  color: #f2ede2;
}

.plan-note-number {
  color: color-mix(in srgb, var(--note-color) 72%, #b9b2a4);
  font: 800 0.62rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: right;
}

.plan-note-swatch {
  width: 0.5rem;
  height: 1.65rem;
  border-radius: 999px;
  background: var(--note-color);
  box-shadow: 0 0 10px color-mix(in srgb, var(--note-color) 38%, transparent);
}

.plan-note-label {
  overflow: hidden;
  font-size: 0.68rem;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-note-reorder {
  display: none;
  width: 38px;
  padding: 0;
  place-items: center;
  border: 0;
  border-left: 1px solid rgba(255, 209, 102, 0.1);
  border-radius: 0;
  background: rgba(255, 209, 102, 0.025);
  color: rgba(255, 209, 102, 0.65);
  font-size: 1rem;
  cursor: grab;
  touch-action: none;
}

.plan-sections.reorganizing .plan-note-row-shell {
  grid-template-columns: minmax(0, 1fr) 38px;
}

.plan-sections.reorganizing .plan-note-reorder {
  display: grid;
}

.plan-sections.reorganizing .plan-note-row,
.plan-sections.reorganizing .plan-piece-backlog {
  pointer-events: none;
}

.plan-note-list.reorder-dragging {
  cursor: grabbing;
  user-select: none;
}

.plan-note-row-shell.reorder-dragging {
  position: relative;
  z-index: 2;
  background: rgba(255, 209, 102, 0.09);
  box-shadow: inset 3px 0 0 #ffd166, 0 5px 18px rgba(0, 0, 0, 0.28);
}

.plan-section-empty {
  margin: 0;
  padding: 0.75rem;
  color: #68645b;
  font-size: 0.62rem;
  text-align: center;
}

.plan-section-empty[hidden] {
  display: none;
}

.plan-piece-backlog {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.32rem;
  padding: 0.55rem 0.65rem 0.8rem;
}

.plan-piece-backlog button {
  min-width: 0;
  min-height: 31px;
  padding: 0.34rem 0.45rem;
  overflow: hidden;
  border-color: rgba(255, 209, 102, 0.1);
  background: rgba(255, 209, 102, 0.025);
  color: #8f8879;
  font: 700 0.57rem/1.15 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-piece-backlog button:hover {
  border-color: rgba(255, 209, 102, 0.3);
  background: rgba(255, 209, 102, 0.08);
  color: #e4d7b8;
}

.plan-dock {
  position: absolute;
  z-index: 14;
  top: 80%;
  right: 0;
  display: none;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 0.42rem;
  padding: 0.68rem 0.38rem 0.68rem 0.52rem;
  border-right: 0;
  border-radius: 10px 0 0 10px;
  background: rgba(14, 13, 11, 0.93);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
  color: #aaa79e;
  backdrop-filter: blur(14px);
  touch-action: none;
  transition: right 220ms ease;
}

.plan-dock.visible {
  display: grid;
}

.plan-dock.is-dragging {
  cursor: ns-resize;
}

.plan-dock > span {
  writing-mode: vertical-rl;
  color: #b9a36d;
  font-size: 0.52rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: rotate(180deg);
}

.plan-dock strong {
  display: grid;
  width: 40px;
  min-width: 40px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.13);
  color: #ffe09a;
  font: 750 0.58rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.stage.workspace-side-open .plan-dock {
  right: var(--workspace-side-width);
}

button.plan-toggle[aria-expanded="true"] {
  border-color: rgba(255, 209, 102, 0.42);
  background: rgba(255, 209, 102, 0.1);
  box-shadow: 0 0 12px rgba(255, 209, 102, 0.08);
  color: #ffe2a0;
}

.plan-toggle-icon {
  color: #ffd166;
  font-size: 0.82rem;
}

.quick-macro-panel {
  position: absolute;
  z-index: 14;
  top: 7rem;
  left: calc(50% - 75px);
  display: grid;
  grid-template-rows: auto auto;
  width: 150px;
  overflow: hidden;
  border: 1px solid rgba(84, 204, 255, 0.24);
  border-radius: 14px;
  background: rgba(13, 13, 15, 0.96);
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.46), 0 0 30px rgba(84, 204, 255, 0.045);
  color: #e4ded2;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px) scale(0.97);
  backdrop-filter: blur(18px);
  transition: opacity 130ms ease, transform 150ms ease, visibility 130ms ease;
}

.quick-macro-panel.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.quick-macro-panel.is-dragging .quick-macro-header {
  cursor: grabbing;
}

.quick-undo-panel {
  position: absolute;
  z-index: 14;
  top: 7rem;
  left: calc(50% - 104px);
  width: 208px;
  overflow: hidden;
  border: 1px solid rgba(255, 174, 91, 0.3);
  border-radius: 14px;
  background: rgba(17, 14, 13, 0.96);
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.46), 0 0 30px rgba(255, 174, 91, 0.06);
  color: #eee8dc;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px) scale(0.97);
  backdrop-filter: blur(18px);
  transition: opacity 130ms ease, transform 150ms ease, visibility 130ms ease;
}

.quick-undo-panel.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.quick-undo-panel.is-dragging .quick-undo-header { cursor: grabbing; }

.quick-undo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0.36rem 0.4rem 0.34rem 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  background: linear-gradient(110deg, rgba(255, 174, 91, 0.11), transparent 64%);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.quick-undo-header p {
  margin: 0 0 0.11rem;
  color: #ffbf83;
  font-size: 0.4rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.quick-undo-header h2 {
  margin: 0;
  color: #eee8dc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
}

.quick-undo-header button {
  display: grid;
  width: 22px;
  height: 22px;
  padding: 0;
  place-items: center;
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
  color: #aaa79d;
}

.quick-undo-header button:hover:not(:disabled) { color: #ffc182; }

.quick-undo-target {
  justify-content: space-between;
  padding: 0.38rem 0.42rem 0;
}

.quick-undo-target select {
  width: 143px;
  min-width: 0;
}

.quick-undo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.32rem;
  padding: 0.42rem;
}

.quick-undo-grid button {
  min-width: 0;
  padding: 0.48rem 0.25rem;
  border: 1px solid rgba(255, 174, 91, 0.21);
  border-radius: 8px;
  background: rgba(255, 174, 91, 0.07);
  color: #f5deca;
  font-size: 0.68rem;
  white-space: nowrap;
}

.quick-undo-grid button:hover:not(:disabled) {
  border-color: rgba(255, 174, 91, 0.6);
  background: rgba(255, 174, 91, 0.18);
}

#quick-undo-cert > span:first-child {
  color: #c7ff45;
}

.quick-macro-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0.36rem 0.4rem 0.34rem 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
  background: linear-gradient(110deg, rgba(84, 204, 255, 0.09), transparent 64%);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.quick-macro-header p {
  margin: 0 0 0.11rem;
  color: #65cceb;
  font-size: 0.4rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.quick-macro-header h2 {
  margin: 0;
  color: #eee8dc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
}

.quick-macro-header button {
  display: grid;
  width: 22px;
  height: 22px;
  padding: 0;
  place-items: center;
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
  color: #aaa79d;
}

.quick-macro-header button:hover:not(:disabled) {
  color: #72d7f5;
}

.quick-macro-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.32rem;
  padding: 0.42rem;
}

.quick-macro-grid button {
  --macro-color: #5d6062;
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  align-content: center;
  justify-items: center;
  aspect-ratio: 1;
  min-width: 0;
  padding: 0.34rem 0.28rem 0.24rem;
  border-color: rgba(255, 255, 255, 0.075);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: #55595a;
  box-shadow: inset 0 0 0 1px transparent;
}

.quick-macro-grid button[data-assigned="true"] {
  border-color: color-mix(in srgb, var(--macro-color) 62%, rgba(255, 255, 255, 0.1));
  background: linear-gradient(145deg,
    color-mix(in srgb, var(--macro-color) 43%, #17171a),
    color-mix(in srgb, var(--macro-color) 18%, #0d0d0f));
  color: #fff;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--macro-color) 24%, transparent),
    0 8px 22px color-mix(in srgb, var(--macro-color) 13%, transparent);
}

.quick-macro-grid button[data-assigned="true"]:hover:not(:disabled) {
  border-color: var(--macro-color);
  background: linear-gradient(145deg,
    color-mix(in srgb, var(--macro-color) 55%, #1b1b1e),
    color-mix(in srgb, var(--macro-color) 24%, #0d0d0f));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--macro-color) 45%, transparent),
    0 9px 26px color-mix(in srgb, var(--macro-color) 22%, transparent);
  transform: translateY(-1px);
}

.quick-macro-grid button.is-applying {
  animation: quick-macro-pulse 720ms ease-in-out infinite alternate;
}

.quick-macro-grid .quick-macro-slot-key {
  position: absolute;
  top: 0.22rem;
  left: 0.28rem;
  color: color-mix(in srgb, var(--macro-color) 62%, #777b7c);
  font: 800 0.46rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.quick-macro-grid .quick-macro-number {
  display: block;
  max-width: 100%;
  overflow: hidden;
  font: 750 1.02rem/1 Georgia, "Times New Roman", serif;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.36);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-macro-grid .quick-macro-name {
  display: block;
  width: 100%;
  margin-top: 0.16rem;
  overflow: hidden;
  color: color-mix(in srgb, currentColor 82%, #9ca1a1);
  font: 750 0.47rem/1.1 system-ui, sans-serif;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes quick-macro-pulse {
  from { filter: brightness(0.92); }
  to { filter: brightness(1.26); }
}

.macro-editor-dialog {
  position: fixed;
  z-index: 895;
  top: 5.5rem;
  left: calc(50% - 285px);
  width: min(570px, calc(100vw - 1.6rem));
  max-height: calc(100vh - 6.5rem);
}

.macro-editor-dialog[hidden] {
  display: none;
}

.macro-editor-card {
  width: 100%;
  max-height: inherit;
  overflow: auto;
  padding: 1.12rem 1.25rem 1.05rem;
  border: 1px solid rgba(84, 204, 255, 0.34);
  border-radius: 13px;
  background: rgba(13, 16, 18, 0.985);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.62), 0 0 30px rgba(84, 204, 255, 0.07);
}

.macro-editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -0.3rem -0.35rem 0.75rem;
  padding: 0.3rem 0.35rem;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.macro-editor-dialog.is-dragging .macro-editor-heading {
  cursor: grabbing;
}

.cyclic-forms-dialog {
  --cyclic-rgb: 84, 204, 255;
  position: fixed;
  z-index: 896;
  top: 5.5rem;
  left: calc(50% - 260px);
  width: min(520px, calc(100vw - 1.6rem));
  max-height: calc(100vh - 2rem);
}

.cyclic-forms-dialog[hidden] {
  display: none;
}

.cyclic-forms-card {
  display: grid;
  grid-template-rows: auto auto auto auto auto auto;
  width: 100%;
  max-height: inherit;
  overflow: hidden;
  border: 1px solid rgba(var(--cyclic-rgb), 0.36);
  border-radius: 13px;
  background: rgba(11, 15, 18, 0.985);
  box-shadow: 0 20px 62px rgba(0, 0, 0, 0.66), 0 0 34px rgba(var(--cyclic-rgb), 0.08);
}

.cyclic-forms-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem 0.72rem;
  border-bottom: 1px solid rgba(var(--cyclic-rgb), 0.13);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.cyclic-forms-dialog.is-dragging .cyclic-forms-heading {
  cursor: grabbing;
}

.cyclic-forms-heading p,
.cyclic-forms-heading h2 {
  margin: 0;
}

.cyclic-forms-heading p {
  color: rgb(var(--cyclic-rgb));
  font-size: 0.56rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.cyclic-forms-heading h2 {
  margin-top: 0.15rem;
  color: #eefaff;
  font: 500 1.45rem/1.05 Georgia, "Times New Roman", serif;
}

.cyclic-forms-heading button {
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  padding: 0;
  color: #9ccddd;
  font-size: 1.15rem;
}

.cyclic-forms-navigation {
  display: flex;
  flex: none;
  gap: 0.35rem;
}

.cyclic-forms-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  min-width: 0;
  padding: 0.62rem 1rem 0.58rem;
}

.cyclic-forms-summary > div {
  display: grid;
  min-width: 0;
  gap: 0.16rem;
}

.cyclic-forms-summary strong {
  color: #dff7ff;
  font-size: 0.74rem;
}

.cyclic-forms-summary > div span {
  overflow: hidden;
  color: #748c94;
  font-size: 0.57rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cyclic-forms-summary label {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.35rem;
  color: #728b94;
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cyclic-forms-summary select {
  width: 9.5rem;
  min-width: 0;
  padding: 0.3rem 1.5rem 0.3rem 0.45rem;
  border: 1px solid rgba(var(--cyclic-rgb), 0.22);
  border-radius: 7px;
  outline: none;
  background: #11191d;
  color: #caeaf4;
  font-size: 0.58rem;
  text-transform: none;
}

.cyclic-forms-summary select:focus-visible {
  border-color: rgba(var(--cyclic-rgb), 0.62);
}

.cyclic-forms-progress {
  display: grid;
  gap: 0.32rem;
  padding: 0 1rem 0.7rem;
}

.cyclic-forms-progress[hidden] {
  display: none;
}

.cyclic-forms-progress > div {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  color: #71909a;
  font-size: 0.55rem;
}

.cyclic-forms-progress strong {
  color: #9ed9eb;
  font-weight: 750;
}

.cyclic-forms-progress i {
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(var(--cyclic-rgb), 0.1);
}

.cyclic-forms-progress i span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: rgb(var(--cyclic-rgb));
  box-shadow: 0 0 10px rgba(var(--cyclic-rgb), 0.7);
  transition: width 90ms linear;
}

.cyclic-forms-list {
  position: relative;
  height: 52px;
  max-height: 260px;
  overflow: auto;
  border-block: 1px solid rgba(255, 255, 255, 0.065);
  outline: none;
  background: rgba(0, 0, 0, 0.19);
  scrollbar-color: rgba(var(--cyclic-rgb), 0.28) rgba(255, 255, 255, 0.025);
}

.cyclic-forms-list[hidden] {
  display: none;
}

.cyclic-forms-list:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(var(--cyclic-rgb), 0.48);
}

.cyclic-forms-list-space {
  position: relative;
  min-height: 100%;
}

.cyclic-form-row {
  position: absolute;
  left: 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 1rem;
  align-items: center;
  width: 100%;
  height: 52px;
  padding: 0.42rem 0.85rem;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.047);
  border-radius: 0;
  background: transparent;
  color: #aeb8ba;
  text-align: left;
}

.cyclic-form-row:hover,
.cyclic-form-row[aria-selected="true"] {
  background: rgba(var(--cyclic-rgb), 0.075);
}

.cyclic-form-row[aria-selected="true"] {
  box-shadow: inset 3px 0 0 rgb(var(--cyclic-rgb));
  color: #e7f8fc;
}

.cyclic-form-row.is-extended {
  color: #817f7b;
}

.cyclic-form-row.is-extended[aria-selected="true"] {
  color: #d8e6e8;
}

.cyclic-form-identity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.22rem;
  white-space: nowrap;
}

.cyclic-form-row code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cyclic-form-identity b {
  color: inherit;
  font-size: 0.67rem;
}

.cyclic-form-identity small {
  color: #70848a;
  font: 650 0.52rem/1.15 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.cyclic-form-row.is-extended .cyclic-form-identity small {
  color: #987d60;
}

.cyclic-form-row code {
  color: #a8cbd5;
  font-size: 0.61rem;
}

.cyclic-forms-error {
  margin: 0;
  padding: 0 1rem 0.62rem;
  color: #ff9b9b;
  font-size: 0.6rem;
}

.cyclic-forms-error[hidden] {
  display: none;
}

.cyclic-forms-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.72rem 1rem 0.82rem;
  border-top: 1px solid rgba(var(--cyclic-rgb), 0.11);
}

.cyclic-forms-actions > span {
  max-width: 19rem;
  color: #697a7f;
  font-size: 0.56rem;
  line-height: 1.35;
}

.cyclic-forms-actions > div {
  display: flex;
  gap: 0.45rem;
  flex: none;
}

.cyclic-forms-actions button {
  min-height: 31px;
  padding: 0.38rem 0.68rem;
  font-size: 0.6rem;
}

#cyclic-forms-use {
  border-color: rgba(var(--cyclic-rgb), 0.46);
  background: rgba(var(--cyclic-rgb), 0.16);
  color: #dff8ff;
}

#cyclic-forms-copy.copied {
  border-color: rgba(var(--cyclic-rgb), 0.48);
  color: #dff8ff;
}

.macro-editor-heading h2 {
  margin: 0;
  color: #edf8fc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 500;
}

.macro-editor-heading > span {
  color: rgba(112, 213, 255, 0.46);
  font-size: 1.25rem;
  transform: rotate(90deg);
}

.macro-editor-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 0.75rem;
}

.macro-editor-card label > span,
.macro-coordinate-mode legend,
.macro-syntax-mode legend {
  display: block;
  margin-bottom: 0.38rem;
  color: #aaaead;
  font-size: 0.59rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.macro-editor-card input[type="text"],
.macro-editor-card textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  outline: none;
  background: rgba(255, 255, 255, 0.045);
  color: #e6e2d9;
}

.macro-editor-card input[type="text"] {
  height: 38px;
  padding: 0.55rem 0.7rem;
}

.macro-editor-card input[type="color"] {
  width: 100%;
  height: 38px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.macro-coordinate-mode,
.macro-syntax-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0.8rem 0;
  padding: 0;
  border: 0;
}

.macro-coordinate-mode legend {
  grid-column: 1 / -1;
}

.macro-syntax-mode legend {
  grid-column: 1 / -1;
}

.macro-coordinate-mode label,
.macro-syntax-mode label {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.08rem 0.48rem;
  padding: 0.52rem 0.62rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.macro-coordinate-mode input,
.macro-syntax-mode input {
  grid-row: 1 / 3;
  align-self: center;
  accent-color: #54ccff;
}

.macro-coordinate-mode label > span,
.macro-syntax-mode label > span {
  margin: 0;
  color: #d4d0c7;
  font-size: 0.68rem;
}

.macro-coordinate-mode small,
.macro-syntax-mode small {
  color: #717b7e;
  font-size: 0.56rem;
}

.macro-coordinate-mode label:has(input:checked),
.macro-syntax-mode label:has(input:checked) {
  border-color: rgba(84, 204, 255, 0.42);
  background: rgba(84, 204, 255, 0.08);
}

.macro-syntax-mode {
  margin-top: -0.18rem;
}

.macro-syntax-mode > p {
  grid-column: 1 / -1;
  margin: -0.12rem 0 0;
  color: #718087;
  font-size: 0.58rem;
  line-height: 1.35;
}

.macro-anchor-tools {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: -0.15rem 0 0.75rem;
}

.macro-anchor-tools > button {
  flex: none;
  padding: 0.4rem 0.6rem;
  font-size: 0.62rem;
}

.macro-anchor-tools > span {
  min-width: 0;
  color: #718087;
  font-size: 0.6rem;
  line-height: 1.3;
}

.macro-editor-card textarea {
  min-height: 135px;
  max-height: min(34vh, 330px);
  padding: 0.75rem 0.85rem;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
  line-height: 1.48;
}

.macro-editor-card input:focus,
.macro-editor-card textarea:focus {
  border-color: rgba(84, 204, 255, 0.62);
  box-shadow: 0 0 0 3px rgba(84, 204, 255, 0.09);
}

.macro-editor-card textarea[aria-invalid="true"] {
  border-color: rgba(255, 105, 105, 0.58);
}

.macro-editor-feedback {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  min-height: 1.2rem;
  margin-top: 0.45rem;
  color: #718087;
  font-size: 0.62rem;
}

.macro-editor-feedback strong {
  color: #a9ddef;
  white-space: nowrap;
}

.macro-editor-error {
  margin: 0.35rem 0 0;
  color: #ff9c9c;
  font: 0.66rem/1.4 ui-monospace, monospace;
}

.macro-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

button.scramble-seed {
  display: block;
  max-width: 11.5rem;
  margin: 0.28rem 0 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(199, 255, 69, 0.72);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  line-height: 1.25;
  text-align: left;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
  cursor: copy;
}

button.scramble-seed[hidden] {
  display: none;
}

button.scramble-seed:hover:not(:disabled) {
  border-color: transparent;
  background: transparent;
  color: var(--lime);
}

.solve-timers {
  display: grid;
  gap: 0.16rem;
  margin: 0.48rem 0 0;
  padding: 0.42rem 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  font-variant-numeric: tabular-nums;
}

.solve-timers[hidden],
.solve-timers .total-time-row[hidden] {
  display: none;
}

.solve-timers div {
  display: grid;
  grid-template-columns: minmax(3.3rem, 1fr) auto;
  align-items: baseline;
  gap: 0.85rem;
}

.solve-timers dt,
.solve-timers dd {
  margin: 0;
}

.solve-timers dt {
  color: #77756f;
  font-size: 0.52rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.solve-timers dd {
  color: #c9c4b9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.62rem;
  font-weight: 700;
}

.solve-timers .total-time-row {
  margin-top: 0.18rem;
  padding-top: 0.28rem;
  border-top: 1px solid rgba(199, 255, 69, 0.12);
}

.solve-timers .total-time-row dt,
.solve-timers .total-time-row dd {
  color: var(--lime);
}

.solve-completion {
  position: fixed;
  z-index: 880;
  inset: 0;
  display: grid;
  padding: 3rem;
  place-items: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(199, 255, 69, 0.12), transparent 31rem),
    rgba(5, 5, 5, 0.9);
  backdrop-filter: blur(16px);
}

.move-text-dialog {
  position: fixed;
  z-index: 890;
  top: clamp(4.75rem, 10vh, 7rem);
  right: clamp(0.8rem, 2.5vw, 2.5rem);
  width: min(600px, calc(100vw - 1.6rem));
  max-height: calc(100vh - clamp(5.55rem, 12vh, 8rem));
}

.move-text-dialog[hidden] {
  display: none;
}

.move-text-dialog-card {
  width: 100%;
  max-height: inherit;
  overflow: auto;
  padding: 1.25rem 1.35rem 1.15rem;
  border: 1px solid rgba(84, 204, 255, 0.36);
  border-radius: 13px;
  background: rgba(13, 16, 18, 0.985);
  box-shadow:
    0 18px 55px rgba(0, 0, 0, 0.62),
    0 0 30px rgba(84, 204, 255, 0.075);
}

.move-text-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: -0.35rem -0.45rem 0;
  padding: 0.35rem 0.45rem;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.move-text-dialog.is-dragging .move-text-dialog-heading {
  cursor: grabbing;
}

.move-text-dialog-drag-mark {
  color: rgba(112, 213, 255, 0.46);
  font-size: 1.25rem;
  line-height: 1;
  transform: rotate(90deg);
}

.move-text-dialog-eyebrow {
  margin: 0 0 0.5rem;
  color: #70d5ff;
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.move-text-dialog h2 {
  margin: 0;
  color: #edf8fc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  font-weight: 400;
  letter-spacing: -0.035em;
}

.move-text-dialog-intro {
  margin: 0.45rem 0 0.9rem;
  color: #89969d;
  font-size: 0.78rem;
  line-height: 1.55;
}

.move-text-anchor-tools {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 0.85rem;
}

.move-text-anchor-tools > button {
  flex: 0 0 auto;
  padding: 0.42rem 0.65rem;
  font-size: 0.65rem;
}

.move-text-anchor-tools > span {
  min-width: 0;
  color: #718087;
  font-size: 0.63rem;
  line-height: 1.35;
}

.move-text-anchor-a,
.move-text-anchor-b {
  display: inline-grid;
  width: 1.18rem;
  height: 1.18rem;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1;
}

.move-text-anchor-a {
  color: #42fff0;
  background: rgba(66, 255, 240, 0.1);
}

.move-text-anchor-b {
  color: #ff55bd;
  background: rgba(255, 85, 189, 0.1);
}

.move-text-dialog code {
  color: #b9dce9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.move-text-dialog label {
  display: block;
  margin-bottom: 0.45rem;
  color: #aaaead;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.move-text-dialog textarea {
  display: block;
  width: 100%;
  min-height: 165px;
  max-height: min(40vh, 400px);
  padding: 0.9rem 1rem;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  outline: none;
  background: rgba(255, 255, 255, 0.045);
  color: #e6e2d9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  tab-size: 2;
}

.move-text-dialog textarea:focus {
  border-color: rgba(84, 204, 255, 0.62);
  box-shadow: 0 0 0 3px rgba(84, 204, 255, 0.09);
}

.move-text-dialog textarea[aria-invalid="true"] {
  border-color: rgba(255, 105, 105, 0.58);
  box-shadow: 0 0 0 3px rgba(255, 105, 105, 0.08);
}

.move-text-dialog-feedback {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  min-height: 1.2rem;
  margin-top: 0.55rem;
  color: #6f7c82;
  font-size: 0.65rem;
}

.move-text-dialog-feedback strong {
  color: #a9ddef;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  white-space: nowrap;
}

.move-text-dialog button.move-text-inverse-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  margin: 0.45rem 0 0;
  padding: 0.4rem 0.62rem;
  color: #b8c5ca;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.move-text-inverse-toggle small {
  color: #69777d;
  font-size: 0.59rem;
  font-weight: 550;
  letter-spacing: 0;
  text-transform: none;
}

.move-text-dialog button.move-text-inverse-toggle[aria-pressed="true"] small {
  color: #a7ca79;
}

.move-text-dialog-error {
  margin: 0.5rem 0 0;
  color: #ff9c9c;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  line-height: 1.45;
}

.move-text-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 0.9rem;
}

.move-text-dialog-shortcut {
  margin-right: auto;
  color: #69777d;
  font-size: 0.61rem;
  white-space: nowrap;
}

.move-text-dialog-shortcut kbd {
  padding: 0.08rem 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.045);
  color: #a4b3b9;
  font: inherit;
}

.move-text-dialog.applying textarea,
.move-text-dialog.applying .move-text-dialog-feedback,
.move-text-dialog.applying .move-text-inverse-toggle {
  opacity: 0.55;
}

.pause-screen {
  position: fixed;
  z-index: 870;
  inset: 0;
  display: grid;
  overflow: hidden;
  padding: 3rem;
  isolation: isolate;
  place-items: center;
  background:
    radial-gradient(circle at 50% 43%, rgba(0, 119, 255, 0.14), transparent 31rem),
    #010409;
}

.pause-screen[hidden] {
  display: none;
}

.app-shell.pause-underlay-hidden {
  visibility: hidden;
}

.pause-screen::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    radial-gradient(circle at 50% 45%, transparent 12%, rgba(0, 4, 12, 0.12) 58%, rgba(0, 2, 8, 0.68) 100%),
    repeating-linear-gradient(
      to bottom,
      rgba(117, 215, 255, 0.018) 0,
      rgba(117, 215, 255, 0.018) 1px,
      transparent 1px,
      transparent 4px
    );
  content: "";
  pointer-events: none;
}

.pause-screen::after {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 112vw;
  height: 2px;
  border-radius: 50%;
  background: rgba(224, 251, 255, 0.98);
  box-shadow:
    0 0 5px 2px rgba(220, 250, 255, 1),
    0 0 18px 7px rgba(91, 210, 255, 0.95),
    0 0 62px 20px rgba(0, 132, 255, 0.72),
    0 0 150px 48px rgba(0, 83, 255, 0.32);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scaleX(0.001) scaleY(0.15);
  transform-origin: center;
}

.pause-screen.pentagon-rain-warming::before {
  animation: pause-crt-field-warmup 20s linear both;
}

.pause-screen.pentagon-rain-warming::after {
  animation: pause-crt-sync-warmup 20s linear both;
}

.pause-pentagon-rain {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  pointer-events: none;
  will-change: opacity;
}

@keyframes pause-crt-field-warmup {
  0%,
  3% {
    opacity: 0.08;
    filter: brightness(0.45);
  }

  8% {
    opacity: 1;
    filter: brightness(2.8);
  }

  16% {
    opacity: 0.42;
    filter: brightness(1.4);
  }

  30%,
  100% {
    opacity: 1;
    filter: brightness(1);
  }
}

@keyframes pause-crt-sync-warmup {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scaleX(0.001) scaleY(0.15);
  }

  3% {
    opacity: 1;
    transform: translate(-50%, -50%) scaleX(0.012) scaleY(8);
  }

  9% {
    opacity: 1;
    transform: translate(-50%, -50%) scaleX(0.98) scaleY(2.2);
  }

  16% {
    opacity: 0.88;
    transform: translate(-50%, -50%) scaleX(1) scaleY(0.72);
  }

  20% {
    opacity: 0.22;
    transform: translate(-50%, -50%) scaleX(1) scaleY(0.42);
  }

  22% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 48vh)) scaleX(1) scaleY(0.3);
  }

  23% {
    opacity: 0.42;
    transform: translate(-50%, calc(-50% - 48vh)) scaleX(1) scaleY(0.3);
  }

  49% {
    opacity: 0.22;
    transform: translate(-50%, calc(-50% + 48vh)) scaleX(1) scaleY(0.24);
  }

  50% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 48vh)) scaleX(1) scaleY(0.24);
  }

  51% {
    opacity: 0.38;
    transform: translate(-50%, calc(-50% - 48vh)) scaleX(1) scaleY(0.24);
  }

  70% {
    opacity: 0.2;
    transform: translate(-50%, calc(-50% + 48vh)) scaleX(1) scaleY(0.18);
  }

  71% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 48vh)) scaleX(1) scaleY(0.18);
  }

  72% {
    opacity: 0.32;
    transform: translate(-50%, calc(-50% - 48vh)) scaleX(1) scaleY(0.18);
  }

  86% {
    opacity: 0.17;
    transform: translate(-50%, calc(-50% + 48vh)) scaleX(1) scaleY(0.15);
  }

  87% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 48vh)) scaleX(1) scaleY(0.15);
  }

  88% {
    opacity: 0.27;
    transform: translate(-50%, calc(-50% - 48vh)) scaleX(1) scaleY(0.15);
  }

  97% {
    opacity: 0.12;
    transform: translate(-50%, calc(-50% + 48vh)) scaleX(1) scaleY(0.1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 50vh)) scaleX(1) scaleY(0.1);
  }
}

.pause-screen-card {
  position: relative;
  z-index: 2;
  width: min(500px, calc(100vw - 6rem));
  padding: clamp(2.3rem, 5vw, 3.8rem);
  border: 1px solid rgba(var(--app-rgb), 0.44);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(8, 22, 36, 0.88), rgba(3, 10, 19, 0.92));
  box-shadow:
    0 34px 100px rgba(0, 0, 0, 0.75),
    0 0 52px rgba(var(--app-rgb), 0.19),
    inset 0 0 36px rgba(var(--app-rgb), 0.045);
  text-align: center;
  -webkit-backdrop-filter: blur(13px) saturate(0.78);
  backdrop-filter: blur(13px) saturate(0.78);
}

.pause-screen-eyebrow {
  margin: 0 0 0.65rem;
  color: var(--app-accent-bright);
  font-size: var(--brand-eyebrow-size);
  font-weight: var(--brand-eyebrow-weight);
  letter-spacing: var(--brand-eyebrow-spacing);
  line-height: 1.3;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(var(--app-rgb), 0.16);
}

.pause-screen h2 {
  margin: 0;
  color: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 7vw, 5.2rem);
  font-weight: 400;
  letter-spacing: -0.04em;
}

.pause-screen-card > p:not(.pause-screen-eyebrow) {
  margin: 1rem 0 1.8rem;
  color: #8e9da5;
  font-size: 0.82rem;
}

.pause-screen-card > button {
  min-width: 9rem;
  border-color: rgba(var(--app-rgb), 0.52);
  background: rgba(var(--app-rgb), 0.17);
  box-shadow: 0 0 18px rgba(var(--app-rgb), 0.1);
  color: #e1eaff;
}

.pause-screen-card > small {
  display: block;
  margin-top: 1rem;
  color: #66747b;
  font-size: 0.66rem;
}

.pause-screen kbd {
  padding: 0.08rem 0.32rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #acbbc2;
  font: inherit;
  font-weight: 800;
}

.solve-completion[hidden] {
  display: none;
}

.solve-completion-card {
  width: min(680px, calc(100vw - 6rem));
  max-height: calc(100vh - 5rem);
  overflow: auto;
  padding: clamp(2.2rem, 4vw, 3.4rem);
  border: 1px solid rgba(199, 255, 69, 0.42);
  border-radius: 18px;
  background: rgba(16, 18, 13, 0.97);
  box-shadow:
    0 34px 100px rgba(0, 0, 0, 0.68),
    0 0 38px rgba(199, 255, 69, 0.1);
  text-align: center;
}

.solve-completion-eyebrow {
  margin: 0 0 0.65rem;
  color: var(--lime);
  font-size: 0.63rem;
  font-weight: 850;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.solve-completion h2 {
  margin: 0 0 1.8rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 4vw, 3.25rem);
  font-weight: 400;
  letter-spacing: -0.03em;
}

.solve-completion-headlines {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem;
  align-items: end;
}

.solve-completion-total span,
.solve-completion-total strong {
  display: block;
}

.solve-completion-total span {
  color: #85847c;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.solve-completion-total strong {
  margin-top: 0.25rem;
  color: var(--lime);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 650;
  letter-spacing: -0.04em;
  text-shadow: 0 0 18px rgba(199, 255, 69, 0.2);
}

#solve-completion-ftm {
  overflow-wrap: anywhere;
}

.solve-completion-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 1.8rem 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.085);
}

.solve-completion-breakdown div {
  padding: 0.85rem 1rem;
  background: rgba(16, 18, 13, 0.98);
}

.solve-completion-breakdown dt,
.solve-completion-breakdown dd {
  margin: 0;
}

.solve-completion-breakdown dt {
  color: #7f7e76;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.solve-completion-breakdown dd {
  margin-top: 0.25rem;
  color: #ddd7cb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  font-weight: 700;
}

.solve-completion-statistics {
  margin: 0 0 1.8rem;
  text-align: left;
}

.solve-completion-statistics h3,
.solve-metric-group h4 {
  margin: 0;
  color: #98978e;
  font-size: 0.6rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.solve-completion-statistics > h3 {
  margin-bottom: 0.65rem;
  color: var(--lime);
}

#solve-completion-statistics {
  display: grid;
  gap: 0.75rem;
}

.solve-metric-group {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.solve-metric-group h4 {
  padding: 0.62rem 0.8rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
}

.solve-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.solve-metric-row {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.46rem 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.solve-metric-row:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.solve-metric-row span {
  min-width: 0;
  color: #8b8a82;
  font-size: 0.65rem;
  line-height: 1.25;
}

.solve-metric-row strong {
  flex: none;
  color: #e2ddd2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.73rem;
}

.solve-metric-group.totals {
  border-color: rgba(var(--app-rgb), 0.22);
}

.solve-metric-group.totals h4 {
  color: var(--app-accent-bright);
}

.solve-metric-group.solving {
  border-color: rgba(var(--move-journal-rgb), 0.2);
}

.solve-metric-group.solving h4 {
  color: var(--move-journal-accent);
}

.solve-metric-group.scratchpad {
  border-color: rgba(255, 59, 210, 0.2);
}

.solve-metric-group.scratchpad h4 {
  color: #ff66dc;
}

.solve-metric-group.explorer {
  border-color: rgba(var(--macro-rgb), 0.22);
}

.solve-metric-group.explorer h4 {
  color: var(--macro-accent);
}

@media (max-width: 700px) {
  .solve-metric-grid {
    grid-template-columns: 1fr;
  }

  .solve-metric-row:nth-last-child(2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  }
}

.unified-transfer-dialog {
  position: fixed;
  z-index: 905;
  inset: 0;
  display: grid;
  padding: 1.5rem;
  place-items: center;
  background: rgba(5, 9, 16, 0.86);
  backdrop-filter: blur(14px);
}

.unified-transfer-dialog[hidden],
.unified-transfer-file[hidden],
.unified-transfer-warning[hidden],
.unified-transfer-error[hidden] {
  display: none;
}

.unified-transfer-parts [data-transfer-status][hidden] {
  display: none;
}

.unified-transfer-card {
  width: min(560px, calc(100vw - 3rem));
  max-height: calc(100vh - 3rem);
  overflow: auto;
  padding: clamp(1.5rem, 3vw, 2.3rem);
  border: 1px solid rgba(var(--app-rgb), 0.42);
  border-radius: 16px;
  background: #151b27;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7), 0 0 40px rgba(var(--app-rgb), 0.1);
}

.unified-transfer-eyebrow {
  margin: 0 0 0.35rem;
  color: var(--app-accent-bright);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.unified-transfer-card h2 {
  margin: 0 0 0.4rem;
  font: 400 2rem/1.1 Georgia, "Times New Roman", serif;
}

.unified-transfer-card > p:not(.unified-transfer-eyebrow) {
  color: #aeb9ca;
  font-size: 0.84rem;
  line-height: 1.45;
}

.unified-transfer-file {
  overflow-wrap: anywhere;
  color: #d8e6ff !important;
}

.unified-transfer-parts {
  display: grid;
  gap: 0.45rem;
  margin: 1.25rem 0;
}

.unified-transfer-parts label {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
}

.unified-transfer-parts label:has(input:checked) {
  border-color: rgba(var(--app-rgb), 0.52);
  background: rgba(var(--app-rgb), 0.105);
}

.unified-transfer-parts label:has(input:disabled) {
  opacity: 0.52;
  cursor: not-allowed;
}

.unified-transfer-parts input {
  flex: 0 0 auto;
  accent-color: var(--app-accent);
}

.unified-transfer-parts strong,
.unified-transfer-parts small {
  display: block;
}

.unified-transfer-parts strong {
  font-size: 0.88rem;
}

.unified-transfer-parts small {
  margin-top: 0.15rem;
  color: #9ba6b7;
  font-size: 0.72rem;
}

.unified-transfer-parts [data-transfer-status] {
  color: #ffcf88;
}

.unified-transfer-card .unified-transfer-warning {
  color: #ffcf88 !important;
}

.unified-transfer-card .unified-transfer-error {
  color: #ff9da1 !important;
}

.unified-transfer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.35rem;
}

.reset-confirmation {
  position: fixed;
  z-index: 900;
  inset: 0;
  display: grid;
  padding: 3rem;
  place-items: center;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 77, 84, 0.12), transparent 30rem),
    rgba(5, 5, 5, 0.92);
  backdrop-filter: blur(16px);
}

.reset-confirmation[hidden],
.reset-confirmation-step[hidden] {
  display: none;
}

.reset-confirmation-card {
  width: min(560px, calc(100vw - 6rem));
  padding: clamp(2rem, 4vw, 3.2rem);
  border: 1px solid rgba(255, 94, 101, 0.48);
  border-radius: 18px;
  background: rgba(19, 15, 15, 0.97);
  box-shadow:
    0 34px 100px rgba(0, 0, 0, 0.68),
    0 0 36px rgba(255, 70, 78, 0.12);
}

.reset-confirmation-eyebrow {
  margin: 0 0 0.65rem;
  color: #ff7c82;
  font-size: 0.63rem;
  font-weight: 850;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.reset-confirmation h2 {
  margin: 0 0 1rem;
  color: #f1e9df;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.02;
}

.reset-confirmation p:not(.reset-confirmation-eyebrow) {
  margin: 0;
  color: #aaa39c;
  font-size: 0.9rem;
  line-height: 1.65;
}

.candidate-delete-confirmation p strong,
.macro-delete-confirmation p strong {
  color: #ffd1d3;
  font-variant-numeric: tabular-nums;
}

.reset-confirmation code {
  color: #ff9da1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
}

.reset-confirmation label,
.reset-confirmation small {
  display: block;
}

.reset-confirmation label {
  margin: 1.55rem 0 0.45rem;
  color: #d8d0c6;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reset-confirmation input {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  outline: none;
  background: rgba(255, 255, 255, 0.055);
  color: var(--paper);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1rem;
}

.reset-confirmation input:focus {
  border-color: rgba(255, 94, 101, 0.68);
  box-shadow: 0 0 0 3px rgba(255, 94, 101, 0.11);
}

.reset-confirmation small {
  margin-top: 0.48rem;
  color: #77716d;
  font-size: 0.68rem;
}

.reset-confirmation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 2rem;
}

button.danger {
  border-color: rgba(255, 94, 101, 0.5);
  background: rgba(255, 74, 82, 0.15);
  color: #ffb5b8;
}

button.danger:hover:not(:disabled) {
  border-color: rgba(255, 112, 118, 0.8);
  background: rgba(255, 74, 82, 0.24);
  color: #ffe1e2;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 13px rgba(199, 255, 69, 0.7);
}

.status-dot.unsolved {
  background: #ff765f;
  box-shadow: 0 0 13px rgba(255, 118, 95, 0.65);
}

.face-chip {
  position: absolute;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.48rem;
  padding: 0.42rem 0.56rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(10, 10, 9, 0.88);
  color: #eee9de;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transform: translateY(12px) scale(0.96);
  transition: opacity 90ms ease, transform 90ms ease;
}

.face-chip.visible {
  opacity: 1;
  transform: translateY(12px) scale(1);
}

#face-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
}

.face-arrow {
  color: var(--muted);
  font-size: 0.85rem;
}

.sticker-match-legend {
  position: absolute;
  z-index: 60;
  bottom: calc(var(--projection-tray-height) + var(--key-hints-height) + 1rem);
  left: 50%;
  display: flex;
  gap: 1rem;
  padding: 0.55rem 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(10, 10, 9, 0.88);
  color: #b3b1a9;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 5px);
  transition: left 220ms ease, opacity 90ms ease, transform 90ms ease;
}

.sticker-match-legend.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sticker-match-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  white-space: nowrap;
}

.sticker-match-piece-type {
  color: #eee9de;
  white-space: nowrap;
}

.sticker-match-legend .piece-highlight-copy {
  display: none;
}

.sticker-match-legend.piece-mode .sticker-match-copy {
  display: none;
}

.sticker-match-legend.piece-mode .piece-highlight-copy {
  display: inline-flex;
}

.sticker-match-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.match-lime {
  background: #a6ff29;
  box-shadow: 0 0 8px rgba(166, 255, 41, 0.55);
}

.match-magenta {
  background: #ff3db8;
  box-shadow: 0 0 8px rgba(255, 61, 184, 0.5);
}

.piece-cyan {
  background: #29efff;
  box-shadow: 0 0 8px rgba(41, 239, 255, 0.55);
}

.instructions {
  position: absolute;
  z-index: 5;
  right: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem 1.2rem;
  max-width: none;
  min-height: 2.6rem;
  padding: 0.48rem clamp(1.25rem, 3vw, 3rem) 0.58rem;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  background: linear-gradient(180deg, rgba(15, 15, 14, 0.9), rgba(9, 9, 8, 0.97));
  color: #7f7e77;
  font-size: 0.67rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  pointer-events: none;
  transition: right 220ms ease, opacity 120ms ease;
}

.instructions > span {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.instructions > span:not(:last-child)::after {
  position: absolute;
  top: 50%;
  right: -0.6rem;
  color: rgba(164, 162, 153, 0.48);
  content: "·";
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  transform: translate(50%, -52%);
}

.stage.key-hints-hidden .instructions {
  opacity: 0;
  visibility: hidden;
}

.stage.workspace-side-open .main-view,
.stage.workspace-side-open .projection-tray-backdrop,
.stage.workspace-side-open .projection-tray {
  right: var(--workspace-side-width);
}

.stage.workspace-side-open .projection-tray {
  padding-bottom: 0.75rem;
}

.stage.workspace-side-open .instructions {
  right: var(--workspace-side-width);
}

.stage.workspace-side-open .empty-selection-hint,
.stage.workspace-side-open .sticker-match-legend {
  left: calc((100% - var(--workspace-side-width)) / 2);
}

.color-scheme-panel {
  position: absolute;
  z-index: 9;
  top: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: var(--color-scheme-pane-width);
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(circle at 82% 2%, rgba(199, 255, 69, 0.055), transparent 26%),
    linear-gradient(160deg, rgba(27, 27, 25, 0.995), rgba(12, 12, 11, 0.995));
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.34);
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%);
  transition: opacity 160ms ease, transform 220ms ease;
  visibility: hidden;
}

.stage.color-scheme-open .color-scheme-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
  visibility: visible;
}

.color-scheme-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.35rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.color-scheme-header p,
.color-scheme-header h2 {
  margin: 0;
}

.color-scheme-header p {
  margin-bottom: 0.26rem;
  color: var(--lime);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.color-scheme-header h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.72rem;
  font-weight: 400;
  letter-spacing: -0.025em;
}

button.color-scheme-close {
  display: grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: #8e8c84;
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
}

.color-scheme-intro {
  margin: 0;
  padding: 0.9rem 1.35rem 0.45rem;
  color: #8f8d85;
  font-size: 0.68rem;
  line-height: 1.45;
}

.color-scheme-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 0.55rem;
  overflow-y: auto;
  padding: 0.55rem 1.35rem 1rem;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  scrollbar-width: thin;
}

.face-color-entry {
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.face-color-heading,
.face-color-inputs {
  display: flex;
  align-items: center;
}

.face-color-heading {
  gap: 0.42rem;
  min-width: 0;
  margin-bottom: 0.52rem;
}

.face-color-letter {
  display: grid;
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  color: #c5c1b7;
  font-size: 0.56rem;
  font-weight: 800;
}

.face-color-name {
  overflow: hidden;
  color: #d6d0c3;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.face-color-inputs {
  gap: 0.42rem;
}

.face-color-picker {
  flex: 0 0 auto;
  width: 34px;
  height: 30px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.22);
  cursor: pointer;
}

.face-color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.face-color-picker::-webkit-color-swatch {
  border: 0;
  border-radius: 4px;
}

.face-color-picker::-moz-color-swatch {
  border: 0;
  border-radius: 4px;
}

.face-color-hex {
  min-width: 0;
  width: 100%;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  padding: 0 0.45rem;
  outline: 0;
  background: rgba(0, 0, 0, 0.22);
  color: #bbb8af;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.62rem;
  text-transform: uppercase;
}

.face-color-hex:focus {
  border-color: rgba(199, 255, 69, 0.55);
  box-shadow: 0 0 0 2px rgba(199, 255, 69, 0.09);
}

.face-color-hex[aria-invalid="true"] {
  border-color: rgba(255, 95, 90, 0.7);
  color: #ff8a84;
}

.color-scheme-footer {
  padding: 0.9rem 1.35rem 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.color-scheme-footer button {
  width: 100%;
}

.piece-inventory {
  position: absolute;
  z-index: 9;
  top: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: var(--inventory-pane-width);
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(circle at 80% 2%, rgba(199, 255, 69, 0.055), transparent 26%),
    linear-gradient(160deg, rgba(27, 27, 25, 0.995), rgba(12, 12, 11, 0.995));
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.34);
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%);
  transition: opacity 160ms ease, transform 220ms ease;
  visibility: hidden;
}

.stage.inventory-open .piece-inventory {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
  visibility: visible;
}

.piece-inventory-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  height: max-content;
  min-height: 60px;
  padding: 0.58rem 0.62rem 0.52rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(110deg, rgba(199, 255, 69, 0.065), transparent 54%);
}

.piece-inventory-header p,
.piece-inventory-header h2 {
  margin: 0;
}

.piece-inventory-header p {
  margin: 0 0 0.25rem;
  color: var(--lime);
  font-size: 0.54rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.piece-inventory-header h2 {
  margin: 0;
  color: #eee8dc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.48rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.42);
}

.piece-inventory-window-actions {
  display: flex;
  flex: 0 0 auto;
  margin-left: auto;
  gap: 0.3rem;
}

.piece-inventory-window-actions button {
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border-color: rgba(255, 255, 255, 0.09);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: #aaa79d;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1;
}

.piece-inventory-window-actions button:hover:not(:disabled) {
  border-color: rgba(199, 255, 69, 0.32);
  background: rgba(199, 255, 69, 0.07);
  color: var(--lime);
}

.piece-inventory-window-actions .piece-inventory-undim-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  width: auto;
  padding: 0 0.5rem;
  border-color: rgba(199, 255, 69, 0.24);
  background: rgba(199, 255, 69, 0.07);
  color: var(--lime);
  font-size: 0.65rem;
  font-weight: 750;
  white-space: nowrap;
}

.piece-inventory-undim-all svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
}

.piece-inventory-undim-all circle {
  fill: currentColor;
  stroke: none;
}

.piece-inventory-dock {
  position: absolute;
  z-index: 11;
  top: 62%;
  right: 0;
  display: none;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 0.42rem;
  min-width: 0;
  padding: 0.68rem 0.38rem 0.68rem 0.52rem;
  border-right: 0;
  border-radius: 10px 0 0 10px;
  background: rgba(14, 14, 13, 0.92);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
  color: #aaa79e;
  backdrop-filter: blur(14px);
  touch-action: none;
  transition: right 220ms ease;
}

.piece-inventory-dock.visible {
  display: grid;
}

.piece-inventory-dock.is-dragging {
  cursor: ns-resize;
}

.piece-inventory-dock > span {
  writing-mode: vertical-rl;
  color: #9caf6e;
  font-size: 0.52rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: rotate(180deg);
}

.piece-inventory-dock strong {
  display: grid;
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  height: 22px;
  padding: 0;
  overflow: hidden;
  place-items: center;
  border-radius: 999px;
  background: rgba(199, 255, 69, 0.13);
  color: var(--lime);
  font: 750 0.58rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-overflow: clip;
  white-space: nowrap;
}

.piece-inventory-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 0.65rem;
  row-gap: 0.35rem;
  padding: 0.75rem 1.35rem 0.55rem;
}

.piece-inventory-summary > div {
  padding: 0.72rem 0.82rem;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.piece-inventory-summary strong,
.piece-inventory-summary span {
  display: block;
}

.piece-inventory-summary strong {
  color: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.32rem;
  font-weight: 400;
}

.piece-inventory-summary span {
  margin-top: 0.08rem;
  color: #7f7e77;
  font-size: 0.56rem;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.piece-inventory-summary p {
  grid-column: 1 / -1;
  margin: 0.08rem 0 0;
  color: #77766f;
  font-size: 0.65rem;
  line-height: 1.5;
}

.piece-inventory-summary > .piece-catalog-orientation-filter {
  grid-column: 1 / 3;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.65rem;
}

.piece-inventory-summary > .piece-catalog-completion-filter {
  grid-column: 3 / -1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.32rem;
  padding: 0.45rem 0.52rem;
}

.piece-catalog-orientation-filter > span,
.piece-catalog-completion-filter > span {
  flex: 0 0 auto;
  margin: 0;
}

#piece-catalog-orientation-filter-buttons {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 0.28rem;
}

#piece-catalog-completion-filter-buttons {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.22rem;
}

button.piece-catalog-orientation-filter-button {
  display: grid;
  min-width: 1.65rem;
  height: 1.55rem;
  padding: 0 0.38rem;
  place-items: center;
  border-color: rgba(199, 255, 69, 0.2);
  border-radius: 5px;
  background: rgba(199, 255, 69, 0.045);
  color: #a9bf78;
  font: 800 0.58rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

button.piece-catalog-orientation-filter-button:hover:not(:disabled),
button.piece-catalog-orientation-filter-button:focus-visible {
  border-color: rgba(199, 255, 69, 0.54);
  background: rgba(199, 255, 69, 0.12);
  color: #e1ff9e;
}

button.piece-catalog-orientation-filter-button.selected {
  border-color: rgba(199, 255, 69, 0.8);
  background: rgba(199, 255, 69, 0.2);
  box-shadow: 0 0 10px rgba(199, 255, 69, 0.16);
  color: #efffc9;
}

#piece-catalog-completion-filter-buttons button {
  min-width: 0;
  height: 1.32rem;
  padding: 0 0.32rem;
  border-color: rgba(199, 255, 69, 0.2);
  border-radius: 5px;
  background: rgba(199, 255, 69, 0.045);
  color: #a9bf78;
  font-size: 0.56rem;
  font-weight: 800;
}

#piece-catalog-completion-filter-buttons button:hover:not(:disabled),
#piece-catalog-completion-filter-buttons button:focus-visible {
  border-color: rgba(199, 255, 69, 0.54);
  background: rgba(199, 255, 69, 0.12);
  color: #e1ff9e;
}

#piece-catalog-completion-filter-buttons button.selected {
  border-color: rgba(199, 255, 69, 0.8);
  background: rgba(199, 255, 69, 0.2);
  box-shadow: 0 0 10px rgba(199, 255, 69, 0.16);
  color: #efffc9;
}

.piece-catalog-index {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(1.45rem, 1fr));
  gap: 0.25rem;
  margin-top: 0.08rem;
}

button.piece-catalog-index-button {
  display: grid;
  min-width: 0;
  height: 1.42rem;
  padding: 0;
  place-items: center;
  border-color: rgba(199, 255, 69, 0.2);
  border-radius: 4px;
  background: rgba(199, 255, 69, 0.045);
  color: #a9bf78;
  font: 750 0.52rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

button.piece-catalog-index-button:hover:not(:disabled),
button.piece-catalog-index-button:focus-visible {
  border-color: rgba(199, 255, 69, 0.62);
  background: rgba(199, 255, 69, 0.16);
  box-shadow: 0 0 9px rgba(199, 255, 69, 0.16);
  color: #dcff91;
}

button.piece-catalog-index-button.piece-type-complete {
  border-color: rgba(199, 255, 69, 0.94);
  background: var(--lime);
  box-shadow: 0 0 8px rgba(199, 255, 69, 0.2);
  color: #11150b;
  font-weight: 900;
}

button.piece-catalog-index-button.piece-type-complete:hover,
button.piece-catalog-index-button.piece-type-complete:focus-visible {
  border-color: #efffc9;
  background: #dcff89;
  box-shadow: 0 0 11px rgba(199, 255, 69, 0.36);
  color: #0d1008;
}

button.piece-catalog-index-button.catalog-filter-mismatch:not(.piece-type-complete) {
  border-color: rgba(199, 255, 69, 0.07);
  background: rgba(199, 255, 69, 0.012);
  box-shadow: none;
  color: #4c5141;
}

button.piece-catalog-index-button.catalog-filter-mismatch.piece-type-complete {
  border-color: rgba(159, 202, 57, 0.56);
  background: #526723;
  box-shadow: none;
  color: #0d1008;
}

button.piece-catalog-index-button.catalog-filter-mismatch:hover,
button.piece-catalog-index-button.catalog-filter-mismatch:focus-visible {
  border-color: rgba(199, 255, 69, 0.42);
  background: rgba(199, 255, 69, 0.09);
  color: #a9bd7c;
}

button.piece-catalog-index-button.catalog-filter-mismatch.piece-type-complete:hover,
button.piece-catalog-index-button.catalog-filter-mismatch.piece-type-complete:focus-visible {
  border-color: rgba(199, 255, 69, 0.8);
  background: #748f31;
  color: #0d1008;
}

button.piece-catalog-index-button.orientation-filter-mismatch:not(.piece-type-complete) {
  border-color: rgba(199, 255, 69, 0.025);
  background: rgba(199, 255, 69, 0.004);
  color: #292d23;
}

button.piece-catalog-index-button.orientation-filter-mismatch.piece-type-complete {
  border-color: rgba(125, 161, 42, 0.34);
  background: #26310e;
  color: #070905;
}

button.piece-catalog-index-button.orientation-filter-mismatch:not(.piece-type-complete):hover,
button.piece-catalog-index-button.orientation-filter-mismatch:not(.piece-type-complete):focus-visible {
  border-color: rgba(199, 255, 69, 0.22);
  background: rgba(199, 255, 69, 0.045);
  color: #727d5d;
}

button.piece-catalog-index-button.orientation-filter-mismatch.piece-type-complete:hover,
button.piece-catalog-index-button.orientation-filter-mismatch.piece-type-complete:focus-visible {
  border-color: rgba(157, 200, 52, 0.55);
  background: #3d4e17;
  color: #080a05;
}

.piece-inventory-list {
  min-height: 0;
  overflow-y: auto;
  padding: 0.25rem 0 1rem;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  scrollbar-width: thin;
}

.piece-type-entry {
  padding: 0.86rem 1.35rem 0.92rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
}

.piece-type-heading {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: baseline;
  column-gap: 0.62rem;
}

.piece-type-identity {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  font-weight: 500;
}

.piece-type-identity strong {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.piece-type-name-shell {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 0.3rem;
}

.piece-type-name {
  min-width: 0;
  overflow: hidden;
  color: #bbb9ae;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.piece-type-name-shell.custom .piece-type-name {
  color: #d4e5aa;
}

button.piece-type-name-edit {
  flex: 0 0 auto;
  min-width: 1.35rem;
  min-height: 1.35rem;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: rgba(199, 255, 69, 0.68);
  font-size: 0.82rem;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.04rem);
  transition: opacity 120ms ease, border-color 120ms ease, background 120ms ease;
}

.piece-type-entry:hover button.piece-type-name-edit,
button.piece-type-name-edit:focus-visible,
.piece-type-name-shell:focus-within button.piece-type-name-edit,
.piece-type-name-shell.unnamed:hover button.piece-type-name-edit {
  opacity: 1;
  pointer-events: auto;
}

button.piece-type-name-edit:hover:not(:disabled),
button.piece-type-name-edit:focus-visible {
  border-color: rgba(199, 255, 69, 0.32);
  background: rgba(199, 255, 69, 0.08);
  color: #eaffb8;
}

.piece-type-name-editor {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(3rem, 1fr) repeat(3, 1.35rem);
  gap: 0.18rem;
}

.piece-type-name-editor[hidden] {
  display: none;
}

.piece-type-heading.editing-name {
  grid-template-columns: max-content minmax(0, 1fr);
}

.piece-type-heading.editing-name .piece-type-signatures {
  display: none;
}

.piece-type-name-editor input {
  min-width: 0;
  height: 1.45rem;
  padding: 0.15rem 0.32rem;
  border: 1px solid rgba(199, 255, 69, 0.32);
  border-radius: 4px;
  outline: none;
  background: rgba(5, 8, 3, 0.86);
  color: #eef8d8;
  font: 650 0.66rem/1.1 Inter, system-ui, sans-serif;
}

.piece-type-name-editor input:focus {
  border-color: rgba(199, 255, 69, 0.72);
  box-shadow: 0 0 0 2px rgba(199, 255, 69, 0.08);
}

.piece-type-name-editor button {
  min-width: 1.35rem;
  min-height: 1.35rem;
  padding: 0;
  border-color: rgba(199, 255, 69, 0.18);
  background: rgba(199, 255, 69, 0.045);
  color: #bccb9b;
  font-size: 0.66rem;
  line-height: 1;
}

.piece-type-signatures {
  display: grid;
  justify-items: end;
  gap: 0.15rem;
}

.piece-type-signatures span {
  display: flex;
  align-items: baseline;
  gap: 0.38rem;
}

.piece-type-signatures b {
  color: var(--lime);
  font-size: 0.52rem;
  letter-spacing: 0.08em;
}

.piece-type-signatures code {
  color: #7e7d76;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.59rem;
  letter-spacing: 0.09em;
}

.piece-type-catalog-row {
  display: grid;
  grid-template-columns: repeat(3, max-content) minmax(3.2rem, 1fr);
  align-items: baseline;
  column-gap: 0.72rem;
  margin-top: 0.34rem;
  padding: 0.38rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.018);
  color: #96948c;
  font-size: 0.59rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.piece-type-catalog-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 0.38rem;
}

.piece-type-protection-controls {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1.9rem;
  gap: 0.25rem;
  margin-top: 0.34rem;
}

.piece-type-protection-controls button.piece-protection-toggle,
.piece-type-protection-controls button.piece-dimming-toggle {
  min-height: 1.55rem;
}

button.piece-type-catalog-row {
  width: 100%;
  font-weight: 400;
  letter-spacing: 0;
  text-align: left;
}

button.piece-type-catalog-row:hover:not(:disabled) {
  border-color: rgba(199, 255, 69, 0.28);
  background: rgba(199, 255, 69, 0.07);
  color: #c8c5bb;
}

button.piece-type-catalog-row.selected,
button.piece-type-catalog-row.selected:hover:not(:disabled) {
  border-color: rgba(199, 255, 69, 0.68);
  background: rgba(199, 255, 69, 0.13);
  color: #f1f7df;
  box-shadow: 0 0 11px rgba(199, 255, 69, 0.09);
}

.piece-type-hand-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.38rem;
  margin-top: 0.38rem;
}

button.piece-type-hand-control {
  min-width: 0;
  padding: 0.3rem 0.5rem;
  border-color: rgba(199, 255, 69, 0.14);
  border-radius: 5px;
  background: rgba(199, 255, 69, 0.035);
  color: #a6a49b;
  font-size: 0.61rem;
  font-weight: 850;
}

button.piece-type-hand-control:hover:not(:disabled) {
  border-color: rgba(199, 255, 69, 0.32);
  background: rgba(199, 255, 69, 0.075);
  color: #d5d2c8;
}

button.piece-type-hand-control.selected,
button.piece-type-hand-control.selected:hover:not(:disabled) {
  border-color: rgba(199, 255, 69, 0.78);
  background: rgba(199, 255, 69, 0.16);
  color: #eaffb8;
  box-shadow: 0 0 10px rgba(199, 255, 69, 0.12);
}

.piece-type-entry.selected .piece-type-identity,
.piece-type-entry.selected .piece-type-name {
  color: #eaffb8;
}

.piece-type-catalog-metric {
  display: grid;
  grid-template-columns: 3ch max-content;
  align-items: baseline;
  column-gap: 0.22em;
}

.piece-type-catalog-metric-number {
  width: 3ch;
  text-align: right;
}

.piece-type-catalog-metric-unit {
  color: rgba(199, 255, 69, 0.72);
  font-weight: 800;
}

.piece-type-catalog-solved {
  min-width: 3.8rem;
  color: #ffb066;
  font-weight: 800;
  text-align: right;
}

.piece-type-catalog-row.complete .piece-type-catalog-solved {
  color: var(--lime);
}

.piece-type-projection-heading {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.42rem;
  margin-top: 0.5rem;
  color: #77766f;
  font-size: 0.53rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

button.piece-type-projections-toggle {
  display: grid;
  width: 1.38rem;
  min-width: 1.38rem;
  height: 1.38rem;
  padding: 0;
  place-items: center;
  border-color: rgba(199, 255, 69, 0.18);
  border-radius: 5px;
  background: rgba(199, 255, 69, 0.035);
  color: #a9bf78;
  font: 800 0.82rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

button.piece-type-projections-toggle:hover:not(:disabled),
button.piece-type-projections-toggle:focus-visible {
  border-color: rgba(199, 255, 69, 0.5);
  background: rgba(199, 255, 69, 0.11);
  color: #e2ff9f;
}

.piece-type-projections {
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
  margin-top: 0.35rem;
}

.piece-type-projections[hidden] {
  display: none;
}

button.piece-type-projection {
  padding: 0.25rem 0.42rem;
  border: 1px solid rgba(199, 255, 69, 0.16);
  border-radius: 5px;
  background: rgba(199, 255, 69, 0.045);
  color: #b9b6aa;
  font-size: 0.57rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.25;
  text-align: left;
}

button.piece-type-projection:hover:not(:disabled) {
  border-color: rgba(199, 255, 69, 0.46);
  background: rgba(199, 255, 69, 0.11);
  color: #ece7dc;
}

.instructions > span {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

kbd {
  min-width: 22px;
  padding: 0.17rem 0.32rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: #a5a39c;
  font-family: inherit;
  font-size: 0.58rem;
  text-align: center;
}

.mouse-icon {
  position: relative;
  width: 10px;
  height: 14px;
  border: 1px solid currentColor;
  border-radius: 5px;
}

.mouse-icon::after {
  position: absolute;
  top: 2px;
  left: 50%;
  width: 1px;
  height: 3px;
  background: currentColor;
  content: "";
  transform: translateX(-50%);
}

.webgl-error {
  position: absolute;
  z-index: 20;
  inset: 50% auto auto 50%;
  width: min(90vw, 360px);
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #1d1d1b;
  text-align: center;
  transform: translate(-50%, -50%);
}

.webgl-error strong,
.webgl-error span {
  display: block;
}

.webgl-error span {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 1600px) {
  .topbar {
    gap: 1rem;
  }

  .actions {
    gap: 0.32rem;
  }

  .actions button {
    padding-right: 0.6rem;
    padding-left: 0.6rem;
  }

  .control-group-panels #piece-inventory-toggle {
    width: 70px;
    padding-right: 0.42rem;
    padding-left: 0.42rem;
  }

  .actions #undo span:first-child,
  .actions #redo span:first-child {
    display: inline;
  }

  .actions #undo span:last-child,
  .actions #redo span:last-child,
  #view-snap span,
  #sticker-guides span,
  #turn-convention-label,
  #move-history-toggle > span:last-child,
  #macro-toggle > span:last-child,
  #candidate-toggle > span:last-child,
  #piece-inventory-toggle > span,
  #plan-toggle > span:last-child,
  #manual-certify span:last-child,
  #undo-to-certification span:last-child,
  #status-card-toggle > span,
  #pause > span,
  #auto-pause > span,
  #key-hints-toggle > span:last-child {
    display: none;
  }

  #view-snap {
    justify-content: center;
  }

  .pause-toggle-icon {
    margin-right: 0;
  }

  .global-view-controls {
    --view-slider-min-width: 6.75rem;
    gap: 0.55rem;
    padding-right: 0.48rem;
    padding-left: 0.48rem;
  }

  #color-scheme-toggle > span {
    display: none;
  }
}

@media (max-width: 1400px) {
  .topbar {
    gap: 0.5rem;
  }

  .mark {
    width: 82px;
    height: 48px;
  }
}

@media (max-width: 1240px) {
  :root {
    --topbar-height: 168px;
  }

  .topbar {
    gap: 0.5rem;
    padding-right: 4.25rem;
    padding-left: 1.25rem;
  }

  .actions {
    flex-wrap: wrap;
    align-content: center;
  }

  .mark {
    width: 64px;
    height: 44px;
  }

  .actions button {
    padding-right: 0.6rem;
    padding-left: 0.6rem;
  }

  .global-view-controls {
    gap: 0.38rem;
    padding-right: 0.38rem;
    padding-left: 0.38rem;
  }

  .sticker-guide-controls select {
    min-width: 76px;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
.session-save-status {
  /* Reserve the longest label ("Not saved") through every save transition. */
  flex: 0 0 9ch;
  width: 9ch;
  font-size: 0.7rem;
  color: #9fbcae;
  text-align: center;
  white-space: nowrap;
}
.session-save-status[data-state="pending"] { color: #c7c2a7; }
.session-save-status[data-state="error"] { color: #ff898f; }
.persistence-warning {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgb(8 11 18 / 95%);
}
.persistence-warning[hidden] { display: none; }
.persistence-warning > div {
  max-width: 36rem;
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: 1.5rem;
  border: 1px solid #e8717b;
  border-radius: 0.8rem;
  background: #141d2b;
  color: #e8eef6;
}
.persistence-warning h2 { color: #ff929b; }
#persistence-warning-detail { overflow-wrap: anywhere; }

/* Credits run as a self-contained alternate pause screen. The wireframe and
   CRT pass live in its canvas; typography stays crisp in the DOM above it. */
.credits-screen {
  position: fixed;
  z-index: 910;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  color: #eaf5ff;
  background: #01050c;
}
.credits-screen[hidden] { display: none; }
#credits-canvas,
.credits-atmosphere {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.credits-atmosphere {
  z-index: 1;
  background:
    linear-gradient(90deg, #020713 0%, rgb(2 7 19 / 96%) 24%, rgb(2 7 19 / 82%) 45%, rgb(2 7 19 / 34%) 66%, transparent 84%),
    radial-gradient(ellipse at 69% 49%, transparent 10%, rgb(0 7 20 / 45%) 68%, #01040b 100%),
    repeating-linear-gradient(to bottom, rgb(95 190 255 / 2.1%) 0 1px, transparent 1px 4px);
}
.credits-screen::after {
  position: absolute;
  z-index: 3;
  inset: 0;
  border: 12px solid rgb(1 5 14 / 72%);
  border-radius: 2.6% / 4%;
  box-shadow: inset 0 0 5rem rgb(0 1 7 / 72%);
  content: "";
  pointer-events: none;
}
.credits-header,
.credits-footer {
  position: absolute;
  z-index: 4;
  right: clamp(1.5rem, 4vw, 4rem);
  left: clamp(1.5rem, 4vw, 4rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transform: translateZ(0);
}
.credits-header { top: clamp(1.3rem, 3vw, 3rem); }
.credits-footer { bottom: clamp(1.4rem, 3vw, 3rem); }
.credits-kicker {
  display: block;
  color: #8dbeef;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-shadow: 0 0 13px rgb(67 157 255 / 31%);
}
.credits-header h2 {
  margin: 0.3rem 0 0;
  color: #d9ebff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2.4vw, 2.1rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  text-shadow: 0 0 22px rgb(48 124 234 / 47%);
}
.credits-screen button {
  position: relative;
  z-index: 5;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0.38rem;
  border: 1px solid rgb(113 180 249 / 43%);
  border-radius: 0.45rem;
  color: #d6e9ff;
  background: rgb(6 22 43 / 78%);
  box-shadow: 0 0 15px rgb(60 146 255 / 10%);
  font-size: 1.1rem;
  line-height: 1;
}
.credits-screen button:hover,
.credits-screen button:focus-visible {
  border-color: #a4d7ff;
  background: #133859;
  box-shadow: 0 0 18px rgb(75 183 255 / 40%);
}
.credits-screen button:focus-visible { outline: 2px solid #c8eeff; outline-offset: 3px; }
#credits-close { padding-inline: 0.85rem; font-size: 0.84rem; font-weight: 700; letter-spacing: 0.04em; }
.credits-card {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: clamp(1.5rem, 8vw, 10rem);
  width: min(39rem, 52vw);
  transform: translateY(-50%);
  text-shadow: 0 2px 12px #010815, 0 0 28px rgb(9 113 242 / 33%);
}
.credits-card::before {
  display: block;
  width: clamp(5rem, 9vw, 9rem);
  height: 2px;
  margin-bottom: clamp(1.3rem, 3vw, 2.8rem);
  background: #79ccff;
  box-shadow: 0 0 18px #4eb9ff, 0 0 40px #2c81ff;
  content: "";
}
.credits-overline {
  display: block;
  margin-bottom: 0.65rem;
  color: #8fc4f6;
  font-size: clamp(0.85rem, 1.45vw, 1.18rem);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.credits-name {
  display: block;
  max-width: 100%;
  color: #f2f8ff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 6.3vw, 6.8rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1.02;
  overflow-wrap: break-word;
  text-shadow: 0 0 10px rgb(177 225 255 / 54%), 0 0 50px rgb(44 132 253 / 54%);
}
.credits-card-long-name .credits-name {
  max-width: 17ch;
  font-size: clamp(2.1rem, 4.3vw, 4.6rem);
  letter-spacing: -0.035em;
}
.credits-message {
  max-width: 34rem;
  margin: 1.45rem 0 0;
  border-left: 2px solid rgb(114 191 255 / 77%);
  padding-left: 1.1rem;
  color: #bdd5ef;
  font-size: clamp(0.95rem, 1.55vw, 1.25rem);
  line-height: 1.55;
}
.credits-card-playing { animation: credits-signal-reveal 6s both; }
@keyframes credits-signal-reveal {
  0% { opacity: 0; clip-path: inset(47% 0 48% 0); filter: brightness(3) blur(10px); transform: translate(-1.5rem, -50%) scaleX(1.12); }
  4% { opacity: 1; clip-path: inset(47% 0 48% 0); filter: brightness(3.4) blur(2px); transform: translate(0.4rem, -50%) scaleX(1.04); }
  11% { clip-path: inset(0 0 0 0); filter: brightness(1.55) blur(0); transform: translate(0, -50%) scaleX(1); }
  16%, 77% { opacity: 1; clip-path: inset(0 0 0 0); filter: brightness(1); transform: translate(0, -50%) scaleX(1); }
  84% { opacity: 0.9; clip-path: inset(0 0 0 0); filter: brightness(1.45); transform: translate(0, -50%) scaleX(1); }
  91% { opacity: 0.75; clip-path: inset(46% 0 48% 0); filter: brightness(3) blur(1px); transform: translate(0.75rem, -50%) scaleX(1.06); }
  100% { opacity: 0; clip-path: inset(48% 0 49% 0); filter: brightness(4) blur(5px); transform: translate(2rem, -50%) scaleX(1.2); }
}
.credits-prototype-label {
  color: #849fb9;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}
.credits-navigation { display: flex; align-items: center; gap: 0.5rem; }
.credits-count {
  min-width: 4.9rem;
  margin-left: 0.55rem;
  color: #b9dafa;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}
.credits-progress {
  position: absolute;
  z-index: 4;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgb(87 165 255 / 15%);
}
.credits-progress::after {
  display: block;
  width: var(--credits-progress, 0%);
  height: 100%;
  background: #7cccff;
  box-shadow: 0 0 13px #67bcff, 0 0 25px #287bff;
  content: "";
}
@media (max-width: 750px) {
  .credits-atmosphere { background: linear-gradient(0deg, #020713 4%, rgb(2 7 19 / 66%) 38%, transparent 90%); }
  .credits-card { top: 63%; left: 7vw; width: 86vw; }
  .credits-prototype-label { max-width: 35vw; line-height: 1.35; }
}
@media (prefers-reduced-motion: reduce) {
  .credits-card-playing { animation: none; }
}
