:root {
  color-scheme: light;
  --panel: rgb(255 255 255);
  --button: rgb(200, 200, 200);
  --button-active: rgb(180, 180, 180);
  --text: rgb(0, 0, 0);
  --group: rgb(241 241 241);
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

html,
body {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  height: 100svh;
  height: 100lvh;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100svh;
  min-height: 100lvh;
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100svh;
  min-height: 100lvh;
  font-family: "Noto Sans", sans-serif !important;
  color: var(--text);
}

.frame {
  display: grid;
  grid-template-rows: 1fr auto;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  height: 100svh;
  height: 100lvh;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100svh;
  min-height: 100lvh;
  position: relative;
  border-radius: 15px;
  overflow: hidden;
}

.viewer-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  --right-panel-width: 350px;
  --left-panel-width: var(--right-panel-width);
  --left-offset: 0px;
  --right-offset: 0px;
  --left-tab-offset: 0px;
  --right-tab-offset: 0px;
}

.viewer-stage.has-left {
  --left-offset: var(--left-panel-width);
}

.viewer-stage.has-right {
  --right-offset: var(--right-panel-width);
}

header {
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

header h1 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

header small {
  opacity: 0.75;
}

.viewer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--left-offset, 0px);
  right: var(--right-offset, 0px);
}

.dock-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--panel);
  color: var(--text);
}

.side-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  padding: 0px 10px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
  overflow: hidden;
  z-index: 5;
}

.left-panel {
  left: 0;
  width: var(--right-panel-width);
  border-right: 1px solid var(--group);
}

.right-panel {
  right: 0;
  width: var(--right-panel-width);
  border-left: 1px solid var(--group);
}

.bottom-panel {
  margin: 0;
  padding: 0px 10px;
  width: 100%;
  border-radius: 0;
  border-top: 1px solid var(--group);
  height: 30vh;
  max-height: 30vh;
}

.dock-panel.collapsed {
  display: none;
}

.panel-header {
  padding: 0;
}

.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--group);
  padding: 0.5rem 0.8rem;
  margin: 0 -0.9rem;
}

.bottom-panel .panel-header-row {
  padding: 0.4rem 0.75rem;
  margin: 0 -0.75rem;
  justify-content: center;
}

.panel-title {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.panel-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
  overflow-y: auto;
}

.side-panel .panel-body {
  padding-right: 0px;
}

.bottom-panel .panel-body {
  padding-top: 0px;
}

.panel-tab {
  position: absolute;
  border-radius: 999px;
  background: var(--button);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  z-index: 6;
}

.panel-tab.left {
  left: 0.5rem;
  top: 0.5rem;
}

.panel-tab.right {
  right: 0.5rem;
  top: 0.5rem;
}

.panel-tab.bottom {
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
}

.panel-tab.hidden {
  display: none;
}

.progress {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.progress.show {
  opacity: 1;
}

.progress-card {
  background: rgb(255, 255, 255);
  color: rgb(0, 0, 0);
  border-radius: 10px;
  padding: 10px 16px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-color: rgb(220, 220, 220);
  width: min(180px, 80vw);
  pointer-events: none;
  align-items: stretch;
}

.progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: rgb(39, 88, 208);
  transition: width 140ms ease;
}

.progress-message {
  color: rgb(0, 0, 0);
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
  pointer-events: none;
}

.progress-title {
  color: rgb(0, 0, 0);
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
  pointer-events: none;
  font-family: "Noto Sans", sans-serif;
}

.manual-load-overlay {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: var(--panel);
  z-index: 6;
}

.manual-load-overlay.show {
  display: grid;
}

.manual-load-card {
  background: var(--panel);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  text-align: center;
  color: var(--text);
  min-width: 220px;
}

.manual-load-card .muted {
  margin-bottom: 0.75rem;
}

.manual-load-card button {
  width: 100%;
}

.shareBtnLinkIframe {
  width: 100%;
  min-height: 80px;
  resize: none;
}

.label-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: #e5e7eb;
}

.label-card-header h4 {
  margin: 0.1rem 0 0;
  font-size: 1.05rem;
}

.label-card-body {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}

.label-card-actions {
  display: flex;
  justify-content: flex-end;
}

.qrcode_container {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.75rem 0;
}

.qrcode_container_image {
  display: grid;
  place-items: center;
  width: 298px;
  height: 330px;
  background: rgb(255, 255, 255);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.qrcode_left_image {
  position: relative;
  width: 270px;
  height: 270px;
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  padding-top: 15px;
}

.qrcode_left_image canvas,
.qrcode_left_image img {
  max-width: 250px;
  max-height: 250px;
}

.qrcode_logo {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.qrcode_logo_icon {
  width: 77px;
  height: 75px;
  background: rgb(255, 255, 255);
  padding: 4px;
}

.qrcode_container_text {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.qrcode_container_text.inside {
  position: relative;
  bottom: 6px;
  color: rgb(0, 0, 0);
  border-radius: 6px;
  font-weight: 500;
  font-size: 1.5rem;
}

.label-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.label-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.label-field span {
  opacity: 0.75;
  font-size: 0.9rem;
}

.shareable-link {
  display: block;
  word-break: break-word;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  color: #e5e7eb;
  text-decoration: none;
}

.shareable-link:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.shareable-link-container {
  display: block;
  text-align: center;
  margin-top: 10px;
}

/* Share card */
.view_3d_value_share {
  width: 100%;
}

.shareCard {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 300px;
  height: 420px;
  border-radius: 15px;
  border: 1px solid var(--bordergray, rgba(255, 255, 255, 0.1));
  background-color: #fff;
  color: black;
  overflow: hidden;
  margin: 0 auto;
}

.shareCardTop {
  display: block;
  position: relative;
  width: 100%;
}

.shareCardText {
  display: block;
  position: absolute;
  width: 100%;
  bottom: 0;
  font-size: 0.75rem;
  padding: 6px 8px;
  text-align: center;
  color: #111827;
}

.shareCardBottom {
  display: flex;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 120px;
  border-top: 1px solid #e5e7eb;
  background-color: #fff;
  border-bottom-left-radius: 15px;
  border-bottom-right-radius: 15px;
}

.shareCardInfo {
  display: inline;
  float: left;
  height: 100%;
  padding: 15px;
  width: calc(100% - 110px);
}

.shareCardTitle {
  color: rgb(0, 0, 0);
  font-size: 0.9rem;
  font-weight: 600;
  padding-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shareCardDescription {
  color: rgb(0, 0, 0);
  font-size: 0.8rem;
  font-weight: 500;
  padding-bottom: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.shareCardPosterWrapper {
  width: 298px;
  height: 298px;
  overflow: hidden;
  position: relative;
  background-color: #fff;
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
}

.shareCardPoster {
  transform: scale(0.4);
  transform-origin: top left;
  pointer-events: none;
  margin: 0 auto;
  position: relative;
  left: 50%;
  transform: translate(-50%, -50%);
}

#shareCardPosterImg {
  height: 298px;
  display: block;
  position: absolute;
}

.shareCardQRcode {
  display: inline;
  float: right;
  width: 100px;
  height: 100%;
  color: #111827;
  font-size: 0.7rem;
  font-weight: 400;
  padding-top: 10px;
}

.qrcodeCardContainer {
  display: grid;
  place-items: center;
  width: 100px;
  height: 100px;
  position: relative;
}

#qrcode_right {
  width: 96px;
  height: 96px;
  position: relative;
  background: #fff;
}

.qrcode_logo_small {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 34px;
  width: 34px;
  left: 50%;
  top: 50%;
  background-color: #fff;
  transform: translate(-50%, -50%);
}

.qrcode_logo_small img {
  width: 30px !important;
  height: 30px !important;
  object-fit: contain;
}

.shareCardLogo img {
  display: block;
  position: absolute;
  width: 100px;
  height: auto;
  top: 15px;
  left: 15px;
  z-index: 2;
}

.posterWrapper {
  position: relative;
}

.shareBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--button);
  color: var(--text);
  padding: 0.4rem 0.9rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  width: 100%;
}

.shareBtn:hover {
  border: 1px solid rgb(100, 100, 100);
}

.shareBtn:active {
  border: 1px solid rgb(200, 200, 200);
}

.viewer-logo {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 5;
  display: none;
  align-items: center;
}

.viewer-close-btn {
  display: none !important;
}

/* Player mode overrides (shared/public hide edit-only chrome). */
.mode-shared #closeViewerBtn,
.mode-shared #toggleGrid,
.mode-shared #toggleAxes,
.mode-shared .panel-tab.left {
  display: none !important;
}

.viewer-logo img {
  height: 35px;
  width: auto;
}

body.mode-public .viewer-logo {
  display: none !important;
}

.eyebrow {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
}

.muted {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.78;
}

.version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.version-label {
  font-size: 0.92rem;
  opacity: 0.75;
}

.version-badge {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.35);
  font-size: 0.9rem;
  color: var(--text);
  backdrop-filter: blur(8px);
}

.viewer-toolbar {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 10px;
  z-index: 4;
}

.viewer-toolbar button {
  padding: 0.35rem 0.55rem;
  font-size: 0.85rem;
  width: auto;
}

.viewer-toolbar select {
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
  width: auto;
}

.transform-toolbar {
  top: 0.5rem;
  right: calc(0.5rem + var(--right-tab-offset));
}

.display-toolbar {
  top: 0.5rem;
  left: calc(0.5rem + var(--left-tab-offset));
}

.mode-shared .display-toolbar {
  gap: 0.6rem;
}

.mode-shared .display-toolbar #toggleAxes {
  display: none;
}

.mode-shared .transform-toolbar {
  display: none;
}

.mode-shared #toggleSpin {
  display: none;
}

.mode-viewer .transform-toolbar,
.mode-viewer .display-toolbar,
.mode-viewer #toggleSpin {
  display: none;
}

.auto-toolbar {
  left: 0.5rem;
  bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
}

.ar-toolbar {
  left: 0.5rem;
  bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  gap: 0.5rem;
}

.mode-toolbar {
  right: 0.5rem;
  bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
}

.bottom-center-toolbar {
  position: absolute;
  left: 50%;
  bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Removed share-only lock so fullscreen can be shown in all modes. */

.animation-overlay {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 10px;
}

.animation-overlay button {
  min-width: auto;
}

.animation-overlay input[type="range"] {
  width: 180px;
  padding: 6px;
}

.mode-upload .transform-toolbar {
  display: none;
}

.mode-upload #toggleGrid,
.mode-upload #toggleAxes {
  display: none;
}

.mode-upload #toggleSpin {
  display: none;
}

.qr-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 50;
}

.qr-overlay.show {
  display: flex;
}

.qr-overlay-card {
  background: rgb(255, 255, 255);
  color: black;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 18px;
  padding: 1.25rem 1.5rem;
  text-align: center;
  max-width: 360px;
}

.qr-overlay-card #qrOverlayCode canvas {
  width: 280px;
  height: 280px;
}

.qr-overlay-card #qrOverlayCode {
  position: relative;
}

.qr-logo-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: #fff;
  padding: 6px;
}

.qr-overlay-title {
  margin: 0.75rem 0 1rem;
  font-weight: 500;
  font-size: 1.4rem;
  color: #111827;
}

.info-panel {
  position: static;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  border-radius: 14px;
  width: 100%;
  font-size: 0.9rem;
}

.info-row {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  align-items: center;
  gap: 0.65rem;
}

.info-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.info-row-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.info-row .label {
  opacity: 0.8;
  letter-spacing: 0.01em;
  font-size: 0.85rem;
}

.info-row .value {
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 600;
}

.edit-row {
  grid-template-columns: 1fr;
  gap: 0.35rem;
  align-items: flex-start;
}

.fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  width: 100%;
}

.fields.single {
  grid-template-columns: 1fr;
}

.fields.inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

/* Inline field rows (e.g., Lighting HDRI + toggle) */
.fields.inline select {
  flex: 1 1 0;
  width: auto;
  max-width: 100%;
}

.fields.inline button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.info-placeholder {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.65;
}

.upload-panel .group-content {
  gap: 0.75rem;
}

.upload-panel .group + .group {
  margin-top: 0.75rem;
}

.upload-form textarea.description_textarea {
  min-height: 96px;
  resize: none;
}

.upload-plan-status {
  display: flex;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: var(--button);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.9rem;
}

.upload-plan-status .ok {
  color: rgb(39, 88, 208);
  font-weight: 600;
}

.upload-plan-status .warn {
  color: #fbbf24;
  font-weight: 600;
}

.upload-file-chip {
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  background: var(--button);
  font-size: 0.9rem;
  word-break: break-word;
}

.upload-file-hint {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: 0.3rem;
}

.upload-actions {
  width: 100%;
  flex-direction: column;
}

.upload-actions button {
  width: 100%;
}

.fields input {
  width: 100%;
  padding: 0.35rem 0.4rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: var(--button);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.fields input:disabled {
  color: var(--text);
}

.fields.single input,
.fields.single textarea {
  text-align: left;
  font-variant-numeric: normal;
}

.material-edit-row .material-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text);
}

.material-edit-row .material-edit-value {
  font-size: 0.8rem;
  opacity: 0.7;
}

.material-edit-row input[type="range"] {
  width: 100%;
}

.material-edit-row input[type="color"] {
  height: 34px;
  width: 56px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: var(--button);
}

.reset-btn {
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
  border-radius: 8px;
  line-height: 1.2;
  min-width: 56px;
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  padding: 0.5rem 0.25rem 0.25rem;
}

.bottom-panel .controls {
  grid-template-columns: 1fr;
  align-items: start;
}

.material-library-standalone {
  height: 100%;
  overflow: hidden;
}

.material-library-standalone .material-library-layout {
  height: 100%;
}

.material-library-standalone .material-library-grid {
  max-height: 100%;
  overflow-y: auto;
  padding: 10px 0px 10px 0px;
}

.right-panel .controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (max-width: 960px) {
  .bottom-panel .controls {
    grid-template-columns: 1fr;
  }
}

.group {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.75rem;
  background: var(--group);
}

#materialLibraryPanel {
  grid-column: span 1;
  min-width: 0;
  width: 100%;
}

.group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: nowrap;
  width: 100%;
  padding: 0.2rem 0;
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: transparent;
  border: none;
  text-align: left;
}

.group-arrow {
  display: inline-block;
  transform: rotate(90deg);
  transition: transform 0.15s ease;
}

.group.collapsed .group-arrow {
  transform: rotate(-90deg);
}

.group.collapsed .group-content {
  display: none;
}

.group-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  margin-left: auto;
  flex-shrink: 0;
}

.ghost-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--button);
  color: var(--text);
  border-radius: 8px;
  font-size: 0.85rem;
}

.ghost-btn.full-width {
  width: 100%;
  text-align: center;
}

.group.readonly input,
.group.readonly textarea,
.group.readonly select {
  pointer-events: none;
  user-select: none;
  background-color: var(--button);
  font-family: "Noto Sans", sans-serif;
  background-image: none;
  padding-right: 0.55rem;
}

.group.readonly .color-picker-control {
  pointer-events: none;
  opacity: 0.7;
}

.group.readonly .color-picker-panel {
  display: none !important;
}

.group.readonly {
  filter: grayscale(0.4);
}
.mode-viewer .group.readonly .edit-toggle,
.mode-shared .group.readonly .edit-toggle {
  display: none;
}

/* Hide variant create/edit buttons in viewer/shared modes */
.mode-viewer #addMaterialVariant,
.mode-shared #addMaterialVariant,
.mode-viewer #editMaterialVariant,
.mode-shared #editMaterialVariant,
.mode-viewer #deleteMaterialVariant,
.mode-shared #deleteMaterialVariant {
  display: none !important;
}

/* Hide the Viewer group in editor-like modes */
.mode-editor #closeViewerPanel,
.mode-configurator #closeViewerPanel {
  display: none !important;
}
.group.readonly .annotation-item,
.annotation-item.locked {
  pointer-events: none;
  opacity: 0.6;
}

@media (max-width: 768px) {
  .frame {
    grid-template-rows: 1fr;
    border: 0px;
  }

  /* Stack panels for mobile; right panel slides from bottom up to 50vh */
  .right-panel {
    display: flex;
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 70vh;
    height: auto;
    bottom: 0;
    top: auto;
    border-left: none;
    border-top: 1px solid var(--group);
  }

  .bottom-panel {
    display: none;
  }

  .left-panel {
    display: none;
  }

  .panel-tab.left {
    display: none !important;
  }

  .viewer-stage {
    --right-offset: 0px !important;
    --right-tab-offset: 0px !important;
    --left-offset: 0px !important;
    --left-tab-offset: 0px !important;
  }

  .viewer-stage.has-left,
  .viewer-stage.has-right {
    --left-offset: 0px !important;
    --right-offset: 0px !important;
  }

  .viewer {
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
  }

  #toggleGrid {
    display: none !important;
  }

  .panel-header .panel-toggle {
    display: inline-flex;
  }
}

.group-header-left {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}

.group-title {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.group-content {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.stack {
  display: grid;
  gap: 0.5rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.actions.wide {
  flex-wrap: nowrap;
  gap: 0.75rem;
}

.actions.wide button {
  flex: 1 1 0;
}

.share-disabled-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  padding: 24px;
  text-align: center;
}

.share-disabled-card {
  max-width: 440px;
  width: 100%;
  background: var(--panel);
  border-radius: 14px;
  padding: 22px 26px;
  color: var(--text);
}

.share-disabled-card h3 {
  margin: 0 0 8px 0;
  font-size: 1.1rem;
}

.share-disabled-card p {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.9;
}

button,
select,
input[type="url"],
input[type="range"] {
  appearance: none;
  border: 1px solid var(--button);
  background: var(--button);
  color: var(--text);
  border-radius: 10px;
  padding: 0.35rem 0.55rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
  text-align: center;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23ffffff' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 10px 6px;
  padding-right: 1.8rem;
  width: 100%;
  max-width: 100%;
  text-align-last: left;
}

.button:hover {
  border: 1px solid rgb(100, 100, 100);
}

.button:active {
  border: 1px solid rgb(200, 200, 200);
}

select option,
select optgroup {
  background: var(--panel);
  color: var(--text);
}

textarea {
  width: 100%;
  min-height: 72px;
  padding: 0.45rem 0.5rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--button);
  color: var(--text);
  resize: vertical;
  font-family: "Noto Sans", sans-serif;
}

#modelDescription {
  resize: none;
  overflow: hidden;
  height: auto;
}

/* Remove number input spinners */
input[type="number"] {
  -moz-appearance: textfield;
}

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

input[type="color"] {
  appearance: none;
  width: 100%;
  height: 38px;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(15, 23, 42, 0.9));
  cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 8px;
}

input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 8px;
}

.color-input-hidden {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.color-chip {
  width: 44px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: var(--chip-color, black);
  cursor: pointer;
}

.color-chip:hover {
  transform: translateY(-1px);

  border-color: rgba(255, 255, 255, 0.3);
}

.color-chip:active {
  transform: translateY(0);
}

.color-value {
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  font-family: "Noto Sans", sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}

button:hover,
select:hover,
input[type="url"]:hover,
input[type="range"]:hover {
  border-color: var(--text);
}

button:active,
select:active,
input[type="url"]:active,
input[type="range"]:active {
  border-color: var(--button);
}

button.active {
  background: var(--button-active);
  border-color: var(--text);
}

input[type="url"] {
  width: 100%;
}

input[type="range"] {
  width: 100%;
}

input[type="file"] {
  width: 100%;
  padding: 0.5rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  margin-right: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

input[type="file"]::file-selector-button:hover {
  border-color: var(--text);
}

/* Branding color picker */
.color-picker-control {
  position: relative;
  width: 100%;
}

.color-picker-trigger {
  width: 100%;
  min-height: 52px;
  border-radius: 12px;
  background: var(--button);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.color-picker-trigger:hover {
  border-color: var(--text);
  background-color: var(--button);
}

.color-picker-trigger:active {
  transform: translateY(1px);
}

.color-picker-swatch {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background-color: black;
}

.color-picker-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  flex: 1;
}

.color-picker-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
}

.color-picker-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.color-picker-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  font-size: 1rem;
  opacity: 0.7;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23ffffff' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 6px;
}

.color-picker-icon svg {
  display: none;
}

.color-picker-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  border: 0;
  padding: 0;
  margin: 0;
  display: none;
}

.color-picker-panel {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  width: 100%;
  border-radius: 16px;
  background-color: var(--button);
  padding: 16px;
  z-index: 30;
  display: none;
  flex-direction: column;
  gap: 12px;
}

.color-picker-panel.open {
  display: flex;
}

.color-picker-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.color-picker-close {
  border: none;
  background: transparent;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  transition: background-color 0.2s ease, color 0.2s ease;
  cursor: pointer;
}

.color-picker-close:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.color-picker-gradient {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  cursor: crosshair;
  background-image: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000 100%), linear-gradient(90deg, #fff 0%, hsl(var(--picker-hue, 210), 100%, 50%) 100%);
}

.color-picker-gradient-thumb {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;

  transform: translate(-50%, -50%);
  pointer-events: none;
}

.color-picker-hue {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff0000, #ff00ff, #0000ff, #00ffff, #00ff00, #ffff00, #ff0000);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.color-picker-hue-thumb {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;

  transform: translate(-50%, -50%);
  pointer-events: none;
}

.color-picker-fields {
  display: flex;
  align-items: center;
  gap: 16px;
}

.color-picker-preview {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background-color: rgb(255, 255, 255);
}

.color-picker-hex {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.color-picker-hex input {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0 12px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  background-color: rgba(255, 255, 255, 0.06);
}

.color-picker-hex input:focus {
  border-color: var(--text);
  outline: none;
}

.color-picker-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(36px, 1fr));
  gap: 8px;
}

.color-picker-swatch-option {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 2px solid rgba(220, 220, 220, 0.8);
  cursor: pointer;
}

.color-picker-swatch-option[data-color="none"] {
  background-image: linear-gradient(45deg, #e5e7eb 25%, transparent 25%), linear-gradient(-45deg, #e5e7eb 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e5e7eb 75%), linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
  background-color: rgb(255, 255, 255);
}

.color-picker-preview.is-transparent,
.color-picker-swatch.is-transparent {
  background-image: linear-gradient(45deg, #e5e7eb 25%, transparent 25%), linear-gradient(-45deg, #e5e7eb 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e5e7eb 75%), linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
  background-color: rgb(255, 255, 255);
}

.color-picker-swatch-option:hover {
  transform: translateY(-2px);
}

.color-picker-swatch-option.is-active {
  border-color: var(--text);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 1rem;
}

.modal-backdrop.show {
  display: flex;
}

.modal {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  width: min(520px, 100%);
  padding: 1rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  padding-left: 10px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.form-row label {
  font-size: 0.9rem;
  opacity: 0.85;
}

.annotation-title-row input {
  font-weight: 700;
  font-size: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.annotation-title-row input:focus {
  border-color: var(--text);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.modal-actions .primary {
  background: var(--text);
  color: #0b1223;
  border-color: var(--text);
  font-weight: 700;
}

/* Variant modal styling */
#variantModal .modal {
  max-width: 520px;
  background: var(--group);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#variantModal .modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

#variantModal .form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

#variantModal label {
  font-weight: 600;
  color: rgb(0, 0, 0);
}

#variantModal input[type="text"],
#variantModal input[type="color"],
#variantModal input[type="file"] {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;

  background: rgba(255, 255, 255);
  color: var(--text);
  font-size: 0.95rem;
}

#variantModal input[type="color"] {
  padding: 0.2rem;
  height: 46px;
}

#variantModal input[type="file"] {
}

#variantThumbPreview {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

#variantThumbPreview img {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.annotation-type-chooser {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.annotations-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.annotation-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.65rem;
  border-radius: 10px;
  background: var(--button);
}

.annotation-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
}

.annotation-type {
  font-size: 0.8rem;
  opacity: 0.7;
}

.annotation-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.annotation-body {
  font-size: 0.85rem;
  opacity: 0.78;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.annotation-image-preview {
  margin-top: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.annotation-image-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.annotation-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 70;
  padding: 1rem;
}

.annotation-lightbox.show {
  display: flex;
}

.annotation-lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
}

.annotation-lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 12px;
}

.annotation-lightbox-title {
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
}

.variant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.variant-thumb {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  overflow: hidden;
  background: var(--button);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem;
  cursor: pointer;
}

.variant-thumb img {
  width: 100%;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
}

.variant-thumb label {
  font-size: 0.8rem;
  text-align: center;
  opacity: 0.8;
}

.variant-thumb.active {
  border-color: var(--text);
  background: var(--button-active);
}

.variant-thumb:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.inline-variant-strip {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 25;
  pointer-events: auto;
}

.inline-variant-btn {
  width: 50px;
  height: 50px;
  padding: 0px;
  border-radius: 25px;
  background: rgb(255, 255, 255);
  overflow: hidden;
  cursor: pointer;
}

.inline-variant-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 25px;
  display: block;
}

.inline-variant-tooltip {
  position: absolute;
  left: 60px;
  transform: translateY(-50%);
  background: #0f172a;
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  z-index: 30;
}

.inline-variant-btn:hover {
  scale: 1.03;
}

.inline-variant-btn.active {
  scale: 1;
}

.collection-list {
  display: flex;
  flex-direction: column;
  gap: 0px;
}

.collection-row {
  display: flex;
  align-items: center;
  padding: 5px 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.scene-node-row {
  background: #f7f9fc;
  border-color: #e5e7eb;
  align-items: center;
  gap: 3px;
}

.scene-node-row span {
  color: #111827;
}

.scene-node-row .muted.small {
  color: #4b5563;
}

.scene-node-toggle {
  background: none;
  border: none;
  color: #111827;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 2px 6px;
}
.scene-node-toggle:disabled {
  opacity: 1;
  cursor: default;
}

.collection-chip-action {
  background: var(--button);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
}

.collection-chip-action:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Allow selecting variants even when the group is locked/read-only. */
.group.readonly .variant-thumb {
  pointer-events: auto;
  opacity: 1;
  filter: none;
}

.material-library-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0.75rem;
  align-items: start;
}

.filter-column {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 200px;
  max-height: 100%;
  min-height: 0;
}

.filter-column-materials {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 100%;
  min-height: 0;
}

.filter-title {
  margin: 10px 0 0.35rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.filter-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  padding: 10px 0px 10px 0px;
}

.filter-btn {
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
}

.filter-btn.active {
  border-color: var(--text);
  background: var(--button-active);
}

.filter-btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.material-library-layout .material-library-grid {
  margin-top: 0;
}

.material-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

@media (max-width: 900px) {
  .material-library-layout {
    grid-template-columns: 1fr;
  }
  .filter-column {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .filter-btn {
    flex: 1 1 45%;
    min-width: 140px;
  }
}

.material-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--group);
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.material-card.active {
  border-color: var(--text);

  background: rgba(255, 255, 255, 0.08);
}

.material-card:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.material-card-swatch {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--swatch-color, #94a3b8);
  border: 1px solid rgba(255, 255, 255, 0.2);

  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.material-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.material-card-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  display: block;
}

.material-card-ral-code {
  display: block;
  font-weight: 600;
  line-height: 1.1;
}

.material-card-ral-name {
  display: block;
  font-size: 0.75rem;
  opacity: 0.85;
  line-height: 1.1;
}

.material-card-meta {
  font-size: 0.78rem;
  opacity: 0.8;
}

.material-card-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  gap: 0.35rem;
}

.material-card-apply {
  padding: 0.25rem 0.55rem;
  min-width: auto;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: var(--button);
  color: var(--text);
  font-size: 0.75rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.material-card-info {
  padding: 0.25rem 0.55rem;
  min-width: auto;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--button);
  color: var(--text);
  font-size: 0.75rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.material-card-info:hover,
.material-card-info:focus-visible {
  border-color: var(--text);
  outline: none;
}

.material-card-info:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.material-card-apply:hover:not(:disabled),
.material-card-apply:focus-visible {
  border-color: var(--text);

  outline: none;
}

.material-card-apply:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.material-info-body {
  display: flex;
  flex-direction: column;

  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.material-info-body .muted {
  margin: 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.78rem;
  opacity: 0.8;
}

.material-info-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  word-break: break-word;
}

.material-info-rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.material-info-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.material-info-label {
  font-weight: 700;
  color: var(--text);
}

.material-info-row.compact {
  grid-template-columns: auto 1fr;
}

.material-info-value {
  opacity: 0.9;
}

.material-info-value a {
  color: var(--text);
  text-decoration: underline;
  word-break: break-all;
}

.material-map-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.material-map-card {
  display: flex;
  flex-direction: column;

  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.material-map-card img {
  width: 100%;
  height: 120px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.material-map-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: rgba(255, 255, 255, 0.9);
}

.material-map-label {
  font-weight: 700;
}

.annotation-actions {
  display: inline-flex;
  flex-direction: column;
  gap: 0.35rem;
}

.annotation-tooltip {
  position: absolute;
  min-width: 180px;
  max-width: 260px;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--text);
  z-index: 6;
  pointer-events: none;
}

.annotation-tooltip-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.annotation-tooltip-body {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Camera limit sliders */
.camera-limit {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 0.2rem 0 0.6rem;
}

.camera-limit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 500;
  font-size: 0.8rem;
}

.dual-range {
  width: 100%;
  padding-top: 0.15rem;
}

.range-slider {
  position: relative;
  width: 100%;
  padding: 14px 0 6px;
}

.range-slider input[type="range"] {
  position: absolute;
  top: 0px;
  left: 0;
  width: 100%;
  pointer-events: none;
  background: none;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
  pointer-events: all;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text);
  border: 1px solid var(--button);
}

.range-slider input[type="range"]::-moz-range-thumb {
  pointer-events: all;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.slider-track {
  display: none;
}

.value-bubble {
  position: absolute;
  top: -20px;
  transform: translateX(-50%);
  font-size: 0.75rem;
  opacity: 0.8;
  background: var(--button);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--panel);
}

.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-check {
  width: 38px;
  height: 20px;
  border-radius: 999px;
  background: var(--button);
  position: relative;
  transition: background 0.2s ease;
}

.toggle-check::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  left: 2px;
  top: 2px;
  transition: transform 0.2s ease;
}

.toggle input:checked + .toggle-check {
  background: var(--button);
}

.toggle input:checked + .toggle-check::after {
  transform: translateX(18px);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

input[type="file"]:disabled,
button:disabled,
select:disabled,
input[type="range"]:disabled {
  opacity: 1;
  cursor: not-allowed;
}

.panel-toggle {
  padding: 0.35rem 0.55rem;
  width: auto;
  height: auto;
  min-width: unset;
  border-radius: 10px;
}

.panel-tab {
  background: var(--button);
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.35rem 0.55rem;
}

label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  opacity: 0.85;
}

code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  font-size: 0.85rem;
}

.status {
  font-size: 0.9rem;
  opacity: 0.8;
}
