@charset "UTF-8";
/*
    IMPORTANT: This is the source file for the editor styles.
    - Edit THIS FILE (editor.scss), not editor.css
    - editor.css is auto-generated from this SCSS file
    - Changes to editor.css will be overwritten
*/
/**
 * Level Editor Styles Hub
 * Imports all component files for modular architecture
 */
/**
 * Design Tokens
 * All CSS custom properties for the editor
 * Organized by category: layout → colors → spacing → typography → components
 */
:root {
  --sidebar-width: 300px;
  --font-mono: 'ND Mono VF', 'Courier New', monospace;
  --font-sans: 'ND Kern VF', 'Futura';
  --font-tracking: 0.025;
  --easing: cubic-bezier(0.645, 0.045, 0.355, 1);
  --color-darker: #131314;
  --color-darkenize: rgba(12, 12, 12, 0.5);
  --color-dark: rgba(23, 23, 25, 1);
  --color-darkish: rgba(23, 23, 26, 0.5);
  --color-darken: rgba(12, 21, 27, 0.65);
  --color-softdark: rgba(12, 21, 27, 0.1);
  --color-bgdark: rgba(12, 21, 27, 0.02);
  --color-mid: rgba(67, 67, 69, 1);
  --color-midlow: rgba(36, 36, 39, 1);
  --color-midlowest: rgba(28, 28, 31, 1);
  --color-midlower: rgba(43, 43, 46, 1);
  --color-lighter: rgba(234, 233, 232, 0.8);
  --color-lightenize: rgba(234, 233, 232, 0.95);
  --color-light: #f3e9e8;
  --color-lighten: rgba(234, 233, 232, 0.6);
  --color-lightish: rgba(234, 233, 232, 0.5);
  --color-softlight: rgba(234, 233, 232, 0.1);
  --color-bglight: rgba(234, 233, 232, 0.05);
  --color-bglighter: rgba(232, 233, 233, 0.025);
  --color-darkoff: rgba(43, 43, 45, 0.05);
  --color-lightoff: rgba(234, 233, 232, 0.05);
  --color-success: rgb(150, 220, 150);
  --color-success-bright: rgb(0, 200, 80);
  --color-success-bg: rgba(110, 220, 110, 0.25);
  --color-success-border: rgba(150, 220, 150, 0.6);
  --color-success-dim: rgba(100, 180, 100, 0.6);
  --color-warning: rgb(255, 180, 60);
  --color-warning-bright: rgb(255, 200, 100);
  --color-warning-bg: rgba(255, 180, 60, 0.3);
  --color-warning-border: rgba(255, 180, 60, 0.6);
  --color-warning-dim: rgba(255, 140, 0, 0.4);
  --color-danger: rgb(220, 53, 69);
  --color-danger-bright: rgb(255, 100, 100);
  --color-danger-bg: rgba(220, 53, 69, 0.2);
  --color-danger-border: rgba(220, 53, 69, 0.6);
  --color-danger-dim: rgba(176, 42, 55, 1);
  --color-info: rgb(0, 102, 204);
  --color-info-bright: rgb(100, 180, 255);
  --color-info-bg: rgba(0, 150, 255, 0.25);
  --color-info-border: rgba(0, 150, 255, 0.6);
  --color-select: rgb(100, 150, 255);
  --color-select-bg: rgba(100, 150, 255, 0.2);
  --space-xs: 2px;
  --space-sm: 4px;
  --space-md: 6px;
  --space-lg: 8px;
  --space-xl: 12px;
  --space-2xl: 16px;
  --space-3xl: 20px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 2px 5px rgba(0, 0, 0, 0.5);
  --ui-font-input: 11px;
  --ui-font-label: 10px;
  --ui-font-suffix: 9px;
  --container-bg: rgba(37, 36, 36, 0.5);
  --input-bg: rgba(37, 36, 36, 0.9);
  --input-border: rgba(69, 67, 69, 0.5);
  --input-border-focus: rgba(69, 67, 69, 0.7);
  --hover-overlay: rgba(255, 255, 255, 0.05);
  --divider: rgba(255, 255, 255, 0.05);
  --icon-tiny: 12px;
  --icon-small: 14px;
  --icon-medium: 16px;
  --icon-large: 20px;
  --icon-plain: 28px;
  --interactive-bg: rgba(0, 0, 0, 0.1);
  --interactive-bg-hover: rgba(234, 233, 232, 0.1);
  --interactive-bg-active: var(--color-midlow);
  --interactive-bg-selected: var(--color-success-bg);
  --interactive-border-selected: var(--color-success-border);
  --interactive-radius: var(--radius-sm);
  --interactive-transition: none;
  --selected-color: var(--color-success);
  --selected-bg: var(--color-success-bg);
  --selected-border: var(--color-success-border);
  --mixed-color: var(--color-warning);
  --mixed-bg: var(--color-warning-bg);
  --mixed-border: var(--color-warning-border);
  --track-bg: rgba(0, 0, 0, 0.2);
  --track-bg-hover: rgba(0, 0, 0, 0.3);
  --track-bg-disabled: rgba(0, 0, 0, 0.25);
  --track-border: rgba(0, 0, 0, 0.1);
  --track-border-disabled: rgba(0, 0, 0, 0.15);
  --track-height: 22px;
  --track-radius: 11px;
  --input-height: 22px;
  --input-radius: 11px;
  --thumb-bg: var(--color-mid);
  --thumb-bg-hover: var(--color-light);
  --thumb-bg-active: var(--selected-color);
  --thumb-bg-mixed: var(--mixed-color);
  --thumb-size: 22px;
  --icon-opacity: 0.7;
  --icon-opacity-hover: 0.85;
  --icon-opacity-active: 1;
  --icon-padding: 2px;
  --icon-inner-padding: 6px;
  --icon-size: 40px;
  --label-size: 11px;
  --label-color: var(--color-lighten);
  --label-color-active: var(--color-light);
  --panel-bg: rgba(44, 44, 44, 0.8);
  --panel-blur: blur(15px);
  --panel-radius: var(--radius-lg);
  --panel-padding: var(--space-md);
  --panel-border: inset 0 0 0 1px var(--divider);
  --panel-shadow: 0 1px 5px 5px rgba(17, 16, 16, 0.3);
}

@font-face {
  font-family: "ND Mono VF";
  src: url("/_fonts/NDMonoVF.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "ND Mono";
  src: url("/_fonts/mono/NDMono-Book.woff2") format("woff2"), url("/_fonts/mono/NDMono-Book.woff") format("woff");
  font-weight: 350;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ND Mono";
  src: url("/_fonts/mono/NDMono-Light.woff2") format("woff2"), url("/_fonts/mono/NDMono-Light.woff") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ND Mono";
  src: url("/_fonts/mono/NDMono-Regular.woff2") format("woff2"), url("/_fonts/mono/NDMono-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ND Mono";
  src: url("/_fonts/mono/NDMono-Demi.woff2") format("woff2"), url("/_fonts/mono/NDMono-Demi.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ND Mono";
  src: url("/_fonts/mono/NDMono-Bold.woff2") format("woff2"), url("/_fonts/mono/NDMono-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ND Mono";
  src: url("/_fonts/mono/NDMono-ExtraBold.woff2") format("woff2"), url("/_fonts/mono/NDMono-ExtraBold.woff") format("woff");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ND Mono";
  src: url("/_fonts/mono/NDMono-Black.woff2") format("woff2"), url("/_fonts/mono/NDMono-Black.woff") format("woff");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "ND Kern VF";
  src: url("/_fonts/kern/NDKernVF.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
}
/**
 * Interactive Base Components
 * Shared UI component classes using design tokens from _tokens.scss
 * Pattern: Dark rectangle with rounded corners + sub-components
 */
.interactive {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--interactive-bg);
  border-radius: var(--interactive-radius);
  border: none;
  cursor: pointer;
  transition: var(--interactive-transition);
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  font-family: var(--font-sans);
  color: var(--color-lighten);
}
.interactive .icon img {
  opacity: 0.4;
}
.interactive:hover {
  background: var(--interactive-bg-hover);
  color: var(--color-light);
}
.interactive:hover .icon img {
  opacity: 0.65;
}
.interactive:active {
  background: var(--interactive-bg-active);
  transform: translateY(0);
}
.interactive:disabled {
  cursor: not-allowed;
}
.interactive.selected {
  background: var(--interactive-bg);
}
.interactive.selected .icon img {
  opacity: 1;
}
.interactive.selected .label {
  color: var(--label-color-active);
}

.label {
  font-size: var(--label-size);
  color: var(--label-color);
  text-align: center;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.badge {
  font-family: var(--font-sans);
  position: absolute;
  top: -4px;
  left: -2px;
  -webkit-backdrop-filter: blur(30px);
          backdrop-filter: blur(30px);
  background-color: rgba(21, 21, 21, 0.5);
  color: rgb(200, 200, 200);
  font-size: 12px;
  line-height: 1;
  border-radius: 16px;
  min-width: 14px;
  padding: 2px 4px;
  text-align: center;
  display: none;
  z-index: 10;
}
.badge.visible, .badge.always {
  display: block;
}

.chevron {
  flex-shrink: 0;
  opacity: 0.6;
}
.chevron.rotated {
  transform: rotate(180deg);
}

.toggle-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
.toggle-control .toggle-checkbox {
  display: none;
}
.toggle-control .toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin: 0;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.toggle-control .toggle-label .toggle-switch {
  position: relative;
  width: 36px;
  height: var(--track-height);
  background: var(--track-bg);
  border-radius: var(--track-radius);
  border: 1px solid var(--track-border);
  flex-shrink: 0;
}
.toggle-control .toggle-label .toggle-switch::before {
  content: "";
  position: absolute;
  width: var(--thumb-size);
  height: var(--thumb-size);
  border-radius: 50%;
  background: var(--thumb-bg);
  top: 1px;
  left: 1px;
}
.toggle-control .toggle-label .toggle-text {
  font-size: 13px;
  color: var(--color-lighten);
}
.toggle-control .toggle-label:hover .toggle-switch {
  background: var(--track-bg-hover);
}
.toggle-control .toggle-label:hover .toggle-switch::before {
  background: var(--thumb-bg-hover);
}
.toggle-control .toggle-label:hover .toggle-text {
  color: var(--color-light);
}
.toggle-control .toggle-label:hover .icon img {
  opacity: 0.85;
}
.toggle-control .toggle-checkbox:checked + .toggle-label .toggle-switch {
  background: var(--selected-bg);
  border-color: var(--selected-border);
}
.toggle-control .toggle-checkbox:checked + .toggle-label .toggle-switch::before {
  left: 19px;
  background: var(--thumb-bg-active);
}
.toggle-control .toggle-checkbox:checked + .toggle-label .toggle-text {
  color: var(--color-light);
}
.toggle-control .toggle-checkbox:checked + .toggle-label .icon img {
  opacity: 1;
}
.toggle-control.mixed .toggle-label .toggle-switch {
  background: var(--mixed-bg);
  border-color: var(--mixed-border);
}
.toggle-control.mixed .toggle-label .toggle-switch::before {
  left: 10px;
  background: var(--thumb-bg-mixed);
}
.toggle-control.mixed .toggle-label .toggle-text {
  color: var(--color-warning);
}
.toggle-control.small .toggle-label .toggle-switch {
  width: 28px;
  height: 14px;
  border-radius: 7px;
}
.toggle-control.small .toggle-label .toggle-switch::before {
  width: 10px;
  height: 10px;
}
.toggle-control.small .toggle-label .toggle-text {
  font-size: 11px;
}
.toggle-control.small .toggle-checkbox:checked + .toggle-label .toggle-switch::before {
  left: 15px;
}

.theme-success {
  --theme-bg: var(--color-success-bg);
  --theme-color: var(--color-success-bright);
  --theme-border: var(--color-success-border);
  --theme-dim: var(--color-success-dim);
  background: var(--theme-bg);
  color: var(--theme-color);
  border-color: var(--theme-border);
}

.theme-warning {
  --theme-bg: var(--color-warning-bg);
  --theme-color: var(--color-warning-bright);
  --theme-border: var(--color-warning-border);
  --theme-dim: var(--color-warning-dim);
  background: var(--theme-bg);
  color: var(--theme-color);
  border-color: var(--theme-border);
}

.theme-danger {
  --theme-bg: var(--color-danger-bg);
  --theme-color: var(--color-danger-bright);
  --theme-border: var(--color-danger-border);
  --theme-dim: var(--color-danger-dim);
  background: var(--theme-bg);
  color: var(--theme-color);
  border-color: var(--theme-border);
}

.theme-info {
  --theme-bg: var(--color-info-bg);
  --theme-color: var(--color-info-bright);
  --theme-border: var(--color-info-border);
  --theme-dim: var(--color-info);
  background: var(--theme-bg);
  color: var(--theme-color);
  border-color: var(--theme-border);
}

/**
 * Icon Component
 * Unified wrapper for all icon assets (img, svg)
 */
.icon {
  --icon-size: 36px;
  --icon-padding: 4px;
  --icon-inner-padding: 2px;
  --icon-opacity: 1;
  padding: var(--icon-padding);
  flex-shrink: 0;
  display: inline-block;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  width: var(--icon-size);
  height: var(--icon-size);
}
.icon img, .icon svg {
  display: block;
  opacity: var(--icon-opacity);
  width: 100%;
  height: 100%;
  padding: var(--icon-inner-padding);
  -o-object-fit: contain;
     object-fit: contain;
}
.icon.s12 {
  --icon-size: 12px;
  --icon-padding: 0;
  --icon-inner-padding: 0;
}
.icon.s16 {
  --icon-size: 16px;
  --icon-padding: 0;
  --icon-inner-padding: 0;
}
.icon.s18 {
  --icon-size: 18px;
  --icon-padding: 0;
  --icon-inner-padding: 0;
}
.icon.s20 {
  --icon-size: 20px;
  --icon-padding: 0;
  --icon-inner-padding: 0;
}
.icon.s24 {
  --icon-size: 24px;
  --icon-padding: 1px;
  --icon-inner-padding: 2px;
}
.icon.s32 {
  --icon-size: 32px;
  --icon-padding: 2px;
  --icon-inner-padding: 3px;
}
.icon.suffix {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.5;
  pointer-events: none;
}
.icon.muted {
  opacity: 0.6;
}

/**
 * Base styles
 * Reset, body, and canvas foundations
 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

hr {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 0;
}

kbd {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 350;
  line-height: 1.3;
  letter-spacing: 0.03em;
  color: var(--color-light);
  background: rgba(40, 40, 40, 0.5);
  border-radius: var(--radius-sm);
  padding: 2px 5px;
  min-width: 20px;
  text-align: center;
  display: inline-block;
  border: 2px solid rgba(255, 255, 255, 0.025);
}

body {
  font-family: var(--font-sans);
  background: var(--color-dark);
  color: var(--color-light);
  margin: 0;
  padding: 0;
  font-feature-settings: "tnum" 1;
  zoom: reset;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}
body.overflow {
  overflow: hidden;
}

#canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  display: block;
  cursor: crosshair;
  background: var(--color-dark);
}

/**
 * Layout components
 * Toolbar, groups, and structural elements
 */
::-moz-selection {
  text-shadow: none;
  color: rgb(200, 220, 255);
  background: rgba(100, 150, 255, 0.2);
}
::selection {
  text-shadow: none;
  color: rgb(200, 220, 255);
  background: rgba(100, 150, 255, 0.2);
}

body.canvas-dragging .app-container * {
  pointer-events: none !important;
}

.ui-toolbar {
  position: absolute;
  top: 0px;
  left: 0px;
  right: 0px;
  margin: 12px;
  z-index: 1000;
  display: flex;
  gap: 4px;
  justify-content: space-between;
}
.ui-toolbar.center {
  justify-content: center;
}
.ui-toolbar.bottom-right {
  top: auto;
  bottom: 0px;
  left: auto;
  right: 0px;
  flex-direction: column;
  align-items: stretch;
  width: 270px;
}
.ui-toolbar.bottom-right .ui-panel {
  flex: 1;
}
.ui-toolbar.bottom-right .control-content {
  width: 100%;
}
.ui-toolbar.bottom-right select {
  flex: 1;
}
.ui-toolbar.bottom-right .tick-slider-wrap {
  flex: 1;
}
.ui-toolbar.bottom-right .prop-input-wrap {
  flex: 1;
}
.ui-toolbar.bottom-right .radio-group {
  width: 100%;
}
.ui-toolbar.bottom-right .radio-group .radio-option {
  flex: 1;
}
.ui-toolbar.bottom-right .object-mode-radios {
  width: 100%;
}
.ui-toolbar.bottom-right .object-mode-radios .radio-label {
  flex: 1;
}
.ui-toolbar.top-right {
  left: auto;
  right: 0px;
  flex-direction: column;
  align-items: stretch;
  width: 270px;
}
.ui-toolbar.top-right .ui-panel {
  width: 100%;
}
.ui-toolbar.top-right .dropdown {
  width: 100%;
}
.ui-toolbar.bottom-center {
  top: auto;
  bottom: 0px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  justify-content: center;
}

.flex-spacer {
  flex: 1;
}

.toolbar-group {
  display: flex;
  gap: 4px;
  align-items: flex-start;
}

.type-group-label {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.125em;
  line-height: 1;
  padding: 0.2em 0.4em;
  width: 100%;
  text-transform: uppercase;
  box-sizing: border-box;
  gap: 10px;
  color: var(--color-lighten);
}
.type-group-label .icon {
  opacity: 0.6;
}
.type-group-label .drag-handle {
  margin: -10px -5px;
  padding: 5px;
  display: flex;
  cursor: grab;
  opacity: 0.5;
  font-size: 14px;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  margin-left: auto;
  align-items: center;
  letter-spacing: -0.1em;
  color: white;
}
.type-group-label .drag-handle:hover {
  opacity: 1;
  font-weight: bold;
}
.type-group-label .drag-handle:active {
  cursor: grabbing;
}

.ui-panel.dragging {
  opacity: 0.15;
}

.bottom-right {
  -webkit-backdrop-filter: var(--panel-blur);
          backdrop-filter: var(--panel-blur);
  border-radius: 12px;
}

.ui-panel {
  flex-wrap: nowrap;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  line-height: 1;
  font-size: 13px;
  background: var(--panel-bg);
  -webkit-backdrop-filter: var(--panel-blur);
          backdrop-filter: var(--panel-blur);
  border-radius: var(--panel-radius);
  padding: var(--panel-padding);
  box-shadow: var(--panel-shadow), var(--panel-border);
  pointer-events: auto;
}
.ui-panel.has-slider {
  flex-direction: column;
  align-items: stretch;
}
.ui-panel.has-slider .control-content {
  width: 100%;
}

#curve-tension-control,
#vector-weight-control {
  gap: 6px;
}
#curve-tension-control > .icon,
#vector-weight-control > .icon {
  opacity: 0.5;
}
#curve-tension-control .tick-slider-wrap,
#vector-weight-control .tick-slider-wrap {
  flex: 1;
}

.zoom-level {
  padding: 8px;
}

#layer-panel {
  min-width: 180px;
  max-height: calc(100vh - 400px);
  min-height: 100px;
  height: 180px;
  flex: none;
  display: flex;
  flex-direction: column;
  position: relative;
  clip-path: inset(-20px 0 0 0);
}
#layer-panel .layer-panel-list {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
}
#layer-panel .action-btns {
  flex-shrink: 0;
}
#layer-panel .type-group-label {
  flex-shrink: 0;
}

#object-type-panel {
  position: relative;
  min-height: 0;
}
#object-type-panel .type-group-label {
  flex-shrink: 0;
  position: relative;
}
#object-type-panel .resize-grip {
  flex: 1;
  align-self: stretch;
  margin: -8px 0;
  min-height: 20px;
  cursor: ns-resize;
}
#object-type-panel .resize-grip::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 3px;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1.5px;
  transition: background 0.2s;
}
#object-type-panel .resize-grip:hover::after, #object-type-panel .resize-grip:active::after {
  background: rgba(255, 255, 255, 0.3);
}
#object-type-panel .type-cluster-label {
  padding: 8px 6px 3px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.125em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--color-lighten);
  opacity: 0.45;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
#object-type-panel .type-cluster-label:first-child {
  padding-top: 4px;
}
#object-type-panel .layer-panel-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}
#object-type-panel .layer-panel-list > * {
  flex-shrink: 0;
}

.resize-handle-top {
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 16px;
  cursor: ns-resize;
  z-index: 100;
}
.resize-handle-top::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  transition: background 0.15s;
}
.resize-handle-top:hover::after, .resize-handle-top:active::after {
  background: rgba(255, 255, 255, 0.5);
}

.layer-panel-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  position: relative;
  background: rgba(0, 0, 0, 0.1);
  padding: 4px;
  border-radius: 6px;
}

.layer-row {
  --depth: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  padding-left: calc(4px + var(--depth) * 24px);
  cursor: pointer;
  border-radius: 4px;
  font-size: 12px;
  line-height: 2.2;
  font-weight: 350;
  letter-spacing: 0.05em;
}
.layer-row:hover {
  background: rgba(255, 255, 255, 0.04);
}
.layer-row:hover .layer-thumb {
  opacity: 1;
}
.layer-row.selected {
  color: rgb(200, 220, 255);
  background: rgba(100, 150, 255, 0.2);
}

.layer-thumb {
  opacity: 0.7;
  width: 18px;
  height: 18px;
  background: transparent;
  flex-shrink: 0;
  margin-right: 4px;
}
.layer-thumb img {
  width: 100%;
  height: 100%;
  -o-object-fit: contain;
     object-fit: contain;
}

.layer-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 320;
}

.layer-name-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  padding: 2px 4px;
  font-size: 12px;
  color: inherit;
  outline: none;
}
.layer-name-input:focus {
  border-color: rgba(100, 150, 255, 0.5);
}

.layer-actions {
  display: flex;
  align-items: center;
  gap: 0px;
  margin-left: auto;
  flex-shrink: 0;
}
.layer-actions .icon {
  --icon-size: 20px;
  --icon-padding: 2px;
}

.layer-visibility,
.layer-lock {
  cursor: pointer;
  opacity: 0.3;
  transition: opacity 0.1s;
}
.layer-visibility:hover,
.layer-lock:hover {
  opacity: 0.9;
}

.layer-row.hidden-layer .layer-thumb,
.layer-row.hidden-layer .layer-name {
  opacity: 0.4;
}
.layer-row.hidden-layer .layer-visibility {
  opacity: 1;
}

.layer-row.locked-layer .layer-lock {
  opacity: 1;
}

.layer-row.partial {
  background: rgba(100, 150, 255, 0.1);
}

.layer-count {
  font-size: 10px;
  opacity: 0.5;
  margin-left: auto;
  margin-right: 4px;
}

.room-panel .room-rename {
  flex: 0 0 auto;
  margin-right: 20px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.1s;
}
.room-panel .room-rename:hover {
  opacity: 0.9;
}
.room-panel .dropdown-input-wrapper:hover .room-rename {
  opacity: 0.4;
}
.room-panel .dropdown-input-wrapper:hover .room-rename:hover {
  opacity: 0.9;
}
.room-panel .dropdown-input-wrapper input {
  padding-right: 0;
  min-width: 0;
}
.room-panel .room-description {
  width: 100%;
  margin-top: 2px;
  padding: 4px 12px;
  border: none;
  outline: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-lighten);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.03em;
}
.room-panel .room-description::-moz-placeholder {
  color: inherit;
  opacity: 0.35;
}
.room-panel .room-description::placeholder {
  color: inherit;
  opacity: 0.35;
}
.room-panel .room-description:hover, .room-panel .room-description:focus {
  background: rgba(255, 255, 255, 0.06);
}
.room-panel .room-description:disabled {
  visibility: hidden;
}
.room-panel .room-map {
  position: sticky;
  top: calc(var(--panel-padding, 4px) * -1);
  z-index: 1;
  margin: calc(var(--panel-padding, 4px) * -1);
  margin-bottom: 4px;
  padding: 8px;
  background: rgb(38, 38, 38);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}
.room-panel .room-map svg {
  display: block;
  width: 100%;
  height: 132px;
}
.room-panel .room-map rect {
  fill: rgba(255, 255, 255, 0.14);
  stroke: rgb(38, 38, 38);
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
}
.room-panel .room-map rect.hover {
  fill: rgba(255, 255, 255, 0.5);
}
.room-panel .room-map rect.current {
  fill: rgb(120, 160, 255);
}
.room-panel .layer-row {
  flex-wrap: wrap;
  line-height: 1.5;
  padding-top: 4px;
  padding-bottom: 4px;
}
.room-panel .layer-row.hover {
  background: rgba(255, 255, 255, 0.04);
}
.room-panel .layer-name {
  flex: 1 1 0;
  min-width: 0;
}
.room-panel .room-row-description {
  flex: 0 0 100%;
  padding-left: 24px;
  font-size: 10.5px;
  letter-spacing: 0.03em;
  opacity: 0.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-panel .dropdown-input-wrapper.renaming {
  cursor: text;
  box-shadow: inset 0 0 0 2px rgba(250, 250, 250, 0.01), 0 2px 6px rgba(0, 0, 0, 0.35);
  background: rgba(255, 255, 255, 0.08);
}
.room-panel .dropdown-input-wrapper.renaming input {
  cursor: text;
}
.room-panel .dropdown-input-wrapper.renaming .room-rename {
  display: none;
}
.room-panel .room-number {
  flex: 0 0 18px;
  font-size: 10px;
  text-align: right;
  opacity: 0.5;
}

.type-category-row {
  padding: 4px 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.5;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.layer-row.dragging {
  opacity: 0.3;
}

.layer-row.drop-inside {
  background: rgba(100, 200, 100, 0.25);
  outline: 1px dashed rgba(100, 200, 100, 0.6);
  outline-offset: -1px;
}

.layer-drag-clone {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  background: rgba(60, 80, 120, 0.95);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  padding: 3px 6px;
}

.layer-drop-indicator {
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  background: var(--color-select, #5588ff);
  border-radius: 1px;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 0 4px var(--color-select, #5588ff);
}

body.layer-dragging {
  cursor: grabbing !important;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.ui-corner {
  position: absolute;
  z-index: 1000;
  display: flex;
  gap: 10px;
  margin: 10px;
  padding: 4px;
  pointer-events: none;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  transition: left 0.3s ease;
}
.ui-corner > * {
  pointer-events: auto;
}
.ui-corner.top-left {
  top: 0;
  left: 0;
  flex-direction: column;
  align-items: flex-start;
}
.ui-corner.top-right {
  top: 0;
  right: 0;
  flex-direction: row;
  align-items: flex-start;
}
.ui-corner.bottom-left {
  bottom: 0;
  left: 0;
  flex-direction: column;
  align-items: flex-start;
}
.ui-corner.bottom-right {
  bottom: 0;
  right: 0;
  flex-direction: row;
  align-items: flex-end;
}
.ui-corner.beside-properties {
  right: 270px;
}
.ui-corner.vertical {
  flex-direction: column;
}

.game-preview-panel {
  padding: 0;
  overflow: hidden;
  width: min(40vw, 520px);
  aspect-ratio: 16/11;
}
.game-preview-panel.hidden {
  display: none;
}
.game-preview-panel iframe {
  display: block;
  flex: 1;
  width: 100%;
  border: 0;
  background: var(--color-darker);
}

body.ui-hidden .app-container {
  visibility: hidden;
}

.game-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
}
.game-stage.hidden {
  display: none;
}
.game-stage iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--color-dark);
}

body.game-stage #canvas {
  background: transparent;
}

.minimap-panel {
  padding: 0;
  overflow: hidden;
  border-radius: 4px;
  position: relative;
  opacity: 0;
  transition: opacity 0.3s ease;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.05);
}
.minimap-panel.active {
  opacity: 1;
}
.minimap-panel.hidden {
  display: none;
}
.minimap-panel #minimap-canvas {
  display: block;
  background: var(--color-darker);
  cursor: pointer;
}
.minimap-panel .minimap-zoom {
  position: absolute;
  bottom: 4px;
  left: 6px;
  font-weight: 700;
  font-size: 10px;
  color: var(--color-light);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.minimap-panel .minimap-zoom.visible {
  opacity: 0.7;
}

.pointer-coords {
  position: fixed;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--panel-bg);
  -webkit-backdrop-filter: var(--panel-blur);
          backdrop-filter: var(--panel-blur);
  border-radius: var(--panel-radius);
  padding: 8px 10px;
  box-shadow: var(--panel-shadow), var(--panel-border);
  font-family: var(--font-mono);
  pointer-events: none;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.pointer-coords .coord-row {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
}
.pointer-coords .coord-value {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--color-light);
  min-width: 50px;
  text-align: right;
}
.pointer-coords .coord-label {
  font-size: 11px;
  color: var(--color-lighten);
  opacity: 0.6;
}

/**
 * Tabs Component
 * Base tab navigation - horizontal or vertical (stacked)
 */
.tabs {
  background: var(--color-darkish);
  display: flex;
  padding: 0;
  margin: 0;
  overflow: auto;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tabs {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.tabs.vertical {
  flex-direction: column;
}
.tabs.vertical .tab-button {
  flex: none;
  text-align: left;
  border-bottom: none;
  border-left: 2px solid transparent;
  padding: 0.75em 1em;
}
.tabs.vertical .tab-button.active {
  border-left-color: var(--color-accent, currentColor);
}

.tab-button {
  border: none;
  color: var(--color-lighten);
  padding: 1em 2em;
  border-radius: 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.075em;
  white-space: nowrap;
}
.tab-button:hover {
  color: var(--color-light);
}
.tab-button.active {
  background: var(--panel-bg);
  color: var(--color-light);
}
.tab-button.active:hover {
  color: var(--color-light);
}
.tab-button .tab-counter {
  opacity: 0.4;
  margin-left: 4px;
}

.tab-content {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.tab-panel {
  display: none;
  height: 100%;
  position: relative;
  flex-direction: column;
}
.tab-panel.active {
  display: flex;
}

.tab-footer {
  padding: 20px;
}

.tab-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tab-body::-webkit-scrollbar {
  display: none;
}
.tab-body {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.tab-actions {
  position: absolute;
  bottom: 12px;
  left: 12px;
  pointer-events: none;
  display: flex;
  gap: 6px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-md);
  padding: 4px;
}
.tab-actions .action-btn {
  background: var(--color-dark);
  border: none;
  color: var(--color-lighten);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 11px;
  opacity: 0.6;
  pointer-events: auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}
.tab-actions .action-btn:hover {
  opacity: 1;
  color: var(--color-light);
  background: var(--color-midlow);
}
.tab-actions .action-btn.primary:hover {
  background: var(--color-info);
  color: white;
}
.tab-actions .action-btn.danger:hover {
  background: var(--color-danger);
  color: white;
}

.tab-footer {
  flex-shrink: 0;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--color-darkish);
}

/**
 * Button Component
 * Tactile button styling with state modifiers
 * Usage: <button class="btn">Default</button>
 *        <button class="btn danger">Delete</button>
 */
button {
  font-family: var(--font-sans);
  border: none;
  outline: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

.btn {
  --btn-hi: 250, 250, 250;
  --btn-lo: 0, 0, 0;
  --btn-bg: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(to bottom, rgba(var(--btn-hi), 0.02) 0%, rgba(var(--btn-lo), 0.02) 100%), var(--btn-bg);
  box-shadow: inset 0 0 0 2px rgba(var(--btn-hi), 0.01), 0 2px 6px rgba(0, 0, 0, 0.35);
  border: none;
  border-radius: 6px;
  color: var(--color-lighter);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 550;
  letter-spacing: 0.04em;
  line-height: 1;
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  letter-spacing: 0.06em;
}
.btn:hover {
  color: var(--color-light);
  background: linear-gradient(to bottom, rgba(var(--btn-hi), 0.04) 0%, rgba(var(--btn-lo), 0) 100%), var(--btn-bg);
}
.btn:active {
  scale: 0.98;
  background: linear-gradient(to bottom, rgba(var(--btn-hi), 0.01) 0%, rgba(var(--btn-lo), 0.1) 100%), var(--btn-bg);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn.active {
  translate: 0 1px;
  background: linear-gradient(to bottom, rgba(var(--btn-lo), 0.12) 0%, rgba(var(--btn-lo), 0.06) 100%), var(--btn-bg);
  box-shadow: inset 0 2px 4px rgba(var(--btn-lo), 0.25), inset 0 1px 2px rgba(var(--btn-lo), 0.15);
}
.btn.mute {
  opacity: 0.6;
}
.btn.danger {
  --btn-hi: 255, 100, 100;
  --btn-lo: 80, 20, 25;
  --btn-bg: var(--color-danger-bg);
  color: var(--color-danger-bright);
}
.btn.confirm {
  --btn-hi: 50, 255, 50;
  --btn-lo: 0, 80, 0;
  --btn-bg: var(--color-success-bg);
  color: var(--color-success-bright);
}
.btn.warning {
  --btn-hi: 255, 200, 100;
  --btn-lo: 120, 80, 0;
  --btn-bg: var(--color-warning-bg);
  color: var(--color-warning-bright);
}
.btn.nude, .btn.ghost {
  background: transparent;
  box-shadow: none;
  color: inherit;
  opacity: 0.7;
}
.btn.nude:hover, .btn.ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  opacity: 1;
}
.btn.nude:active, .btn.ghost:active {
  background: rgba(0, 0, 0, 0.1);
}
.btn.sm {
  padding: 6px 10px;
  font-size: 12px;
}
.btn.lg {
  padding: 12px 18px;
  font-size: 16px;
}
.btn.full {
  width: 100%;
}
.btn.square {
  padding: 8px;
  aspect-ratio: 1;
}
.btn.restore {
  --btn-hi: 100, 180, 255;
  --btn-lo: 0, 40, 80;
  --btn-bg: var(--color-info-bg);
  color: var(--color-info-bright);
}
.btn.nude {
  background: transparent;
  box-shadow: none;
  color: var(--color-lighten);
}
.btn.nude:hover {
  color: var(--color-light);
  background: transparent;
}
.btn span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

input, select {
  font-family: var(--font-sans);
  border: none;
  outline: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-lighten);
}

.file-status-btn {
  position: relative;
  border-radius: var(--radius-md);
  color: var(--color-light);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
}
.file-status-btn .file-icon-folder {
  display: block;
}
.file-status-btn .icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  position: relative;
}
.file-status-btn:hover {
  background: var(--color-lighten);
}
.file-status-btn:active {
  transform: scale(0.95);
}
.file-status-btn.disconnected .file-icon-folder {
  opacity: 0.4;
}
.file-status-btn.disconnected .icon::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-warning-bright);
}
.file-status-btn.disconnected:hover {
  background: var(--color-warning-dim);
}

.tight,
.save-to-drive-control {
  padding: 0;
  display: flex;
  align-items: center;
}

.save-to-drive-btn {
  position: relative;
  border-radius: var(--radius-md);
  color: var(--color-light);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.save-to-drive-btn .save-icon-check, .save-to-drive-btn .save-icon-warn {
  display: none;
}
.save-to-drive-btn:hover {
  background: var(--color-lighten);
  border-color: var(--color-light);
}
.save-to-drive-btn:active {
  transform: scale(0.95);
}
.save-to-drive-btn.fresh {
  border-color: var(--color-success-border);
  color: var(--color-success-bright);
}
.save-to-drive-btn.fresh .save-icon-check {
  display: block;
}
.save-to-drive-btn.fresh .save-icon-warn {
  display: none;
}
.save-to-drive-btn.fresh:hover {
  background: var(--color-success-dim);
  border-color: var(--color-success-border);
}
.save-to-drive-btn.stale {
  border-color: var(--color-warning-border);
  color: var(--color-warning-bright);
}
.save-to-drive-btn.stale .save-icon-check {
  display: none;
}
.save-to-drive-btn.stale .save-icon-warn {
  display: block;
}
.save-to-drive-btn.stale:hover {
  background: var(--color-warning-dim);
  border-color: var(--color-warning-border);
}
.save-to-drive-btn .icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.save-icon {
  width: 32px;
  height: 32px;
  display: none;
  opacity: 1 !important;
}

.save-timer {
  font-size: 12px;
  opacity: 0.9;
  white-space: nowrap;
  font-weight: 500;
  position: absolute;
  top: 0;
  right: 0;
  padding: 4px;
}

.btn-icon-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--interactive-bg);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--color-lighten);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-icon-toggle .icon {
  display: flex;
}
.btn-icon-toggle .icon svg {
  width: 18px;
  height: 18px;
}
.btn-icon-toggle:hover {
  background: var(--interactive-bg-hover);
  color: var(--color-light);
}
.btn-icon-toggle.active {
  background: var(--selected-bg);
  border-color: var(--selected-border);
  color: var(--color-light);
}

/**
 * Select Component
 * Tactile dropdown styling with chevron indicator
 */
select {
  --select-hi: 250, 250, 250;
  --select-lo: 0, 0, 0;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  padding: 12px 40px 12px 16px;
  background: url("/lonely-boing/editor/icons/chevron-bottom.svg") no-repeat right 14px center/12px, linear-gradient(to bottom, rgba(var(--select-hi), 0.04) 0%, rgba(var(--select-lo), 0.1) 100%);
  box-shadow: inset 0 0 0 2px rgba(var(--select-hi), 0.025), 0 2px 6px rgba(0, 0, 0, 0.35);
  border: none;
  border-radius: 6px;
  color: var(--color-lighter);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
}
select:hover {
  color: var(--color-light);
  background: url("/lonely-boing/editor/icons/chevron-bottom.svg") no-repeat right 14px center/12px, linear-gradient(to bottom, rgba(var(--select-hi), 0.04) 0%, rgba(var(--select-lo), 0) 100%);
}
select:focus {
  outline: none;
}

select.sm {
  padding: 8px 32px 8px 12px;
  font-size: 12px;
  background-position: right 10px center;
}

/**
 * Textarea Component
 * Reusable auto-sizing textarea for dialog editor and forms
 */
.editor-textarea {
  width: 100%;
  min-height: 1.5em;
  padding: 12px;
  font-size: 14px;
  line-height: 1.6;
  font-family: var(--font-mono);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--color-lighten);
  resize: none;
  overflow: hidden;
  field-sizing: content;
}
.editor-textarea::-moz-placeholder {
  color: var(--color-mid);
  opacity: 0.4;
}
.editor-textarea::placeholder {
  color: var(--color-mid);
  opacity: 0.4;
}
.editor-textarea:hover {
  background: var(--hover-overlay);
}
.editor-textarea:focus {
  border-color: var(--track-border);
  background: var(--track-bg);
  color: var(--color-light);
  outline: none;
}
.editor-textarea.sm {
  font-size: 12px;
  padding: 10px;
}
.editor-textarea.sm:not(:focus) {
  color: var(--color-mid);
}

/**
 * ▗▖  ▗▖▗▄▄▄▖▗▖  ▗▖▗▖ ▗▖
 * ▐▛▚▞▜▌▐▌   ▐▛▚▖▐▌▐▌ ▐▌
 * ▐▌  ▐▌▐▛▀▀▘▐▌ ▝▜▌▐▌ ▐▌
 * ▐▌  ▐▌▐▙▄▄▖▐▌  ▐▌▝▚▄▞▘
 *
 * Unified Menu System
 * Context menus, dropdowns, and inline menus
 */
/* ========================================================================
   MENU CONTAINER
   ======================================================================== */
/*
 * Menu Structure:
 * <div class="menu fix">    // fixed (right-click)
 * <div class="menu abs">    // absolute (flyout)
 * <div class="menu rel">    // static (inline)
 *   <button class="menu-item">
 *     <span class="icon"><img src="icon.svg"></span>
 *     <span class="menu-label">Action</span>
 *     <kbd>⌘X</kbd>
 *   </button>
 *   <hr>
 *   <button class="menu-item current">
 *     <span class="icon"><img src="icon.svg"></span>
 *     <span class="menu-label">Selected</span>
 *   </button>
 * </div>
 */
.menu {
  background: var(--panel-bg);
  -webkit-backdrop-filter: var(--panel-blur);
          backdrop-filter: var(--panel-blur);
  border-radius: var(--panel-radius);
  padding: var(--panel-padding);
  box-shadow: var(--panel-shadow), var(--panel-border);
  min-width: 240px;
}
.menu.fix {
  position: fixed;
  z-index: 10000;
}
.menu.abs {
  position: absolute;
  z-index: 1000;
}
.menu.rel {
  position: static;
}
.menu hr {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 6px 4px;
}

/* ========================================================================
   MENU ITEM
   ======================================================================== */
.menu-item {
  min-width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-lighter);
  font-family: var(--font-sans);
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.menu-item:hover {
  background: var(--hover-overlay);
  color: var(--color-light);
}
.menu-item:hover .icon img {
  opacity: 0.9;
}
.menu-item .icon {
  --icon-size: 20px;
  --icon-padding: 0;
  --icon-inner-padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  padding: 0;
  font-size: 20px;
  opacity: 0.5;
}
.menu-item .icon img {
  width: 100%;
  height: 100%;
  -o-object-fit: contain;
     object-fit: contain;
  opacity: 0.7;
  padding: 0;
}
.menu-item .menu-label {
  flex: 1;
  font-weight: 400;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0.025em;
  text-align: left;
}
.menu-item.checkable:not(.current):hover::after {
  content: "";
  width: var(--icon-tiny);
  height: var(--icon-tiny);
  margin-left: auto;
  flex-shrink: 0;
  background-image: url("/lonely-boing/editor/icons/mark-check.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.2;
}
.menu-item.current::after {
  content: "";
  width: var(--icon-tiny);
  height: var(--icon-tiny);
  margin-left: auto;
  flex-shrink: 0;
  background-image: url("/lonely-boing/editor/icons/mark-check.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.8;
}
.menu-item.current .label {
  color: var(--color-light);
}

/* ========================================================================
   DROPDOWN CONTAINER
   ======================================================================== */
/*
 * Dropdown Structure:
 * <div class="dropdown">
 *   <div class="dropdown-input-wrapper">
 *     <div class="dropdown-indicator">
 *       <span class="icon"><img src="icon.svg"></span>
 *     </div>
 *     <input type="text" readonly value="Selected">
 *   </div>
 *   <div class="dropdown-menu">
 *     <button class="menu-item">
 *       <span class="icon"><img src="icon.svg"></span>
 *       <span class="menu-label">Option 1</span>
 *     </button>
 *     <button class="menu-item current">
 *       <span class="icon"><img src="icon.svg"></span>
 *       <span class="menu-label">Option 2</span>
 *     </button>
 *   </div>
 * </div>
 */
.dropdown {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 180px;
  width: 100%;
  padding: 4px;
}

/* ========================================================================
   DROPDOWN TRIGGER
   ======================================================================== */
.dropdown-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(to bottom, rgba(250, 250, 250, 0.02) 0%, rgba(0, 0, 0, 0.02) 100%);
  box-shadow: inset 0 0 0 2px rgba(250, 250, 250, 0.01), 0 2px 6px rgba(0, 0, 0, 0.35);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  font-family: var(--font-sans);
  color: var(--color-lighten);
  padding: 8px 12px;
}
.dropdown-input-wrapper:hover {
  color: var(--color-light);
  background: linear-gradient(to bottom, rgba(250, 250, 250, 0.04) 0%, rgba(0, 0, 0, 0) 100%);
}
.dropdown-input-wrapper::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  width: var(--icon-tiny);
  height: var(--icon-tiny);
  background-image: url("/lonely-boing/editor/icons/chevron-bottom.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.2;
}
.dropdown-input-wrapper:hover::after {
  opacity: var(--icon-opacity-hover);
}
.dropdown-input-wrapper input {
  cursor: pointer;
  padding: 0;
  padding-right: 20px;
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-light);
  font-family: inherit;
  font-size: 13px;
  font-style: normal;
  line-height: 1.4;
  height: auto;
}

/* ========================================================================
   DROPDOWN INDICATOR (current selection icon)
   ======================================================================== */
.dropdown-indicator {
  --icon-size: 20px;
  --icon-padding: 0;
  --icon-inner-padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  font-size: 20px;
}
.dropdown-indicator .icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.dropdown-indicator .icon img {
  width: 100%;
  height: 100%;
  -o-object-fit: contain;
     object-fit: contain;
  padding: 0;
}
.dropdown-indicator img {
  width: 100%;
  height: 100%;
  -o-object-fit: contain;
     object-fit: contain;
  padding: 0;
}
.dropdown-indicator.emoji {
  border: none;
  background: none;
  font-size: 20px;
}
.dropdown-indicator.has-value {
  opacity: var(--icon-opacity-active);
  border: none;
}
.dropdown-indicator.has-mixed {
  border: 1px solid var(--color-lighten);
  opacity: var(--icon-opacity-hover);
}
.dropdown-indicator.has-zone {
  opacity: var(--icon-opacity-active);
}
.dropdown-indicator.has-mixed-zones {
  border: 1px solid var(--color-lighten);
  opacity: var(--icon-opacity-hover);
}
.dropdown-indicator.enemy-indicator .count {
  font-size: 10px;
  color: var(--color-lighten);
  margin-left: 2px;
}

/* ========================================================================
   DROPDOWN MENU
   ======================================================================== */
.dropdown-menu {
  position: static;
  margin-top: 2px;
  display: none;
  background: var(--panel-bg);
  -webkit-backdrop-filter: var(--panel-blur);
          backdrop-filter: var(--panel-blur);
  border-radius: var(--panel-radius);
  padding: var(--panel-padding);
  box-shadow: var(--panel-shadow), var(--panel-border);
}
.dropdown-menu.show {
  gap: 2px;
  display: flex;
  flex-direction: column;
}
.dropdown-menu hr {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 4px 0;
}
.dropdown-menu .btn:first-child {
  margin-top: 0;
}

.dropdown-menu[popover] {
  position: fixed;
  inset: auto;
  margin: 0;
  border: 0;
  box-sizing: border-box;
  color: inherit;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), var(--panel-shadow), var(--panel-border);
}
.dropdown-menu[popover] > * {
  flex-shrink: 0;
}

.dropdown.open > .dropdown-input-wrapper::after {
  transform: translateY(-50%) rotate(180deg);
  opacity: var(--icon-opacity-hover);
}

.menu-footer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}

/* ========================================================================
   DROPDOWN-SPECIFIC MENU ITEM REFINEMENTS
   ======================================================================== */
.dropdown .menu-item {
  background: transparent;
}
.dropdown .menu-item:hover {
  background: var(--hover-overlay);
}
.dropdown .menu-item .menu-label {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}
.dropdown .menu-item .option-desc,
.dropdown .menu-item .option-count {
  color: var(--color-lighten);
  font-size: 12px;
  opacity: 0.8;
  line-height: 1;
}
.dropdown .menu-item .option-count {
  text-align: right;
  margin-left: auto;
}
.dropdown .menu-item .option-values {
  color: var(--color-mid);
  font-size: 11px;
  opacity: 0.8;
  margin-left: 8px;
}

/* ========================================================================
   DROPDOWN VARIANTS
   ======================================================================== */
.dropdown.dropup .dropdown-menu {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: 4px;
}
.dropdown.dropup .dropdown-input-wrapper::after {
  transform: translateY(-50%) rotate(180deg);
}

.dropdown.overlay-flyout .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  overflow: hidden;
  z-index: 1000;
  background: var(--panel-bg);
  -webkit-backdrop-filter: var(--panel-blur);
          backdrop-filter: var(--panel-blur);
  border-radius: var(--panel-radius);
  box-shadow: var(--panel-shadow), var(--panel-border);
}

/* ========================================================================
   SPECIFIC DROPDOWNS
   ======================================================================== */
#spring-preset-dropdown {
  min-width: 120px;
}
#spring-preset-dropdown .dropdown-indicator {
  width: var(--icon-medium);
  height: var(--icon-medium);
}
#spring-preset-dropdown .dropdown-indicator img {
  width: 100%;
  height: 100%;
  opacity: 0.6;
}
#spring-preset-dropdown .dropdown-input-wrapper input {
  padding-left: 28px;
  padding-right: 24px;
  font-size: 13px;
}

/* ========================================================================
   ICON LABEL BUTTON
   ======================================================================== */
.icon-label {
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  background: var(--interactive-bg);
  border: none;
  border-radius: var(--interactive-radius);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 18px;
  color: var(--color-lighten);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-label img {
  width: var(--icon-small);
  height: 14px;
  opacity: 0.4;
}
.icon-label:hover {
  background: var(--interactive-bg-hover);
  color: var(--color-light);
}
.icon-label:hover img {
  opacity: 0.7;
}
.icon-label.active {
  background: var(--color-success-bg);
  color: var(--color-success-bright);
  box-shadow: inset 0 0 0 1px var(--color-success-border);
}
.icon-label.square {
  width: 38px;
  padding: 0;
}
.icon-label.danger-subtle {
  opacity: 0.5;
}
.icon-label.danger-subtle img {
  width: 18px;
  height: 18px;
  opacity: 0.6;
}
.icon-label.danger-subtle:hover {
  opacity: 1;
  background: var(--color-danger-bg);
}
.icon-label.danger-subtle:hover img {
  opacity: 1;
}

/* ========================================================================
   VERSION CONTROL DROPDOWN
   ======================================================================== */
#version-control .version-control-row {
  display: flex;
  align-items: stretch;
  gap: 4px;
  width: 100%;
}
#version-control .version-control-row .dropdown {
  flex: 1;
  min-width: 0;
}
#version-control .version-control-row .dropdown-input-wrapper {
  min-width: 0;
}
#version-control .version-control-row .dropdown-input-wrapper input {
  min-width: 0;
}
#version-control .version-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--interactive-bg);
  border-radius: var(--interactive-radius);
  border: none;
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  padding: 3px;
  transition: var(--interactive-transition);
  flex-shrink: 0;
  width: 34px;
  height: 34px;
}
#version-control .version-btn .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
#version-control .version-btn .icon img {
  display: block;
  width: var(--icon-medium);
  height: var(--icon-medium);
  opacity: var(--icon-opacity);
}
#version-control .version-btn:hover {
  background: var(--interactive-bg-hover);
}
#version-control .version-btn:hover .icon img {
  opacity: var(--icon-opacity-hover);
}
#version-control .version-btn:active {
  background: var(--interactive-bg-active);
}
#version-control .version-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
#version-control .version-btn:disabled:hover {
  background: var(--interactive-bg);
}
#version-control .version-btn:disabled:hover .icon img {
  opacity: var(--icon-opacity);
}

#weather-control,
#fog-control,
#atmo-control,
#enemy-control,
#zone-control {
  width: 100%;
}

.icon.digit,
.icon.alpha,
.icon.color {
  width: var(--icon-large);
  height: var(--icon-large);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon.digit {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-lighten);
  border-radius: 50%;
  aspect-ratio: 1;
}

.icon.alpha {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-light);
}

.icon.color {
  margin: 3px;
  height: 8px;
  width: 8px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  color: white;
}

/* ========================================================================
   MENU ITEM PATTERNS
   ======================================================================== */
.menu-item.deletable {
  position: relative;
}
.menu-item.deletable .delete-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: var(--icon-large);
  height: var(--icon-large);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.6;
}
.menu-item.deletable .delete-btn img {
  width: 100%;
  height: 100%;
  display: block;
}
.menu-item.deletable .delete-btn:hover {
  opacity: 1;
}
.menu-item.deletable:hover .delete-btn {
  display: flex;
}

.menu-item.active {
  background: var(--selected-bg);
  box-shadow: inset 0 0 0 1px var(--selected-border);
}
.menu-item.active .menu-label {
  color: var(--color-light);
}
.menu-item.active::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: var(--icon-tiny);
  height: var(--icon-tiny);
  background-image: url("/lonely-boing/editor/icons/mark-check.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.8;
}

.menu-item .mono {
  font-family: var(--font-mono);
  font-size: 13px;
  min-width: var(--icon-plain);
  text-align: center;
  color: var(--color-light);
}

/* ========================================================================
   SUBMENUS
   ======================================================================== */
.menu-item.has-submenu {
  padding-right: 28px;
}
.menu-item.has-submenu .submenu-arrow {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.menu-item.has-submenu .submenu-arrow img {
  width: 100%;
  height: 100%;
  opacity: 0.4;
}
.menu-item.has-submenu:hover .submenu-arrow img {
  opacity: 0.8;
}
.menu-item.has-submenu:hover::before {
  content: "";
  position: absolute;
  top: -8px;
  right: -12px;
  width: 50px;
  height: calc(100% + 16px);
}

.menu.submenu {
  position: absolute;
  min-width: 180px;
  display: none;
  margin: 0;
}
.menu.submenu.visible {
  display: block;
}

.menu-item .check {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.6;
  min-width: 16px;
  text-align: center;
}

.menu-item .state-icon {
  margin-left: auto;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.menu-item .state-icon img {
  width: 100%;
  height: 100%;
  opacity: 0.35;
}

.menu-item:hover .state-icon img {
  opacity: 0.7;
}

/**
 * Radio components
 * Generic radio groups and variants
 */
.radio-group {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
}
.radio-group.stacked {
  flex-direction: column;
}

.radio-option {
  position: relative;
}
.radio-option svg {
  display: block;
}
.radio-option input[type=radio] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.radio-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--interactive-bg);
  border-radius: var(--interactive-radius);
  border: none;
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  font-family: var(--font-sans);
  color: var(--color-lighten);
  padding: 0px;
  margin: 0;
  flex-direction: column;
}
.radio-option label .icon img {
  opacity: 0.4;
}
.radio-option label .label {
  position: absolute;
  opacity: 0;
}
.radio-option label:hover {
  background: var(--interactive-bg-hover);
  color: var(--color-light);
}
.radio-option label:hover .icon img {
  opacity: 0.65;
}
.radio-option input[type=radio]:checked + label {
  background: var(--interactive-bg);
}
.radio-option input[type=radio]:checked + label .icon img {
  opacity: 1;
}
.radio-option input[type=radio]:checked + label .label {
  color: var(--label-color-active);
}

.count-badge {
  text-shadow: 0 0 4px black;
  display: none;
}

.radio-option:hover .badge {
  display: block;
}

.orientation-radio-group {
  display: flex;
  gap: 4px;
}

.orientation-radio input[type=radio] {
  display: none;
}
.orientation-radio label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--icon-plain);
  height: var(--icon-plain);
  border: 1px solid var(--color-lighten);
  border-radius: var(--radius-sm);
  background: rgba(69, 67, 69, 0.3);
  color: var(--color-lighten);
  font-size: 14px;
  cursor: pointer;
}
.orientation-radio label:hover {
  border-color: rgba(243, 233, 232, 0.5);
  background: rgba(69, 67, 69, 0.5);
  color: rgba(243, 233, 232, 0.9);
}
.orientation-radio input[type=radio]:checked + label {
  border-color: rgba(243, 233, 232, 0.8);
  background: rgba(243, 233, 232, 0.2);
  color: var(--color-light);
  box-shadow: 0 0 0 1px var(--color-lighten);
}

.radio-group.corner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
}
.radio-group.corner-grid .radio-option[data-value=top] {
  order: 1;
}
.radio-group.corner-grid .radio-option[data-value=right] {
  order: 2;
}
.radio-group.corner-grid .radio-option[data-value=left] {
  order: 3;
}
.radio-group.corner-grid .radio-option[data-value=bottom] {
  order: 4;
}
.radio-group.corner-grid .radio-option label {
  opacity: 0.4;
}
.radio-group.corner-grid .radio-option input[type=radio]:checked + label {
  opacity: 1;
}

.stroke-weight-radio-group .radio-option label {
  width: 28px;
  height: 28px;
  position: relative;
}
.stroke-weight-radio-group .radio-option label kbd {
  font-size: 9px;
  opacity: 0.6;
}
.stroke-weight-radio-group .weight-preview {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--color-light);
  border-radius: 4px;
}
.stroke-weight-radio-group .w1 {
  width: 2px;
  height: 12px;
}
.stroke-weight-radio-group .w2 {
  width: 3px;
  height: 12px;
}
.stroke-weight-radio-group .w3 {
  width: 5px;
  height: 12px;
}
.stroke-weight-radio-group .w4 {
  width: 7px;
  height: 12px;
}
.stroke-weight-radio-group .w5 {
  width: 10px;
  height: 12px;
}

.tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--interactive-bg);
  border-radius: var(--interactive-radius);
  border: none;
  cursor: pointer;
  padding: 0;
}
.tool-btn .icon img {
  opacity: 0.4;
}
.tool-btn:hover {
  background: var(--interactive-bg-hover);
}
.tool-btn:hover .icon img {
  opacity: 0.65;
}
.tool-btn.active {
  background: var(--interactive-bg);
}
.tool-btn.active .icon img {
  opacity: 1;
}

#draw-actions-group .button-group {
  display: flex;
  gap: 4px;
}
#draw-actions-group .btn-icon {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: var(--interactive-bg);
  border: none;
  border-radius: var(--interactive-radius);
  color: var(--color-lighten);
  cursor: pointer;
  font-size: 11px;
}
#draw-actions-group .btn-icon:hover {
  background: var(--interactive-bg-hover);
  color: var(--color-light);
}

#draw-props-toolbar .type-badge {
  display: inline-block;
  padding: 1px 6px;
  background: var(--interactive-bg);
  border-radius: var(--radius-sm);
  font-size: 10px;
  color: var(--color-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 6px;
}

#type-toolbar .ui-panel {
  gap: 0;
  flex: 1;
  align-items: flex-start;
  flex-direction: row;
  flex-wrap: no-wrap;
  overflow: scroll;
  max-width: 800px;
}
#type-toolbar .ui-panel::-webkit-scrollbar {
  display: none;
}
#type-toolbar .ui-panel .type-group-label {
  display: none;
}
#type-toolbar .ui-panel .object-type-radio-group.expanded .radio-option,
#type-toolbar .ui-panel .object-type-radio-group:has(input:checked) .radio-option {
  max-width: 50px;
  opacity: 1;
}
#type-toolbar .ui-panel .object-type-radio-group {
  margin-right: 16px;
}
#type-toolbar .ui-panel .object-type-radio-group:last-child {
  margin-right: 0;
}
#type-toolbar .ui-panel .object-type-radio-group .radio-option:first-child:has(input:checked) {
  max-width: 50px;
  opacity: 1;
}
#type-toolbar .ui-panel .object-type-radio-group .radio-option:has(input:checked) {
  max-width: 50px;
  opacity: 1;
}
#type-toolbar .ui-panel .object-type-radio-group:not(:has(.radio-option:not(:first-child) input:checked)) .radio-option:first-child {
  max-width: 50px;
  opacity: 1;
}

/**
 * Slider Components
 * Reusable range sliders: editor-slider, tick-slider
 * Uses design tokens for track/thumb sizing
 */
.editor-slider {
  width: 100px;
  height: var(--track-height);
  -webkit-appearance: none;
  -moz-appearance: none;
       appearance: none;
  background: var(--track-bg);
  border-radius: var(--track-radius);
  border: 1px solid var(--track-border);
  cursor: pointer;
  margin: 0;
  padding: 0 1px;
  box-sizing: border-box;
}
.editor-slider::-webkit-slider-runnable-track {
  background: var(--track-bg);
  height: var(--track-height);
  border-radius: var(--track-radius);
}
.editor-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: var(--thumb-size);
  height: var(--thumb-size);
  background: var(--thumb-bg);
  border-radius: 50%;
  cursor: pointer;
  margin-top: 2px;
  border: none;
}
.editor-slider::-moz-range-track {
  background: var(--track-bg);
  height: var(--track-height);
  border-radius: var(--track-radius);
}
.editor-slider::-moz-range-thumb {
  width: var(--thumb-size);
  height: var(--thumb-size);
  background: var(--thumb-bg);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}
.editor-slider:hover {
  background: var(--track-bg-hover);
}
.editor-slider:hover::-webkit-slider-thumb {
  background: var(--color-light);
}
.editor-slider:focus {
  outline: none;
}
.editor-slider.wide {
  width: 120px;
}

.slider-control {
  display: flex;
  align-items: center;
  gap: 6px;
}
.slider-control .slider-label {
  font-size: 11px;
  color: var(--color-lighten);
  min-width: 40px;
}
.slider-control .slider-value {
  font-size: 11px;
  color: var(--color-light);
  font-family: var(--font-mono);
  min-width: 35px;
  text-align: right;
}

.tick-slider-wrap {
  position: relative;
  flex: 1;
}
.tick-slider-wrap .slider-ticks {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--track-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  box-sizing: border-box;
}
.tick-slider-wrap .slider-ticks .tick {
  width: var(--thumb-size);
  height: var(--thumb-size);
  line-height: 2;
  font-size: var(--ui-font-label);
  text-align: center;
  pointer-events: none;
  font-weight: 900;
}
.tick-slider-wrap .slider-ticks .tick::before {
  top: 1.3px;
  position: relative;
  border-radius: 4px;
  display: inline-block;
  content: "";
  height: 0.6em;
  width: 0.6em;
  background: var(--color-light);
  opacity: 0.05;
}
.tick-slider-wrap .slider-ticks .tick.active:before {
  opacity: 0.85;
  background: var(--color-dark);
  z-index: 1;
}
.tick-slider-wrap.mixed .slider-ticks .tick {
  opacity: 0.3;
}
.tick-slider-wrap:has(.tick-slider:disabled) .slider-ticks .tick {
  opacity: 0.25;
  color: var(--color-mid);
}

.tick-slider {
  display: block;
  width: 100%;
  height: calc(var(--track-height) + 2px);
  -webkit-appearance: none;
  -moz-appearance: none;
       appearance: none;
  background: transparent;
  border: none;
  cursor: pointer;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
.tick-slider::-webkit-slider-runnable-track {
  background: var(--track-bg);
  height: var(--track-height);
  border-radius: var(--track-radius);
}
.tick-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: var(--thumb-size);
  height: var(--thumb-size);
  background: var(--thumb-bg);
  border-radius: 50%;
  cursor: pointer;
  margin-top: calc((var(--track-height) - var(--thumb-size)) / 2);
  border: none;
  box-shadow: 0 0 0 2px rgba(34, 34, 34, 0.3);
}
.tick-slider::-moz-range-track {
  background: var(--track-bg);
  height: var(--track-height);
  border-radius: var(--track-radius);
  border: 1px solid var(--track-border);
}
.tick-slider::-moz-range-thumb {
  width: var(--thumb-size);
  height: var(--thumb-size);
  background: var(--thumb-bg);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}
.tick-slider:hover::-webkit-slider-runnable-track {
  background: var(--track-bg-hover);
}
.tick-slider:hover::-moz-range-track {
  background: var(--track-bg-hover);
}
.tick-slider:focus {
  outline: none;
}
.tick-slider:disabled {
  cursor: not-allowed;
  pointer-events: none;
}
.tick-slider:disabled::-webkit-slider-runnable-track {
  background: var(--track-bg-disabled);
  border-color: var(--track-border-disabled);
}
.tick-slider:disabled::-moz-range-track {
  background: var(--track-bg-disabled);
  border-color: var(--track-border-disabled);
}
.tick-slider:disabled::-webkit-slider-thumb {
  background: var(--color-mid);
}
.tick-slider:disabled::-moz-range-thumb {
  background: var(--color-mid);
}

.ui-panel.mixed-state .tick-slider {
  opacity: 0.5;
}
.ui-panel.mixed-state .slider-ticks .tick {
  opacity: 0.4;
}

.slider-input-wrap {
  flex: 1 1 auto;
  justify-content: flex-end;
  margin-left: auto;
}
.slider-input-wrap .prop-input {
  width: 72px;
  flex: 0 0 auto;
}
.slider-input-wrap:not(:has(.prop-suffix)) .prop-input {
  padding-right: 10px;
}

.slider-title {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.125em;
  text-transform: uppercase;
  color: var(--color-lighten);
}

#curve-tension-control,
.ui-panel.expandable .expand-main,
.ui-panel.expandable .mini-slider-row,
.slider-control {
  flex-wrap: wrap;
}
#curve-tension-control > .tick-slider-wrap,
#curve-tension-control > input[type=range],
.ui-panel.expandable .expand-main > .tick-slider-wrap,
.ui-panel.expandable .expand-main > input[type=range],
.ui-panel.expandable .mini-slider-row > .tick-slider-wrap,
.ui-panel.expandable .mini-slider-row > input[type=range],
.slider-control > .tick-slider-wrap,
.slider-control > input[type=range] {
  flex: 0 0 100%;
}

#curve-tension-control {
  flex-direction: row;
  align-items: center;
}

.slider-control:has(.slider-input) .slider-value {
  display: none;
}

/**
 * Orientation Grid Component
 * 3x3 dot grid for alignment selection (Figma-style)
 * Used for spawn orientation, anchor points, etc.
 */
.orientation-grid {
  display: grid;
  grid-template-columns: repeat(3, 20px);
  grid-template-rows: repeat(3, 20px);
  width: 60px;
  height: 60px;
}
.orientation-grid.mini {
  grid-template-columns: repeat(3, 14px);
  grid-template-rows: repeat(3, 14px);
  width: 42px;
  height: 42px;
  margin: 4px;
}
.orientation-grid.mini .ori-dot {
  width: 14px;
  height: 14px;
}
.orientation-grid.mini .ori-dot::after {
  width: 4px;
  height: 4px;
}
.orientation-grid.mini .ori-dot:hover::after {
  width: 6px;
  height: 6px;
}
.orientation-grid.mini .ori-dot:checked::after {
  width: 8px;
  height: 8px;
}
.orientation-grid .ori-dot {
  width: 20px;
  height: 20px;
  -webkit-appearance: none;
  -moz-appearance: none;
       appearance: none;
  background: transparent;
  border: none;
  cursor: pointer;
  margin: 0;
  padding: 0;
  position: relative;
}
.orientation-grid .ori-dot::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-mid);
}
.orientation-grid .ori-dot:hover::after {
  background: var(--color-light);
  width: 8px;
  height: 8px;
}
.orientation-grid .ori-dot:checked::after {
  background: var(--color-select);
  width: 10px;
  height: 10px;
}

#orientation-control-bottom.mode-cardinal .corner-option {
  opacity: 0.2;
  pointer-events: none;
}

#orientation-control-bottom.mode-corner .cardinal-option {
  opacity: 0.2;
  pointer-events: none;
}

/**
 * Form components
 * Input, select, and form utilities
 */
input {
  line-height: 24px;
  font-size: 14px;
  padding: 4px 12px;
  width: 100%;
}
input::-moz-placeholder {
  color: var(--color-lighten);
  opacity: 0.7;
}
input::placeholder {
  color: var(--color-lighten);
  opacity: 0.7;
}

.grid-size,
.density-size {
  color: var(--color-light);
  font-size: 14px;
  font-weight: 600;
  min-width: 50px;
  text-align: center;
  padding: 4px 8px;
  background: var(--panel-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--input-border);
}

label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  color: var(--color-light);
}

.object-properties-control {
  min-width: 200px;
}

.object-properties-panel .properties-header {
  margin-bottom: 8px;
}
.object-properties-panel .properties-header .properties-title {
  font-size: 12px;
  color: var(--color-lighten);
  font-weight: bold;
}
.object-properties-panel .properties-content .property-group {
  margin-bottom: 10px;
}
.object-properties-panel .properties-content .property-group .property-label {
  display: block;
  font-size: 11px;
  color: var(--color-lighten);
  margin-bottom: 4px;
}

.control-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
}

#spring-physics-control .spring-axis-sliders {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#spring-physics-control .spring-axis-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
#spring-physics-control .spring-axis-row .axis-icon {
  width: var(--icon-medium);
  height: var(--icon-medium);
  opacity: 0.6;
  flex-shrink: 0;
}
#spring-physics-control .spring-axis-row .axis-icon img {
  width: 100%;
  height: 100%;
}
#spring-physics-control .spring-axis-row .tick-slider-wrap {
  flex: 1;
}
#spring-physics-control .control-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
#spring-physics-control .control-row label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
  margin-bottom: 4px;
}
#spring-physics-control .control-row label .label-text {
  font-size: 11px;
  color: var(--color-lighten);
  font-weight: 500;
}
#spring-physics-control .control-row label .label-value {
  font-size: 11px;
  color: var(--color-light);
  font-weight: 600;
  font-family: var(--font-mono);
  min-width: 30px;
  text-align: right;
}
#spring-physics-control .control-row label .label-hint {
  font-size: 9px;
  color: var(--color-mid);
  opacity: 0.7;
  display: none;
}
#spring-physics-control .control-row input[type=range] {
  flex: 1;
  -webkit-appearance: none;
  -moz-appearance: none;
       appearance: none;
  cursor: pointer;
  height: 18px;
}
#spring-physics-control .control-row input[type=range]::-webkit-slider-runnable-track {
  background: var(--input-bg);
  height: var(--space-lg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--input-border-focus);
}
#spring-physics-control .control-row input[type=range]::-webkit-slider-track {
  background: var(--input-bg);
  height: var(--space-lg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--input-border-focus);
}
#spring-physics-control .control-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--color-lighten);
  border-radius: 50%;
  cursor: pointer;
  margin-top: -6px;
  border: 2px solid var(--input-border-focus);
  box-shadow: var(--shadow-sm);
}
#spring-physics-control .control-row input[type=range]::-webkit-slider-thumb:hover {
  background: var(--color-light);
  box-shadow: var(--shadow-md);
}
#spring-physics-control .control-row input[type=range]::-webkit-slider-thumb:active {
  background: var(--color-light);
}
#spring-physics-control .control-row input[type=range]::-moz-range-track {
  background: var(--input-bg);
  height: var(--space-lg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--input-border-focus);
}
#spring-physics-control .control-row input[type=range]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--color-lighten);
  border-radius: 50%;
  border: 2px solid var(--input-border-focus);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
#spring-physics-control .control-row input[type=range]::-moz-range-thumb:hover {
  background: var(--color-light);
  box-shadow: var(--shadow-md);
}
#spring-physics-control .control-row input[type=range]::-moz-range-thumb:active {
  background: var(--color-light);
}
#spring-physics-control .control-row input[type=range]:focus {
  outline: none;
}
#spring-physics-control .control-row input[type=number] {
  width: 80px;
  padding: var(--space-sm) var(--space-lg);
  font-size: 12px;
  background: var(--panel-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--color-light);
}
#spring-physics-control .control-row input[type=number]:focus {
  outline: none;
  border-color: var(--color-lighten);
  background: var(--color-midlow);
}
#spring-physics-control .control-row input[type=number]::-moz-placeholder {
  color: var(--color-lighten);
  opacity: 0.5;
}
#spring-physics-control .control-row input[type=number]::placeholder {
  color: var(--color-lighten);
  opacity: 0.5;
}
#spring-physics-control .control-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
#spring-physics-control #spring-presets-ui {
  padding: 0;
}
#spring-physics-control .spring-sliders-mode {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}
#spring-physics-control .spring-preset-group {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  width: 100%;
}
#spring-physics-control .spring-preset {
  display: block;
  flex: 1;
  margin: 0 !important;
}
#spring-physics-control .spring-preset input[type=radio] {
  display: none;
}
#spring-physics-control .spring-preset .preset-label {
  display: block;
  flex: 1;
  padding: 5px var(--space-sm);
  background: var(--input-bg);
  border: 1px solid var(--input-border-focus);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 13px;
  color: var(--color-lighten);
  cursor: pointer;
  white-space: nowrap;
}
#spring-physics-control .spring-preset .preset-label:hover {
  background: rgba(50, 48, 48, 0.9);
  border-color: rgba(90, 88, 90, 0.8);
}
#spring-physics-control .spring-preset input[type=radio]:checked + .preset-label {
  color: var(--color-light);
  font-weight: 600;
}

#collidable-control .collidable-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}
#collidable-control .collidable-toggle .toggle-checkbox {
  display: none;
}
#collidable-control .collidable-toggle .toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin: 0;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
#collidable-control .collidable-toggle .toggle-label .toggle-switch {
  position: relative;
  width: calc(var(--track-height) * 2);
  height: var(--track-height);
  background: var(--input-border-focus);
  border-radius: var(--track-radius);
  border: 1px solid var(--input-border);
}
#collidable-control .collidable-toggle .toggle-label .toggle-switch::before {
  content: "";
  position: absolute;
  width: var(--thumb-size);
  height: var(--thumb-size);
  border-radius: 50%;
  background: var(--color-mid);
  top: calc((var(--track-height) - var(--thumb-size)) / 2 - 1px);
  left: 2px;
}
#collidable-control .collidable-toggle .toggle-label .collidable-label {
  font-size: 13px;
  color: var(--color-lighten);
}
#collidable-control .collidable-toggle .toggle-label:hover .toggle-switch {
  background: var(--color-mid);
}
#collidable-control .collidable-toggle .toggle-label:hover .collidable-label {
  color: var(--color-light);
}
#collidable-control .collidable-toggle .toggle-checkbox:checked + .toggle-label .toggle-switch {
  background: var(--color-success-dim);
  border-color: var(--color-success-border);
}
#collidable-control .collidable-toggle .toggle-checkbox:checked + .toggle-label .toggle-switch::before {
  left: calc(var(--track-height) - 2px);
  background: var(--color-success);
}
#collidable-control .collidable-toggle .toggle-checkbox:checked + .toggle-label .collidable-label {
  color: var(--color-light);
}

.ui-panel.expandable {
  flex-direction: column;
  align-items: stretch;
}
.ui-panel.expandable .expand-main {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}
.ui-panel.expandable .expand-toggle {
  cursor: pointer;
  transition: opacity 0.15s;
}
.ui-panel.expandable .expand-toggle:hover {
  opacity: 0.7;
}
.ui-panel.expandable:has(.tick-slider:disabled) .expand-toggle {
  opacity: 0.4;
}
.ui-panel.expandable .expand-drawer {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding-top: 6px;
  margin-top: -4px;
}
.ui-panel.expandable.expanded .expand-drawer {
  display: flex;
}
.ui-panel.expandable .mini-slider-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ui-panel.expandable .mini-slider-row .icon {
  flex-shrink: 0;
}
.ui-panel.expandable .mini-slider-row .tick-slider {
  flex: 1;
}

#sound-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.prop-select.compact {
  min-width: 42px;
  width: auto;
  height: 26px;
  padding: 0 6px;
  background: var(--color-dark);
  border: 1px solid var(--color-mid);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--color-light);
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  text-align: center;
}
.prop-select.compact:hover {
  background: var(--color-mid);
}
.prop-select.compact:focus {
  outline: none;
  border-color: var(--color-select);
}

.button-group {
  display: flex;
  gap: 4px;
}

.object-mode-radios {
  display: flex;
  gap: 4px;
}
.object-mode-radios .radio-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 0%, rgba(0, 0, 0, 0.04) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 -1px 0 rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.15);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-lighten);
  margin: 0;
  transition: all 0.15s ease;
  letter-spacing: 0.05em;
}
.object-mode-radios .radio-label input[type=radio] {
  display: none;
}
.object-mode-radios .radio-label .icon {
  --icon-size: 24px;
  --icon-padding: 0;
  --icon-inner-padding: 0;
}
.object-mode-radios .radio-label:hover {
  color: var(--color-light);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.08) 0%, rgba(0, 0, 0, 0.02) 100%);
}
.object-mode-radios .radio-label:hover img {
  filter: brightness(1);
}
.object-mode-radios .radio-label:has(input:checked) {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0.06) 100%);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), inset 0 1px 2px rgba(0, 0, 0, 0.15);
  color: var(--color-light);
}
.object-mode-radios .radio-label:has(input:checked) img {
  filter: brightness(1);
}

.ui-toolbar.top-right select {
  width: 100%;
}
.ui-toolbar.top-right #editor-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ui-toolbar.top-right #crossref-list {
  width: 100%;
}
.ui-toolbar.top-right .crossref-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}
.ui-toolbar.top-right .crossref-item .crossref-header {
  display: flex;
  gap: 4px;
}
.ui-toolbar.top-right .crossref-item .crossref-header select {
  flex: 1;
}
.ui-toolbar.top-right .crossref-item textarea {
  width: 100%;
}

/**
 * Input List - Universal editable list component
 *
 * Structure:
 * .input-list
 *   └── .input-row
 *       ├── textarea (main content)
 *       └── input.goto (optional target link)
 *
 * Behavior:
 * - Always has one blank row at end for adding
 * - Empty textarea on blur = delete row
 * - No explicit add/delete buttons
 */
.input-list {
  display: flex;
  flex-direction: column;
}

.input-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  position: relative;
  border-bottom: 1px solid var(--divider);
}
.input-row:last-child {
  border-bottom: none;
}
.input-row:hover {
  background: rgba(0, 0, 0, 0.08);
}
.input-row:focus-within {
  background: rgba(0, 0, 0, 0.12);
}
.input-row:hover .drag-handle {
  opacity: 0.3;
}
.input-row.dirty {
  border-right: 2px solid var(--color-warning-dim);
}
.input-row.saved {
  animation: save-border 1s ease forwards;
}
.input-row .drag-handle {
  order: 3;
  opacity: 0.1;
  margin: 14px;
  transition: opacity 0.15s ease;
}
.input-row .drag-handle:hover {
  opacity: 1;
}
.input-row .drag-handle:active {
  cursor: grabbing;
}
.input-row.dragging {
  opacity: 0.4;
  background: rgba(100, 150, 255, 0.1);
}
.input-row.drag-over {
  border-top: 2px solid var(--color-select);
}
.input-row.placeholder .drag-handle {
  display: none;
}
.input-row textarea {
  width: 100%;
  min-height: 1.5em;
  padding: 14px;
  border: none;
  border-radius: 0;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-light);
  resize: none;
  overflow: hidden;
  field-sizing: content;
  flex: 2;
  text-wrap: balance;
}
.input-row textarea::-moz-placeholder {
  opacity: 0.35;
}
.input-row textarea::placeholder {
  opacity: 0.35;
}
.input-row textarea:focus {
  outline: none;
}
.input-row .goto {
  padding: 14px 0;
  font-size: 11px;
  line-height: 1;
  font-family: var(--font-mono);
  background: transparent;
  border: none;
  color: var(--color-mid);
  text-align: right;
  flex: 1;
}
.input-row .goto::-webkit-calendar-picker-indicator {
  display: none !important;
}
.input-row .goto::-moz-placeholder {
  opacity: 0.5;
}
.input-row .goto::placeholder {
  opacity: 0.5;
}
.input-row .goto:hover {
  color: var(--color-lighten);
}
.input-row .goto:focus {
  outline: none;
  color: var(--color-light);
}
.input-row.placeholder {
  opacity: 0.5;
}
.input-row.placeholder textarea::-moz-placeholder {
  opacity: 0.6;
}
.input-row.placeholder textarea::placeholder {
  opacity: 0.6;
}

@keyframes save-border {
  0% {
    border-right: 2px solid var(--color-success);
  }
  70% {
    border-right: 2px solid var(--color-success);
  }
  100% {
    border-right: 2px solid transparent;
  }
}
/**
 * Modal Base Component
 * Core modal structure, backdrop, content, and themed variants
 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
}
.modal#input-modal, .modal#confirm-modal, .modal#error-modal {
  z-index: 1100;
}
.modal {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}
.modal.show {
  opacity: 1;
  visibility: visible;
}
.modal.show .modal-content {
  transform: translate(-50%, -50%) scale(1);
}
.modal.modal-floating {
  pointer-events: none;
  background: transparent;
}
.modal.modal-floating.show .modal-content {
  transform: none;
}
.modal.modal-floating .modal-content {
  pointer-events: auto;
  position: absolute;
  top: 100px;
  left: 100px;
  transform: none;
  min-width: 320px;
  min-height: 300px;
  max-width: none;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal.modal-floating .resize-handle {
  position: absolute;
  z-index: 100;
}
.modal.modal-floating .resize-handle.n {
  top: 0;
  left: 8px;
  right: 8px;
  height: 6px;
  cursor: ns-resize;
}
.modal.modal-floating .resize-handle.s {
  bottom: 0;
  left: 8px;
  right: 8px;
  height: 6px;
  cursor: ns-resize;
}
.modal.modal-floating .resize-handle.e {
  right: 0;
  top: 8px;
  bottom: 8px;
  width: 6px;
  cursor: ew-resize;
}
.modal.modal-floating .resize-handle.w {
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 6px;
  cursor: ew-resize;
}
.modal.modal-floating .resize-handle.nw {
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  cursor: nwse-resize;
}
.modal.modal-floating .resize-handle.ne {
  top: 0;
  right: 0;
  width: 12px;
  height: 12px;
  cursor: nesw-resize;
}
.modal.modal-floating .resize-handle.sw {
  bottom: 0;
  left: 0;
  width: 12px;
  height: 12px;
  cursor: nesw-resize;
}
.modal.modal-floating .resize-handle.se {
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  cursor: nwse-resize;
}
.modal.modal-floating .modal-header.draggable {
  cursor: grab;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.modal.modal-floating .modal-header.draggable:active {
  cursor: grabbing;
}
.modal.modal-floating .modal-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.modal.modal-floating .modal-body::-webkit-scrollbar {
  display: none;
}
.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(23, 23, 25, 0.25);
}
.modal-content {
  pointer-events: auto;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--panel-bg);
  -webkit-backdrop-filter: var(--panel-blur);
          backdrop-filter: var(--panel-blur);
  border-radius: 12px;
  box-shadow: var(--panel-shadow), var(--panel-border);
  min-width: 400px;
  max-width: 500px;
  color: var(--color-light);
  transition: transform 0.15s ease;
}
.modal-content.danger {
  background: var(--color-danger-bg);
  color: var(--color-danger-bright);
}
.modal-content.danger .modal-header h3 {
  color: inherit;
}
.modal-content.danger .btn.nude {
  color: inherit;
}
.modal-content.success {
  background: var(--color-success-bg);
  color: var(--color-success-bright);
}
.modal-content.success .modal-header h3 {
  color: inherit;
}
.modal-content.success .btn.nude {
  color: inherit;
}
.modal-content.info {
  background: var(--color-info-bg);
  color: var(--color-info-bright);
}
.modal-content.info .modal-header h3 {
  color: inherit;
}
.modal-content.info .btn.nude {
  color: inherit;
}
.modal-content.warning {
  background: var(--color-warning-bg);
  color: var(--color-warning-bright);
}
.modal-content.warning .modal-header h3 {
  color: inherit;
}
.modal-content.warning .btn.nude {
  color: inherit;
}
.modal-header {
  padding: 16px;
  padding-left: 20px;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}
.modal-header h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.04em;
  font-weight: var(--weight-semibold);
  font-weight: 600;
  text-align: left;
  text-transform: none;
  color: var(--color-light);
}
.modal-body {
  padding: 16px 20px 8px;
}
.modal-body:has(.tabs) {
  padding: 0;
}
.modal-body:not(:first-child) {
  padding-top: 0;
}
.modal-body .input-label {
  display: block;
  font-size: 12px;
  color: var(--color-lighten);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.modal-body input[type=text] {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--input-radius);
  color: var(--color-lighten);
  font-size: 14px;
  font-family: var(--font-sans);
}
.modal-body input[type=text]:focus {
  outline: none;
  color: var(--color-light);
  border-color: var(--color-light);
}
.modal-footer {
  padding: 20px;
  padding-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-direction: row;
}

.modal-large .modal-content {
  min-width: 500px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.empty-state {
  text-align: center;
  color: var(--color-lighten);
  font-size: 13px;
  padding: 20px;
  opacity: 0.7;
}

/**
 * Confirm/Delete Modal Variants
 * Confirmation dialogs, delete warnings, and preview tables
 */
.delete-items {
  background: var(--color-dark);
  border: 1px solid var(--color-mid);
  border-radius: var(--radius-sm);
  padding: 12px;
  max-height: 150px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
}
.delete-items div {
  margin: 2px 0;
  color: var(--color-light);
}

.delete-warning,
.confirm-warning {
  font-size: 12px;
  color: var(--color-lighten);
  font-style: italic;
}

table.delete-preview {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 8px 0;
}
table.delete-preview th, table.delete-preview td {
  padding: 4px 0;
  text-align: left;
  vertical-align: top;
}
table.delete-preview th {
  color: var(--color-lightish);
  font-weight: 500;
  white-space: nowrap;
  padding-right: 12px;
  width: 1%;
}
table.delete-preview td {
  color: var(--color-light);
}

.modal-confirm-content {
  min-width: 300px;
  max-width: 400px;
}
.modal-confirm-content .modal-footer .btn:first-child {
  flex: 2;
}
.modal-confirm-content .modal-header + .modal-footer {
  padding-top: 0;
}

.confirm-subtitle {
  opacity: 0.75;
  font-weight: 400;
  display: block;
}

.confirm-warning-box {
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 0;
  font-size: 14px;
  color: var(--color-danger-bright);
  text-align: center;
}

/**
 * Restore Modal
 * Backup comparison and restore functionality
 */
.restore-modal-content {
  width: 90vw;
}

.backup-info {
  background: var(--color-midlow);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 16px;
}
.backup-info .backup-timestamp,
.backup-info .backup-version {
  margin-bottom: 8px;
  font-size: 14px;
}
.backup-info .backup-timestamp:last-child,
.backup-info .backup-version:last-child {
  margin-bottom: 0;
}
.backup-info .backup-timestamp strong,
.backup-info .backup-version strong {
  color: var(--color-light);
}
.backup-info .backup-timestamp span,
.backup-info .backup-version span {
  color: var(--color-lighten);
}

.comparison-section {
  margin-bottom: 16px;
}
.comparison-section h4 {
  color: var(--color-light);
  margin-bottom: 12px;
  font-size: 16px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.comparison-column {
  background: var(--color-midlow);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.comparison-column h5 {
  color: var(--color-light);
  margin-bottom: 8px;
  font-size: 14px;
  text-align: center;
  border-bottom: 1px solid var(--color-mid);
  padding-bottom: 4px;
}

.stats-list .stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-size: 13px;
}
.stats-list .stat-item:last-child {
  margin-bottom: 0;
}
.stats-list .stat-item .stat-label {
  color: var(--color-lighten);
}
.stats-list .stat-item .stat-value {
  color: var(--color-light);
  font-weight: 500;
}
.stats-list .stat-item.stat-changed .stat-value {
  color: var(--color-warning);
}

.warning-section .restore-warning {
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 0;
  font-size: 14px;
  color: var(--color-warning);
  text-align: center;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}
.stats-table tr + tr td {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.stats-table th,
.stats-table td {
  padding: 8px 12px;
  text-align: center;
  vertical-align: middle;
}
.stats-table th:first-child, .stats-table th:last-child,
.stats-table td:first-child,
.stats-table td:last-child {
  width: 1%;
  white-space: nowrap;
}
.stats-table th:first-child,
.stats-table td:first-child {
  text-align: right;
}
.stats-table th:last-child,
.stats-table td:last-child {
  text-align: left;
}
.stats-table td:nth-child(2),
.stats-table th {
  color: var(--color-lighten);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
}
.stats-table td {
  color: var(--color-light);
  font-size: 13px;
}
.stats-table .stat-changed {
  color: var(--color-warning);
}

.preview-canvases {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.canvas-preview {
  width: 100%;
  text-align: center;
}
.canvas-preview canvas {
  width: 100%;
  border-radius: var(--radius-sm);
  background: #171719;
}

/**
 * Form Row Component
 * Consistent label + input pairing for modal forms
 *
 * Usage:
 *   <div class="form-row">
 *     <label>Label text</label>
 *     <input type="text|number"> or <select> or <textarea>
 *   </div>
 *
 *   Modifiers: .form-row.stacked (label above input)
 */
.form-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  width: 100%;
}
.form-row:last-child {
  margin-bottom: 0;
}
.form-row label {
  flex: 1;
  font-size: 13px;
  color: var(--color-lighten);
  line-height: 1.3;
}
.form-row input[type=text],
.form-row input[type=number],
.form-row select {
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.2);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-light);
  font-size: 13px;
  font-family: var(--font-sans);
}
.form-row input[type=text]::-moz-placeholder, .form-row input[type=number]::-moz-placeholder, .form-row select::-moz-placeholder {
  color: var(--color-lightish);
}
.form-row input[type=text]::placeholder,
.form-row input[type=number]::placeholder,
.form-row select::placeholder {
  color: var(--color-lightish);
}
.form-row input[type=text]:focus,
.form-row input[type=number]:focus,
.form-row select:focus {
  outline: none;
  background: rgba(0, 0, 0, 0.3);
}
.form-row input[type=number] {
  width: 70px;
  flex: 0 0 70px;
  text-align: center;
}
.form-row input[type=text] {
  flex: 1;
  min-width: 100px;
}
.form-row select {
  min-width: 120px;
  cursor: pointer;
}
.form-row.stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.form-row.stacked label {
  flex: none;
}
.form-row.stacked textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-light);
  font-size: 13px;
  font-family: var(--font-sans);
  resize: vertical;
  line-height: 1.5;
}
.form-row.stacked textarea::-moz-placeholder {
  color: var(--color-lightish);
}
.form-row.stacked textarea::placeholder {
  color: var(--color-lightish);
}
.form-row.stacked textarea:focus {
  outline: none;
  background: rgba(0, 0, 0, 0.3);
}
.form-row.stacked input[type=text],
.form-row.stacked input[type=number] {
  width: 100%;
  flex: 1;
  text-align: left;
}
.form-row .form-hint {
  font-size: 11px;
  color: var(--color-lightish);
  margin-top: 4px;
}

.form-group {
  margin-bottom: 20px;
}
.form-group:last-child {
  margin-bottom: 0;
}
.form-group h4 {
  color: var(--color-light);
  font-size: 13px;
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-group .form-group-hint {
  font-size: 12px;
  color: var(--color-lighten);
  margin: -8px 0 12px;
}

.lore-group {
  margin-bottom: 16px;
}
.lore-group:last-child {
  margin-bottom: 0;
}

.lore-type {
  font-size: 11px;
  color: var(--color-lighten);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--color-mid);
}

.btn-add {
  margin-bottom: 12px;
}

/**
 * Editable Table Component
 * Spreadsheet-style table with resizable columns and inline editing
 * Used in Writer's Bible, potentially reusable elsewhere
 */
.editable-table-wrapper {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
}

.tab-content:has(.editable-table) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

b, strong {
  font-weight: 600 !important;
}

.editable-table {
  min-width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.editable-table thead {
  position: sticky;
  top: 0;
  background: var(--panel-bg);
  z-index: 1;
}
.editable-table thead th {
  box-sizing: border-box;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-lightish);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.editable-table thead th:hover {
  color: var(--color-light);
}
.editable-table th {
  position: relative;
}
.editable-table th::after {
  content: "";
  position: absolute;
  right: 0;
  top: 25%;
  height: 50%;
  width: 3px;
  background: transparent;
  cursor: col-resize;
  transition: background 0.15s;
}
.editable-table th:hover::after {
  background: rgba(255, 255, 255, 0.2);
}
.editable-table th:last-child::after {
  display: none;
}
.editable-table td:first-child, .editable-table th:first-child {
  padding-left: 24px !important;
}
.editable-table td:last-child, .editable-table th:last-child {
  padding-right: 24px !important;
}
.editable-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}
.editable-table tbody tr.blank-row {
  background: transparent;
}
.editable-table tbody tr td {
  padding: 20px 14px;
  vertical-align: top;
  color: var(--color-light);
  font-size: 16px;
  font-family: var(--font-mono);
  line-height: 1.95;
  cursor: text;
  text-wrap: balance;
}
.editable-table tbody tr td:hover {
  outline: none;
  background: rgba(100, 100, 100, 0.08);
}
.editable-table tbody tr td:focus {
  outline: none;
  background: rgba(100, 140, 180, 0.15);
}
.editable-table tbody tr td:empty::before {
  content: attr(data-placeholder);
  opacity: 0.35;
  pointer-events: none;
}
.editable-table tbody tr:nth-child(odd) {
  background: rgba(0, 0, 0, 0.05);
}
.editable-table tbody tr:nth-child(odd) td:hover {
  background: rgba(100, 100, 100, 0.12);
}
.editable-table tbody tr:nth-child(odd) td:focus {
  background: rgba(100, 140, 180, 0.18);
}

/**
 * Writer's Bible Modal
 * Modal-specific layout for tabbed content
 */
.writer-bible-content {
  min-width: 480px;
  min-height: 500px;
}
.writer-bible-content .modal-header {
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.writer-bible-content .modal-header h3 {
  flex: 1;
}
.writer-bible-content .tabs {
  flex-shrink: 0;
}
.writer-bible-content .tab-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.writer-bible-content .tab-panel {
  flex: 1;
  overflow: hidden;
}
.writer-bible-content .tab-panel.active {
  display: flex;
  flex-direction: column;
}
.writer-bible-content .tab-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.writer-bible-content .tab-footer {
  flex-shrink: 0;
  padding: 12px 20px;
  border-top: 1px solid var(--color-darkish);
  display: flex;
  justify-content: flex-start;
}

.list-item-actions {
  display: flex;
  gap: 4px;
}
.list-item-actions .btn-icon {
  opacity: 0.4;
  transition: opacity 0.15s;
}
.list-item-actions .btn-icon:hover {
  opacity: 1;
}

.close-btn,
.add-tab-btn {
  font-size: 24px !important;
  padding: 6px 12px !important;
  max-width: 2em !important;
  min-width: 48px;
}
.close-btn:hover,
.add-tab-btn:hover {
  opacity: 1;
}

.add-tab-btn {
  margin-left: auto;
}

.writer-bible-content td b, .writer-bible-content td strong {
  font-weight: 700;
}
.writer-bible-content td u {
  text-decoration: underline;
}

/**
 * Toast notifications
 * Transient feedback messages matching modal theming
 */
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--panel-bg);
  border-radius: var(--radius-md);
  font-size: 14px;
  letter-spacing: 0.03em;
  color: var(--color-light);
  box-shadow: var(--panel-shadow);
}
.toast .icon {
  margin: -6px;
  margin-right: 0;
  --icon-size: 32px;
  --icon-padding: 2px;
  --icon-inner-padding: 0;
}
.toast.danger {
  background: var(--color-danger-bg);
  color: var(--color-danger-bright);
}
.toast.success {
  background: var(--color-success-bg);
  color: var(--color-success-bright);
}
.toast.warning {
  background: var(--color-warning-bg);
  color: var(--color-warning-bright);
}
.toast.info {
  display: flex;
  position: static;
  background: var(--color-info-bg);
  color: var(--color-info-bright);
}
.toast .btn {
  margin-left: auto;
}

/**
 * Sidebar Component
 * Tabbed interface for JSON data, help, and tools
 */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  pointer-events: none;
}

body.editor-loading .main-content {
  opacity: 0 !important;
  pointer-events: none !important;
}

.main-content {
  transition: opacity 0.2s 0.1s ease, scale 0.5s 0.1s ease;
  flex: 1;
  position: relative;
  overflow: hidden;
}

.sidebar-trigger {
  background: var(--color-midlow);
  border: 2px solid var(--color-mid);
  color: var(--color-light);
  padding: 6px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: 12px;
}
.sidebar-trigger:hover {
  background: var(--color-mid);
}

.sidebar {
  width: 0;
  min-width: 0;
  background: var(--color-dark);
  background: rgba(19, 19, 21, 0.9);
  -webkit-backdrop-filter: blur(16px);
          backdrop-filter: blur(16px);
  overflow: hidden;
  transition: width 0.3s ease, min-width 0.3s ease;
  z-index: 10;
  position: relative;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
}
.sidebar.open {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
}
.sidebar .sidebar-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--color-lighten);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  z-index: 10;
  width: auto;
}
.sidebar .sidebar-close:hover {
  background: var(--color-mid);
  color: var(--color-light);
}
.sidebar .tabs {
  width: 100%;
  min-width: var(--sidebar-width);
  padding: 0 0.5em;
}
.sidebar .tabs .tab-button {
  padding-top: 1.5em;
}
.sidebar .tab-content {
  min-width: var(--sidebar-width);
}
.sidebar #json-tab .tab-body {
  padding: 0;
}
.sidebar #json-tab .tab-body pre {
  margin: 0;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 17px;
  line-height: 1.5;
  color: var(--color-lighten);
  white-space: pre-wrap;
  word-break: break-word;
  height: 100%;
  overflow-y: auto;
  box-sizing: border-box;
  width: 100%;
}
.sidebar #json-tab .tab-body pre::-webkit-scrollbar {
  display: none;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.sidebar #json-tab .tab-body pre .json-selected {
  color: #ffffff;
  font-weight: bold;
}
.sidebar #json-tab .tab-body pre .json-dimmed {
  color: var(--color-lighten);
  opacity: 0.7;
  line-height: 1.4;
}
.sidebar #help-tab .tab-body {
  padding-bottom: 60px;
}
.sidebar #help-tab .tab-body h3 {
  color: var(--color-lightish);
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 500;
  display: none;
}
.sidebar #help-tab .tab-body h3.section-group {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-mid);
  margin: 16px 0 8px 0;
  padding-top: 12px;
  border-top: 1px solid var(--color-darkish);
  position: sticky;
  top: -20px;
  z-index: 2;
  background: var(--color-darker);
  padding-bottom: 4px;
}
.sidebar #help-tab .tab-body h3.section-group:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 8px;
}
.sidebar #help-tab li kbd {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-light);
  padding: 3px 6px;
  min-width: 20px;
  text-align: center;
  border-radius: var(--radius-sm);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.sidebar #tools-tab .tool-btn {
  background: transparent;
  border: none;
  color: var(--color-lighten);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  display: block;
  width: 100%;
  text-align: left;
}
.sidebar #tools-tab .tool-btn:hover {
  background: var(--hover-overlay);
  color: var(--color-light);
}
.sidebar #tools-tab .tool-output {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-lighten);
  min-height: 40px;
  opacity: 0.6;
}
.sidebar #tools-tab .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-lighten);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  position: relative;
}
.sidebar #tools-tab .checkbox-label:hover {
  background: var(--hover-overlay);
  color: var(--color-light);
}
.sidebar #tools-tab .checkbox-label input[type=checkbox] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.sidebar #tools-tab .checkbox-label::after {
  content: "";
  margin-left: auto;
  width: var(--icon-small);
  height: var(--icon-small);
  background-image: url("_img/icon-circle.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.3;
  transition: opacity 0.15s ease;
}
.sidebar #tools-tab .checkbox-label:has(input:checked)::after {
  background-image: url("_img/icon-check.svg");
  opacity: 0.8;
}
.sidebar #tools-tab .checkbox-label:has(input:checked) {
  color: var(--color-light);
}

.object-type-list {
  display: contents;
}

.top-scorers-wrapper {
  margin-top: auto;
  position: sticky;
  bottom: -20px;
  background: linear-gradient(to right, var(--color-darker) 0%, transparent 20px, transparent calc(100% - 20px), var(--color-darker) 100%), linear-gradient(to top, var(--color-darker) 0%, transparent 100%);
  margin-bottom: -20px;
  margin-left: -20px;
  margin-right: -20px;
  padding: 20px;
}

.top-scorers {
  background: var(--panel-bg);
  -webkit-backdrop-filter: blur(5px);
          backdrop-filter: blur(5px);
  border-radius: var(--radius-lg);
  padding: 8px;
  box-shadow: 0 1px 5px rgba(27, 26, 26, 0.3), inset 0 0 0 1px rgba(234, 233, 232, 0.1);
  display: flex;
  align-items: flex-end;
  gap: 4px;
}
.top-scorers .bar-item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.top-scorers .bar-item .bar {
  width: 100%;
  max-width: 36px;
  background: rgba(76, 175, 80, 0.1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
  box-sizing: border-box;
}
.top-scorers .bar-item .bar img {
  width: var(--icon-small);
  height: var(--icon-small);
  opacity: 0.85;
}
.top-scorers .bar-item .bar-count {
  font-size: 11px;
  color: var(--color-light);
  margin-top: 5px;
}
.top-scorers .bar-item .bar-label {
  font-size: 8px;
  color: var(--color-mid);
  text-transform: uppercase;
  margin-top: 1px;
}

.sidebar-panel {
  background: var(--panel-bg);
  -webkit-backdrop-filter: var(--panel-blur);
          backdrop-filter: var(--panel-blur);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  border-radius: var(--panel-radius);
  padding: var(--panel-padding);
  box-shadow: var(--panel-shadow), var(--panel-border);
}
.sidebar-panel > h4 {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-lighten);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  opacity: 0.5;
  line-height: 1;
  margin: 0 0 4px 0;
  padding: 0.4em;
}
#layer-tab .sidebar-panel > h4, #room-tab .sidebar-panel > h4 {
  position: sticky;
  top: -20px;
  z-index: 1;
  background: var(--color-midlower);
  border-radius: var(--panel-radius) var(--panel-radius) 0 0;
  margin: 0 calc(-1 * var(--panel-padding)) 4px;
  padding: 0.4em calc(var(--panel-padding) + 0.4em);
}

.z-index-header {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-lighten);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  opacity: 0.5;
  line-height: 1;
  padding: 0.4em;
  margin: 10px 0 4px 0;
}
.z-index-header:first-child {
  margin-top: 0;
}

.tab-body ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tab-body ul > li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: var(--radius-sm);
  margin-bottom: 1px;
  font-size: 12px;
}
.tab-body ul > li:hover {
  background: var(--hover-overlay);
}
.tab-body ul > li:hover .type-count {
  opacity: 0.6;
}
.tab-body ul > li:hover .type-toggle {
  opacity: 0.4;
}
.tab-body ul > li > .type-icon {
  width: var(--icon-small);
  height: var(--icon-small);
  opacity: 0.7;
  flex-shrink: 0;
}
.tab-body ul > li > .icon {
  margin: -4px;
  --icon-size: 32px;
  --icon-padding: 6px;
  --icon-inner-padding: 0;
  opacity: 0.7;
  flex-shrink: 0;
}
.tab-body ul > li > span:not(.icon) {
  color: var(--color-light);
}
.tab-body ul > li .type-name {
  flex: 1;
  color: var(--color-light);
  text-transform: capitalize;
}
.tab-body ul > li .type-count {
  font-family: var(--font-mono);
  min-width: 24px;
  text-align: right;
  font-size: 11px;
  opacity: 0.3;
  transition: opacity 0.15s ease;
}
.tab-body ul > li .type-toggle {
  width: var(--icon-large);
  height: var(--icon-large);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.2;
  transition: opacity 0.15s ease;
}
.tab-body ul > li .type-toggle:hover {
  opacity: 1;
}
.tab-body ul > li .type-toggle img {
  width: var(--icon-small);
  height: var(--icon-small);
  filter: brightness(2);
}
.tab-body ul > li.hidden-type {
  opacity: 0.5;
}
.tab-body ul > li.hidden-type .type-name {
  text-decoration: line-through;
}
.tab-body ul > li.locked-type {
  background: var(--color-mid);
}
.tab-body ul > li.zero-count {
  display: none;
}

.tab-body section.empty-group {
  display: none;
}

.tab-body ul li.room-object-row {
  cursor: pointer;
  border-left: 2px solid transparent;
}
.tab-body ul li.room-object-row:hover {
  background: rgba(255, 255, 255, 0.05);
}
.tab-body ul li.room-object-row.selected {
  background: rgba(255, 255, 255, 0.08);
  border-left-color: var(--color-accent);
}
.tab-body ul li.room-object-row.obj-hidden {
  opacity: 0.4;
}
.tab-body ul li.room-object-row.obj-hidden .type-name {
  text-decoration: line-through;
}
.tab-body ul li.room-object-row.obj-locked .type-name {
  color: var(--color-mid);
}
.tab-body ul li.room-object-row.grabbed {
  margin: 10px 0;
  background: rgba(255, 255, 255, 0.1);
}
.tab-body ul li.room-object-row.dragging {
  margin: 10px 0;
  opacity: 0.1;
}
.tab-body ul li .type-pos {
  display: none;
}
.tab-body ul li .drag-handle {
  cursor: grab;
  opacity: 0.5;
  margin-right: 4px;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.tab-body ul li .drag-handle:hover {
  opacity: 1;
}
.tab-body ul li .drag-handle:active {
  cursor: grabbing;
}
.tab-body ul li .z-override-badge {
  font-size: 10px;
  opacity: 0.6;
  color: var(--color-accent);
  margin-left: 4px;
}

.room-list-empty {
  padding: 20px;
  text-align: center;
  color: var(--color-mid);
  font-size: 12px;
}

#maps-tab .tab-body {
  position: relative;
}

.maps-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.maps-panel .maps-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stats-panel {
  flex-shrink: 0;
}

.maps-stats {
  display: flex;
  align-items: flex-end;
  gap: 4px;
}
.maps-stats .stat-item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.maps-stats .stat-item .stat-bar {
  width: 100%;
  max-width: 36px;
  background: rgba(76, 175, 80, 0.1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
  box-sizing: border-box;
}
.maps-stats .stat-item .stat-count {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-light);
  margin-top: 4px;
}
.maps-stats .stat-item .stat-label {
  font-size: 9px;
  color: var(--color-lighten);
  text-transform: uppercase;
  opacity: 0.5;
  margin-top: 2px;
}

.maps-list {
  display: contents;
}

#dialog-tab .tab-body {
  gap: 12px;
}
#dialog-tab .sidebar-panel:first-child {
  flex-shrink: 0;
  max-height: 180px;
  overflow-y: auto;
}
#dialog-tab .dialog-graph-section {
  flex: 1;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  padding: 0;
}
#dialog-tab .dialog-graph-section > h4 {
  flex-shrink: 0;
  padding: var(--panel-padding);
  margin: 0;
}
#dialog-tab .dialog-graph-section canvas {
  flex: 1;
  width: 100%;
  min-height: 250px;
}

.dialog-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 120px;
  overflow-y: auto;
}
.dialog-list .empty-state {
  width: 100%;
  text-align: center;
  color: var(--color-mid);
  font-size: 12px;
  padding: 12px;
}

.dialog-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  font-size: 11px;
  white-space: nowrap;
}
.dialog-item .dialog-name {
  color: var(--color-light);
}
.dialog-item .dialog-meta {
  font-family: var(--font-mono);
  font-size: 9px;
  opacity: 0.5;
}
.dialog-item.active {
  background: var(--color-select, #5DA9E9);
  color: var(--color-dark);
}
.dialog-item.active .dialog-name {
  color: var(--color-dark);
}
.dialog-item.active .dialog-meta {
  color: var(--color-dark);
  opacity: 0.6;
}

.map-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
}
.map-item:hover {
  background: var(--hover-overlay);
}
.map-item:hover .map-delete-btn {
  opacity: 0.4;
}
.map-item:hover .map-delete-btn:hover {
  opacity: 1;
}
.map-item .map-thumbnail {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  opacity: 0.6;
}
.map-item .map-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.map-item .map-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-light);
  line-height: 1.2;
}
.map-item .map-meta {
  font-size: 10px;
  color: var(--color-lighten);
  display: flex;
  gap: 8px;
  line-height: 1.2;
  opacity: 0.5;
}
.map-item .map-delete-btn {
  background: transparent;
  border: none;
  color: var(--color-lighten);
  cursor: pointer;
  font-size: 11px;
  padding: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.map-item .map-delete-btn:hover {
  color: var(--color-danger);
}
.map-item .map-delete-btn:focus {
  outline: none;
}
.map-item.active {
  background: var(--hover-overlay);
}
.map-item.map-item-new {
  opacity: 0.5;
  padding: 8px 6px;
}
.map-item.map-item-new:hover {
  opacity: 1;
}
.map-item.map-item-new:hover .map-new-btn {
  opacity: 0.8;
}
.map-item.map-item-new .map-new-btn {
  background: transparent;
  border: none;
  color: var(--color-lighten);
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  cursor: pointer;
  font-size: 20px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.4;
  padding: 0;
}
.map-item.map-item-new .map-new-btn:hover {
  opacity: 1;
  color: var(--color-info);
}
.map-item.map-item-new .map-new-btn:focus {
  outline: none;
}
.map-item.map-item-new .map-name {
  font-weight: 400;
  opacity: 0.8;
}
.map-item.map-item-new .map-meta {
  opacity: 0.6;
}

/**
 * Dialog Editor - imports modular components
 *
 * Structure:
 * - dialog/_dialog-base.scss       - container, canvas
 * - dialog/_dialog-layout.scss     - positioning
 * - dialog/_dialog-node-panel.scss - sidebar panels (header, lines, options, flags, notes)
 * - dialog/_dialog-preview.scss    - preview modal
 */
/**
 * Dialog Editor - Base container and canvas
 */
.dialog-editor {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--color-darker);
}
.dialog-editor.hidden {
  display: none;
}
.dialog-editor #dialog-graph-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: auto;
}

.search-match {
  box-shadow: 0 0 0 2px var(--color-select), 0 0 12px var(--color-select);
}

/**
 * Dialog Editor - Layout positioning
 */
.dialog-bottom-left {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dialog-bottom-left .minimap-panel {
  padding: 0;
  overflow: hidden;
}
.dialog-bottom-left .minimap-panel #dialog-minimap {
  display: block;
  background: var(--color-darker);
  cursor: pointer;
}
.dialog-bottom-left .graph-controls {
  flex-direction: row;
  padding: 6px 8px;
}
.dialog-bottom-left .graph-controls .zoom-level {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--color-mid);
  min-width: 40px;
  text-align: center;
}

.dialog-graph-area .minimap-panel {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 10;
}
.dialog-graph-area .minimap-panel #dialog-minimap {
  display: block;
  background: var(--color-darker);
  cursor: pointer;
}

.dialog-graph-area .graph-controls {
  bottom: 10px;
  left: 180px;
}

#dialog-align-toolbar .toolbar-group {
  pointer-events: auto;
}
#dialog-align-toolbar .radio-option.disabled {
  pointer-events: none;
}
#dialog-align-toolbar .radio-option.disabled label {
  cursor: default;
}
#dialog-align-toolbar .radio-option.disabled .icon {
  opacity: 0.15;
}

/**
 * Dialog Editor - Node Panels
 *
 * Structure:
 * .dialog-panel-stack
 *   ├── .dialog-header.ui-panel
 *   ├── .dialog-lines.ui-panel
 *   ├── .dialog-options.ui-panel
 *   ├── .dialog-flags.ui-panel
 *   └── .dialog-notes.ui-panel
 *
 * Patterns:
 * .flush  - edge-to-edge content (compensates panel padding)
 * .list   - stacked items with dividers + hover actions
 */
.dialog-sidebar {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: 440px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.dialog-sidebar > * {
  pointer-events: auto;
}

.dialog-header {
  background: var(--color-panel);
  border-radius: var(--panel-radius);
  padding: 8px 12px;
  flex-shrink: 0;
}
.dialog-header .dialog-title {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-light);
  letter-spacing: 0.02em;
}

.dialog-panel-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  pointer-events: none;
}
.dialog-panel-stack::-webkit-scrollbar {
  display: none;
}
.dialog-panel-stack {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.dialog-panel-stack > * {
  pointer-events: auto;
}
.dialog-panel-stack .empty-state {
  color: var(--color-mid);
  font-size: 11px;
  text-align: center;
  padding: 40px 20px;
}

.dialog-panel-stack .ui-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  gap: 0;
  padding: 10px;
  flex-shrink: 0;
}
.dialog-panel-stack .ui-panel .flush {
  margin: 0 -10px -10px;
}
.dialog-panel-stack .ui-panel .flush > input,
.dialog-panel-stack .ui-panel .flush > textarea {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 0 0 var(--panel-radius) var(--panel-radius);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-light);
}
.dialog-panel-stack .ui-panel .flush > input::-moz-placeholder, .dialog-panel-stack .ui-panel .flush > textarea::-moz-placeholder {
  opacity: 0.35;
}
.dialog-panel-stack .ui-panel .flush > input::placeholder,
.dialog-panel-stack .ui-panel .flush > textarea::placeholder {
  opacity: 0.35;
}
.dialog-panel-stack .ui-panel .flush > input:focus,
.dialog-panel-stack .ui-panel .flush > textarea:focus {
  outline: none;
}
.dialog-panel-stack .ui-panel .flush > textarea {
  min-height: 60px;
  resize: vertical;
}

.dialog-header textarea {
  font-weight: 700;
  font-size: 150%;
  padding: 0 16px;
}

.dialog-panel-stack .ui-panel .input-list {
  margin: 0 -10px;
  margin-left: -10px;
  margin-right: -10px;
  margin-bottom: -10px;
}

/**
 * Dialog Editor - Preview modal
 */
.dialog-preview-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  max-height: 80vh;
  background: var(--color-dark);
  border: 1px solid var(--divider);
  border-radius: var(--panel-radius);
  box-shadow: var(--panel-shadow);
  z-index: 10001;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.dialog-preview-modal .preview-header {
  padding: 12px 16px;
  background: var(--panel-bg);
  border-bottom: 1px solid var(--divider);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dialog-preview-modal .preview-header h3 {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.125em;
  text-transform: uppercase;
  color: var(--color-lighten);
  margin: 0;
}
.dialog-preview-modal .preview-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}
.dialog-preview-modal .preview-speaker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-success);
  margin-bottom: 4px;
}
.dialog-preview-modal .preview-text {
  font-size: 14px;
  color: var(--color-light);
  line-height: 1.5;
  margin-bottom: 16px;
}
.dialog-preview-modal .preview-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dialog-preview-modal .preview-options button {
  padding: 10px 14px;
  font-size: 13px;
  text-align: left;
  background: var(--hover-overlay);
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  color: var(--color-light);
  cursor: pointer;
}
.dialog-preview-modal .preview-options button:hover {
  background: var(--interactive-bg-hover);
  border-color: var(--color-select);
}
.dialog-preview-modal .preview-options button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.dialog-preview-modal .preview-end {
  text-align: center;
  color: var(--color-mid);
  font-style: italic;
}

.dialog-preview-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  z-index: 10000;
}

/**
 * Utility components
 * Helper classes, state utilities, and misc utilities
 */
.flex {
  display: flex;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.flex-row {
  display: flex;
  flex-direction: row;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.items-stretch {
  align-items: stretch;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.center {
  align-items: center;
  justify-content: center;
}

.stretch {
  align-items: stretch;
}

.start {
  align-items: flex-start;
  justify-content: flex-start;
}

.gap-2 {
  gap: 2px;
}

.gap-4 {
  gap: 4px;
}

.gap-6 {
  gap: 6px;
}

.gap-8 {
  gap: 8px;
}

.gap-12 {
  gap: 12px;
}

.gap-16 {
  gap: 16px;
}

.w-full {
  width: 100%;
}

.hidden {
  display: none !important;
}

[disabled] {
  box-shadow: none !important;
  background: none !important;
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.w-200 {
  width: 200px;
}

#room-props-control {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.prop-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.prop-input-wrap:has(.icon.suffix) .prop-input {
  padding-right: 26px;
}

.prop-input-stack {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-direction: column;
}

.prop-input {
  width: 100%;
  height: var(--input-height);
  text-align: right;
  padding: 0 20px 0 6px;
  font-size: var(--ui-font-input);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  background: var(--track-bg);
  border: 1px solid var(--track-border);
  border-radius: var(--input-radius);
  color: var(--color-light);
  box-sizing: border-box;
}
.prop-input:hover, .prop-input:focus {
  outline: none;
  background: var(--track-bg-hover);
}
.prop-input::-webkit-outer-spin-button, .prop-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.prop-input {
  -moz-appearance: textfield;
}

.autocomplete-wrap {
  position: relative;
  width: 100%;
  background: var(--track-bg);
  border: 1px solid var(--track-border);
  border-radius: 16px;
  height: 32px;
}
.autocomplete-wrap:hover, .autocomplete-wrap:focus-within {
  background: var(--track-bg-hover);
}
.autocomplete-wrap.disabled {
  opacity: 0.35;
  pointer-events: none;
}
.autocomplete-wrap .autocomplete-ghost {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
  font-family: var(--font-mono);
  line-height: 32px;
  color: var(--color-light);
  opacity: 0.35;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
}
.autocomplete-wrap .prop-input {
  width: 100%;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: 16px;
  position: relative;
  z-index: 1;
  padding: 0 32px 0 14px;
  font-size: 13px;
  text-align: left;
}
.autocomplete-wrap .prop-input::-moz-placeholder {
  opacity: 0.3;
}
.autocomplete-wrap .prop-input::placeholder {
  opacity: 0.3;
}
.autocomplete-wrap .prop-input:hover, .autocomplete-wrap .prop-input:focus {
  background: transparent;
  outline: none;
}
.autocomplete-wrap .input-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0;
  border: none;
  background: none;
  color: var(--color-light);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.2;
  z-index: 2;
}
.autocomplete-wrap .input-clear-btn:hover {
  opacity: 1;
}
.autocomplete-wrap .autocomplete-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  margin-bottom: 4px;
  background: var(--color-dark);
  border: 1px solid var(--track-border);
  border-radius: 8px;
  max-height: min(300px, 50vh);
  overflow-y: auto;
  z-index: 10;
  display: none;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.5);
}
.autocomplete-wrap .autocomplete-dropdown.show {
  display: block;
}
.autocomplete-wrap .autocomplete-dropdown .autocomplete-item {
  padding: 8px 14px;
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--color-light);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.autocomplete-wrap .autocomplete-dropdown .autocomplete-item b {
  color: var(--color-select, #5DA9E9);
  font-weight: 600;
}
.autocomplete-wrap .autocomplete-dropdown .autocomplete-item:hover, .autocomplete-wrap .autocomplete-dropdown .autocomplete-item.active {
  background: var(--track-bg-hover);
}
.autocomplete-wrap .autocomplete-dropdown .autocomplete-item.active {
  background: var(--color-select, #5DA9E9);
  color: var(--color-dark);
}
.autocomplete-wrap .autocomplete-dropdown .autocomplete-item.active b {
  color: var(--color-dark);
}
.autocomplete-wrap .autocomplete-dropdown .autocomplete-item.current {
  opacity: 0.6;
}
.autocomplete-wrap .autocomplete-dropdown .autocomplete-item .dialog-badge {
  float: right;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
}
.autocomplete-wrap .autocomplete-dropdown .autocomplete-item .dialog-badge.current {
  color: var(--color-select, #5DA9E9);
}
.autocomplete-wrap .autocomplete-dropdown .autocomplete-item .dialog-badge.here {
  background: rgba(93, 169, 233, 0.2);
  color: var(--color-select, #5DA9E9);
}
.autocomplete-wrap .autocomplete-dropdown .autocomplete-item .dialog-badge.other {
  background: rgba(173, 173, 176, 0.15);
  color: var(--color-light);
  opacity: 0.6;
}
.autocomplete-wrap .autocomplete-dropdown .autocomplete-item .dialog-badge.mixed {
  background: rgba(93, 169, 233, 0.15);
  color: var(--color-select, #5DA9E9);
}

.prop-suffix {
  position: absolute;
  right: 0px;
  font-size: var(--ui-font-suffix);
  color: var(--color-light);
  opacity: 0.5;
  pointer-events: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
  font-size: 11px;
  text-align: center;
  min-width: 2.25em;
}

.action-btns {
  display: flex;
  gap: 2px;
  padding: 4px 0;
  width: 100%;
  justify-content: center;
}

.action-divider {
  width: var(--icon-tiny);
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 4px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0.4;
  white-space: nowrap;
}
.action-btn:hover:not([disabled]) {
  opacity: 1;
}
.action-btn:active:not([disabled]) {
  opacity: 1;
}
.action-btn.active {
  opacity: 1;
  background: rgba(100, 150, 255, 0.2);
}
.action-btn[disabled] {
  opacity: 0.2;
  cursor: not-allowed;
  pointer-events: none;
}
.action-btn img {
  width: var(--icon-medium);
  height: var(--icon-medium);
}

#props-control .control-content {
  opacity: 0.3;
  pointer-events: none;
}
#props-control.props-enabled .control-content {
  opacity: 1;
  pointer-events: auto;
}
#props-control .lock-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  width: 44px;
  padding: 4px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0.5;
}
#props-control .lock-toggle:hover {
  opacity: 1;
}
#props-control .lock-toggle img {
  width: var(--icon-medium);
  height: var(--icon-medium);
}
#props-control .spacing-control {
  display: flex;
  gap: 6px;
  width: 100%;
  justify-content: center;
}
#props-control .distribute-buttons {
  display: flex;
  gap: 4px;
}

.spawn-input-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.spawn-input-row .autocomplete-wrap {
  flex: 1;
}
.spawn-input-row #dialog-edit-btn {
  flex-shrink: 0;
}
.spawn-input-row:not(.npc-mode) #dialog-edit-btn {
  display: none;
}

.info {
  position: fixed;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.8);
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid #555;
  font-size: 12px;
  line-height: 1.4;
  display: none;
  transform-origin: top left;
  transform: scale(1);
  zoom: 1;
  -webkit-text-size-adjust: none;
  -ms-text-size-adjust: none;
}

.angle-input-wrap {
  flex-shrink: 0;
}
.angle-input-wrap .prop-input {
  field-sizing: content;
  width: auto;
  min-width: 2ch;
  max-width: 7ch;
  height: auto;
  padding: 2px 0;
  text-align: left;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: text;
}
.angle-input-wrap .prop-input:hover {
  background: transparent;
}
.angle-input-wrap .prop-input:focus {
  padding: 2px 4px;
  margin: 0 -4px;
  background: var(--track-bg-hover);
  border-radius: var(--input-radius);
  color: var(--color-light);
}
.angle-input-wrap .prop-suffix {
  position: static;
  min-width: 0;
  opacity: 1;
  font: inherit;
  letter-spacing: 0;
  color: inherit;
}

#waypoint-dur-control {
  flex-wrap: wrap;
}
#waypoint-dur-control #waypoint-motor-radios {
  flex-basis: 100%;
}

html:not(.mode-room):not(.mode-zone) .when-room:not(.when-world),
html:not(.mode-room):not(.mode-zone) .when-draw:not(.when-world),
html:not(.mode-room):not(.mode-zone) .when-object:not(.when-world),
html:not(.mode-room):not(.mode-zone) .when-decal,
html:not(.mode-room):not(.mode-zone) .when-zone,
html:not(.mode-room):not(.mode-zone) .when-dialog {
  display: none !important;
}

html.mode-room .when-world:not(.when-room):not(.when-object):not(.when-draw) {
  display: none !important;
}

html.mode-room:not(.mode-draw) .when-draw:not(.when-room):not(.when-object),
html.mode-room:not(.mode-draw) .when-decal:not(.when-room):not(.when-object) {
  display: none !important;
}

html.mode-draw .when-object:not(.when-draw) {
  display: none !important;
}

html.mode-draw:not(.mode-decal) .when-decal {
  display: none !important;
}

html.mode-zone .when-world:not(.when-zone) {
  display: none !important;
}

html:not(.mode-zone) .when-zone {
  display: none !important;
}

html.mode-dialog .when-object {
  display: none !important;
}
html.mode-dialog .ui-toolbar.bottom-right {
  display: none !important;
}
html.mode-dialog .sidebar {
  display: none !important;
}
html.mode-dialog .ui-toolbar.center:not(.when-dialog) {
  display: none !important;
}
html.mode-dialog #version-control {
  display: none !important;
}

html.mode-room:not(.mode-dialog) .when-dialog:not(.when-room) {
  display: none !important;
}

html:not(.mode-dialog) .when-dialog {
  display: none !important;
}

html.mode-link .when-object {
  display: none !important;
}

html.mode-room:not(.mode-link) .when-link:not(.when-room) {
  display: none !important;
}

html:not(.mode-link) .when-link {
  display: none !important;
}

/**
 * Documentation Page Styles
 * Component showcase and pattern library
 */
.doc-h1, .doc-h2, .doc-h3, .doc-h4 {
  font-weight: 450;
  margin-bottom: 0.25em;
  line-height: 1;
}

.doc-h2, .doc-h3, .doc-h4 {
  margin-bottom: 0.5em;
}
.doc-h2:not(:first-child), .doc-h3:not(:first-child), .doc-h4:not(:first-child) {
  margin-top: 3em;
}

.doc-h1 {
  font-size: clamp(28px, 5vw, 42px);
}

.doc-h2 {
  font-size: clamp(22px, 4vw, 32px);
}

.doc-h3 {
  font-size: clamp(10px, 2.5vw, 14px);
  color: var(--color-lighten);
  letter-spacing: 0.035em;
}

.doc-h4 {
  font-size: clamp(14px, 2vw, 18px);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

.doc-p {
  color: var(--color-lighten);
  margin-top: 0.25em;
  margin-bottom: 1em;
}

.doc-main .component-item,
.doc-main .doc-section {
  z-index: 0;
}
.doc-main .component-item > strong, .doc-main .component-item > b,
.doc-main .doc-section > strong,
.doc-main .doc-section > b {
  font-weight: 600;
}

.h1 {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 500;
  line-height: 1.2;
}

.h2 {
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 500;
  line-height: 1.2;
}

.h3 {
  font-size: clamp(13px, 3vw, 20px);
  font-weight: 500;
  line-height: 1.3;
}

.h4 {
  font-size: clamp(14px, 2vw, 18px);
  font-weight: 600;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.text-light {
  color: var(--color-light);
}

.text-muted {
  color: var(--color-lighten);
}

.text-dim {
  color: var(--color-lighten);
  opacity: 0.7;
}

.font-normal {
  font-weight: 400;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-mono {
  font-family: var(--font-mono);
}

.doc-search-wrap {
  position: relative;
  background: var(--track-bg);
  border: 1px solid var(--track-border);
  border-radius: 16px;
  height: 32px;
}
.doc-search-wrap:hover, .doc-search-wrap:focus-within {
  background: var(--track-bg-hover);
}
.doc-search-wrap::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: url("/lonely-boing/editor/icons/tool-search.svg") center/contain no-repeat;
  opacity: 0.4;
  pointer-events: none;
  z-index: 1;
}
.doc-search-wrap:focus-within::before {
  opacity: 0.7;
}

input.doc-search[type=text] {
  width: 100%;
  height: 32px;
  padding: 0 32px 0 32px;
  background: transparent;
  border: none;
  border-radius: 16px;
  color: var(--color-light);
  font-size: 13px;
  font-family: var(--font-mono);
  outline: none;
  position: relative;
  z-index: 2;
}
input.doc-search[type=text]::-moz-placeholder {
  color: var(--color-light);
  opacity: 0.3;
}
input.doc-search[type=text]::placeholder {
  color: var(--color-light);
  opacity: 0.3;
}
input.doc-search[type=text]:hover, input.doc-search[type=text]:focus {
  background: transparent;
  outline: none;
}

.doc-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--color-light);
  opacity: 0.4;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.doc-search-clear:hover {
  opacity: 0.8;
  background: var(--track-bg);
}
.doc-search:-moz-placeholder ~ .doc-search-clear {
  display: none;
}
.doc-search:placeholder-shown ~ .doc-search-clear {
  display: none;
}

.doc-page-switcher {
  position: relative;
  flex: 1;
  min-width: 0;
}
.doc-page-switcher .btn {
  width: 100%;
  min-width: 0;
}
.doc-page-switcher .menu {
  display: none;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 200000;
  margin-top: 4px;
  background: var(--panel-bg);
  -webkit-backdrop-filter: var(--panel-blur);
          backdrop-filter: var(--panel-blur);
  box-shadow: var(--panel-shadow), var(--panel-border);
}
.doc-page-switcher.open .menu {
  display: block;
}
.doc-page-switcher a.menu-item {
  text-decoration: none;
  color: var(--color-lighter);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.025em;
}
.doc-page-switcher a.menu-item:hover {
  color: var(--color-light);
}

.doc-layout {
  display: grid;
  grid-template-columns: auto 1fr auto;
  min-height: 100vh;
  width: 100%;
}
@media (max-width: 1200px) {
  .doc-layout {
    grid-template-columns: auto 1fr;
  }
  .doc-layout .doc-aside {
    display: none;
  }
}
@media (max-width: 600px) {
  .doc-layout {
    grid-template-columns: 1fr;
  }
}
.doc-layout.nav-collapsed .doc-nav {
  width: 0;
}
.doc-layout.nav-collapsed .doc-nav .nav-header-row > *:not(.nav-toggle),
.doc-layout.nav-collapsed .doc-nav .doc-search-wrap,
.doc-layout.nav-collapsed .doc-nav .nav-content,
.doc-layout.nav-collapsed .doc-nav .nav-footer {
  visibility: hidden;
  opacity: 0;
}
.doc-layout.aside-collapsed .doc-aside {
  width: 0;
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
  border-left-color: transparent;
}
.doc-layout.aside-collapsed .doc-aside #aside-content {
  visibility: hidden;
  opacity: 0;
}
.doc-layout.nav-collapsed .doc-nav > .side-resize, .doc-layout.aside-collapsed .doc-aside > .side-resize {
  display: none;
}
.doc-layout.panel-resizing {
  cursor: ew-resize;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.doc-layout.panel-resizing .doc-nav,
.doc-layout.panel-resizing .doc-aside {
  transition: none;
}

.side-toggle {
  position: absolute;
  top: 50%;
  margin-top: -22px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  opacity: 0.2;
  cursor: pointer;
  z-index: 200;
}
.side-toggle:hover {
  opacity: 1;
}
.side-toggle:before, .side-toggle:after {
  content: "";
  position: absolute;
  left: 40%;
  top: 50%;
  width: 1em;
  height: 2px;
  background-color: var(--color-light);
  transform-origin: left center;
  transition: all 0.1s 0s var(--easing);
}
.side-toggle:before {
  transform: rotate(90deg);
}
.side-toggle:after {
  transform: rotate(-90deg);
}
.doc-nav > .side-toggle {
  right: -44px;
}
.doc-aside > .side-toggle {
  left: -44px;
}

.doc-layout:not(.nav-collapsed) .doc-nav > .side-toggle:hover:before,
.doc-layout.aside-collapsed .doc-aside > .side-toggle:hover:before {
  transform: rotate(110deg);
}
.doc-layout:not(.nav-collapsed) .doc-nav > .side-toggle:hover:after,
.doc-layout.aside-collapsed .doc-aside > .side-toggle:hover:after {
  transform: rotate(-110deg);
}

.doc-layout.nav-collapsed .doc-nav > .side-toggle:hover:before,
.doc-layout:not(.aside-collapsed) .doc-aside > .side-toggle:hover:before {
  transform: rotate(70deg);
}
.doc-layout.nav-collapsed .doc-nav > .side-toggle:hover:after,
.doc-layout:not(.aside-collapsed) .doc-aside > .side-toggle:hover:after {
  transform: rotate(-70deg);
}

.side-resize {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
  z-index: 150;
}
.doc-nav > .side-resize {
  right: -4px;
}
.doc-aside > .side-resize {
  left: -4px;
}
.side-resize:hover {
  background: var(--color-lightoff);
}

.nav-header-row {
  display: flex;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.doc-room {
  backface-visibility: hidden;
  position: relative;
  width: -moz-fit-content;
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  box-shadow: 0 0 10px var(--color-lightoff);
  border-radius: calc(var(--base) * 0.5);
}
.doc-room .grid {
  contain: unset;
}

.doc-nav {
  --nav-bg: var(--color-darker);
  position: sticky;
  top: 0;
  width: var(--panel-w, 180px);
  height: 100vh;
  background: var(--nav-bg);
  transition: width 0.35s 0s var(--easing);
  z-index: 100;
  display: flex;
  flex-direction: column;
}
@media (max-width: 600px) {
  .doc-nav {
    position: fixed;
    width: 100%;
    top: auto;
    bottom: 0;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 0;
  }
  .doc-nav .doc-search-wrap {
    display: none;
  }
  .doc-nav .nav-footer {
    display: none;
  }
  .doc-nav .nav-header {
    display: none;
  }
  .doc-nav .nav-content {
    display: flex;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    overflow: visible;
    flex: 1;
  }
  .doc-nav .nav-sections {
    display: contents;
  }
  .doc-nav .nav-section {
    display: none;
  }
  .doc-nav .nav-section:has(a.active) {
    display: block;
  }
  .doc-nav .nav-section:has(a.active) h2 {
    display: none;
  }
  .doc-nav .nav-section:has(a.active) ul {
    margin: 0;
    padding: 0;
  }
  .doc-nav .nav-section:has(a.active) a:not(.active) {
    display: none;
  }
  .doc-nav .nav-section:has(a.active) a.active {
    border: none;
    padding: 0;
    opacity: 0.7;
  }
}
.doc-nav .nav-header,
.doc-nav .nav-content,
.doc-nav .nav-footer {
  padding: 4px 20px;
}
.doc-nav .nav-header {
  padding-top: 20px;
}
.doc-nav .nav-footer {
  padding-bottom: 20px;
}
.doc-nav .nav-header {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  text-decoration: none;
}
.doc-nav .nav-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  gap: 10px;
  display: flex;
  flex-direction: column;
}
.doc-nav .nav-content::-webkit-scrollbar {
  display: none;
}
.doc-nav .nav-section {
  padding: 0;
}
.doc-nav .nav-section h2 {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-lighten);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.75;
  line-height: 2;
  padding-top: 0.4em;
}
.doc-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  margin: 0 -20px;
}
.doc-nav li {
  margin-bottom: 1px;
}
.doc-nav .nav-section a {
  display: block;
  padding: 5px 20px;
  color: var(--color-light);
  opacity: 1;
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.04em;
  border-left: 2px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-nav .nav-section a:hover, .doc-nav .nav-section a.active {
  border-left: 2px solid white;
  opacity: 1;
}
.doc-nav .nav-section a.updated::after {
  content: "";
  width: 6px;
  height: 6px;
  background: #4ade80;
  border-radius: 50%;
  margin-left: auto;
}
.doc-nav .nav-section a .nav-updated {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  border: 2px solid rgba(0, 150, 20, 0.3);
  background: rgba(0, 150, 20, 0.4);
  color: rgb(0, 200, 140);
  padding: 0px 4px;
  border-radius: 3px;
  margin-left: auto;
  white-space: nowrap;
}
.doc-nav .nav-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--divider);
}
.doc-nav .nav-footer a {
  color: var(--color-lighten);
  text-decoration: none;
  font-size: 13px;
}
.doc-nav .nav-footer a:hover {
  color: var(--color-light);
}
.doc-nav .nav-search {
  position: relative;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.3);
}
.doc-nav .nav-search .search-label {
  position: absolute;
  left: 8px;
  top: 4px;
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-lighten);
  opacity: 0.5;
  pointer-events: none;
}
.doc-nav .nav-search input {
  width: 100%;
  padding: 18px 8px 6px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--color-light);
  font-size: 13px;
  font-weight: 500;
  outline: none;
}
.doc-nav .nav-search input::-moz-placeholder {
  color: var(--color-lighten);
  opacity: 0.4;
}
.doc-nav .nav-search input::placeholder {
  color: var(--color-lighten);
  opacity: 0.4;
}
.doc-nav .nav-search input:focus {
  background: rgba(0, 0, 0, 0.1);
}
.doc-nav .nav-count {
  margin: 8px 0 0;
  padding: 0 4px;
  font-size: 10px;
  color: var(--color-lighten);
  opacity: 0.4;
}

.doc-aside {
  position: sticky;
  display: flex;
  flex-direction: column;
  top: 0;
  width: var(--panel-w, 400px);
  height: 100vh;
  padding: 24px 32px;
  overflow: visible;
  background: var(--color-darker);
  border-left: 1px solid var(--color-lightoff);
  transition: width 0.35s 0s var(--easing), padding 0.35s 0s var(--easing);
}
.doc-aside h3 {
  font-size: 24px;
  font-weight: 500;
  color: var(--color-light);
  margin: 0 0 20px;
  line-height: 1.2;
}
.doc-aside p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-lighten);
  margin: 0;
  text-wrap: balance;
  margin-top: 0.5em;
  margin-bottom: 2em;
}
.doc-aside dl {
  margin: 0;
  padding: 20px 0;
  border-top: 1px solid var(--color-lightoff);
}
.doc-aside dl:first-of-type {
  border-top: none;
  padding-top: 0;
}
.doc-aside dt {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-lightenize);
  line-height: 1;
}
.doc-aside dd {
  margin: 10px 0 0;
}
.doc-aside #aside-content {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  overflow-y: auto;
  transition: opacity 0.2s 0s var(--easing);
}
.doc-aside #aside-content::-webkit-scrollbar {
  display: none;
}
.doc-aside .aside-header {
  flex-shrink: 0;
  margin-bottom: 20px;
}
.doc-aside .aside-header h3 {
  margin: 0;
}
.doc-aside .aside-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.doc-aside .aside-row,
.doc-aside .aside-footer-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--color-lighten);
}
.doc-aside .aside-row:last-child,
.doc-aside .aside-footer-row:last-child {
  margin-bottom: 0;
}
.doc-aside .aside-row .aside-label,
.doc-aside .aside-footer-row .aside-label {
  flex-shrink: 0;
  margin-bottom: 0;
  line-height: 1;
}
.doc-aside .footer-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}
.doc-aside .chip {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-radius: 4px;
  color: var(--color-lighten);
  text-decoration: none;
  font-size: 12px;
  font-family: var(--font-mono);
}
.doc-aside .chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-light);
}
.doc-aside .props-table + .props-table {
  margin-top: 20px;
}
.doc-aside .props-table {
  width: 100%;
  font-size: 12px;
  line-height: 1;
  border-collapse: collapse;
  table-layout: fixed;
  margin-top: 12px;
}
.doc-aside .props-table th:not(:last-child), .doc-aside .props-table td:not(:last-child) {
  padding-right: 20px;
}
.doc-aside .props-table th:last-child, .doc-aside .props-table td:last-child {
  text-align: right;
}
.doc-aside .props-table th, .doc-aside .props-table td {
  padding: 12px 0;
  text-align: left;
  border-bottom: 1px solid var(--color-lightoff);
}
.doc-aside .props-table th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.075em;
  color: var(--color-lightenize);
}
.doc-aside .props-table td {
  color: var(--color-lighten);
}
.doc-aside .props-table code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 11px;
}
.doc-aside .props-table td:first-child code {
  color: var(--color-lighter);
  font-weight: 500;
}
.doc-aside .aside-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.075em;
  color: var(--color-lightenize);
  margin-bottom: 8px;
}
.doc-aside .aside-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-lighten);
  margin: 0 0 24px;
  text-wrap: balance;
}
.doc-aside .aside-code {
  margin-top: auto;
  margin-bottom: 20px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
}
.doc-aside .aside-code summary {
  display: block;
  padding: 4px 12px 0;
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.doc-aside .aside-code summary::-webkit-details-marker {
  display: none;
}
.doc-aside .aside-code summary::marker {
  display: none;
}
.doc-aside .aside-code summary .aside-label {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.doc-aside .aside-code summary .aside-label::before {
  content: "▶";
  font-size: 8px;
  width: 8px;
  text-align: center;
}
.doc-aside .aside-code pre {
  margin: 0;
  margin-top: 8px;
  max-height: 6.4em;
  overflow: scroll;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-lighter);
}
.doc-aside .aside-code[open] summary .aside-label::before {
  content: "▼";
}
.doc-aside .aside-code[open] pre {
  max-height: none;
}
.doc-aside .aside-footer {
  margin-top: auto;
  font-size: 12px;
  color: var(--color-lighten);
}

.doc-main {
  container-type: inline-size;
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.doc-main > h1 {
  margin: 0 0 8px 0;
  font-size: 28px;
  font-weight: 300;
  letter-spacing: 0.05em;
}
.doc-main > p.intro {
  margin: 0 0 40px 0;
  color: var(--color-lighten);
  font-size: 14px;
}
@media (max-width: 600px) {
  .doc-main {
    padding-bottom: 80px;
  }
}

.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

body:has(.doc-layout) #performance-profiler {
  display: none;
}

.doc-section.doc-sidebar-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@container (min-width: 1000px) {
  .doc-section.doc-sidebar-layout {
    grid-template-columns: 280px 1fr;
    gap: 24px 48px;
  }
}
.doc-section.doc-sidebar-layout > h2 {
  grid-column: 1;
  font-size: 28px;
  font-weight: 500;
  color: var(--color-light);
  margin: 0;
  line-height: 1.2;
}
.doc-section.doc-sidebar-layout > p,
.doc-section.doc-sidebar-layout > .doc-stub {
  text-wrap: balance;
  grid-column: 1;
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-lighten);
  margin: 0;
}
.doc-section.doc-sidebar-layout > .doc-meta {
  grid-column: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-lighten);
  opacity: 0.7;
  margin: 0;
}
.doc-section.doc-sidebar-layout > .doc-meta dt {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.doc-section.doc-sidebar-layout > .doc-meta dd {
  margin: 0 0 12px;
}
.doc-section.doc-sidebar-layout > .doc-ref {
  grid-column: 1;
}
.doc-section.doc-sidebar-layout > .btn.doc-ref {
  font-size: 12px;
  padding: 8px 12px;
}
.doc-section.doc-sidebar-layout > .btn.doc-ref code {
  background: none;
  padding: 0;
  color: inherit;
}
.doc-section.doc-sidebar-layout > .doc-list,
.doc-section.doc-sidebar-layout > .doc-table,
.doc-section.doc-sidebar-layout > table,
.doc-section.doc-sidebar-layout > .doc-code,
.doc-section.doc-sidebar-layout > .doc-note,
.doc-section.doc-sidebar-layout > .doc-grid,
.doc-section.doc-sidebar-layout > .doc-rules {
  grid-column: 1;
}
@container (min-width: 1000px) {
  .doc-section.doc-sidebar-layout > .doc-list,
  .doc-section.doc-sidebar-layout > .doc-table,
  .doc-section.doc-sidebar-layout > table,
  .doc-section.doc-sidebar-layout > .doc-code,
  .doc-section.doc-sidebar-layout > .doc-note,
  .doc-section.doc-sidebar-layout > .doc-grid,
  .doc-section.doc-sidebar-layout > .doc-rules {
    grid-column: 2;
    grid-row: 1/span 10;
  }
}

.doc-sidebar {
  display: contents;
}

.doc-content {
  display: contents;
}

.doc-header {
  margin-bottom: 32px;
}
.doc-header h2 {
  font-size: 24px;
  font-weight: 500;
  color: var(--color-light);
  margin: 0 0 8px;
}
.doc-header p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-lighten);
  margin: 0;
}

.doc-rules {
  --doc-rules-bg: transparent;
  --doc-rules-border: var(--color-lightoff);
  --doc-rule-bg: rgba(0, 0, 0, 0.15);
  --doc-rules-radius: 6px;
}

.doc-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--doc-rules-bg);
  border: 1px solid var(--doc-rules-border);
  border-radius: var(--doc-rules-radius);
  padding: 16px;
}
.doc-rules:has(.doc-rule:nth-child(2):last-child) .doc-rule {
  flex: 1 1 calc(50% - 8px);
}
.doc-rules:has(.doc-rule:nth-child(3):last-child) .doc-rule {
  flex: 1 1 calc(33.33% - 11px);
}
.doc-rules:has(.doc-rule:nth-child(4):last-child) .doc-rule {
  flex: 1 1 calc(25% - 12px);
}
@container (max-width: 800px) {
  .doc-rules:has(.doc-rule:nth-child(4):last-child) .doc-rule {
    flex: 1 1 calc(50% - 8px);
  }
}
.doc-rules:has(.doc-rule:nth-child(5)) .doc-rule {
  flex: 1 1 calc(33.33% - 11px);
}
@container (max-width: 600px) {
  .doc-rules:has(.doc-rule:nth-child(5)) .doc-rule {
    flex: 1 1 calc(50% - 8px);
  }
}

.doc-rule {
  background: var(--doc-rule-bg);
  border-radius: var(--doc-rules-radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.doc-rule .doc-rule-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-light);
  margin: 0;
}
.doc-rule .doc-rule-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-lighten);
  margin: 0;
}
.doc-rule .doc-rule-value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-lighter);
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 10px;
  border-radius: 4px;
  margin-top: auto;
}

.doc-rules.borderless {
  border: none;
  padding: 0;
  background: transparent;
}

.doc-rules.compact {
  gap: 8px;
  padding: 8px;
}
.doc-rules.compact .doc-rule {
  padding: 12px;
  gap: 4px;
}

.doc-rule.do {
  border-left: 3px solid #4ade80;
}
.doc-rule.do .doc-rule-title::before {
  content: "✓ ";
  color: #4ade80;
}

.doc-rule.dont {
  border-left: 3px solid #f87171;
}
.doc-rule.dont .doc-rule-title::before {
  content: "✗ ";
  color: #f87171;
}

.doc-section,
.doc-section {
  border-bottom: 1px solid var(--color-lightoff);
  padding: 64px;
}
@media (max-width: 900px) {
  .doc-section,
  .doc-section {
    padding: 32px;
  }
}
@media (max-width: 600px) {
  .doc-section,
  .doc-section {
    padding: 20px 16px;
  }
}
.doc-section,
.doc-section {
  scroll-margin-top: 24px;
  container-type: inline-size;
}
.doc-section > p.source,
.doc-section > p.source {
  margin: 0 0 24px 0;
  font-size: 12px;
  color: var(--color-lighten);
  opacity: 0.6;
  font-family: var(--font-mono);
}
@media (min-width: 1201px) {
  .doc-section > p.source,
  .doc-section > p.source {
    display: none;
  }
}

.component-item {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 4px;
  margin-bottom: 24px;
}
.component-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.component-item .component-code pre {
  padding-left: 32px;
}
.component-item > h3 {
  grid-column: 1/-1;
}
.component-item > .component-desc {
  grid-column: 1/-1;
  font-size: 14px;
  color: var(--color-lighten);
  margin: 4px 0 8px;
  line-height: 1.5;
}
@media (min-width: 1201px) {
  .component-item > .component-desc {
    display: none;
  }
}
@container (max-width: 700px) {
  .component-item {
    grid-template-columns: 1fr;
    margin-bottom: 24px;
    padding-bottom: 24px;
  }
  .component-item .component-code pre {
    padding-left: 0;
  }
}

.sandbox-item {
  margin-bottom: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--color-lightoff);
}
.sandbox-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.sandbox-item > h3 {
  margin: 0 0 16px;
}
.sandbox-item .sandbox-code {
  margin-top: 16px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 16px 20px;
  overflow-x: auto;
  max-width: -moz-fit-content;
  max-width: fit-content;
}
.sandbox-item .sandbox-code pre {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-lighter);
}
.sandbox-item .sandbox-code code {
  font-family: var(--font-mono);
}
@container (max-width: 700px) {
  .sandbox-item {
    margin-bottom: 24px;
    padding-bottom: 24px;
  }
  .sandbox-item .sandbox-code {
    padding: 12px 16px;
  }
}

.component-demo {
  position: relative;
  min-width: 200px;
  min-height: 120px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  display: flex;
  gap: 10px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.component-demo .ui-panel {
  pointer-events: auto;
}
.component-demo .demo-menu {
  position: static !important;
}
.component-demo .demo-dropdown .dropdown-menu.show {
  position: static;
}
.component-demo {
  padding: 24px;
}
@container (max-width: 700px) {
  .component-demo {
    padding: 16px;
  }
}
.component-demo.bg-dark {
  background: var(--color-darker);
}
.component-demo.bg-panel {
  background: var(--panel-bg);
  border-radius: 8px;
}
.component-demo.p-0 {
  padding: 0;
}
.component-demo.p-sm {
  padding: 10px;
}
.component-demo.p-md {
  padding: 20px;
}
.component-demo.p-lg {
  padding: 40px 20px;
}
.component-demo.w-xs {
  max-width: 200px;
}
.component-demo.w-sm {
  max-width: 400px;
}
.component-demo.w-md {
  max-width: 460px;
}
.component-demo.row {
  flex-direction: row;
}
.component-demo.wrap {
  flex-wrap: wrap;
}
.component-demo.stretch {
  align-items: stretch;
}
.component-demo.start {
  align-items: flex-start;
  justify-content: flex-start;
}
.component-demo.center {
  text-align: center;
}
.component-demo.gap-sm {
  gap: 8px;
}
.component-demo.gap-md {
  gap: 16px;
}
.component-demo.gap-lg {
  gap: 24px;
}

.component-code {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.component-code pre {
  margin: 0;
  padding: 0;
  background: transparent;
  border-radius: 6px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1.8;
  color: var(--color-lighter);
  flex: 1;
  max-width: 100%;
}
.component-code code {
  font-family: inherit;
}
.component-code:hover .copy-btn {
  opacity: 0.6;
}

.copy-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--color-mid);
  border: none;
  color: var(--color-lighten);
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.copy-btn:hover {
  opacity: 1 !important;
  background: var(--color-lighten);
  color: var(--color-dark);
}

.hl-tag {
  color: rgba(198, 120, 221, 0.9);
}

.hl-attr {
  color: rgba(209, 154, 102, 0.9);
}

.hl-str {
  color: rgba(152, 195, 121, 0.9);
}

.hl-cmt {
  color: rgba(92, 99, 112, 0.9);
  font-style: italic;
}

.convention-desc {
  width: 100%;
  font-size: 24px;
  line-height: 1.8;
  color: var(--color-light);
  margin: 0;
  padding: 1em;
  text-wrap: balance;
}
.convention-desc code {
  border-radius: 0.125em;
  padding: 0.3em 0.4em;
  font-size: 80%;
  background: var(--color-lightish);
}

.flex-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.icon-palette {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.icon-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.icon-group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-lighten);
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.icon-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 6px;
}

.cursor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  width: 100%;
}

.cursor-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 1.5em 2em;
  border-radius: var(--radius-sm);
}
.cursor-item span:last-child {
  font-size: 14px;
  color: var(--color-lighten);
  opacity: 0.7;
  text-align: center;
  display: none;
}

.cursor-icon {
  width: 24px;
  height: 24px;
}
.cursor-icon img {
  width: 24px;
  height: 24px;
  display: block;
}

.cursor-demo-box {
  width: 48px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-mid);
  border-radius: var(--radius-sm);
  font-size: 10px;
  color: var(--color-lighten);
  opacity: 0.6;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-lightish);
  border-top-color: var(--color-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner.spinner-sm {
  width: 14px;
  height: 14px;
  border-width: 1.5px;
}
.spinner.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.doc-note {
  width: 100%;
  grid-column: 1/-1;
  padding: 10px 14px;
  background: rgba(255, 193, 7, 0.1);
  border-left: 3px solid rgba(255, 193, 7, 0.6);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
  color: var(--color-light);
}
.doc-note::before {
  content: "TODO: ";
  font-weight: 600;
  color: rgba(255, 193, 7, 0.9);
}

.pattern-note {
  font-size: 13px;
  color: var(--color-lighten);
  margin: 4px 0 12px;
  padding: 8px 12px;
  background: rgba(100, 150, 255, 0.08);
  border-left: 3px solid rgba(100, 150, 255, 0.4);
  border-radius: 0 4px 4px 0;
}
.pattern-note strong {
  color: rgba(130, 170, 255, 0.9);
  font-weight: 600;
}
.pattern-note code {
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
}

.doc-table {
  box-shadow: var(--panel-border);
  border-radius: 16px;
  width: calc(100% + 24px);
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 17px;
  line-height: 2;
  margin-bottom: 20px;
  letter-spacing: 0.04em;
  text-wrap: balance;
}
.doc-table.fixed {
  table-layout: fixed;
}
.doc-table th, .doc-table td {
  padding: 20px 24px;
  text-align: left;
}
.doc-table code {
  white-space: nowrap;
}
.doc-table th > .icon {
  margin-left: -0.5em;
  margin-right: 0.5em;
}
.doc-table td > .icon {
  margin-left: -0.5em;
  margin-right: 0.5em;
}
.doc-table thead th {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1;
  font-weight: 700;
  color: var(--color-lightenize);
  padding: 12px 24px;
}
.doc-table tbody th {
  letter-spacing: 0.04em;
  font-size: 22px;
  font-weight: 500;
}
.doc-table tbody td {
  color: var(--color-lighten);
  line-height: 1.5;
}
.doc-table tbody td:first-child {
  color: var(--color-lighter);
  font-weight: 500;
  font-family: var(--font-mono);
  font-size: 15px;
  white-space: nowrap;
}
.doc-table tbody tr:nth-child(odd) td {
  background: rgba(240, 240, 255, 0.05);
}
.doc-table tbody tr:nth-child(even) td {
  background: rgba(240, 240, 255, 0.03);
}
.doc-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 16px;
}
.doc-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 16px;
}
.doc-table tbody + tbody tr:first-child td {
  border-top: 1px solid var(--color-lightoff);
}
.doc-table.module-index thead:not(:first-of-type) th {
  padding-top: 48px;
}
.doc-table.module-index thead.subhead th {
  padding-top: 8px;
  font-size: 11px;
  color: var(--color-lightenize);
}
.doc-table.module-index td:first-child {
  width: 220px;
}
.doc-table.module-index td:nth-child(2) {
  width: 60px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-lighten);
}
.doc-table.module-index tr.warn td {
  background: rgba(255, 100, 80, 0.08);
}
.doc-table.module-index tr.warn td:first-child {
  color: rgba(255, 150, 130, 0.9);
}
.doc-table.module-index tr.highlight td {
  background: rgba(255, 200, 100, 0.06);
}
.doc-table.module-index tr.highlight td:first-child {
  color: rgba(255, 220, 150, 0.85);
}
.doc-table.metrics-summary {
  width: auto;
}
.doc-table.metrics-summary td:first-child {
  font-family: inherit;
  color: var(--color-lighten);
}
.doc-table.metrics-summary td:nth-child(2) {
  text-align: right;
  padding-right: 24px;
}
.doc-table.metrics-summary td:nth-child(3) {
  font-size: 13px;
  color: var(--color-lightenize);
  font-family: var(--font-mono);
}
.doc-table.glossary {
  table-layout: fixed;
}
.doc-table.glossary th:first-child,
.doc-table.glossary td:first-child {
  width: 200px;
}
.doc-table.glossary th:nth-child(2),
.doc-table.glossary td:nth-child(2) {
  width: 100px;
}
.doc-table.glossary-2col {
  table-layout: fixed;
}
.doc-table.glossary-2col th:first-child,
.doc-table.glossary-2col td:first-child {
  width: 200px;
}
.doc-table.glossary-4col {
  table-layout: fixed;
}
.doc-table.glossary-4col th:first-child,
.doc-table.glossary-4col td:first-child {
  width: 160px;
}
.doc-table.glossary-4col th:nth-child(2),
.doc-table.glossary-4col td:nth-child(2) {
  width: 80px;
}
.doc-table.glossary-4col th:nth-child(3),
.doc-table.glossary-4col td:nth-child(3) {
  width: 60px;
}
.doc-table th:last-child:not(:first-child),
.doc-table td:last-child:not(:first-child) {
  text-align: right;
}
.doc-table td.danger {
  color: #ff8866;
}
.doc-table td.safe {
  color: #88cc88;
}
.doc-table td.warn {
  color: #ddaa55;
}
.doc-table.editable tbody tr {
  transition: background 0.1s;
}
.doc-table.editable tbody tr:hover td {
  background: rgba(255, 255, 255, 0.08) !important;
}
.doc-table.editable td:last-child {
  white-space: nowrap;
  text-align: right;
}
.doc-table.editable td.editable-cell {
  cursor: text;
}
.doc-table.editable td.editable-cell:hover {
  outline: 1px solid var(--color-lightoff);
  outline-offset: -1px;
}
.doc-table.editable td.editable-cell:focus {
  outline: 1px solid var(--color-select);
  outline-offset: -1px;
  background: rgba(255, 255, 255, 0.05);
}

.doc-code {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-x: auto;
  margin-bottom: 20px;
}
.doc-code .cmt {
  color: var(--color-lightenize);
}
.doc-code .kw {
  color: #c792ea;
}
.doc-code .str {
  color: #c3e88d;
}
.doc-code .fn {
  color: #82aaff;
}

.doc-diagram {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.7;
  white-space: pre;
  overflow-x: auto;
  color: var(--color-lighter);
  border-left: 3px solid rgba(100, 150, 255, 0.4);
  margin-bottom: 20px;
}
.doc-diagram.flow {
  border-left-color: rgba(100, 200, 150, 0.5);
}
.doc-diagram.tree {
  border-left-color: rgba(200, 150, 100, 0.5);
}

.status {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status.done {
  background: rgba(100, 200, 100, 0.2);
  color: #8f8;
}
.status.partial {
  background: rgba(255, 200, 100, 0.2);
  color: #fc8;
}
.status.todo {
  background: rgba(255, 100, 100, 0.15);
  color: #f88;
}

.term-marker {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
  margin-left: 8px;
}
.term-marker.camel {
  background: rgba(130, 170, 255, 0.2);
  color: #8af;
}
.term-marker.caps {
  background: rgba(255, 180, 100, 0.2);
  color: #fb8;
}
.term-marker.kebab {
  background: rgba(180, 130, 255, 0.2);
  color: #c8f;
}
.term-marker.prefix {
  background: rgba(100, 200, 180, 0.2);
  color: #8fc;
}
.term-marker.ambig {
  background: rgba(255, 200, 100, 0.25);
  color: #fc8;
}
.term-marker.legacy {
  background: rgba(255, 100, 100, 0.15);
  color: #f88;
}
.term-marker.new {
  background: rgba(100, 255, 150, 0.2);
  color: #8f8;
}
.term-marker.internal {
  background: rgba(100, 100, 100, 0.3);
  color: #999;
}

.marker-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  margin-bottom: 24px;
  font-size: 12px;
}
.marker-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-lighten);
}

.doc-list {
  box-shadow: var(--panel-border);
  border-radius: 16px;
  margin: 10px 0;
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-lighter);
  list-style: none;
  display: flex;
  flex-direction: column;
  margin-bottom: 3em;
}
.doc-list li {
  padding: 20px 24px;
  text-align: left;
  background: rgba(0, 0, 0, 0.2);
}
.doc-list li.title {
  letter-spacing: 0.075em;
  text-transform: uppercase;
  font-weight: 700;
  background: transparent !important;
}
.doc-list li:nth-child(odd) {
  background: rgba(240, 240, 255, 0.05);
}
.doc-list li:nth-child(even) {
  background: rgba(240, 240, 255, 0.03);
}
.doc-list li:first-child {
  border-top-left-radius: 16px;
}
.doc-list li:first-child {
  border-top-right-radius: 16px;
}
.doc-list li:last-child {
  border-bottom-left-radius: 16px;
}
.doc-list li:last-child {
  border-bottom-right-radius: 16px;
  flex: 1;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.doc-section > .desc {
  font-size: 17px;
  line-height: 1.6;
  color: var(--color-lighten);
  margin-bottom: 32px;
}

.doc-sub {
  margin-bottom: 40px;
}

.metrics-grid {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.metric-card {
  flex: 1;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 16px 20px;
  min-width: 120px;
  text-align: center;
}
.metric-card .metric-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--color-light);
  line-height: 1;
}
.metric-card .metric-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-lighten);
  margin-top: 6px;
}
.metric-card .metric-detail {
  font-size: 11px;
  color: var(--color-lightenize);
  margin-top: 4px;
  font-family: var(--font-mono);
}
.metric-card.warning {
  background: var(--color-warning-bg);
}
.metric-card.warning .metric-value {
  color: var(--color-warning-bright);
}
.metric-card.warning .metric-label {
  color: var(--color-warning);
}
.metric-card.success {
  background: var(--color-success-bg);
}
.metric-card.success .metric-value {
  color: var(--color-success-bright);
}
.metric-card.success .metric-label {
  color: var(--color-success);
}
.metric-card.danger {
  background: var(--color-danger-bg);
}
.metric-card.danger .metric-value {
  color: var(--color-danger-bright);
}
.metric-card.danger .metric-label {
  color: var(--color-danger);
}
.metric-card.info {
  background: var(--color-info-bg);
}
.metric-card.info .metric-value {
  color: var(--color-info-bright);
}
.metric-card.info .metric-label {
  color: var(--color-info);
}

.event-flow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}
@media (max-width: 600px) {
  .event-flow-grid {
    grid-template-columns: 1fr;
  }
}

.flow-card {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 16px 20px;
}
.flow-card h4 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-lightenize);
  margin: 0 0 12px;
}
.flow-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.flow-card li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 17px;
  line-height: 2;
  color: var(--color-lighter);
  border-bottom: 1px solid var(--color-lightoff);
}
.flow-card li:last-child {
  border-bottom: none;
}
.flow-card li em {
  margin-left: auto;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-lightenize);
}
.flow-card li .rank {
  display: flex;
  gap: 3px;
}
.flow-card li .rank::before, .flow-card li .rank::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-lightenize);
}
.flow-card li .rank.rank-1::before, .flow-card li .rank.rank-1::after {
  background: var(--color-lighten);
}
.flow-card li .rank.rank-2::before, .flow-card li .rank.rank-2::after {
  background: var(--color-lightenize);
}
.flow-card li .rank.rank-3::before {
  background: var(--color-lightenize);
}
.flow-card li .rank.rank-3::after {
  display: none;
}

.color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px;
}
.color-grid.compact {
  gap: 8px;
}

.color-chip {
  display: flex;
  align-items: flex-end;
  position: relative;
  width: 110px;
  height: 72px;
  border-radius: 8px;
  font-family: var(--font-mono);
  box-shadow: inset 0 0 0 1px var(--color-lightish);
  padding: 4px;
}
.color-chip .chip-label {
  width: 100%;
  background: #1e1e21;
  padding: 6px 10px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 13px;
}
.color-chip .chip-name {
  font-weight: 600;
  color: var(--color-lighter);
  line-height: 1.2;
}
.color-chip .chip-value {
  color: var(--color-lighten);
}

.canvas-demo-grid {
  display: flex;
  gap: 24px;
  padding: 20px;
}

.canvas-demo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-lighten);
}

.selection-preview {
  width: 80px;
  height: 60px;
  border-radius: 2px;
}
.selection-preview.marquee {
  background: rgba(128, 128, 128, 0.05);
  border: 1px solid rgba(128, 128, 128, 0.5);
}
.selection-preview.bounds {
  background: rgba(128, 128, 128, 0.05);
  border: 1px solid rgba(128, 128, 128, 0.5);
}
.selection-preview.offscreen {
  background: transparent;
  border: none;
  border-left: 3px solid #18A0FB;
  border-radius: 0;
}

.gizmo-preview {
  display: flex;
  gap: 20px;
  padding: 20px;
}

.gizmo-point {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid transparent;
}
.gizmo-point.corner {
  background: #5B9BD5;
}
.gizmo-point.smooth {
  background: #6ABF69;
}
.gizmo-point.control {
  background: #888888;
  width: 10px;
  height: 10px;
}
.gizmo-point.selected {
  background: #fff;
  border-color: #18A0FB;
}

.gizmo-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 0 20px 20px;
  font-size: 11px;
  color: var(--color-lighten);
}
.gizmo-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.gizmo-legend .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.gizmo-legend .dot.corner {
  background: #5B9BD5;
}
.gizmo-legend .dot.smooth {
  background: #6ABF69;
}
.gizmo-legend .dot.control {
  background: #888;
}
.gizmo-legend .dot.selected {
  background: #18A0FB;
}
.gizmo-legend .dot.cyan {
  background: rgba(79, 195, 247, 0.8);
}
.gizmo-legend .dot.green {
  background: #4CAF50;
}
.gizmo-legend .line {
  width: 16px;
  height: 2px;
}
.gizmo-legend .line.cyan {
  background: rgba(79, 195, 247, 0.8);
}
.gizmo-legend .line.red {
  background: #FF4444;
}

.guide-preview {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px;
}

.guide-line {
  width: 40px;
  height: 2px;
}
.guide-line.alignment {
  background: rgba(79, 195, 247, 0.8);
}
.guide-line.axis-lock {
  background: #FF4444;
}

.guide-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.guide-dot.midpoint {
  background: rgba(0, 188, 212, 0.8);
  border: 2px solid #fff;
}
.guide-dot.merge {
  background: rgba(76, 175, 80, 0.5);
  border: 2px solid #4CAF50;
}

.stroke-preview {
  display: flex;
  gap: 24px;
  padding: 20px;
}

.stroke-sample {
  width: 60px;
  height: 40px;
  border-radius: 4px;
}
.stroke-sample.weight {
  background: rgba(50, 50, 55, 0.8);
}
.stroke-sample.working {
  background: var(--color-lighter);
}
.stroke-sample.fill {
  background: rgba(50, 50, 55, 0.6);
}

.corner-preview {
  display: flex;
  gap: 24px;
  padding: 20px;
}

.corner-sample {
  width: 60px;
  height: 50px;
  background: rgba(69, 67, 69, 0.4);
  border: 1px solid var(--color-lightenize);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--color-lighten);
}
.corner-sample.rounded {
  border-radius: 4px;
}
.corner-sample.sharp {
  border-radius: 0;
}

.opacity-preview {
  display: flex;
  gap: 16px;
  padding: 20px;
}

.opacity-sample {
  width: 80px;
  height: 50px;
  background: rgba(69, 67, 69, 0.8);
  border: 1px solid var(--color-lightenize);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--color-lighter);
}

.breakout-card {
  background: var(--panel-bg);
  -webkit-backdrop-filter: var(--panel-blur);
          backdrop-filter: var(--panel-blur);
  border-radius: var(--panel-radius);
  box-shadow: var(--panel-shadow), var(--panel-border);
  padding: var(--space-2xl);
  width: 140px;
  height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.breakout-card.morph {
  position: relative;
  overflow: hidden;
}

.breakout-card-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 13px;
}

.breakout-card-desc {
  font-size: 10px;
  color: var(--color-lighten);
  line-height: 1.4;
  flex: 1;
}

.breakout-card-hint {
  font-size: 9px;
  color: var(--color-mid);
  font-family: var(--font-mono);
}

.breakout-active {
  box-shadow: var(--panel-shadow), var(--panel-border), 0 0 80px rgba(0, 0, 0, 0.6);
}

.breakout-full {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  padding: var(--space-2xl);
  box-sizing: border-box;
  overflow: hidden;
}

.breakout-active .breakout-full {
  position: relative;
}
