:root {
  color-scheme: light;
  --panel: #fbf7ec;
  --ink: #181019;
  --muted: #7b7062;
  --line: #ded3c1;
  --ui-accent: #ead6ad;
  --ui-focus: #8c6a35;
  --radius: 8px;
  font-family: "Paperlogy", "SUIT", "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: linear-gradient(135deg, #151515 0%, #2a2a2a 48%, #0f0f0f 100%);
  color: #181019;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  min-height: 100vh;
  padding: 28px;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.brand-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  color: #fff8e7;
}

.eyebrow {
  margin: 0 0 6px;
  color: #f7ead1;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

h1 {
  margin: 0;
  font-family: "Eulyoo 1945", "BookkMyungjo", "Playfair Display", Georgia, "Noto Serif KR", serif;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: 0;
}

.canvas-wrap {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 18px;
  border: 1px solid rgba(255, 248, 231, 0.12);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    rgba(0, 0, 0, 0.22);
  background-size: 34px 34px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

#ticketCanvas {
  display: block;
  width: min(100%, 1180px);
  height: auto;
  max-height: calc(100vh - 170px);
  border-radius: var(--radius);
  cursor: grab;
  touch-action: none;
}

#ticketCanvas:active {
  cursor: grabbing;
}

.hint {
  margin: 0;
  color: #efe5d0;
  font-size: 14px;
  line-height: 1.6;
}

.mini-status {
  min-height: 18px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.control-panel {
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - 56px);
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(255, 248, 231, 0.28);
  border-radius: var(--radius);
  background: rgba(251, 247, 236, 0.96);
  color: #181019;
  box-shadow: 0 16px 52px rgba(0, 0, 0, 0.25);
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.panel-section:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 900;
}

.section-title span {
  font-size: 16px;
}

.section-title strong {
  color: var(--muted);
  font-size: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: #40372e;
  font-size: 13px;
  font-weight: 800;
}

input[type="text"],
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffdf7;
  color: #181019;
  padding: 10px 11px;
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: #9a9081;
}

input[type="text"]:focus,
textarea:focus,
input[type="range"]:focus-visible,
input[type="color"]:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(165, 116, 238, 0.34);
  outline-offset: 2px;
}

textarea {
  resize: vertical;
  min-height: 76px;
  line-height: 1.45;
}

select {
  min-height: 42px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--ui-focus);
}

input[type="color"] {
  width: 100%;
  height: 42px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffdf7;
}

.upload-card {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 50px;
  border: 1px dashed #9b8b72;
  border-radius: var(--radius);
  background: #fffaf0;
  color: #2f2922;
  text-align: center;
}

.upload-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.primary-action,
.soft-button,
.ghost-button {
  min-height: 42px;
  border-radius: 7px;
  border: 1px solid transparent;
  font-weight: 900;
}

.primary-action {
  padding: 0 18px;
  background: var(--ui-accent);
  color: #17120c;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.soft-button {
  background: #eee2ce;
  color: #362d23;
}

.soft-button.is-active {
  background: #181019;
  color: #fff8e7;
}

.ghost-button {
  background: transparent;
  border-color: var(--line);
  color: #4b4035;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .control-panel {
    max-height: none;
  }

  #ticketCanvas {
    max-height: none;
  }
}

@media (max-width: 620px) {
  .brand-row {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 28px;
  }

  .canvas-wrap {
    padding: 10px;
  }
}
