:root {
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #172033;
  background: #dfe6ee;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input {
  font: inherit;
}

.app-shell {
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0) 42%),
    #dfe6ee;
}

.stage-panel {
  min-width: 0;
  min-height: 0;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr) auto;
  padding: 18px 28px;
  gap: 10px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  position: relative;
  z-index: 2;
}

.eyebrow {
  margin: 0 0 4px;
  color: #667085;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.5rem, 2.1vw, 2.55rem);
  line-height: 1.02;
  max-width: 760px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.primary-button,
.ghost-button,
.preset-button,
.segmented button {
  border: 0;
  cursor: pointer;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #ffffff;
  color: #162033;
  box-shadow: 0 12px 28px rgba(29, 42, 62, 0.12);
}

.primary-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 8px;
  background: #0f172a;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.2);
}

.scene-mount {
  min-height: 330px;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: #ffffff;
  user-select: none;
}

.scene-mount canvas,
.configurator-frame {
  display: block;
  width: 100%;
  height: 100%;
}

.configurator-frame {
  min-height: inherit;
  border: 0;
  background: #ffffff;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.summary-item {
  min-height: 72px;
  padding: 14px;
  border: 1px solid rgba(120, 135, 155, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  display: flex;
  flex-direction: column;
  gap: 4px 9px;
  justify-content: center;
}

.summary-item span {
  color: #667085;
  font-size: 0.78rem;
  font-weight: 700;
}

.summary-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-panel {
  min-height: 0;
  height: 100dvh;
  overflow-y: auto;
  padding: 24px;
  background: #ffffff;
  border-left: 1px solid #d4dbe6;
  box-shadow: -18px 0 50px rgba(27, 39, 56, 0.08);
}

.panel-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid #e5eaf1;
}

.panel-heading h2 {
  font-size: 1.25rem;
}

.panel-heading p {
  margin-top: 4px;
  color: #667085;
  font-size: 0.9rem;
  line-height: 1.45;
}

.control-group {
  padding: 18px 0;
  border-bottom: 1px solid #e5eaf1;
}

.control-group h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.preset-button {
  min-height: 70px;
  padding: 9px;
  border-radius: 8px;
  background: #f6f8fb;
  color: #172033;
  font-size: 0.78rem;
  font-weight: 800;
}

.swatch-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  height: 23px;
  overflow: hidden;
  border-radius: 6px;
  margin-bottom: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.swatch-row span {
  min-width: 0;
}

.color-row,
.text-row,
.range-row {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 9px 0;
  font-size: 0.86rem;
  color: #475467;
  font-weight: 700;
}

.color-row > div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
}

.color-row input[type="color"] {
  width: 42px;
  height: 36px;
  padding: 2px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
}

.color-row input[type="text"],
.text-row input {
  min-width: 0;
  height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 10px;
  color: #172033;
  background: #fbfcfe;
}

.upload-drop {
  display: grid;
  gap: 5px;
  min-height: 86px;
  padding: 15px;
  border: 1px dashed #9aa8ba;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
}

.upload-drop input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-title {
  color: #172033;
  font-weight: 900;
}

.upload-meta {
  color: #667085;
  font-size: 0.82rem;
  line-height: 1.35;
}

.logo-preview {
  height: 86px;
  margin-top: 10px;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  background-color: #ffffff;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  color: #0f172a;
  display: grid;
  place-items: center;
  font-weight: 950;
  font-size: 1.35rem;
}

.compact {
  min-height: 36px;
  margin-top: 10px;
  font-size: 0.84rem;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  background: #eef2f7;
  border-radius: 8px;
}

.segmented button {
  min-height: 38px;
  padding: 0 8px;
  border-radius: 7px;
  background: transparent;
  color: #475467;
  font-size: 0.78rem;
  font-weight: 800;
}

.segmented button.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 5px 14px rgba(30, 41, 59, 0.12);
}

.range-row input {
  width: 100%;
}

.order-card {
  border: 1px solid #d7dee8;
  border-radius: 8px;
  padding: 13px;
  background: #f8fafc;
}

.order-card > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.order-card span {
  font-weight: 900;
  color: #b42318;
}

.wide {
  width: 100%;
}

.ghost-button {
  width: 100%;
  min-height: 42px;
  margin-top: 18px;
  border-radius: 8px;
  color: #172033;
  background: #eef2f7;
  font-weight: 800;
}

@media (max-width: 980px) {
  html,
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .stage-panel {
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  .control-panel {
    min-height: auto;
    height: auto;
    overflow: visible;
    border-left: 0;
    border-top: 1px solid #d4dbe6;
  }

  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .stage-panel,
  .control-panel {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .scene-mount {
    min-height: 360px;
  }

  .summary-strip,
  .preset-grid {
    grid-template-columns: 1fr;
  }

  .color-row,
  .text-row,
  .range-row {
    grid-template-columns: 1fr;
  }
}
