canvas { display: block; outline: none; }

.render-container {
  height: 300px;
  width: 100%;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #000;
  position: relative;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #1f2937;
}

::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
  transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.pose-viewport-title {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 15;
  border-radius: 0.375rem;
  background: rgba(0, 0, 0, 0.55);
  padding: 0.3rem 0.55rem;
  font-size: 0.75rem;
  color: #9ca3af;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.pose-viewport-action-panel,
.pose-viewport-overlay-panel {
  position: absolute;
  z-index: 15;
  display: flex;
  align-items: stretch;
  gap: 0;
  pointer-events: auto;
  transition: transform 180ms ease;
}

.pose-viewport-action-panel {
  bottom: 0.5rem;
  right: 1.75rem;
  transform: translateX(100%);
}

.pose-viewport-overlay-panel {
  top: 0.5rem;
  right: 0.5rem;
  transform: translateX(84%);
}

.pose-viewport-action-panel:hover,
.pose-viewport-action-panel:focus-within {
  transform: translateX(0%);
  right: 0.5rem;
}

.pose-viewport-overlay-panel:hover,
.pose-viewport-overlay-panel:focus-within {
  transform: translateX(0);
}

.pose-viewport-panel-handle,
.pose-viewport-panel-body {
  border: 1px solid rgba(75, 85, 99, 0.95);
  background: rgba(3, 7, 18, 0.82);
  backdrop-filter: blur(6px);
}

.pose-viewport-panel-handle {
  display: flex;
  min-width: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem 0 0 0.5rem;
  color: #cbd5e1;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.pose-viewport-overlay-panel .pose-viewport-panel-handle {
  min-width: 2.15rem;
}

.pose-viewport-panel-body {
  display: flex;
  border-left: 0;
  border-radius: 0 0.5rem 0.5rem 0;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.pose-viewport-icon-stack {
  flex-direction: row;
  gap: 0.35rem;
  padding: 0.4rem;
}

.pose-viewport-icon-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.4rem;
}

.pose-viewport-icon-btn {
  display: inline-flex;
  height: 2rem;
  width: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.45rem;
  border: 1px solid #4b5563;
  background: rgba(31, 41, 55, 0.95);
  color: #e5e7eb;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.pose-viewport-icon-btn:hover,
.pose-viewport-icon-btn:focus-visible {
  background: rgba(55, 65, 81, 1);
  border-color: #6b7280;
  color: #fff;
  transform: translateY(-1px);
}

.pose-viewport-icon-btn.is-active {
  border-color: rgba(59, 130, 246, 0.95);
  background: rgba(37, 99, 235, 0.3);
  color: #bfdbfe;
}

.pose-viewport-icon-btn i {
  pointer-events: none;
}

.pose-bone-value-shell {
  position: relative;
  display: inline-flex;
  width: 4.25rem;
  justify-content: center;
}

.pose-bone-value-btn,
.pose-bone-value-input {
  width: 100%;
  border-radius: 0.375rem;
  padding: 0.25rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.pose-bone-value-btn {
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  cursor: ew-resize;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.pose-bone-value-btn:hover,
.pose-bone-value-btn:focus-visible {
  border-color: #4b5563;
  background: rgba(17, 24, 39, 0.9);
  color: #fff;
}

.pose-bone-value-input {
  border: 1px solid #3b82f6;
  background: #030712;
  color: #fff;
  outline: none;
}

.pose-matrix-shell {
  position: relative;
  overflow: hidden;
  background: rgba(17, 24, 39, 0.6);
}

.pose-matrix-scroll {
  max-height: 34rem;
  overflow: auto;
}

.pose-matrix-scroll--compact {
  max-height: 18rem;
}

#session-matrix-body-shell .pose-matrix-scroll--compact {
  max-height: 30rem;
}

.pose-matrix-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: max-content;
}

.pose-matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #111827;
  box-shadow: inset 0 -1px 0 rgba(55, 65, 81, 0.9);
}

.pose-matrix-corner,
.pose-matrix-rowlabel {
  position: sticky;
  left: 0;
}

.pose-matrix-corner {
  z-index: 30 !important;
  background: #0f172a !important;
}

.pose-matrix-rowlabel {
  z-index: 10;
  background: #111827;
  box-shadow: inset -1px 0 0 rgba(55, 65, 81, 0.85);
}

.pose-matrix-header {
  min-width: 8rem;
  max-width: 12rem;
}

.pose-matrix-data {
  min-width: 7.5rem;
}

.pose-matrix-cell {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: 1px solid rgba(75, 85, 99, 0.45);
  background: rgba(15, 23, 42, 0.85);
  padding: 0.55rem 0.35rem;
  font-weight: 700;
  transition: transform 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.pose-matrix-cell--compact {
  border-radius: 0.375rem;
  padding: 0.2rem 0.25rem;
}

.pose-matrix-cell--static {
  cursor: default;
}

.pose-matrix-cell:hover,
.pose-matrix-cell:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(96, 165, 250, 0.8);
  background: rgba(30, 41, 59, 0.98);
  outline: none;
}

.pose-matrix-table--compact .pose-matrix-header {
  min-width: 5.5rem;
  max-width: 8rem;
}

.pose-matrix-table--compact .pose-matrix-data {
  min-width: 5.25rem;
}

.pose-matrix-table--compact .pose-matrix-rowlabel,
.pose-matrix-table--compact .pose-matrix-corner {
  max-width: 10rem;
}

.pose-matrix-cell-value {
  font-variant-numeric: tabular-nums;
}

.pose-matrix-tooltip {
  pointer-events: none;
  position: fixed;
  z-index: 999;
  width: min(22rem, calc(100vw - 24px));
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 100ms ease, transform 100ms ease;
}

.pose-matrix-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.pose-matrix-tooltip-card {
  border: 1px solid rgba(75, 85, 99, 0.95);
  border-radius: 0.75rem;
  background: rgba(2, 6, 23, 0.97);
  padding: 0.8rem;
  color: #e5e7eb;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
}

.pose-matrix-tooltip-title {
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.pose-matrix-tooltip-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.pose-matrix-tooltip-summary div,
.pose-matrix-tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.pose-matrix-tooltip-summary span,
.pose-matrix-tooltip-section,
.pose-matrix-tooltip-row span:first-child {
  color: #94a3b8;
  font-size: 0.75rem;
}

.pose-matrix-tooltip-summary strong,
.pose-matrix-tooltip-row span:last-child {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.pose-matrix-tooltip-section {
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pose-matrix-tooltip-grid {
  display: grid;
  gap: 0.25rem;
}
