/* === EDITOR WORKSPACE LAYOUT === */
.editor-workspace {
  display: flex;
  flex: 1;
  margin: 0 10px 10px 10px;
  gap: 10px;
  overflow: hidden; /* Verhindert das Scrollen der ganzen Seite */
}

/* === SCHMALE WERKZEUG-LEISTE (LINKS) === */
.sidebar-tools {
  width: 72px;
  background: var(--color-panel);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0; /* Leicht angepasst für gleichmäßige Abstände */
  gap: 5px; /* Kleinerer Gap, da wir jetzt Padding auf den Buttons nutzen */
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.sidebar-tools::-webkit-scrollbar {
  display: none;
}

.tool-btn {
  background: transparent;
  border: none;
  color: var(--color-text); /* Standard Schriftfarbe wie in der Top-Nav */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0.7;
  transition: all 0.2s ease;
  width: 90%; /* Etwas schmaler für den Button-Hintergrund-Effekt */
  padding: 12px 0;
  border-radius: 10px; /* Abrundung für den dunklen BG */
}

.tool-btn[hidden] {
  display: none;
}

.tool-btn img.icon {
  height: 24px;
  filter: brightness(1.5); /* Icons etwas heller für bessere Sichtbarkeit */
  transition: filter 0.2s ease;
}

/* === AKTIVES FEATURE (Dunkler Hintergrund & Volle Sichtbarkeit) === */
.tool-btn:hover, 
.tool-btn.active {
  opacity: 1;
  background: #0E0F11; /* Dunklerer Hintergrund wie im Screenshot */
  color: var(--color-text); /* Schrift bleibt grau/weiß, NICHT blau */
}

/* Optional: Icon beim aktiven Button noch etwas hervorheben */
.tool-btn.active img.icon {
  filter: brightness(2); 
}

/* === TOOL PANEL (EINSTELLUNGEN DANEBEN) === */
.tool-panel {
  width: 260px;
  background: var(--color-panel);
  border-radius: var(--radius);
  padding: 20px;
  display: none; /* Standardmäßig versteckt, wird via JS gesteuert */
  flex-direction: column;
  gap: 20px;
  flex-shrink: 0;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

.tool-panel.active {
  display: flex;
  position: relative;
  z-index: 30;
}

#exportSidebar {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

#exportSidebar .export-body {
    flex: 1 1 auto;
    min-height: 0;
}

#exportSidebar .dropdown-toggle.btn-flat {
    min-height: 42px !important;
    height: 42px !important;
    padding: 0 14px !important;
    border-radius: 21px !important;
    box-sizing: border-box !important;
}

#exportSidebar .export-type-toggle-primary {
    outline: 2px solid #1473E6 !important;
    outline-offset: 0;
}

#exportSidebar .export-type-toggle-primary:hover,
#exportSidebar .export-type-toggle-primary:focus-visible {
    box-shadow: 0 0 0 3px rgba(20, 115, 230, 0.22) !important;
}

.export-section-copy {
    font-size: 0.85rem;
    color: var(--color-text);
    text-align: center;
    line-height: 1.32;
    margin: 0;
}

#exportSidebar .dropdown-toggle.btn-flat .export-type-label,
#exportSidebar .dropdown-toggle.btn-flat > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

#exportSidebar .dropdown {
    position: relative;
}

#exportSidebar .dropdown.open {
    z-index: 2000;
}

#exportSidebar .dropdown-menu {
    position: absolute !important;
    top: calc(100% + 5px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    margin-top: 0 !important;
    box-sizing: border-box !important;
    z-index: 2001;
}

.autosave-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text);
    font-size: var(--font-size-base);
    line-height: 1;
    cursor: pointer;
    user-select: none;
    opacity: 0.82;
    transition: opacity 0.16s ease;
}

.autosave-toggle:hover {
    opacity: 1;
}

.autosave-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.autosave-toggle-track {
    position: relative;
    width: 34px;
    height: 18px;
    border-radius: 999px;
    background: #2D2E33;
    border: 1px solid #48494c;
    box-sizing: border-box;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.autosave-toggle-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #9ca3af;
    transition: transform 0.18s ease, background 0.18s ease;
}

.autosave-toggle input:checked + .autosave-toggle-track {
    background: rgba(20, 115, 230, 0.25);
    border-color: #1473E6;
}

.autosave-toggle input:checked ~ .autosave-toggle-track {
    background: rgba(20, 115, 230, 0.25);
    border-color: #1473E6;
}

.autosave-toggle input:checked + .autosave-toggle-track::after {
    transform: translateX(16px);
    background: #1473E6;
}

.autosave-toggle input:checked ~ .autosave-toggle-track::after {
    transform: translateX(16px);
    background: #1473E6;
}

.autosave-toggle-text {
    white-space: nowrap;
}

.editor-highres-toggle-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.editor-highres-toggle-wrap .panel-divider {
    margin: 0;
}

.editor-highres-toggle {
    width: 100%;
    min-height: 24px;
    gap: 10px;
}

.editor-smooth-surface-toggle {
    width: 100%;
    min-height: 24px;
    gap: 10px;
    margin-top: -6px;
}

#panel-setup .autosave-toggle {
    opacity: 1;
}

#panel-setup .icon-tooltip-wrapper {
    opacity: 0.82;
}

#panel-setup .slider-row .icon-tooltip-wrapper:hover,
#panel-setup .autosave-toggle:hover .icon-tooltip-wrapper {
    opacity: 1;
}

#panel-setup .slider-row img.icon,
#panel-setup .editor-highres-toggle img.icon,
#panel-setup .editor-smooth-surface-toggle img.icon,
#panel-setup .editor-ground-grid-icon {
    filter: brightness(1.5);
}

.editor-highres-toggle img.icon,
.editor-smooth-surface-toggle img.icon {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
}

.editor-highres-toggle .autosave-toggle-text,
.editor-smooth-surface-toggle .autosave-toggle-text {
    flex: 1;
}

.editor-highres-toggle .autosave-toggle-track,
.editor-smooth-surface-toggle .autosave-toggle-track {
    margin-left: auto;
    flex: 0 0 auto;
}

.editor-ground-grid-toggle {
    width: 100%;
    min-height: 24px;
    gap: 10px;
}

.editor-ground-grid-icon {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
}

.editor-ground-grid-toggle .autosave-toggle-track {
    margin-left: auto;
    flex: 0 0 auto;
}

.editor-texture-source-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.editor-texture-source-block .panel-divider {
    margin: 0;
}

.editor-texture-source-options {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

.editor-texture-source-option {
    position: relative;
    width: 70px;
    height: 62px;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 8px;
    background: #0e0f11;
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
    transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
}

.editor-texture-source-option::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 0 #1473e6;
    pointer-events: none;
    z-index: 3;
    transition: box-shadow 0.16s ease;
}

.editor-texture-source-option img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.editor-texture-source-option span {
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: 4px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background: rgba(14, 15, 17, 0.72);
    color: #ffffff;
    font-size: 0.72rem;
    line-height: 1;
    pointer-events: none;
    z-index: 2;
}

.editor-texture-source-option.active {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.editor-texture-source-option.active::after {
    box-shadow: inset 0 0 0 2px #1473e6;
}

.editor-texture-source-option:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.08);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35), 0 6px 16px rgba(0, 0, 0, 0.25);
}

.editor-texture-source-option.active:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.editor-texture-source-option:disabled {
    cursor: wait;
    opacity: 0.55;
}

.texture-set-preview-list {
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.texture-set-preview-row {
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 60px;
}

.texture-set-preview-row[hidden] {
    display: none;
}

.texture-set-preview-thumb {
    width: 60px;
    height: 60px;
    flex: 0 0 60px;
    display: block;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #333;
    background: #111318;
}

.texture-set-preview-thumb.is-grayscale {
    filter: grayscale(100%);
}

.texture-set-preview-meta {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.texture-set-preview-title {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
}

.texture-set-preview-detail {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
}

.texture-set-preview-size {
    color: var(--color-text);
    font-size: 0.75rem;
    line-height: 1.25;
}

.texture-set-toggle {
    flex: 0 0 auto;
    margin-left: auto;
}

.embed-hint-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    user-select: none;
}

.embed-hint-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.embed-hint-toggle .autosave-toggle-track {
    flex: 0 0 auto;
}

.embed-hint-toggle input:checked + .autosave-toggle-track {
    background: rgba(20, 115, 230, 0.25);
    border-color: #1473E6;
}

.embed-hint-toggle input:checked + .autosave-toggle-track::after {
    transform: translateX(16px);
    background: #1473E6;
}

.embed-hint-toggle-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.embed-hint-toggle-title {
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 500;
}

.embed-hint-toggle-note {
    color: var(--color-text);
    font-size: 0.75rem;
    line-height: 1.35;
}

.embed-option-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.embed-option-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.embed-option-header span:last-child {
    color: var(--color-text);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.embed-option-box input[type="range"] {
    width: 100%;
}

.gpx-path-options {
    flex-direction: column;
    gap: 14px;
}

.gpx-option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--color-text);
    font-size: 0.85rem;
}

.gpx-option-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.gpx-option-label .icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex: 0 0 24px;
}

.gpx-option-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--color-text);
    font-size: 0.85rem;
}

.gpx-option-block label {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.elevation-profile-settings {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.elevation-profile-settings.hidden {
    display: none !important;
}

.gpx-select {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 38px;
    border: none;
    border-radius: 8px;
    background: var(--color-bg);
    background-image: url('../images/arrow-down-01-round.svg');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px 16px;
    color: var(--color-text);
    padding: 0 34px 0 12px;
    outline: none;
    box-sizing: border-box;
}

.elevation-profile-overlay {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 350px;
    height: 130px;
    z-index: 12;
    box-sizing: border-box;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
    overflow: hidden;
    pointer-events: none;
}

.elevation-profile-overlay[hidden] {
    display: none !important;
}

.elevation-profile-overlay canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* === PANEL HEADINGS (H2) === */
.tool-panel h2 {
    font-size: 0.95rem;
    font-weight: 400;
    color: #d1d1d1;
    margin: 0 0 -10px 0; /* Gleicht den 20px gap des Panels etwas aus */
}

/* === CANVAS BEREICH (3D SZENE) === */
.canvas-wrapper {
  flex: 1;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  z-index: 1;
  background-image: url('../assets/edges/ground_x.jpg');
    background-repeat: repeat;
    background-size: 80px 80px; /* Adjust size to your thumbnail dimensions */
    background-position: center;
}

#renderCanvas {
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
  background: transparent !important;
}

.embed-logo-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.embed-logo-pick,
.embed-logo-remove {
    min-height: 28px;
}

.embed-logo-pick {
    height: 28px;
    padding: 0 16px !important;
    font-size: 0.82rem !important;
    line-height: 1 !important;
}

.embed-corporate-color-control {
    display: flex;
    align-items: center;
    min-height: 24px;
}

#exportEmbedCorporateColorThumb {
    width: 22px;
    height: 22px;
}

.embed-logo-remove {
    display: inline-flex;
    width: 20px;
    height: 20px;
    min-height: 0;
    flex: 0 0 20px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
}

.embed-logo-remove:hover {
    background: transparent;
    opacity: .75;
}

.embed-logo-remove img {
    display: block;
    width: 17px;
    height: 17px;
}

.embed-logo-remove[hidden] {
    display: none;
}

.embed-logo-status {
    max-width: 58%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#exportEmbedLogoPreview {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 6px;
    background-color: rgba(255,255,255,.04);
}

.editor-view-compass {
  position: absolute;
  left: 14px;
  bottom: 92px;
  z-index: 15;
  width: 72px;
  height: 72px;
  display: grid;
  grid-template-columns: repeat(3, 24px);
  grid-template-rows: repeat(3, 24px);
  gap: 0;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(20, 21, 24, 0.95);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.canvas-wrapper.terrain-maker-3d-map .editor-view-compass {
  bottom: 10px;
}

.editor-view-compass-btn {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.editor-view-compass-btn img {
  width: 24px;
  height: 24px;
  display: block;
  pointer-events: none;
}

.editor-view-compass-btn:hover,
.editor-view-compass-btn:focus-visible {
  outline: none;
}

.editor-view-compass-btn:hover img,
.editor-view-compass-btn:focus-visible img,
.editor-view-compass-btn.is-active img {
  filter: brightness(0) saturate(100%) invert(35%) sepia(88%) saturate(2724%) hue-rotate(201deg) brightness(94%) contrast(96%);
}

.canvas-wrapper .tile-set-strip {
  position: absolute;
  left: 14px;
  bottom: 10px;
  z-index: 14;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.canvas-wrapper .tile-set-collapse {
  width: 30px;
  height: 70px;
  border: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
}

.canvas-wrapper .tile-set-collapse img {
  width: 18px;
  height: 18px;
  opacity: 0.9;
}

.canvas-wrapper .tile-set-strip.collapsed .tile-set-collapse,
.canvas-wrapper .tile-set-strip.collapsed .layer-option:not(.active) {
  display: none;
}

.canvas-wrapper .tile-set-strip.collapsed .layer-option.active {
  border: 2px solid transparent;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.canvas-wrapper .layer-option {
  width: 70px;
  height: 70px;
  box-sizing: border-box;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
  border: 2px solid transparent;
  background: var(--color-accent);
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.canvas-wrapper .layer-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.canvas-wrapper .layer-option span {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  padding: 3px 4px;
  border-radius: 4px;
  background: rgba(20, 21, 24, 0.72);
  color: #ffffff;
  font-size: 12px;
  line-height: 1;
  text-align: center;
  pointer-events: none;
}

.canvas-wrapper .layer-option:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 2px var(--color-primary);
}

.canvas-wrapper .layer-option.active {
  border: 3px solid #1473e6;
  box-shadow: inset 0 0 0 1px rgba(20,115,230,0.35);
}

.source-attribution {
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 24px);
  padding: 2px 2px 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #333333;
  font-size: 11px;
  line-height: 1.15;
  font-family: Roboto, Arial, sans-serif;
  pointer-events: auto;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
  transition: padding 0.28s ease, gap 0.28s ease, background-color 0.28s ease;
}

.source-attribution-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: calc(100vw - 90px);
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
  transition: max-width 0.32s ease, opacity 0.18s ease, transform 0.32s ease;
  transform: translateX(0);
}

.source-attribution.collapsed {
  gap: 0;
  padding-left: 2px;
}

.source-attribution.collapsed .source-attribution-text {
  max-width: 0;
  opacity: 0;
  transform: translateX(10px);
}

.source-attribution img {
  width: 9px;
  height: 9px;
  display: block;
  flex: 0 0 auto;
}

.source-attribution a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #333333;
  text-decoration: none;
  white-space: nowrap;
}

.source-attribution a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.source-attribution .source-separator {
  display: none;
}

.source-attribution-info {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: #111111;
  color: #ffffff;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  font-family: Arial, sans-serif;
  cursor: pointer;
  padding: 0;
}

/* === SPEZIFISCHE UI-ELEMENTE === */
.btn-green {
  background: #219229 !important;
  border-color: #219229 !important;
  color: #ffffff !important; /* Schrift jetzt reinweiß */
  font-weight: 400;
}

.btn-green:hover {
  background: #1b7a22 !important; /* Eine Nuance dunkler für den Hover-Effekt */
  border-color: #1b7a22 !important;
}

/* Input-Bar ohne Hintergrund (wie im Mockup) */
.tool-panel .input-bar {
  width: 100%;
  background: var(--color-bg);
  box-sizing: border-box;
}

/* === PANEL & EXPORT SAVE BUTTONS (Identischer Style + Pillenform) === */
.tool-panel .btn-round,
#exportSidebar .btn-round {
  background: #2D2E33 !important; /* Dunkles Grau */
  color: #ffffff !important;      /* Weiße Schrift */
  border: 1px solid #48494c !important; /* Dezenter Rahmen */
  border-radius: 50px !important; /* <--- HIER IST DER FIX: 50px erzwingt die perfekte Pillenform! */
  transition: background 0.2s ease, border-color 0.2s ease;
  padding: 10px 24px !important;  
  height: auto !important;
  font-size: 0.9rem !important;
  font-weight: 400 !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  text-align: center !important;
}

/* Der bleibt für die linke Leiste kompakt, streckt sich rechts im Export aber auf 100% */
#exportSidebar .btn-round {
  width: 100% !important;         
  display: block !important;
}

#exportSidebar .threedm-project-download-button {
  background: #1473e6 !important;
  border-color: #1473e6 !important;
  font-weight: 600 !important;
}

#exportSidebar .threedm-project-download-button img {
  filter: brightness(0) invert(1);
}

#exportSidebar.active .threedm-project-download-button.is-pulsing {
  animation: threedm-project-download-pulse 2s ease-in-out 3;
}

@keyframes threedm-project-download-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(20, 115, 230, 0); }
  50% { box-shadow: 0 0 0 5px rgba(20, 115, 230, 0.24); }
}

@media (prefers-reduced-motion: reduce) {
  #exportSidebar.active .threedm-project-download-button.is-pulsing { animation: none; }
}

.tool-panel .btn-round:hover,
#exportSidebar .btn-round:hover {
  background: #3d3e44 !important; /* Etwas heller beim Hover */
  border-color: #58595c !important;
}

#exportSidebar .threedm-project-download-button:hover {
  background: #0f63c9 !important;
  border-color: #0f63c9 !important;
}

.print-assembly-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.print-option-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 8px;
  box-sizing: border-box;
}

.print-option-card-expanded {
  gap: 11px;
}

.print-assembly-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--color-text);
  font-size: 0.85rem;
  width: 100%;
  opacity: 0.9;
}

.print-assembly-row .autosave-toggle-text {
  flex: 1 1 auto;
}

.print-platform-height-control {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
}

.print-control-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--color-text);
  font-size: 0.76rem;
  opacity: 0.88;
}

.print-control-label span:last-child {
  color: #ffffff;
}

.print-text-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.print-text-side-label {
  margin-top: 0;
}

.print-text-height-control,
.print-text-width-control {
  margin-top: 2px;
}

.print-text-side-label span:last-child {
  color: var(--color-text);
}

#exportSidebar .print-text-side-control {
  margin: 0;
}

#printTextError:empty {
  display: none;
}

#printAssemblyMessage:empty {
  display: none;
}

#printTextInput {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: var(--color-bg);
  color: var(--color-text);
  padding: 8px 10px;
  font-size: 0.85rem;
}

.print-text-error,
.print-assembly-message {
  min-height: 14px;
  margin-top: 5px;
  color: #ff8c7a;
  font-size: 0.72rem;
  line-height: 1.25;
}
.tool-panel .btn-round.autosave-button {
  position: relative !important;
  overflow: hidden !important;
}

.tool-panel .btn-round.autosave-button::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--autosave-progress, 0%);
  height: 3px;
  background: rgba(255, 255, 255, 0.38);
  transition: width 0.25s linear, background 0.2s ease;
  pointer-events: none;
}

.tool-panel .btn-round.autosave-saving::after {
  background: #1473E6;
}

.tool-panel .btn-round.autosave-saved::after {
  background: #219229;
}

.tool-panel .btn-round.autosave-error::after {
  background: #C93535;
}

/* ============================================================
   [SECTION] SLIDER REFINEMENT (Final Look)
   ============================================================ */

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 32px; /* Genug Platz für den großen Punkt */
    background: transparent;
    cursor: pointer;
    margin: 0;
    display: block;
}

/* 1. Die Schiene (Track) - Dick und dunkel */
input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 14px; /* Dicke der Schiene laut Bild */
    background: #2b2c30 !important;
    border-radius: 7px; /* Voll abgerundet */
    border: none;
}

input[type="range"]::-moz-range-track {
    width: 100%;
    height: 14px;
    background: #2b2c30 !important;
    border-radius: 7px;
    border: none;
}

/* 2. Der Knopf (Thumb) - Größer als die Schiene & überlappend */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 18px; /* Größer als die 14px der Schiene */
    width: 18px;
    border-radius: 50%;
    background: #1473E6 !important;
    cursor: pointer;
    border: none;
    /* Zentrierung: (Schiene 14px - Punkt 18px) / 2 = -2px */
    margin-top: -2px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

input[type="range"]::-moz-range-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #1473E6 !important;
    cursor: pointer;
    border: none;
}

.video-export-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 5px -7px;
    font-size: 0.78rem;
    color: var(--color-text);
    opacity: 0.82;
}

.video-export-label span {
    color: #ffffff;
    opacity: 1;
}

#exportSidebar .video-segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    padding: 4px;
    background: var(--color-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    box-sizing: border-box;
}

#exportSidebar .video-segmented.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

#exportSidebar .video-segmented.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

#exportSidebar .video-segmented.single {
    grid-template-columns: 1fr;
}

#exportSidebar .video-segmented button {
    -webkit-appearance: none !important;
    appearance: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 0 !important;
    width: 100% !important;
    min-height: 34px !important;
    padding: 0 8px !important;
    border: 0 !important;
    border-radius: 6px !important;
    background: transparent !important;
    color: var(--color-text) !important;
    font-family: inherit !important;
    font-size: 0.78rem !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    box-shadow: none !important;
    outline: none !important;
    transition: background 0.16s ease, color 0.16s ease !important;
}

#exportSidebar .video-segmented button:hover {
    background: rgba(255, 255, 255, 0.06) !important;
}

#exportSidebar .video-segmented button.active {
    background: #1473E6 !important;
    color: #ffffff !important;
}

.video-duration-control {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 0 5px;
    color: var(--color-text);
    font-size: 0.76rem;
    box-sizing: border-box;
}


/* 3. Trenner (Divider) vor dem Save Button */
.panel-divider {
    border: none;
    border-top: 1px solid #2b2c30; /* Dezentes Grau wie im Bild */
    margin: 0px 0;
    width: 100%;
}

/* Zentrierung für den Save Button Bereich */
.panel-actions {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* =========================================================================
   HOLZHAMMER-FIX FÜR SLIDER-LAYOUT
   Überschreibt ALLES, was dieses Layout kaputt macht.
   ========================================================================= */

/* 1. Die Slider-Zeile zwingend nach links */
div.slider-row {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important; /* Strikte Linksausrichtung */
    gap: 10px !important; /* Exakt 10px Abstand - nicht mehr, nicht weniger */
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    padding-left: 0 !important; /* Falls irgendwo ein Padding versteckt ist */
}

/* 2. Der Wrapper ODER das nackte Icon zwingend 24px groß und links */
div.slider-row .icon-tooltip-wrapper,
div.slider-row > img.icon {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important; /* Zwingt das Bild im Wrapper nach links */
    flex: 0 0 24px !important; /* WICHTIG: Darf nicht wachsen, muss exakt 24px breit sein */
    width: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    height: 24px !important;
    margin: 0 !important; /* Verhindert jegliche Einrückung */
    padding: 0 !important;
    position: relative !important;
}

/* 3. Das Bild innerhalb des Wrappers */
div.slider-row .icon-tooltip-wrapper img.icon {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 4. Der Slider füllt den Rest */
div.slider-row input[type="range"] {
    flex: 1 1 auto !important; /* Darf wachsen und schrumpfen */
    margin: 0 !important;
}

/* 5. Der Text am Ende (verhindert, dass der Wrapper sich diesen Style schnappt) */
div.slider-row > span.value-text,
div.slider-row > span:last-child {
    min-width: 45px !important;
    text-align: right !important;
}


/**
 * ============================================================
 * TOOLTIP SYSTEM (CSS-Based)
 * ============================================================
 */

/* 1. Die passgenaue Hülle um das Icon */
.icon-tooltip-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* WICHTIG: Drückt das Icon an die absolute linke Kante! */
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin: 0 !important; /* Verhindert jegliches Einrücken */
    padding: 0 !important;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

/* 2. Hover-Effekt: Icon wird hell (wie vorher) */
.icon-tooltip-wrapper:hover {
    opacity: 1;
}

/* 3. Der Tooltip-Kasten (Text) */
.icon-tooltip-wrapper::after {
    content: attr(data-tooltip);
    position: absolute;
    
    /* Positionierung sehr nah über dem Icon */
    bottom: 100%; 
    left: 50%;
    transform: translateX(-50%);
    
    /* Design */
    background-color: rgba(0, 0, 0, 0.9);
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-family: sans-serif;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    
    /* Animation & Interaktion */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease-in-out;
    pointer-events: none; /* Blockiert keine Klicks auf Slider */
    z-index: 1000;
}

/* 4. Kleiner Pfeil nach unten */
.icon-tooltip-wrapper::before {
    content: "";
    position: absolute;
    
    /* Direkt zwischen Tooltip und Icon */
    bottom: 110%; 
    left: 50%;
    transform: translateX(-50%);
    
    /* Pfeil-Form */
    border-width: 4px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.9) transparent transparent transparent;
    
    /* Animation */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease-in-out;
    pointer-events: none;
    z-index: 1000;
}

/* 5. Tooltip & Pfeil einblenden, wenn die Maus EXAKT auf dem Icon ist */
.icon-tooltip-wrapper:hover::after,
.icon-tooltip-wrapper:hover::before {
    opacity: 1;
    visibility: visible;
}

.ui-tooltip-source {
    position: relative;
}

.ui-tooltip-source::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.9);
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-family: sans-serif;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease-in-out;
    pointer-events: none;
    z-index: 1000;
}

.ui-tooltip-source::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.9) transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease-in-out;
    pointer-events: none;
    z-index: 1000;
}

.ui-tooltip-source:hover::after,
.ui-tooltip-source:hover::before {
    opacity: 1;
    visibility: visible;
}

.tool-panel .icon-tooltip-wrapper::after {
    bottom: auto;
    top: 50%;
    left: 32px;
    transform: translateY(-50%);
}

.tool-panel .icon-tooltip-wrapper::before {
    bottom: auto;
    top: 50%;
    left: 28px;
    transform: translateY(-50%) rotate(90deg);
}

.tool-panel .ui-tooltip-source::after {
    bottom: auto;
    top: 50%;
    left: 32px;
    transform: translateY(-50%);
}

.tool-panel .ui-tooltip-source::before {
    bottom: auto;
    top: 50%;
    left: 28px;
    transform: translateY(-50%) rotate(90deg);
}

.draw-modal .ui-tooltip-source::after {
    top: calc(100% + 6px);
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6000;
}

.draw-modal .ui-tooltip-source::before {
    top: calc(100% + 2px);
    bottom: auto;
    left: 50%;
    transform: translateX(-50%) rotate(180deg);
    z-index: 6000;
}

.icon-tooltip-wrapper::before,
.icon-tooltip-wrapper::after,
.ui-tooltip-source::before,
.ui-tooltip-source::after {
    content: none !important;
    display: none !important;
}

.editor-tooltip-portal {
    position: fixed;
    z-index: 2147482500;
    max-width: min(280px, calc(100vw - 16px));
    padding: 5px 9px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 5px;
    background: rgba(12, 13, 16, 0.97);
    color: #fff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
    font: 11px/1.35 Arial, sans-serif;
    white-space: normal;
    overflow-wrap: anywhere;
    pointer-events: none;
}

.editor-tooltip-portal[hidden] {
    display: none !important;
}


/* thumbnails für edges section */
.edge-texture-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 Spalten */
    gap: 10px;
    margin-top: 10px;
}

.edge-thumb {
    aspect-ratio: 1 / 1;
    display: block;
    
    /* 1. Verhindert das Wiederholen/Blitzen */
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    
    /* 2. Die runden Ecken */
    border-radius: 8px !important;
    
    /* 3. WICHTIG: Kein Border, stattdessen Inset-Schatten als Rahmen-Ersatz */
    border: none; 
    box-shadow: inset 0 0 0 2px transparent; 
    
    /* 4. Die Stanze für die Textur */
    overflow: hidden !important;
    
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.edge-thumb:hover {
    transform: scale(1.05);
    /* Hier nutzen wir den Inset-Schatten als blassen blauen Rahmen */
    box-shadow: inset 0 0 0 2px rgba(20, 115, 230, 0.5);
}

.edge-thumb.active {
    /* Hier nutzen wir den Inset-Schatten für die kräftige blaue Outline */
    /* PLUS den äußeren Glow-Effekt */
    box-shadow: inset 0 0 0 3px var(--color-primary), 0 0 8px rgba(20, 115, 230, 0.4);
    transform: scale(1.02); /* Minimaler Zoom-Effekt für Aktiv-Status */
}

/* ==========================================
   PICKR CUSTOMIZATION (Dark Theme & Width)
   ========================================== */

/* Main Pickr container */
.pcr-app {
    width: 220px !important; /* Default is wider, adjust to your liking */
    background-color: #2b2b2b !important; /* Dark grey background */
    border: 1px solid #444 !important; 
    border-radius: 8px !important; /* Matches your other UI elements */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5) !important;
    padding: 12px !important;
}

/* Hex input field styling */
.pcr-app .pcr-interaction input {
    background-color: #1e1e1e !important; /* Darker input background */
    color: #ffffff !important; /* White text */
    border: 1px solid #444 !important;
    border-radius: 4px !important;
}

/* Save Button styling */
.pcr-app .pcr-interaction .pcr-save {
    background-color: var(--color-primary) !important; /* Uses your global blue color */
    color: white !important;
    border-radius: 4px !important;
}

/* Save Button Hover */
.pcr-app .pcr-interaction .pcr-save:hover {
    filter: brightness(1.2);
}

/* ============================================================
   [SECTION] ELEMENTS PANEL (Tabs & Grid)
   ============================================================ */

.elements-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 0px; /* Reduced margin to bring grid closer */
    padding-bottom: 0px; /* Slightly reduced padding */
    border-bottom: none; /* Removed separator line */
}

.elements-tabs .tab-btn {
    min-width: 0;
    background: transparent;
    border: none;
    color: var(--color-text);
    cursor: pointer;
    padding: 7px 4px;
    border-radius: 6px;
    font-size: 0.72rem;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.elements-tabs .tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.elements-tabs .tab-btn.active {
    background: var(--color-accent);
    color: #ffffff;
}

.elements-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    flex: 0 1 auto;
    min-height: 110px;
    
    /* Reduced vertical padding to match the compact look */
    padding: 0px 10px; 
    
    /* Limit height to approx. 4 rows */
    max-height: min(310px, 40vh); 
    
    overflow-y: auto;
    overflow-x: hidden; /* Prevent horizontal wobble on hover */
    box-sizing: border-box;
}

/* Custom Scrollbar Styling */
.elements-grid::-webkit-scrollbar {
    width: 6px;
}
.elements-grid::-webkit-scrollbar-track {
    background: transparent;
}
.elements-grid::-webkit-scrollbar-thumb {
    background: #2b2c30;
    border-radius: 4px;
}

.element-thumb {
    aspect-ratio: 1 / 1;
    background-color: transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Transition limited to transform for better performance */
    transition: transform 0.15s ease-out, background 0.2s ease;
    
    /* Keep element from affecting others during scaling */
    position: relative;
    z-index: 1;
}

.element-thumb:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.15); /* Scaling happens within the padding area */
    z-index: 10; /* Hovered icon stays on top */
}

.element-thumb img {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
    pointer-events: none;
}

/* ============================================================
   [SECTION] ELEMENT ACTION BAR
   ============================================================ */

.element-action-bar {
    display: flex;
    align-items: center;
    background: var(--color-accent);
    border-radius: 8px;
    padding: 8px;
    gap: 8px;
    margin-top: 4px; /* Reduced margin to pull it closer to the thumbs */
    box-sizing: border-box;
}

/* Color Picker Circle */
.element-color-picker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2);
    flex-shrink: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    margin-right: 0;
}

.element-color-picker:hover {
    transform: scale(1.15);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3);
}

/* Tools Container */
.element-tools {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    flex: 1; /* Takes up all remaining space in the action bar */
    min-width: 0;
}

/* Tool Group (keeps related buttons tight like +/- or rotate L/R) */
.tool-group {
    display: flex;
    align-items: center;
    gap: 0px; /* Zero gap because button padding creates the perfect distance */
}

/* Action Buttons */
.action-btn {
    background: transparent;
    border: none;
    padding: 2px; /* Reduced padding pulls paired icons very close together */
    width: 24px;
    height: 24px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Action Button Icons */
.action-btn .icon {
    width: 20px;
    height: 20px;
    opacity: 0.7;
    filter: brightness(1.2); 
    transition: opacity 0.2s ease, transform 0.1s ease;
}

.action-btn:hover .icon {
    opacity: 1;
}

.action-btn:active .icon {
    transform: scale(0.9);
}

/* ============================================================
   [SECTION] ELEMENT LABEL INPUT BAR
   ============================================================ */

.element-label-bar {
    display: flex;
    align-items: center;
    background: var(--color-bg); /* Dark background to match the mockup */
    border-radius: 24px;
    padding: 4px 4px 4px 12px; /* Less padding on the right to fit the Add button snugly */
    height: 44px; /* Matches standard input height */
    box-sizing: border-box;
}

.element-image-bar {
    margin-top: 0px;
}

.element-label-bar .icon {
    width: 20px;
    height: 20px;
    opacity: 0.7;
    filter: brightness(1.2);
    margin-right: 5px;
    flex-shrink: 0;
}

.element-label-bar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--color-text);
    font-size: 0.9rem;
    min-width: 0; /* Prevents flexbox overflow */
}

.element-label-bar input::placeholder {
    color: #666; /* Subdued placeholder color */
}

.element-image-bar input[readonly] {
    cursor: pointer;
}

.element-image-shape-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--color-text);
    font-size: 0.85rem;
}

.element-flag-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.element-flag-bar {
    padding-left: 12px;
}

.element-flag-bar input {
    flex: 1 1 0%;
    width: 0;
    min-width: 0;
}

.element-hover-animation-settings {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
}

.element-hover-animation-settings h2 {
    margin: 0;
}

#panel-elements .element-animation-strength-row {
    gap: 6px !important;
}

#panel-elements .element-animation-strength-row > span:last-child {
    width: 15px !important;
    min-width: 15px !important;
}

.element-hover-animation-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.element-hover-info {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.tool-panel .element-hover-info.ui-tooltip-source::after {
    left: auto;
    right: 18px;
    transform: translateY(-50%);
}

.tool-panel .element-hover-info.ui-tooltip-source::before {
    left: auto;
    right: 14px;
    transform: translateY(-50%) rotate(90deg);
}

.element-hover-info img {
    display: block;
    width: 14px;
    height: 14px;
    filter: brightness(1.35);
}

.element-hover-info:focus-visible {
    outline: 1px solid var(--color-accent);
    outline-offset: 2px;
}

.element-hover-info:focus-visible::before,
.element-hover-info:focus-visible::after {
    opacity: 1;
    visibility: visible;
}

.element-hover-animation-divider {
    margin: 0;
}

.element-animation-mode-toggle {
    display: flex;
    width: 100%;
    padding: 2px;
    gap: 2px;
    box-sizing: border-box;
    border-radius: 6px;
    background: var(--color-bg);
}

.element-animation-mode-toggle button {
    flex: 1 1 33.333%;
    min-height: 27px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #bdbdbd;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.15;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.element-animation-mode-toggle button.active {
    background: #45464d;
    color: #fff;
}

.element-animation-mode-toggle button:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 1px;
}

/* The embedded 'Add' Button */
.element-label-bar .add-btn {
    background: var(--color-accent); /* Lighter dark grey matching the tool buttons */
    color: #ffffff;
    border: none;
    border-radius: 20px; /* Fully rounded pill */
    padding: 0 16px;
    font-size: 0.85rem;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    height: 100%; /* Fill the container's height (minus padding) */
    display: flex;
    align-items: center;
    justify-content: center;
}

.element-label-bar .add-btn:hover {
    background: #3d3e44; /* Subtle highlight on hover */
}

.element-label-bar .add-btn:active {
    transform: scale(0.95);
}

/* ============================================================
   [SECTION] ELEMENT NOTE CONTAINER (Info Popup)
   ============================================================ */
.note-container {
    display: none; /* Versteckt bis Klick */
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.note-container.active {
    display: flex;
}

.note-input {
    background: var(--color-bg); 
    border: none;
    border-radius: 6px; 
    padding: 12px 14px;
    color: var(--color-text);
    font-size: 0.9rem;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    font-family: inherit;
}

.note-input::placeholder {
    color: #666;
}

.note-input:focus {
    box-shadow: inset 0 0 0 1px #48494c; 
}

.note-media-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.note-media-row .note-input {
    min-width: 0;
}

.note-media-btn,
.note-media-clear {
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #2D2E33;
    color: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
}

.note-media-btn.is-hidden,
.note-media-clear.is-hidden {
    display: none;
}

.note-media-btn {
    padding: 0 10px;
    font-size: 0.78rem;
}

.note-media-clear {
    width: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.note-media-clear img {
    width: 16px;
    height: 16px;
    display: block;
    opacity: 0.82;
}

.note-media-btn:hover,
.note-media-clear:hover {
    background: #3A3B41;
}

.note-textarea {
    resize: vertical; 
    min-height: 90px;
}

/* ============================================================
   [SECTION] INFO POPUP OVERLAY (PREVIEW)
   ============================================================ */
.info-popup-overlay {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px); /* Cooler Blur-Effekt für den Hintergrund */
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.24s ease, visibility 0s linear 0.24s;
}

.info-popup-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

.info-popup-content {
    background: #ffffff;
    width: 340px;
    max-width: 90%;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    color: #333;
    transform: translateY(8px) scale(0.98);
    opacity: 0;
    transition: transform 0.24s ease, opacity 0.24s ease;
}

.info-popup-overlay.active .info-popup-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.info-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.7);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: background 0.2s ease;
}

.info-popup-close:hover {
    background: rgba(255, 255, 255, 1);
}

.info-popup-image-container {
    width: 100%;
    height: 200px;
    background: #eee;
    display: none; /* Wird via JS gesteuert */
}

.info-popup-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}

.info-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: rgba(0, 0, 0, 0.88);
}

.info-lightbox.active { display: flex; }
.info-lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.info-lightbox-close {
    position: absolute; top: 18px; right: 22px; width: 40px; height: 40px;
    border: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: #222;
    font-size: 28px; line-height: 1; cursor: pointer;
}

.info-popup-body {
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Das Pill-Design für den Titel */
.info-popup-title-pill {
    background: #999999;
    color: white;
    padding: 6px 24px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 15px;
    display: none;
}

.info-popup-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #333;
    margin-bottom: 15px;
    display: none;
}

/* Normaler Titel (kein Button, passend zum Screenshot) */
.info-popup-title-normal {
    font-size: 1.25rem;
    font-weight: 500;
    color: #333333;
    margin: 0 0 15px 0;
    text-align: center;
    display: none;
}

/* Button Titel (das graue Pill) */
.info-popup-title-pill {
    background: #999999;
    color: white !important;
    padding: 6px 24px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 15px;
    display: none;
    text-decoration: none;
    transition: filter 0.2s ease, transform 0.1s ease;
    cursor: pointer;
}

.info-popup-title-pill:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}



.tour-player-overlay {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100; /* Über dem 3D Canvas */
    background: transparent;
    padding: 0;
    transition: opacity 0.3s ease;
}

.tour-player-overlay button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-accent);
    border: none;
    color: white;
    font-weight: bold;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

/* Disabled State wenn noch keine Pins gesetzt sind */
.tour-player-overlay button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-tour-play:not(:disabled):hover { background: #2ECC71; color: #000; }
.btn-tour-stop:hover { background: #E74C3C; color: #fff; }

.tour-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    counter-reset: waypoint-counter;
}

.tour-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.tour-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tour-item .pin-name {
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    /* Flex is needed to align the counter text nicely */
    display: flex; 
    align-items: center;
}

/* NEW: The dynamic number that auto-updates on drag & drop! */
.tour-item .pin-name::before {
    counter-increment: waypoint-counter;
    content: counter(waypoint-counter) ". ";
    color: #959595;
    font-weight: normal;
    margin-right: 6px;
}

.tour-item .drag-handle {
    cursor: grab;
    opacity: 0.4;
}

.tour-item .remove-btn {
    opacity: 0.6;
    transition: opacity 0.2s;
}

.tour-item .remove-btn:hover {
    opacity: 1;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    opacity: 0.8;
}


/* Drag & Drop Feedback */
.sortable-ghost {
    opacity: 0.4;
    background: rgba(20, 115, 230, 0.2) !important;
    border: 1px dashed var(--color-primary) !important;
}

.tour-item.sortable-drag {
    cursor: grabbing !important;
}

.tour-item .drag-handle {
    cursor: grab;
    padding: 0 10px 0 0; /* Etwas mehr Hitbox für die Maus */
}

.tour-item .drag-handle:active {
    cursor: grabbing;
}

#messageModal .modal-content {
    overflow: hidden;
}

#messageModal #msgModalBody {
    padding: 0 !important;
    gap: 0;
}

#messageModal #msgModalBody > p,
#messageModal #msgModalBody > ul,
#messageModal .preview-mode-checkbox {
    margin-left: 15px;
    margin-right: 15px;
}

#messageModal .preview-mode-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 12px;
    font-size: 0.82rem;
    color: var(--color-text);
    cursor: pointer;
}

#messageModal .preview-mode-checkbox input {
    margin: 0;
}

#messageModal .preview-mode-image {
    display: block;
    width: calc(100% + 20px);
    max-width: none;
    margin: 0 -10px -10px -10px;
    object-fit: cover;
}

#messageModal .login-register-modal-content {
    width: 420px;
}

#messageModal .login-register-modal-content .modal-header h2 {
    visibility: hidden;
}

#messageModal #msgModalBody.login-register-prompt {
    align-items: center;
    padding: 6px 24px 24px 24px !important;
    text-align: center;
}

.info-popup-overlay:not(.has-body-content) .info-popup-body {
    display: none;
}

.info-popup-overlay:not(.has-media) .info-popup-body {
    padding-top: 42px;
}

.login-register-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.login-register-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.login-register-inner h2 {
    margin: 0;
    color: var(--color-text);
    font-size: 1.8rem;
    font-weight: 500;
    line-height: 1.1;
}

.login-register-inner p {
    max-width: 330px;
    margin: 0;
    color: #b7b8bd;
    font-size: 0.95rem;
    line-height: 1.45;
}

.login-register-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}

.login-register-btn.btn-round {
    background: #2D2E33 !important;
    color: #ffffff !important;
    border: 1px solid #48494c !important;
    border-radius: 50px !important;
    padding: 10px 24px !important;
    height: auto !important;
    min-width: 116px;
    font-size: 0.9rem !important;
    font-weight: 400 !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-register-btn.btn-round:hover {
    background: #3d3e44 !important;
    border-color: #58595c !important;
}

.login-register-btn.btn-round:disabled {
    cursor: wait;
    opacity: 0.78;
}

.login-register-btn.btn-round.is-pending {
    background: #3d3e44 !important;
}

.login-register-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    flex: 0 0 auto;
    animation: login-register-spin 0.8s linear infinite;
}

@keyframes login-register-spin {
    to {
        transform: rotate(360deg);
    }
}

.checkout-info-modal {
    width: min(764px, calc(100vw - 36px));
    background: #191a1f;
    border-radius: 14px;
}

.checkout-info-modal .modal-header .modal-close {
    margin-left: auto;
}

.checkout-info-body {
    color: var(--color-text);
    line-height: 1.5;
    padding: 0 28px 22px 28px;
}

.checkout-license-intro {
    margin: 0 0 38px 0;
    color: #b6b7bb;
    font-size: 1.42rem;
    line-height: 1.35;
    text-align: center;
}

.checkout-license-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
}

.checkout-license-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 398px;
    padding: 18px 26px 18px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: #202126;
    color: #c9c9cc;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.checkout-license-card:hover {
    transform: translateY(-2px);
    background: #222329;
    border-color: rgba(36, 189, 68, 0.68);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.checkout-license-card:disabled {
    cursor: wait;
    opacity: 0.62;
}

.checkout-license-card:disabled:hover {
    transform: none;
}

.checkout-license-card.is-processing {
    opacity: 1;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px rgba(20, 115, 230, 0.35), 0 12px 28px rgba(0, 0, 0, 0.28);
}

.checkout-license-card.is-processing .checkout-license-button {
    gap: 8px;
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.checkout-license-card.is-processing .checkout-license-button::before {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: login-register-spin 0.8s linear infinite;
}

.checkout-license-card.is-processing .checkout-license-button {
    font-size: 0;
}

.checkout-license-card.is-processing .checkout-license-button::after {
    content: "Processing...";
    font-size: 0.78rem;
}

.checkout-license-pro {
    border-color: #1c9c34;
}

.checkout-license-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
    margin-bottom: 18px;
}

.checkout-license-title {
    color: #cfcfd2;
    font-size: 1.34rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 34px;
}

.checkout-license-price {
    color: #d3d3d5;
    font-size: 2.86rem;
    line-height: 0.9;
    font-weight: 800;
    margin-bottom: 2px;
}

.checkout-license-price-period {
    font-size: 0.96rem;
    line-height: 1.05;
    font-weight: 500;
    white-space: nowrap;
}

.checkout-license-sub {
    color: #c2c2c5;
    font-size: 0.96rem;
    line-height: 1.05;
    text-align: center;
    margin-bottom: 28px;
}

.checkout-license-features {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
    max-width: 100%;
    min-height: 82px;
    margin-bottom: 22px;
    color: #cfcfd2;
    font-size: 1.32rem;
    line-height: 1.17;
    text-align: center;
}

.checkout-license-features span { text-align: center; }

.checkout-license-features span::before {
    content: "✓";
    color: #24bd44;
    font-weight: 800;
    margin-right: 8px;
}

.checkout-license-button {
    min-width: 188px;
    min-height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    border-radius: 999px;
    background: #303137;
    color: #ffffff;
    font-size: 1.28rem;
    line-height: 1;
    border: 0;
    cursor: pointer;
}

.checkout-license-button-group {
    display: flex;
    gap: 10px;
    width: 100%;
    justify-content: center;
    margin-top: auto;
}

.checkout-license-button-group .checkout-license-button {
    min-width: 0;
    width: 50%;
    font-size: 1rem;
}

.checkout-license-pro .checkout-license-button {
    background: #1d9b33;
}

.checkout-license-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 34px 0 0 0;
    text-align: center;
    color: #c2c2c5;
    font-size: 0.94rem;
}

.checkout-license-note img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    opacity: 0.62;
    flex: 0 0 28px;
}

@media (max-width: 720px) {
    .checkout-license-grid {
        grid-template-columns: 1fr;
    }

    .checkout-info-body {
        padding: 0 18px 20px 18px;
    }

    .checkout-license-card {
        min-height: 340px;
    }
}

.export-type-label,
#exportTypeMenu a {
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-type-label img,
#exportTypeMenu a img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex: 0 0 18px;
}

#snapshotBtn {
    position: relative;
    overflow: visible;
    min-height: 44px;
    height: 44px;
    box-sizing: border-box;
}

.snapshot-free-badge {
    position: absolute;
    top: -2px;
    right: 0px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 14px;
    padding: 0;
    border-radius: 999px;
    background: #32a43f;
    color: #fff;
    font-size: 0.60rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.snapshot-modal-content {
    width: min(420px, calc(100vw - 32px));
}

.snapshot-modal-body {
    padding: 0 15px 18px 15px !important;
    color: var(--color-text);
}

.snapshot-format-control {
    position: relative;
    margin: 6px 0 8px 0;
}

.snapshot-format-toggle.btn-flat {
    width: 100%;
    min-height: 42px !important;
    height: 42px !important;
    justify-content: space-between;
    background: var(--color-bg) !important;
    border-radius: 21px !important;
    padding: 0 14px !important;
    box-sizing: border-box !important;
}

.snapshot-format-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    text-align: left;
}

.snapshot-format-main img,
.snapshot-format-menu a img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex: 0 0 24px;
}

.snapshot-format-main span,
.snapshot-format-menu a span {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
}

.snapshot-format-main strong,
.snapshot-format-menu a strong {
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.1;
}

.snapshot-format-main small,
.snapshot-format-menu a small {
    color: inherit;
    font-size: 0.76rem;
    opacity: 0.72;
    line-height: 1.25;
}

.snapshot-format-menu {
    position: absolute;
    top: calc(100% + 5px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    margin-top: 0 !important;
    box-sizing: border-box !important;
    z-index: 2001;
}

.snapshot-format-menu a {
    min-height: 52px;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}

.snapshot-license-note {
    color: var(--color-text);
    font-size: 16;
    line-height: 1.45;
    text-align: center;
    margin: 8px 0 20px 0;
}

.snapshot-download-btn {
    min-width: 200px;
    margin: 0 auto;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    line-height: 1 !important;
    text-align: center !important;
}

