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


body {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: #f0ede8;
  font-family: 'Segoe UI', sans-serif;
  color: #1a1a1a;
  cursor: none;
}

/* ── Panel toggle button ── */
.cfg-toggle {
  position: fixed;
  top: 50%;
  left: 260px;
  transform: translateY(-50%);
  z-index: 100;
  width: 20px;
  height: 48px;
  background: #fff;
  border: 1px solid #e0ddd8;
  border-left: none;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  font-size: 1.1rem;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: left 0.25s ease, color 0.15s;
  padding: 0;
  line-height: 1;
}
.cfg-toggle:hover { color: #1a1a1a; }

body.panel-hidden .cfg-toggle {
  left: 0;
}
body.panel-hidden .cfg-toggle { content: '›'; }

/* ── Panel ── */
.cfg-panel {
  width: 260px;
  flex-shrink: 0;
  height: 100vh;
  overflow-y: auto;
  background: #fff;
  border-right: 1px solid #e0ddd8;
  padding: 20px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: margin-left 0.25s ease;
}

body.panel-hidden .cfg-panel {
  margin-left: -260px;
}

.cfg-logo {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 4px;
}

.cfg-section {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #bbb;
  margin-top: 8px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.78rem;
  color: #888;
}

label span {
  color: #1a1a1a;
  font-weight: 600;
  float: right;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 3px;
  background: #e8e5e0;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #1a1a1a;
  cursor: pointer;
}

.cfg-color-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.cfg-color-row input[type="color"] {
  width: 32px;
  height: 22px;
  border: 1px solid #e0ddd8;
  border-radius: 4px;
  padding: 1px;
  cursor: pointer;
  background: #fff;
}

.cfg-toggle-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.cfg-mat-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.cfg-mat {
  flex: 1;
  min-width: 52px;
  padding: 5px 4px;
  border: 1px solid #e0ddd8;
  background: #faf9f7;
  color: #888;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.72rem;
  transition: all 0.15s;
}

.cfg-mat.active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

.cfg-export-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cfg-export-btns button,
.cfg-import-label {
  width: 100%;
  padding: 8px 12px;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  text-align: center;
  transition: opacity 0.15s;
  display: block;
}

.cfg-export-btns button:hover,
.cfg-import-label:hover { opacity: 0.75; }

.cfg-import-label {
  background: #f0ede8;
  color: #1a1a1a;
  border: 1px solid #e0ddd8;
  margin-top: 2px;
}

input[type="file"] { display: none; }

#scriptInput {
  width: 100%;
  height: 80px;
  font-size: 0.7rem;
  font-family: monospace;
  padding: 8px;
  border: 1px solid #e0ddd8;
  border-radius: 6px;
  background: #faf9f7;
  color: #1a1a1a;
  resize: vertical;
  outline: none;
}

#btnApplyScript {
  width: 100%;
  padding: 7px 12px;
  background: #4a9eff;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  transition: opacity 0.15s;
}

#btnApplyScript:hover { opacity: 0.8; }

/* Toast */
.cfg-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #1a1a1a;
  color: #fff;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.8rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.cfg-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Viewport ── */
.cfg-viewport {
  flex: 1;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
}

.cfg-viewport .cards-on {
  width: 100%;
  height: 600px;
}

/* Card content inside configurator */
.card-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.card-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
}

.card-content p {
  font-size: 0.78rem;
  color: #888;
}
