:root {
  color-scheme: light;
  --page-width: min(100vw, 430px);
  --page-bg: #f7f2e8;
  --ink: #40312c;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #d9d4c9;
  color: var(--ink);
  font-family: Arial, "Noto Sans TC", "Noto Sans JP", "Noto Sans KR", sans-serif;
}

body {
  display: flex;
  justify-content: center;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.page-root {
  position: relative;
  width: var(--page-width);
  max-width: 430px;
  min-width: 320px;
  aspect-ratio: 1080 / 1921;
  overflow: hidden;
  background: var(--page-bg);
  box-shadow: 0 0 0 1px rgba(40, 32, 28, 0.1), 0 20px 50px rgba(28, 24, 20, 0.18);
}

.page-bg,
.layer-img {
  position: absolute;
  display: block;
  user-select: none;
  pointer-events: none;
}

.page-bg {
  inset: 0;
  width: 100%;
  height: 100%;
}

.layer-img {
  height: auto;
}

.data-slot,
.qr-slot {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: #fff;
}

.data-slot {
  border: 0;
  background: transparent;
  color: #34251d;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.data-slot[data-key="ticketNo"],
.data-slot[data-key="currentCallingCode"] {
  font-size: clamp(21px, calc(var(--page-width) * 0.072), 33px);
  letter-spacing: 0;
}

.data-slot[data-key="waitingAheadCount"],
.data-slot[data-key="estimatedWaitingMinutes"] {
  font-size: clamp(18px, calc(var(--page-width) * 0.058), 27px);
}

.qr-slot svg,
.qr-slot canvas,
.qr-slot img {
  width: 100%;
  height: 100%;
  display: block;
  shape-rendering: crispEdges;
  image-rendering: pixelated;
}

.error-state {
  width: var(--page-width);
  max-width: 430px;
  min-height: 100vh;
  padding: 32px 22px;
  background: #fffaf3;
}

.error-state h1 {
  margin: 0 0 12px;
  font-size: 24px;
  line-height: 1.15;
}

.error-state p {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.5;
}

.error-state code {
  display: block;
  padding: 12px;
  overflow-wrap: anywhere;
  background: #efe7d8;
}

.empty-ticket-state {
  width: var(--page-width);
  max-width: 430px;
  min-height: 100vh;
  padding: 34px 24px;
  background: #fffaf3;
  color: #34251d;
}

.empty-ticket-state h1 {
  margin: 0 0 12px;
  font-size: 24px;
  line-height: 1.15;
}

.empty-ticket-state p {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
}

.qa-panel {
  position: fixed;
  right: 12px;
  bottom: 12px;
  width: min(420px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 24px));
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(35, 30, 26, 0.18);
  background: rgba(255, 255, 255, 0.96);
  color: #241f1b;
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  box-shadow: 0 12px 28px rgba(20, 16, 12, 0.18);
}

.qa-panel h2 {
  margin: 0 0 8px;
  font-size: 13px;
}

.qa-panel pre {
  margin: 0;
  white-space: pre-wrap;
}
