/* LoginPage — Clay/Neumorphic design matching woogie StartupPage */

:root {
  --page-bg: #e0e0e0;
  --clay-inner: #d8d8d8;
  --soft-shadow: rgba(0, 0, 0, 0.12);
  --deep-shadow: rgba(0, 0, 0, 0.18);
  --sharp-highlight: rgba(255, 255, 255, 0.85);
  --etched-text: #999999;
}

.login-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: var(--page-bg);
  padding: 2rem;
}

/* ── The Well ────────────────────────────────────────────────────────────────── */

.login-container {
  background: var(--clay-inner);
  border-radius: 50px;
  padding: 4rem;
  max-width: 520px;
  width: 100%;
  box-shadow:
    inset 8px 8px 20px var(--soft-shadow),
    inset -8px -8px 20px var(--sharp-highlight);
}

/* ── Title ───────────────────────────────────────────────────────────────────── */

.login-title {
  font-size: 4.5rem;
  font-weight: 900;
  color: var(--page-bg);
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 0.5rem;
  text-shadow:
    0.5px 0.5px 0px var(--sharp-highlight),
    1px 1px 0px var(--soft-shadow),
    2px 2px 2px var(--soft-shadow),
    3px 3px 5px var(--soft-shadow);
}

.login-subtitle {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--etched-text);
  margin-bottom: 3rem;
  text-shadow:
    -1px -1px 1px rgba(0, 0, 0, 0.1),
    1px 1px 1px var(--sharp-highlight);
}

/* ── Tab Toggle ──────────────────────────────────────────────────────────────── */

.login-tabs {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  background: var(--page-bg);
  border-radius: 18px;
  padding: 0.5rem;
  box-shadow:
    inset 4px 4px 8px var(--soft-shadow),
    inset -4px -4px 8px var(--sharp-highlight);
}

.login-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--etched-text);
  cursor: pointer;
  transition: all 0.2s ease;
  text-shadow:
    -1px -1px 1px rgba(0, 0, 0, 0.1),
    1px 1px 1px var(--sharp-highlight);
}

.login-tab.active {
  background: var(--clay-inner);
  color: var(--etched-text);
  box-shadow:
    3px 3px 8px var(--soft-shadow),
    -3px -3px 8px var(--sharp-highlight);
}

/* ── Form Fields ─────────────────────────────────────────────────────────────── */

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.login-field-label {
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--etched-text);
  margin-bottom: 0.5rem;
  text-shadow:
    -1px -1px 1px rgba(0, 0, 0, 0.1),
    1px 1px 1px var(--sharp-highlight);
}

.login-field {
  background: var(--clay-inner);
  border: none;
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: #555;
  width: 100%;
  box-sizing: border-box;
  box-shadow:
    inset 4px 4px 8px var(--soft-shadow),
    inset -4px -4px 8px var(--sharp-highlight);
  transition: all 0.3s ease;
  outline: none;
}

.login-field::placeholder {
  color: #bbb;
  font-weight: 500;
}

.login-field:focus {
  box-shadow:
    inset 6px 6px 12px var(--soft-shadow),
    inset -6px -6px 12px var(--sharp-highlight);
}

/* ── Submit Button ───────────────────────────────────────────────────────────── */

.login-submit-btn {
  background: var(--page-bg);
  color: var(--etched-text);
  font-size: 1.1rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 3px;
  padding: 1.25rem 2rem;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  margin-top: 0.5rem;
  width: 100%;
  box-shadow:
    6px 6px 15px var(--soft-shadow),
    -3px -3px 8px var(--sharp-highlight);
  text-shadow:
    -1px -1px 2px rgba(0, 0, 0, 0.25),
    1px 1px 1px var(--sharp-highlight);
  transition: all 0.2s ease;
}

.login-submit-btn:hover {
  box-shadow:
    8px 8px 20px var(--soft-shadow),
    -4px -4px 10px var(--sharp-highlight);
}

.login-submit-btn:active {
  box-shadow:
    inset 4px 4px 8px var(--soft-shadow),
    inset -4px -4px 8px var(--sharp-highlight);
  transform: translateY(1px);
}

.login-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ── Divider ─────────────────────────────────────────────────────────────────── */

.login-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.75rem 0;
}

.login-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(0,0,0,0.1), transparent);
}

.login-divider-label {
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--etched-text);
  text-shadow:
    -1px -1px 1px rgba(0, 0, 0, 0.1),
    1px 1px 1px var(--sharp-highlight);
  white-space: nowrap;
}

/* ── Wallet Button ───────────────────────────────────────────────────────────── */

.login-wallet-btn {
  background: var(--page-bg);
  color: var(--etched-text);
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 1rem 2rem;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  box-shadow:
    5px 5px 12px var(--soft-shadow),
    -3px -3px 8px var(--sharp-highlight);
  text-shadow:
    -1px -1px 2px rgba(0, 0, 0, 0.2),
    1px 1px 1px var(--sharp-highlight);
  transition: all 0.2s ease;
  font-variant-emoji: text;
  filter: grayscale(100%);
}

.login-wallet-btn:hover {
  box-shadow:
    7px 7px 18px var(--soft-shadow),
    -4px -4px 10px var(--sharp-highlight);
}

.login-wallet-btn:active {
  box-shadow:
    inset 4px 4px 8px var(--soft-shadow),
    inset -4px -4px 8px var(--sharp-highlight);
}

.login-wallet-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Error / Status Messages ─────────────────────────────────────────────────── */

.login-error {
  background: var(--page-bg);
  border-radius: 12px;
  padding: 0.9rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #9a4a4a;
  text-align: center;
  box-shadow:
    inset 3px 3px 6px var(--soft-shadow),
    inset -3px -3px 6px var(--sharp-highlight);
  text-shadow:
    -0.5px -0.5px 1px rgba(0, 0, 0, 0.1),
    0.5px 0.5px 1px var(--sharp-highlight);
}

.login-success {
  background: var(--page-bg);
  border-radius: 12px;
  padding: 0.9rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #4a7a4a;
  text-align: center;
  box-shadow:
    inset 3px 3px 6px var(--soft-shadow),
    inset -3px -3px 6px var(--sharp-highlight);
}

/* ── Wallet Status ───────────────────────────────────────────────────────────── */

.login-wallet-address {
  text-align: center;
  font-family: monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--etched-text);
  opacity: 0.7;
  text-shadow:
    -1px -1px 1px rgba(0, 0, 0, 0.1),
    1px 1px 1px var(--sharp-highlight);
  margin-top: 0.5rem;
}

/* ── Footer link ─────────────────────────────────────────────────────────────── */

.login-footer {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--etched-text);
  text-shadow:
    -1px -1px 1px rgba(0, 0, 0, 0.1),
    1px 1px 1px var(--sharp-highlight);
}
.terraform-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.terraform-modal-content {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.terraform-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.terraform-modal-header h3 {
  margin: 0;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 600;
}

.terraform-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
}

.terraform-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.terraform-modal-body {
  padding: 1.5rem;
}

.terraform-full-description {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  border-left: 3px solid #667eea;
}

.terraform-full-description p {
  margin: 0 0 0.75rem 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  line-height: 1.6;
}

.terraform-full-description p:last-child {
  margin-bottom: 0;
}

.terraform-action {
  margin-bottom: 1.5rem;
}

.terraform-action label {
  display: block;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.terraform-input-group {
  display: flex;
  gap: 0.5rem;
}

.terraform-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: 'Courier New', monospace;
}

.terraform-input:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.terraform-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.terraform-btn {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  white-space: nowrap;
}

.terraform-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.terraform-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.terraform-btn-full {
  width: 100%;
}

.terraform-error {
  background: rgba(231, 76, 60, 0.2);
  border: 1px solid rgba(231, 76, 60, 0.4);
  color: #e74c3c;
  padding: 0.75rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.terraform-success {
  background: rgba(46, 204, 113, 0.2);
  border: 1px solid rgba(46, 204, 113, 0.4);
  color: #2ecc71;
  padding: 0.75rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.terraform-loading {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  text-align: center;
  padding: 0.5rem;
  font-style: italic;
}

.terraform-result {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  color: #4a90e2;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}
.cheon-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.cheon-modal-content {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
}

.cheon-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cheon-modal-header h3 {
  margin: 0;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 600;
}

.cheon-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
}

.cheon-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.cheon-modal-body {
  padding: 1.5rem;
}

.cheon-full-description {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  border-left: 3px solid #4a90e2;
}

.cheon-full-description p {
  margin: 0 0 0.75rem 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  line-height: 1.6;
}

.cheon-full-description p:last-child {
  margin-bottom: 0;
}

.cheon-error {
  background: rgba(231, 76, 60, 0.2);
  border: 1px solid rgba(231, 76, 60, 0.4);
  color: #e74c3c;
  padding: 0.75rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.cheon-action-section {
  margin-top: 1.5rem;
}

.cheon-action-button {
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
}

.cheon-action-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 144, 226, 0.6);
}

.cheon-action-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.cheon-warning {
  background: rgba(255, 193, 7, 0.2);
  border: 1px solid rgba(255, 193, 7, 0.4);
  color: #ffc107;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  text-align: center;
}
.chao-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.chao-modal-content {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
}

.chao-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chao-modal-header h3 {
  margin: 0;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 600;
}

.chao-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
}

.chao-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.chao-modal-body {
  padding: 1.5rem;
}

.chao-full-description {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  border-left: 3px solid #9b59b6;
}

.chao-full-description p {
  margin: 0 0 0.75rem 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  line-height: 1.6;
}

.chao-full-description p:last-child {
  margin-bottom: 0;
}
.model-selector-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.model-selector-modal {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 12px;
  width: 90vw;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.model-selector-header {
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.model-selector-header h2 {
  margin: 0;
  color: white;
  font-size: 1.5rem;
}

.model-selector-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.model-selector-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.model-selector-content {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.model-selector-search {
  margin-bottom: 0.5rem;
}

.model-selector-search-input {
  width: 100%;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: white;
  font-size: 1rem;
}

.model-selector-search-input:focus {
  outline: none;
  border-color: rgba(74, 144, 226, 0.8);
  box-shadow: 0 0 10px rgba(74, 144, 226, 0.3);
}

.model-selector-search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.model-selector-directory {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

.model-selector-directory label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  white-space: nowrap;
}

.model-selector-directory-input {
  flex: 1;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: white;
  font-size: 0.9rem;
}

.model-selector-directory-input:focus {
  outline: none;
  border-color: rgba(74, 144, 226, 0.8);
}

.model-selector-refresh-btn {
  padding: 0.5rem 1rem;
  background: rgba(74, 144, 226, 0.3);
  border: 1px solid rgba(74, 144, 226, 0.5);
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.model-selector-refresh-btn:hover {
  background: rgba(74, 144, 226, 0.5);
  border-color: rgba(74, 144, 226, 0.8);
}

/* Tabs */
.model-selector-tabs {
  display: flex;
  gap: 0;
  padding: 0 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.model-selector-tab {
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.model-selector-tab:hover {
  color: rgba(255, 255, 255, 0.95);
}

.model-selector-tab.active {
  color: white;
  border-bottom-color: rgba(74, 144, 226, 0.9);
}

/* Toolbar: thumbnail size */
.model-selector-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.model-selector-toolbar-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.model-selector-size-buttons {
  display: flex;
  gap: 4px;
}

.model-selector-size-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.model-selector-size-btn:hover {
  background: rgba(74, 144, 226, 0.3);
  border-color: rgba(74, 144, 226, 0.5);
}

.model-selector-size-btn.active {
  background: rgba(74, 144, 226, 0.5);
  border-color: rgba(74, 144, 226, 0.8);
}

.model-selector-size-icon {
  font-size: 1rem;
  line-height: 1;
}

.model-selector-size-icon-md {
  font-size: 1.2rem;
}

.model-selector-size-icon-lg {
  font-size: 1.35rem;
}

/* Grid of thumbnails */
.model-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--thumb-size, 112px), 1fr));
  gap: 1rem;
  min-height: 200px;
  max-height: 380px;
  overflow-y: auto;
  padding: 0.5rem 0;
  margin-bottom: 1rem;
}

.model-selector-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.model-selector-card:hover {
  background: rgba(74, 144, 226, 0.2);
  border-color: rgba(74, 144, 226, 0.5);
  transform: translateY(-2px);
}

.model-selector-card.selected {
  background: rgba(74, 144, 226, 0.4);
  border-color: rgba(74, 144, 226, 0.8);
  box-shadow: 0 0 12px rgba(74, 144, 226, 0.3);
}

.model-selector-card-thumb {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
}

.model-selector-card-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.model-selector-card-placeholder {
  font-size: 1.5rem;
  opacity: 0.6;
  z-index: 0;
}

.model-selector-card-label {
  margin: 4px 4px 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.model-selector-card-btn {
  margin: 4px 0 4px;
  padding: 2px 8px;
  font-size: 10px;
}

.model-selector-list {
  flex: 1;
  min-height: 300px;
  max-height: 400px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  padding: 0.5rem;
}

.model-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.model-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.model-item:hover {
  background: rgba(74, 144, 226, 0.2);
  border-color: rgba(74, 144, 226, 0.5);
  transform: translateX(4px);
}

.model-item.selected {
  background: rgba(74, 144, 226, 0.4);
  border-color: rgba(74, 144, 226, 0.8);
  box-shadow: 0 0 15px rgba(74, 144, 226, 0.3);
}

.model-item-icon {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
}

.model-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.model-item-name {
  color: white;
  font-weight: 600;
  font-size: 1rem;
}

.model-item-path {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  font-family: 'Courier New', monospace;
}

.model-item-type {
  color: rgba(74, 144, 226, 0.8);
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
}

.model-selector-loading,
.model-selector-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}

.model-selector-hint {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
}

.model-selector-manual {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

.model-selector-manual label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}

.model-selector-manual-input {
  width: 100%;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: white;
  font-size: 1rem;
  font-family: 'Courier New', monospace;
}

.model-selector-manual-input:focus {
  outline: none;
  border-color: rgba(74, 144, 226, 0.8);
  box-shadow: 0 0 10px rgba(74, 144, 226, 0.3);
}

.model-selector-manual-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.model-selector-selection {
  padding: 0.75rem;
  background: rgba(74, 144, 226, 0.2);
  border: 1px solid rgba(74, 144, 226, 0.4);
  border-radius: 6px;
  color: white;
  font-size: 0.9rem;
  font-family: 'Courier New', monospace;
}

.model-selector-selection strong {
  color: rgba(74, 144, 226, 1);
  margin-right: 0.5rem;
}

.model-selector-footer {
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.model-selector-cancel-btn,
.model-selector-confirm-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.model-selector-cancel-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.model-selector-cancel-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.model-selector-confirm-btn {
  background: rgba(74, 144, 226, 0.6);
  color: white;
  border: 1px solid rgba(74, 144, 226, 0.8);
}

.model-selector-confirm-btn:hover:not(:disabled) {
  background: rgba(74, 144, 226, 0.8);
  box-shadow: 0 0 15px rgba(74, 144, 226, 0.4);
  transform: translateY(-2px);
}

.model-selector-confirm-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Scrollbar styling */
.model-selector-list::-webkit-scrollbar {
  width: 8px;
}

.model-selector-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.model-selector-list::-webkit-scrollbar-thumb {
  background: rgba(74, 144, 226, 0.5);
  border-radius: 4px;
}

.model-selector-list::-webkit-scrollbar-thumb:hover {
  background: rgba(74, 144, 226, 0.7);
}

.model-selector-grid::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.model-selector-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.model-selector-grid::-webkit-scrollbar-thumb {
  background: rgba(74, 144, 226, 0.5);
  border-radius: 4px;
}

.model-selector-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(74, 144, 226, 0.7);
}
.character-viewer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.character-viewer-container {
  width: 95vw;
  height: 90vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  color: #fff;
}

.character-viewer-header {
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.character-viewer-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.settings-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1) rotate(90deg);
}

.character-viewer-header h2 {
  margin: 0;
  color: white;
  font-size: 1.5rem;
}

.close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.character-viewer-content {
  flex: 1;
  display: flex;
  gap: 0;
  padding: 1rem;
  overflow: hidden;
  position: relative;
}

.character-viewer-center {
  flex: 1;
  min-width: 0;
  position: relative;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  overflow: hidden;
}

.character-viewer-right {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  color: white;
  flex-shrink: 0;
}

.character-viewer-right h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: #4a90e2;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.5rem;
}

.panel-resizer {
  width: 4px;
  background: rgba(255, 255, 255, 0.1);
  cursor: col-resize;
  flex-shrink: 0;
  position: relative;
  margin: 0 0.5rem;
  transition: background 0.2s;
}

.panel-resizer:hover { background: rgba(74, 144, 226, 0.6); }
.panel-resizer::before { content: ''; position: absolute; left: -2px; right: -2px; top: 0; bottom: 0; }

.character-viewer-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
}

.character-viewer-tab {
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  font-weight: 500;
  position: relative;
  bottom: -2px;
  white-space: nowrap;
}

.character-viewer-tab:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
}

.character-viewer-tab.active {
  color: #fff;
  border-bottom-color: rgba(74, 144, 226, 0.8);
  background: rgba(74, 144, 226, 0.1);
}

.character-viewer-tab-content {
  flex: 1;
  overflow-y: auto;
  padding-top: 8px;
  min-height: 0;
}

/* Viewport frame button */
.viewport-frame-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

.viewport-frame-btn:hover {
  background: rgba(74, 144, 226, 0.3);
  border-color: rgba(74, 144, 226, 0.6);
  color: #fff;
}

/* Canvas fills its parent */
.character-viewer-center canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Section headers */
.section-header-with-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.balance-toggle-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: white;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
  margin-left: 0.5rem;
}

.balance-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Token lists */
.token-list { display: flex; flex-direction: column; gap: 0.5rem; }
.token-item { display: flex; justify-content: space-between; padding: 0.5rem; border-radius: 4px; font-size: 0.9rem; }
.token-name { font-weight: 600; color: #ffdbac; }
.token-balance { color: #4a90e2; font-family: 'Courier New', monospace; }

/* Attributes */
.user-tokens { margin-bottom: 1.5rem; }
.user-token-item, .attribute-item { display: flex; justify-content: space-between; padding: 0.5rem; margin-bottom: 0.5rem; border-radius: 4px; font-size: 0.9rem; }

.address-with-copy { display: flex; align-items: center; gap: 0.5rem; }
.copy-button-small { background: rgba(74,144,226,0); border: 0px solid rgba(74,144,226,0.4); color: #4a90e2; padding: 0.2rem 0.4rem; border-radius: 4px; cursor: pointer; font-size: 0.7rem; transition: all 0.2s; }
.copy-button-small:hover { background: rgba(74,144,226,0.3); transform: scale(1.1); }
.lau-address, .yue-address { font-family: 'Courier New', monospace; color: #4a90e2; font-size: 0.85rem; }

.yue-attributes { margin-top: 0.5rem; margin-bottom: 0.5rem; padding: 0.75rem; border-radius: 6px; border-left: 2px solid #4a90e2; }
.yue-attribute { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; font-size: 0.9rem; }
.yue-attribute:not(:last-child) { border-bottom: 1px solid rgba(255,255,255,0.1); }
.yue-value { color: #ffdbac; font-weight: 500; }
.yue-loading, .lau-loading { color: rgba(255,255,255,0.6); font-size: 0.85rem; font-style: italic; }
.yue-error { color: #e74c3c; font-size: 0.85rem; font-style: italic; padding: 0.5rem 0; }

.placeholder { color: rgba(255,255,255,0.4); font-style: italic; }
.placeholder-right { text-align: right; display: block; }
.attribute-value { color: #4a90e2; font-weight: 500; }
.attribute-value.address { font-family: 'Courier New', monospace; font-size: 0.85rem; }

.qing-info { display: flex; flex-direction: column; gap: 0.25rem; }
.qing-details { font-size: 0.85rem; color: #b0b0b0; margin-left: 0.5rem; }
.qing-name { font-weight: 500; color: #4a90e2; }
.qing-symbol { color: #888; }
.qing-select { background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.2); color: white; padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.85rem; }

.location-details { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 0.25rem; }
.coordinate-item { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding-left: 0.5rem; }
.coordinate-label { color: rgba(255,255,255,0.7); font-size: 0.85rem; }
.coordinate-value { text-align: right; font-family: monospace; font-size: 0.85rem; }

.error-text { color: #e74c3c; font-size: 0.85rem; }

.attributes-section, .game-tokens-section, .actions-section { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.attributes-section h4, .game-tokens-section h4, .actions-section h4 { margin-top: 0; margin-bottom: 0.75rem; font-size: 1rem; color: #4a90e2; }
.section-header-collapsible { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 0.5rem; transition: color 0.2s; }
.section-header-collapsible:hover { color: #6ba3e8; }
.section-content { margin-top: 0.5rem; }

/* Game tokens */
.game-token-item { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem; margin-bottom: 0.5rem; border-radius: 4px; font-size: 0.9rem; }
.game-token-balance { color: #4a90e2; font-family: 'Courier New', monospace; font-weight: 500; }

/* Action cards */
.action-cards { display: flex; flex-direction: column; gap: 1rem; }
.action-card { background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; padding: 1rem; transition: all 0.3s ease; }
.action-card:hover { background: rgba(0,0,0,0.4); border-color: rgba(255,255,255,0.25); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.action-card-title { margin: 0 0 0.75rem 0; color: #fff; font-size: 1.1rem; font-weight: 600; line-height: 1.3; }
.action-card-row { display: flex; align-items: stretch; justify-content: space-between; gap: 1rem; }
.action-card-description { margin: 0; color: rgba(255,255,255,0.75); font-size: 0.85rem; line-height: 1.5; flex: 1; display: flex; align-items: center; }
.action-card-button { width: 120px; padding: 0.75rem 1rem; border: none; border-radius: 6px; color: #fff; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; flex-shrink: 0; display: flex; align-items: center; justify-content: center; min-height: 100%; }
.action-card-button:hover:not(:disabled) { transform: translateY(-2px); }
.action-card-button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.action-card-button.terraform-action { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); box-shadow: 0 4px 15px rgba(102,126,234,0.4); }
.action-card-button.terraform-action:hover:not(:disabled) { box-shadow: 0 6px 20px rgba(102,126,234,0.6); }
.action-card-button.accumulate-cheon-action { background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%); box-shadow: 0 4px 15px rgba(74,144,226,0.4); }
.action-card-button.accumulate-cheon-action:hover:not(:disabled) { box-shadow: 0 6px 20px rgba(74,144,226,0.6); }
.action-card-button.chao-action { background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%); box-shadow: 0 4px 15px rgba(155,89,182,0.4); }
.action-card-button.chao-action:hover:not(:disabled) { box-shadow: 0 6px 20px rgba(155,89,182,0.6); }

/* Engine toggle */
.engine-toggle-container { background: rgba(0,0,0,0.5); border-radius: 6px; padding: 0.5rem; border: 1px solid rgba(255,255,255,0.2); }
.engine-toggle-label { display: flex; align-items: center; gap: 0.75rem; cursor: pointer; user-select: none; }
.engine-toggle-checkbox { display: none; }
.engine-toggle-slider { position: relative; width: 50px; height: 24px; background: rgba(255,255,255,0.2); border-radius: 12px; transition: all 0.3s; border: 1px solid rgba(255,255,255,0.3); }
.engine-toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: white; top: 2px; left: 2px; transition: all 0.3s; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.engine-toggle-checkbox:checked + .engine-toggle-slider { background: rgba(74,144,226,0.8); border-color: #4a90e2; }
.engine-toggle-checkbox:checked + .engine-toggle-slider::before { transform: translateX(26px); }
.engine-toggle-text { color: white; font-size: 0.85rem; font-weight: 600; min-width: 110px; }

/* Settings panel */
.character-viewer-settings-panel { position: absolute; top: 60px; right: 1rem; width: 320px; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); z-index: 1001; border: 1px solid rgba(255,255,255,0.1); overflow: hidden; }
.settings-panel-header { padding: 1rem 1.5rem; background: rgba(0,0,0,0.3); display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.1); }
.settings-panel-header h3 { margin: 0; color: white; font-size: 1.1rem; }
.settings-close-btn { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: white; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.settings-close-btn:hover { background: rgba(255,255,255,0.2); transform: scale(1.1); }
.settings-panel-content { padding: 1.5rem; }
.settings-section { margin-bottom: 1.5rem; }
.settings-section:last-child { margin-bottom: 0; }
.settings-section h4 { margin: 0 0 1rem 0; color: #4a90e2; font-size: 0.95rem; font-weight: 600; }
.settings-description { margin: 0.75rem 0 0 0; color: rgba(255,255,255,0.6); font-size: 0.8rem; line-height: 1.4; font-style: italic; }
.settings-model-selector-btn { width: 100%; padding: 0.75rem 1rem; background: rgba(74,144,226,0.6); border: 1px solid rgba(74,144,226,0.8); border-radius: 6px; color: white; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.settings-model-selector-btn:hover { background: rgba(74,144,226,0.8); transform: translateY(-2px); }
.settings-model-path { margin-top: 0.75rem; padding: 0.75rem; background: rgba(0,0,0,0.3); border-radius: 6px; border: 1px solid rgba(255,255,255,0.1); }
.settings-model-path-label { display: block; color: rgba(255,255,255,0.7); font-size: 0.8rem; margin-bottom: 0.25rem; }
.settings-model-path-value { display: block; color: #4a90e2; font-size: 0.85rem; font-family: 'Courier New', monospace; word-break: break-all; font-weight: 600; }
/* ═══════════════════════════════════════════════════════════════════════════
   DOPPLE — Claymorphism Theme
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --clay-base: #d4d6d0;
  --clay-shadow: #b9bcb4;
  --clay-highlight: #eef0ea;
  --clay-text: #636860;
  --clay-accent: #848882;
  --etch-dark: rgba(0, 0, 0, 0.14);
  --etch-light: rgba(255, 255, 255, 0.42);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body, #root {
  width: 100%;
  height: 100%;
  background: var(--clay-base);
  color: var(--clay-text);
  font-family: 'Comic Sans MS', 'Rounded', system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

/* Utility classes shared across routes */
.sculpted { filter: url('#clay-mold'); }
.etched-no-color { color: var(--clay-base); text-shadow: -1px -1px 1px var(--etch-dark), 1px 1px 1px var(--etch-light); }
.color-etched { color: var(--clay-text); text-shadow: -1px -1px 1px var(--etch-dark), 1px 1px 1px var(--etch-light); }

/* ═══════════════════════════════════════════════════════════════════════════
   VIEWER LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

.dopple-app {
  width: 100%;
  height: 100%;
  display: flex;
  background: var(--clay-base);
  position: relative;
}
.dopple-app::before {
  content: "";
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  z-index: 1000;
}

/* ─── Viewport (3D Canvas) — left column top ─────────────────────────────── */

.viewport {
  flex: 1;
  position: relative;
  margin: 16px;
  margin-right: 8px;
  border-radius: 30px;
  overflow: hidden;
  background: var(--clay-base);
  box-shadow:
    inset 10px 10px 25px var(--clay-shadow),
    inset -8px -8px 20px var(--clay-highlight);
}

.viewport canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ─── Model Loading Overlay ────────────────────────────────────────────────── */

.viewport-loading {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--clay-base);
  border-radius: inherit;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.viewport-loading.fade-out {
  opacity: 0;
}

.viewport-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.12);
  border-top-color: rgba(255,255,255,0.55);
  border-radius: 50%;
  animation: vp-spin 0.8s linear infinite;
}

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

/* ─── Left Column (Viewport + Chat) ──────────────────────────────────────── */

.left-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

/* ─── Chat Panel — left column bottom ────────────────────────────────────── */

.chat-panel {
  height: 280px;
  min-height: 180px;
  background: var(--clay-base);
  margin: 16px 8px 16px 16px;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    inset 3px 3px 8px var(--clay-shadow),
    inset -2px -2px 6px var(--clay-highlight);
}

/* ─── Demo Panel (sidebar) — right column ────────────────────────────────── */

.demo-panel {
  width: 340px;
  background: var(--clay-base);
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px;
  border-radius: 24px;
  box-shadow:
    7px 7px 15px var(--clay-shadow),
    -7px -7px 15px var(--clay-highlight);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.demo-panel h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.back-chip {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--clay-base);
  color: var(--clay-text);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow:
    3px 3px 6px var(--clay-shadow),
    -3px -3px 6px var(--clay-highlight);
  transition: all 0.15s;
}
.back-chip:hover {
  box-shadow:
    4px 4px 8px var(--clay-shadow),
    -4px -4px 8px var(--clay-highlight);
  transform: translateY(-1px);
}
.back-chip:active {
  box-shadow:
    inset 3px 3px 6px var(--clay-shadow),
    inset -2px -2px 4px var(--clay-highlight);
  transform: translateY(1px);
}

.demo-panel section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.demo-panel label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--clay-accent);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.demo-panel .value {
  font-size: 14px;
  color: var(--clay-text);
  font-weight: 600;
}

.demo-panel .badge {
  font-size: 10px;
  background: var(--clay-base);
  padding: 2px 10px;
  border-radius: 10px;
  color: var(--clay-accent);
  text-transform: none;
  letter-spacing: 0;
  box-shadow:
    inset 2px 2px 4px var(--clay-shadow),
    inset -2px -2px 4px var(--clay-highlight);
}

/* ─── Buttons ──────────────────────────────────────────────────────────────── */

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chip {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  background: var(--clay-base);
  color: var(--clay-accent);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow:
    3px 3px 6px var(--clay-shadow),
    -3px -3px 6px var(--clay-highlight);
}

.chip:hover {
  color: var(--clay-text);
  box-shadow:
    4px 4px 8px var(--clay-shadow),
    -4px -4px 8px var(--clay-highlight);
  transform: translateY(-1px);
}

.chip.active {
  color: var(--clay-text);
  font-weight: 800;
  box-shadow:
    inset 3px 3px 6px var(--clay-shadow),
    inset -2px -2px 4px var(--clay-highlight);
  transform: translateY(1px);
}

.primary-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  background: var(--clay-base);
  color: var(--clay-text);
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 6px;
  box-shadow:
    5px 5px 12px var(--clay-shadow),
    -5px -5px 12px var(--clay-highlight);
  letter-spacing: 0.5px;
}

.primary-btn:hover {
  box-shadow:
    6px 6px 14px var(--clay-shadow),
    -6px -6px 14px var(--clay-highlight);
  transform: translateY(-2px);
}

.primary-btn:active {
  box-shadow:
    inset 4px 4px 8px var(--clay-shadow),
    inset -3px -3px 6px var(--clay-highlight);
  transform: translateY(1px);
}

/* ─── Colors ───────────────────────────────────────────────────────────────── */

.color-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.color-swatch .swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  box-shadow:
    inset 2px 2px 4px rgba(0,0,0,0.1),
    inset -2px -2px 4px rgba(255,255,255,0.3),
    3px 3px 6px var(--clay-shadow),
    -3px -3px 6px var(--clay-highlight);
}

.color-swatch span {
  font-size: 9px;
  color: var(--clay-accent);
  font-weight: 600;
}

/* ─── Clip List ────────────────────────────────────────────────────────────── */

.clip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.clip-tag {
  font-size: 10px;
  padding: 3px 8px;
  background: var(--clay-base);
  border: none;
  border-radius: 8px;
  color: var(--clay-accent);
  font-weight: 600;
  box-shadow:
    inset 2px 2px 3px var(--clay-shadow),
    inset -1px -1px 2px var(--clay-highlight);
}

.muted {
  font-size: 11px;
  color: var(--clay-accent);
  opacity: 0.7;
}

footer.muted {
  margin-top: auto;
  padding-top: 8px;
  text-align: center;
}

/* ─── Scrollbar Styling ────────────────────────────────────────────────────── */

.demo-panel::-webkit-scrollbar {
  width: 6px;
}
.demo-panel::-webkit-scrollbar-track {
  background: transparent;
}
.demo-panel::-webkit-scrollbar-thumb {
  background: var(--clay-shadow);
  border-radius: 3px;
}
.demo-panel::-webkit-scrollbar-thumb:hover {
  background: var(--clay-accent);
}
