:root {
  --bg: #f2f2f4;
  --bg-2: #e8e8ec;
  --panel: rgba(255, 255, 255, 0.96);
  --surface: rgba(255, 255, 255, 0.92);
  --surface-soft: rgba(249, 249, 251, 0.98);
  --border: rgba(20, 20, 20, 0.05);
  --text: #161416;
  --muted: #77747b;
  --muted-2: #5d5962;
  --shadow-card: 0 20px 45px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 6px 13px rgba(0, 0, 0, 0.08);
  --shadow-tab: 0 6px 13px rgba(0, 0, 0, 0.17);
  --status-bg: rgba(255, 255, 255, 0.92);
  --status-idle: #161416;
  --status-loading: #161416;
  --status-success: #161416;
  --status-error: #161416;
  --overlay: rgba(18, 18, 20, 0.74);
  --viewer-shade: 239;
  --viewer-bg: linear-gradient(
    180deg,
    rgb(var(--viewer-shade), var(--viewer-shade), var(--viewer-shade)) 0%,
    rgb(calc(var(--viewer-shade) - 10), calc(var(--viewer-shade) - 10), calc(var(--viewer-shade) - 10)) 100%
  );
  --toggle-bg: rgba(0, 0, 0, 0.1);
  --toggle-thumb: #ffffff;
  --toggle-border: rgba(20, 20, 20, 0.06);
  --primary-bg: #19171a;
  --primary-text: #ffffff;
  --secondary-bg: rgba(255, 255, 255, 0.78);
  --secondary-text: #161416;

  --tab-token: rgba(22, 169, 215, 0.55);
  --tab-token-text: #101010;

  --tab-text: rgba(22, 163, 74, 0.55);
  --tab-text-text: #101010;

  --tab-image: rgba(163, 200, 29, 0.55);
  --tab-image-text: #101010;

  --tab-four: rgba(242, 223, 27, 0.55);
  --tab-four-text: #101010;

  --tab-model: rgba(243, 154, 27, 0.55);
  --tab-model-text: #101010;

  --tab-info: rgba(139, 124, 246, 0.55);
  --tab-info-text: #101010;
}

body[data-theme="dark"] {
  --bg: #000000;
  --bg-2: #000000;
  --panel: rgba(20, 20, 20, 0.98);
  --surface: rgba(34, 34, 34, 0.96);
  --surface-soft: rgba(28, 28, 28, 1);
  --border: rgba(255, 255, 255, 0.06);
  --text: #f4f4f7;
  --muted: #b2b1b8;
  --muted-2: #d5d4da;
  --shadow-card: 0 15px 32px rgba(0, 0, 0, 0.54);
  --shadow-soft: 0 7px 15px rgba(0, 0, 0, 0.3);
  --shadow-tab: 0 6px 13px rgba(0, 0, 0, 0.42);
  --status-bg: rgba(35, 35, 40, 0.95);
  --status-idle: #ffffff;
  --status-loading: #ffffff;
  --status-success: #ffffff;
  --status-error: #ffffff;
  --overlay: rgba(5, 5, 8, 0.8);
  --toggle-bg: rgba(255, 255, 255, 0.12);
  --toggle-thumb: #ffffff;
  --toggle-border: rgba(255, 255, 255, 0.08);
  --primary-bg: #ffffff;
  --primary-text: #131316;
  --secondary-bg: rgba(48, 48, 54, 0.95);
  --secondary-text: #f4f4f7;

  --tab-token-text: #ffffff;
  --tab-text-text: #ffffff;
  --tab-image-text: #ffffff;
  --tab-four-text: #ffffff;
  --tab-model-text: #ffffff;
  --tab-info-text: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Roboto", Arial, sans-serif;
  font-weight: 300;
  color: var(--text);
  background: var(--bg);
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  padding: 2px 16px 16px;
}

.site-header {
  max-width: 1080px;
  margin: 0 auto 2px;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 26px;
  min-width: 0;
}

.brand-logo {
  width: auto;
  height: 72px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
}

.brand-text {
  min-width: 0;
}

.brand-text h1 {
  margin: 0;
  font-family: "Roboto", Arial, sans-serif;
  font-size: clamp(34px, 4vw, 46px);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 200;
  text-align: left;
  white-space: nowrap;
}

.site-version {
  font-size: 33%;
  font-weight: 300;
  vertical-align: baseline;
}

.blank-card {
  min-height: 320px;
}

.header-center {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  width: 100%;
}

.header-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}

.global-status {
  min-height: 44px;
  min-width: 240px;
  width: 100%;
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 11px;
  background: var(--status-bg);
  box-shadow: var(--shadow-soft);
  color: var(--status-idle);
  font-size: 18px;
  line-height: 1.4;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
}

.global-status.loading {
  color: var(--status-loading);
}

.global-status.success {
  color: var(--status-success);
}

.global-status.error {
  color: var(--status-error);
}

.theme-toggle {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.theme-toggle-track {
  position: relative;
  width: 56px;
  height: 34px;
  border-radius: 999px;
  background: var(--toggle-bg);
  border: 1px solid var(--toggle-border);
  box-shadow: var(--shadow-soft);
  display: block;
}

.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--toggle-thumb);
  box-shadow: var(--shadow-soft);
  transition: left 0.2s ease;
}

body[data-theme="dark"] .theme-toggle-thumb {
  left: 31px;
}

.workspace {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}

.tab-rail {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  padding: 18px 0 18px;
}

.tab-info {
  margin-top: auto;
}

.side-tab {
  width: 82px;
  min-height: 68px;
  border: none;
  border-radius: 18px 0 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  cursor: pointer;
  position: relative;
  margin-right: 0;
  transform: translateX(0);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.side-tab.active {
  transition: none;
}

.side-tab span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  font-size: 18px;
  letter-spacing: 0.03em;
  font-weight: 500;
  text-align: center;
}

.side-tab:hover {
  box-shadow: var(--shadow-tab);
  transform: translateX(-2px);
}

/* The card sits above closed tabs and casts a narrow contact shadow onto them. */
.side-tab:not(.active) {
  box-shadow:
    inset -12px 0 12px -12px rgba(0, 0, 0, 0.52),
    -3px 6px 11px rgba(0, 0, 0, 0.14);
}

.side-tab:not(.active):hover {
  box-shadow:
    inset -14px 0 13px -13px rgba(0, 0, 0, 0.56),
    -5px 8px 15px rgba(0, 0, 0, 0.2);
}

body[data-theme="dark"] .side-tab:not(.active) {
  box-shadow:
    inset -22px 0 18px -14px rgba(0, 0, 0, 0.92),
    inset -1px 0 rgba(255, 255, 255, 0.1),
    -4px 7px 14px rgba(0, 0, 0, 0.72);
}

body[data-theme="dark"] .side-tab:not(.active):hover {
  box-shadow:
    inset -25px 0 20px -14px rgba(0, 0, 0, 0.96),
    inset -1px 0 rgba(255, 255, 255, 0.13),
    -6px 9px 18px rgba(0, 0, 0, 0.8);
}

.side-tab.active {
  width: 130px;
  min-height: 64px;
  transform: translateX(24px);
  filter: saturate(1.04) brightness(1.02);
  box-shadow: none;
  z-index: 3;
}

#tab-btn-token {
  background: var(--tab-token);
  color: var(--tab-token-text);
}

#tab-btn-text {
  background: var(--tab-text);
  color: var(--tab-text-text);
}

#tab-btn-image {
  background: var(--tab-image);
  color: var(--tab-image-text);
}

#tab-btn-four {
  background: var(--tab-four);
  color: var(--tab-four-text);
}

#tab-btn-model {
  background: var(--tab-model);
  color: var(--tab-model-text);
}

#tab-btn-info {
  background: var(--tab-info);
  color: var(--tab-info-text);
}

.panel-host {
    box-shadow: 0 -28px 60px rgba(0, 0, 0, 0.38);
  position: relative;
    box-shadow: 0 -28px 60px rgba(0, 0, 0, 0.38);
  z-index: 2;
    box-shadow: 0 -28px 60px rgba(0, 0, 0, 0.38);
  min-height: 480px;
    box-shadow: 0 -28px 60px rgba(0, 0, 0, 0.38);
  background: var(--panel);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  padding: 20px 20px 20px 46px;
  margin-left: 0;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.panel-head {
  margin-bottom: 18px;
}

.panel-head h2 {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 500;
  display: none;
}

.panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: 24px;
  line-height: 1.5;
  font-weight: 300;
}

.token-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(150px, 0.8fr) minmax(140px, 0.8fr);
  gap: 16px;
  align-items: stretch;
}

.payment-coming-soon {
  margin-top: 16px;
  padding: 28px 20px;
  text-align: center;
}

.payment-coming-soon h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 22px;
  font-weight: 500;
}

.payment-coming-soon p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 300;
}

.paypal-card {
  margin-top: 16px;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: center;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-card);
}

.paypal-copy,
.paypal-quantity-wrap {
  min-height: 112px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.paypal-copy {
  background: transparent;
  border-color: transparent;
}

.paypal-quantity-wrap {
  background: transparent;
  border-color: transparent;
}

.paypal-card > h3 {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.3;
  font-weight: 500;
  text-align: center;
}

.paypal-copy p,
.paypal-result {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.3;
  font-weight: 300;
}

.paypal-quantity-wrap {
  text-align: center;
}

.paypal-quantity-wrap label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.3;
  font-weight: 500;
}

#paypal-quantity {
  width: 64px;
  min-height: 42px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: center;
  font-size: 22px;
  appearance: textfield;
  -moz-appearance: textfield;
}

#paypal-quantity::-webkit-inner-spin-button,
#paypal-quantity::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.paypal-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.paypal-step-button {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--tab-token);
  color: var(--tab-token-text);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
  font-weight: 500;
}

.paypal-step-button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.paypal-step-button:active {
  transform: translateY(0);
  box-shadow: none;
}

.paypal-summary {
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 300;
}

.paypal-button-container {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 480px;
  min-height: 52px;
  justify-self: center;
}

.paypal-result {
  grid-column: 1 / -1;
  min-height: 22px;
  text-align: center;
}

.paypal-result.success {
  color: var(--status-success);
  font-weight: 500;
}

.paypal-result.error {
  color: var(--status-error);
  font-weight: 500;
}

.soft-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}

.metric-card {
  min-height: 126px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.credits-card {
  justify-content: space-between;
  align-items: stretch;
  text-align: left;
}

.metric-label {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.3;
  font-weight: 500;
}

.metric-label-centered {
  text-align: center;
}

.metric-content {
  color: var(--text);
  font-size: 18px;
  font-weight: 300;
}

.action-card {
  align-items: center;
  text-align: center;
}

.action-card-content {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#token-input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: 13px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

#token-input {
  font-size: 36px;
  min-height: 50px;
  padding: 0 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  font-weight: 300;
}

#token-input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

textarea {
  min-height: 140px;
  resize: vertical;
  padding: 16px;
  font-size: 24px;
  line-height: 1.5;
  margin: 0 0 16px;
  font-weight: 300;
}

#token-input:focus,
textarea:focus {
  border-color: rgba(110, 110, 120, 0.2);
}

.credits-value {
  font-size: 4em;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.credits-value-centered {
  text-align: center;
}

.upload-title {
  display: block;
  margin-bottom: 8px;
  color: var(--muted-2);
  font-size: 18px;
  font-weight: 500;
  text-align: center;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.upload-shell {
  padding: 12px;
}

.single-upload-shell {
  margin-bottom: 16px;
  width: 100%;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.custom-dropzone {
  width: 100%;
  min-height: 145px;
  padding: 12px;
  border: 1.5px dashed rgba(120, 120, 128, 0.28);
  border-radius: 13px;
  background: var(--surface-soft);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.square-dropzone {
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  overflow: hidden;
}
}

#dz-image.square-dropzone {
  aspect-ratio: 3 / 4;
}

#panel-four .upload-grid {
  grid-template-columns: repeat(2, minmax(300px, 460px));
  justify-content: center;
}

#panel-four .upload-shell {
  width: 100%;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.custom-dropzone:hover {
  transform: translateY(-1px);
}

.custom-dropzone .dz-message {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.4;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 16px;
  text-align: center;
  font-weight: 300;
}

.custom-dropzone.dz-started .dz-message {
  display: none;
}

.custom-dropzone .dz-preview {
  position: relative;
  margin: 0;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  border-radius: 11px;
  overflow: hidden;
  background: transparent;
}

.custom-dropzone .dz-preview .dz-image {
  width: 100%;
  height: 100%;
  border-radius: 11px;
  overflow: hidden;
  background: transparent;
}

.custom-dropzone .dz-preview .dz-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.custom-dropzone .dz-preview .dz-details,
.custom-dropzone .dz-preview .dz-size,
.custom-dropzone .dz-preview .dz-filename,
.custom-dropzone .dz-preview .dz-progress,
.custom-dropzone .dz-preview .dz-success-mark,
.custom-dropzone .dz-preview .dz-error-mark,
.custom-dropzone .dz-preview .dz-error-message {
  display: none !important;
}

.custom-dropzone .dz-preview .dz-remove {
  position: absolute;
  right: 7px;
  bottom: 7px;
  z-index: 10;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #ffffff;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  backdrop-filter: blur(6px);
}

.custom-dropzone .dz-preview .dz-remove:hover {
  background: rgba(0, 0, 0, 0.82);
}

.viewer-tone-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.viewer-tone-label {
  color: var(--muted-2);
  font-size: 18px;
  font-weight: 500;
  white-space: nowrap;
}

.viewer-tone-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 195px;
  max-width: 195px;
  flex: 0 0 195px;
  height: 32px;
  border-radius: 999px;
  background: var(--toggle-bg);
  border: 1px solid var(--toggle-border);
  box-shadow: var(--shadow-soft);
  padding: 0 3px;
  cursor: pointer;
}

.viewer-tone-slider::-webkit-slider-runnable-track {
  height: 24px;
  background: transparent;
  border-radius: 999px;
}

.viewer-tone-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  margin-top: 0;
  border: none;
  border-radius: 50%;
  background: var(--toggle-thumb);
  box-shadow: var(--shadow-soft);
}

.viewer-tone-slider::-moz-range-track {
  height: 24px;
  background: transparent;
  border-radius: 999px;
}

.viewer-tone-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: var(--toggle-thumb);
  box-shadow: var(--shadow-soft);
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
}

.panel-actions-model {
  flex-wrap: nowrap;
}

.primary-action,
.secondary-action {
  min-height: 46px;
  border: none;
  border-radius: 12px;
  padding: 11px 18px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.16s ease, opacity 0.16s ease;
  font-size: 18px;
  font-weight: 500;
}

.primary-action:hover,
.secondary-action:hover {
  transform: translateY(-1px);
}

.primary-action {
  background: var(--primary-bg);
  color: var(--primary-text);
}

.secondary-action {
  background: var(--secondary-bg);
  color: var(--secondary-text);
}

.primary-token-tab {
  background: var(--tab-token);
  color: var(--tab-token-text);
}

.primary-text-tab {
  background: var(--tab-text);
  color: var(--tab-text-text);
}

.primary-image-tab {
  background: var(--tab-image);
  color: var(--tab-image-text);
}

.primary-four-tab {
  background: var(--tab-four);
  color: var(--tab-four-text);
}

.primary-model-tab {
  background: var(--tab-model);
  color: var(--tab-model-text);
}

.large-button {
  min-width: 156px;
}

#download-stl-btn.stl-ready {
  background: var(--tab-model);
  color: var(--tab-model-text);
}

#download-stl-btn.stl-download-progress {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  opacity: 1;
}

#download-stl-btn.stl-download-progress::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 0;
  width: var(--stl-download-progress, 0%);
  background: var(--tab-model);
  transition: width 0.1s linear;
  pointer-events: none;
}

#download-stl-btn.stl-download-progress .button-label {
  position: relative;
  z-index: 1;
}

.generate-btn:disabled,
.primary-action:disabled,
.secondary-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.viewer-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 18px;
  overflow: hidden;
  background: var(--viewer-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  margin-bottom: 16px;
}

#viewer {
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
}

.viewer-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.4;
  text-align: center;
  pointer-events: none;
  font-weight: 300;
}

.viewer-shell.has-model .viewer-placeholder {
  display: none;
}

.info-grid {
  column-count: 2;
  column-gap: 16px;
}

.info-block {
  display: inline-block;
  width: 100%;
  padding: 16px;
  margin: 0 0 16px;
  break-inside: avoid;
}

.info-block h3 {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.12;
  font-weight: 500;
}

.info-block p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
  font-weight: 300;
}

.info-block-token {
  background: var(--tab-token);
  color: var(--tab-token-text);
}

.info-block-text {
  background: var(--tab-text);
  color: var(--tab-text-text);
}

.info-block-image {
  background: var(--tab-image);
  color: var(--tab-image-text);
}

.info-block-four {
  background: var(--tab-four);
  color: var(--tab-four-text);
}

.info-block-model {
  background: var(--tab-model);
  color: var(--tab-model-text);
}

.info-block-token p,
.info-block-text p,
.info-block-image p,
.info-block-four p,
.info-block-model p {
  color: inherit;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-overlay.hidden {
  display: none;
}

.loading-status-bar {
  position: relative;
  width: min(88vw, 520px);
  min-height: 58px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow-card);
}

body[data-theme="dark"] .loading-status-bar {
  background: rgba(30, 30, 34, 0.92);
  border-color: rgba(255, 255, 255, 0.08);
}

.loading-status-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--tab-model);
  transition: width 0.2s linear;
}

.loading-overlay.overlay-mode-text .loading-status-fill {
  background: var(--tab-text);
}

.loading-overlay.overlay-mode-model .loading-status-fill {
  background: var(--tab-model);
}

.loading-overlay.overlay-mode-stl .loading-status-fill {
  background: var(--tab-model);
}

.loading-status-text-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.loading-status-text {
  position: absolute;
  inset: 0;
  min-height: 58px;
  padding: 0 18px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

.loading-status-text-dark {
  color: #161416;
}

.loading-status-text-light {
  color: #ffffff;
  z-index: 2;
  mix-blend-mode: difference;
}

#dz-image .dz-preview:hover .dz-image img,
#dz-image .dz-preview.dz-image-preview:hover .dz-image img {
  filter: none !important;
  transform: none !important;
}

#panel-four .square-dropzone {
  aspect-ratio: 4 / 3;
}

#visualise-btn-text {
  margin-bottom: 20px;
}

#visualise-results {
  grid-template-columns: repeat(2, 460px);
  justify-content: center;
}
@media (min-width: 961px) {
  #visualise-results > .visualise-shell:nth-child(1) { grid-column: 1; grid-row: 1; }
  #visualise-results > .panel-actions:nth-child(2) { grid-column: 1; grid-row: 2; margin-top: 0; }
  #visualise-results > .visualise-shell:nth-child(3) { grid-column: 2; grid-row: 1; }
  #visualise-results > .panel-actions:nth-child(4) { grid-column: 2; grid-row: 2; margin-top: 0; }
}

.visualise-shell {
  width: 100%;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.visualise-option-box {
  aspect-ratio: 4 / 3;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.visualise-option-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 11px;
}

@media (max-width: 960px) {
  .workspace {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .side-tab {
    width: 48px;
    min-height: 52px;
  }

  .side-tab.active {
    width: 56px;
    min-height: 62px;
    transform: translateX(10px);
  }

  .token-layout {
    grid-template-columns: 1fr;
  }

  .paypal-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .paypal-result {
    grid-column: 1;
  }

  .panel-actions-model {
    flex-wrap: wrap;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding: 8px 10px 10px;
  }

  .site-header {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 8px;
  }
    .panel-head { margin-top: 16px; }

  .brand-left {
    gap: 10px;
  }

  .brand-logo {
    height: 50px;
  }

  .brand-text h1 {
    font-size: 32px;
  }

    .header-center {
      justify-content: flex-start;
    }

    .header-right {
      justify-content: flex-end;
    }

  .global-status {
    min-height: 40px;
    min-width: 0;
    width: 100%;
    padding: 8px 10px;
    font-size: 18px;
  }

  .theme-toggle-track {
    width: 54px;
    height: 31px;
  }

  .theme-toggle-thumb {
    top: 3px;
    left: 3px;
    width: 23px;
    height: 23px;
  }

  body[data-theme="dark"] .theme-toggle-thumb {
    left: 28px;
  }

  .workspace {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .tab-rail {
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
    padding: 0 0 18px;
    overflow-x: auto;
    min-height: 92px;
    margin-bottom: -28px;
    position: relative;
  }

  .tab-info {
    margin-top: 0;
    margin-left: auto;
  }

  .side-tab {
    width: 56px;
    min-width: 56px;
    height: 92px;
    min-height: 92px;
    border-radius: 16px 16px 0 0;
    padding: 8px 4px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(0);
    opacity: 0.9;
  }

  .side-tab.active {
    width: 56px;
    min-width: 56px;
    height: 145px;
    min-height: 145px;
    transform: translateY(16px);
    opacity: 1;
    z-index: 3;
    transition: none;
  }

  .side-tab:not(.active) {
    transition: none;
    box-shadow:
      inset 0 -13px 12px -12px rgba(0, 0, 0, 0.5),
      0 -3px 10px rgba(0, 0, 0, 0.12);
  }

  .side-tab:hover {
    box-shadow: var(--shadow-tab);
    transform: translateY(-1px);
  }

  .side-tab:not(.active):hover {
    box-shadow:
      inset 0 -15px 13px -13px rgba(0, 0, 0, 0.55),
      0 -5px 14px rgba(0, 0, 0, 0.18);
  }

  body[data-theme="dark"] .side-tab:not(.active) {
    box-shadow:
      inset 0 -23px 19px -14px rgba(0, 0, 0, 0.92),
      inset 0 -1px rgba(255, 255, 255, 0.1),
      0 -4px 14px rgba(0, 0, 0, 0.72);
  }

  body[data-theme="dark"] .side-tab:not(.active):hover {
    box-shadow:
      inset 0 -26px 21px -14px rgba(0, 0, 0, 0.96),
      inset 0 -1px rgba(255, 255, 255, 0.13),
      0 -6px 18px rgba(0, 0, 0, 0.8);
  }

  .side-tab.active:hover {
    transform: translateY(16px);
  }

  .side-tab span {
    font-size: 18px;
    line-height: 1;
    white-space: nowrap;
    display: inline-block;
    transform: rotate(-90deg);
    transform-origin: center;
    text-align: center;
  }

  .panel-host {
    box-shadow: 0 -28px 60px rgba(0, 0, 0, 0.38);
    padding: 20px 14px 14px;
    border-radius: 15px;
    min-height: 380px;
  }


  .metric-content,
  #token-input,
  .upload-title,
  .viewer-tone-label,
  .custom-dropzone .dz-message,
  .primary-action,
  .secondary-action,
  .global-status,
  .loading-status-text,
  .viewer-placeholder,
  .info-block p {
    font-size: 18px;
  }

  textarea {
    min-height: 132px;
    font-size: 22px;
  }

  .metric-label,
  .upload-title,
  .viewer-tone-label {
    font-size: 18px;
  }

  .upload-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .info-grid {
    column-count: 1;
  }

  #panel-four .upload-grid {
    grid-template-columns: 1fr;
  }

  #panel-four .upload-shell {
    max-width: 100%;
  }

  .single-upload-shell {
    max-width: 100%;
  }

  .viewer-tone-row {
    flex-direction: column;
    align-items: stretch;
  }

  .viewer-tone-slider {
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
  }
      #viewer,
      .viewer-shell {
        aspect-ratio: 3 / 4;
        height: auto;
        min-height: 0;
      }
    }
  }

  @media (max-width: 720px) {
    .large-button {
      min-width: 100%;
    }

    .custom-dropzone .dz-preview .dz-remove {
      right: 6px;
      bottom: 6px;
      min-height: 22px;
      padding: 0 8px;
      font-size: 18px;
    }

    .loading-status-bar {
      width: min(92vw, 520px);
      min-height: 54px;
    }

    .loading-status-text {
      min-height: 54px;
      padding: 0 14px;
    }

    }

  @media (max-width: 960px) {
    #visualise-results {
      grid-template-columns: 1fr;
    }

    .visualise-shell {
      max-width: 100%;
    }
  }
.btn-cost { font-weight: 300; opacity: 0.75; margin-left: 6px; }
  .credits-value { font-size: 4em; }
  #token-input { font-size: 36px; }
