/* ===== Threekit brand palette ===== */

:root {
  /* Primary - Threekit Dark Teal */
  --primary: #1d4749;
  --primary-light: #2a5a5c;
  --primary-dark: #142f30;

  /* Accent - Threekit Lime/Sage */
  --accent: #b7c988;
  --accent-light: #eef3e4;
  --accent-bright: #d4e157;
  --accent-dark: #9bb56a;

  /* Secondary - Threekit Warm Coral */
  --coral: #e8998d;
  --coral-light: #fdf0ee;

  /* Semantic */
  --success: #4a7c59;
  --success-light: #eef3e4;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --info: #2a5a5c;
  --info-light: #e8f0f0;
  --rose: #c75d5d;
  --rose-light: #fdf0ee;

  /* UI tokens (derived) */
  --surface-page: var(--accent-light);
  --surface-player: var(--info-light);
  --surface-input: #ffffff;
  --surface-muted: rgba(238, 243, 228, 0.7);
  --surface-admin-muted: rgba(253, 240, 238, 0.92);
  --focus-ring-coral: rgba(232, 153, 141, 0.4);
  --text-primary: var(--primary-dark);
  --text-muted: var(--primary-light);
  --text-subtle: var(--info);
  --text-on-accent: var(--primary-dark);
  --border-soft: rgba(29, 71, 73, 0.18);
  --border-focus: var(--accent);
  --shadow-soft: rgba(20, 47, 48, 0.1);
  --focus-ring: rgba(183, 201, 136, 0.45);
}

/* ===== Base (shared with mainPlayer.html / secondaryPlayer.html iframes) ===== */

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--surface-page);
  color: var(--text-primary);
}

#frameBody {
  margin: 0;
}

#threekitPlayerZone {
  height: 100%;
  width: 100%;
  position: absolute;
}

/* ===== Page chrome (config.html) ===== */

.ui-header-title {
  color: var(--primary);
}

.ui-header-btn {
  color: var(--primary-light);
}

.ui-header-btn:hover {
  color: var(--primary);
  border-color: var(--accent);
}

.ui-admin-panel {
  background: rgba(238, 243, 228, 0.35);
  box-shadow: -12px 0 40px var(--shadow-soft);
}

.ui-admin-border {
  border-color: var(--border-soft);
}

.ui-admin-heading {
  color: var(--text-primary);
}

.ui-admin-subheading {
  color: var(--text-subtle);
}

.ui-admin-close {
  color: var(--text-muted);
}

.ui-admin-close:hover {
  color: var(--text-primary);
}

.ui-admin-trigger {
  background: rgba(232, 240, 240, 0.95);
  border-color: var(--border-soft);
  color: var(--primary-light);
}

.ui-admin-trigger:hover {
  background: var(--accent);
  color: var(--primary-dark);
}

.ui-product-title {
  color: var(--primary);
}

.ui-product-subtitle {
  color: var(--text-muted);
}

.ui-panel-label {
  color: var(--text-muted);
}

.ui-done-btn {
  background: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
  cursor: pointer;
}

.ui-done-btn:hover:not(:disabled) {
  background: var(--primary-light);
  border-color: var(--primary-light);
}

.ui-done-btn.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

.ui-spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: ui-spinner-rotate 0.7s linear infinite;
  flex-shrink: 0;
}

.ui-spinner--small {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}

.ui-spinner--inline {
  width: 1.1rem;
  height: 1.1rem;
}

@keyframes ui-spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

#dataDrivenOutputZone.is-loading-recap ol {
  gap: 1rem;
}

.recap-line-skeleton {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.5rem 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.03);
}

/* ===== Recap page (step 2) ===== */

.font-headline {
  font-family: 'Manrope', sans-serif;
}

.font-body {
  font-family: 'Inter', sans-serif;
}

html:has(body.recap-page),
body.recap-page {
  background: #ffffff;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html:has(body.recap-page)::-webkit-scrollbar,
body.recap-page::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.recap-page,
.recap-page * {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.recap-page::-webkit-scrollbar,
.recap-page *::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.recap-page {
  min-height: 100vh;
  background: #ffffff;
  color: #1a1a1a;
  overflow: hidden;
}

.recap-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 1.25rem 2rem;
  text-align: center;
  letter-spacing: 0.35em;
  font-size: 0.75rem;
  font-weight: 700;
}

.recap-layout {
  display: grid;
  grid-template-columns: 1fr;
  height: calc(100vh - 57px);
  min-height: calc(100vh - 57px);
}

@media (min-width: 1024px) {
  .recap-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.recap-gallery {
  background: #ffffff;
  padding: 0;
  margin: 0;
  display: block;
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.recap-gallery-image {
  width: 100%;
  max-width: 100%;
  max-height: 50vh;
  height: auto;
  object-fit: contain;
  object-position: center top;
  display: block;
  border: none;
  margin: 0 auto;
  padding: 0;
}

.recap-gallery-placeholder {
  flex: 1;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.recap-gallery-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  width: 100%;
}

.recap-gallery-slot--loaded {
  display: block;
  min-height: 0;
}

.recap-gallery-slot-error {
  color: #999;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (min-width: 1024px) {
  .recap-gallery {
    border-right: 1px solid rgba(0, 0, 0, 0.08);
  }
}

.recap-sidebar {
  padding: 2rem 1.75rem 3rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
}

@media (min-width: 1024px) {
  .recap-sidebar {
    border-top: none;
    align-self: stretch;
    min-height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
    background: #ffffff;
  }

  .recap-sidebar::-webkit-scrollbar {
    display: none;
  }
}

.recap-product-name {
  font-family: 'Manrope', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

.recap-product-ref {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 0.35rem;
}

.recap-product-price {
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.recap-personalization {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 2px;
  padding: 1rem 1.25rem 1.25rem;
  margin-bottom: 1.5rem;
}

.recap-personalization-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.recap-personalization-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

.recap-modify-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
  color: #1a1a1a;
}

.recap-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.recap-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  line-height: 1.35;
}

.recap-line-label {
  color: #666;
}

.recap-line-value {
  text-align: right;
  font-weight: 500;
}

.recap-cta {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  padding: 0.95rem 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.recap-cta:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
}

.recap-secondary-link {
  display: block;
  text-align: center;
  margin-top: 1rem;
  font-size: 0.8rem;
  text-decoration: underline;
  color: #1a1a1a;
}

.ui-loading-bar {
  background-color: var(--accent-bright);
}

/* ===== Icon font ===== */

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

/* ===== Glass Panel ===== */

.glass-panel {
  background: rgba(255, 255, 255, 0.35);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-soft);
  box-shadow: 0 8px 32px var(--shadow-soft);
}

/* ===== Admin Panel Section Titles ===== */

.admin-section-title {
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 0.65rem;
  color: var(--text-subtle);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-soft);
  display: block;
}

/* ===== Data-Driven Controls (glass panel + admin additional items) ===== */

#dataDrivenOutputZone ol,
#additonalItemsZone ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

#dataDrivenOutputZone li,
#additonalItemsZone li {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
}

#dataDrivenOutputZone select,
#dataDrivenOutputZone input[type="text"],
#dataDrivenOutputZone input[type="number"],
#additonalItemsZone select,
#additonalItemsZone input[type="text"],
#additonalItemsZone input[type="number"] {
  width: 100%;
  background: var(--surface-input);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 0.75rem;
  font-family: 'Inter', sans-serif;
  margin-top: 4px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

#dataDrivenOutputZone select,
#additonalItemsZone select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231D4749' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  cursor: pointer;
}

#dataDrivenOutputZone select:hover,
#dataDrivenOutputZone input:hover,
#additonalItemsZone select:hover,
#additonalItemsZone input:hover {
  border-color: var(--accent);
}

#dataDrivenOutputZone select:focus,
#dataDrivenOutputZone input:focus,
#additonalItemsZone select:focus,
#additonalItemsZone input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

#dataDrivenOutputZone select option,
#additonalItemsZone select option {
  background: var(--accent-light);
  color: var(--text-primary);
}

#dataDrivenOutputZone button {
  background: var(--accent-light);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  color: var(--text-primary);
  padding: 6px 10px;
  font-size: 0.65rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

#dataDrivenOutputZone button:hover {
  background: var(--accent);
  border-color: var(--accent-dark);
}

/* ===== Connection Section (admin panel) ===== */

#connectionZone {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.conn-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.conn-field label {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-subtle);
  font-family: 'Inter', sans-serif;
}

.conn-field select,
.conn-field input[type="text"] {
  background: var(--surface-input);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  color: var(--text-primary);
  padding: 6px 10px;
  font-size: 0.7rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.conn-field select:hover,
.conn-field input:hover {
  border-color: var(--accent);
}

.conn-field select:focus,
.conn-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

/* ===== Action Zone (admin panel) ===== */

#actionZone .actionSubZone {
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 0.7rem;
  line-height: 1.8;
  color: var(--text-muted);
}

#actionZone a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s;
}

#actionZone a:hover {
  color: var(--primary);
  text-decoration: underline;
}

#actionZone b {
  color: var(--text-primary);
  font-size: 0.7rem;
}

#actionZone select {
  background: var(--surface-input);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  color: var(--text-primary);
  padding: 3px 8px;
  font-size: 0.65rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  margin: 2px 0;
  -webkit-appearance: none;
  appearance: none;
}

#actionZone input[type="text"] {
  background: var(--surface-input);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  color: var(--text-primary);
  padding: 3px 8px;
  font-size: 0.65rem;
  font-family: 'Inter', sans-serif;
  outline: none;
}

#actionZone label {
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.7rem;
  text-decoration: none;
}

#actionZone label:hover {
  color: var(--text-primary);
}

.no-wrap-container {
  white-space: nowrap;
  display: inline-block;
  color: var(--text-muted);
}

/* ===== Special Zone Buttons ===== */

#datadrivenSpecialZone button {
  background: var(--accent-light);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  color: var(--text-primary);
  padding: 6px 10px;
  font-size: 0.65rem;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.2s;
  margin: 3px 2px;
}

#datadrivenSpecialZone button:hover {
  background: var(--accent);
  border-color: var(--accent-dark);
}

#datadrivenSpecialZone select {
  background: var(--surface-input);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  color: var(--text-primary);
  padding: 3px 8px;
  font-size: 0.65rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  display: block;
  margin-top: 8px;
}

#adminPanel .admin-reload-btn {
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  background: var(--accent-light);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

#adminPanel .admin-reload-btn:hover {
  background: var(--accent);
  border-color: var(--accent-dark);
}

/* ===== Performance Info ===== */

#datadrivenInfoZone {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
}

/* ===== Loading Bar ===== */

#prefetchLoadingBar {
  width: 100%;
  height: 2px;
  transition-property: opacity, width;
  transition-delay: 0.2s, 0s;
}

/* ===== Separator ===== */

.separatorLight {
  border-color: var(--border-soft);
  border-width: 0;
  border-top-width: 1px;
  margin: 4px 0;
}

/* ===== Scrollbar ===== */

::-webkit-scrollbar {
  width: 3px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}

/* ===== Responsive ===== */

@media (max-width: 768px) {
  #adminPanel {
    width: 100% !important;
  }
}

/* ===== Product menu (home) ===== */

html:has(body.menu-page),
body.menu-page {
  height: auto;
  min-height: 100%;
  background: #ffffff;
  background-color: #ffffff;
}

.menu-page {
  min-height: 100vh;
  background: #ffffff;
  color: #1a1a1a;
}

.menu-main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.menu-title {
  font-family: 'Manrope', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.menu-subtitle {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #666;
  margin: 0 0 1.75rem;
}

.menu-nav {
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.menu-link {
  display: block;
  padding: 0.95rem 0.15rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  color: #1a1a1a;
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.15s ease, padding-left 0.15s ease;
}

.menu-link:hover {
  color: var(--primary);
  padding-left: 0.35rem;
}

