:root {
  --ink: #000;
  --canvas: #fff;
  --surface: #f7f7f5;
  --line: #dedede;
  --muted: #555;
  --lilac: #c5b0f4;
  --lilac-soft: #ece4fd;
  --lime: #dceeb1;
  --pink: #ff3d8b;
  --green: #1a8f41;
  --danger: #c9342b;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}

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

html {
  background: var(--canvas);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background-color: var(--canvas);
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

.shell {
  width: min(520px, 100%);
  margin: 0 auto;
  padding: 16px 16px calc(40px + env(safe-area-inset-bottom));
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin-bottom: 12px;
}

.brand__name {
  margin: 0;
  font-weight: 800;
  font-size: 0.95rem;
}

.brand__mark {
  display: inline-block;
  padding: 3px 8px 2px;
  margin-right: 4px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--lime);
  font-weight: 900;
  letter-spacing: 0.06em;
}

.link {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.screen--center {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 80px 0;
}

.title {
  margin: 28px 0 10px;
  font-size: clamp(1.8rem, 8vw, 2.3rem);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.lead {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

.muted {
  margin: 0;
  color: var(--muted);
}

.notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--lime);
  font-weight: 700;
}

.error {
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.login {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

.field__label {
  font-size: 0.85rem;
  font-weight: 800;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--canvas);
  font-size: 1.1rem;
  outline: none;
}

.field textarea {
  min-height: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  resize: vertical;
  background: var(--surface);
}

.field input:focus-visible,
.field textarea:focus-visible {
  box-shadow: 0 0 0 4px var(--lilac);
}

/* ---- 버튼 ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 18px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--canvas);
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 60ms ease, box-shadow 60ms ease;
}

.btn:active:not(:disabled) {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 3px;
}

.btn:disabled {
  opacity: 0.32;
  box-shadow: none;
  cursor: not-allowed;
}

.btn--block {
  width: 100%;
}

.btn--ink {
  background: var(--ink);
  color: var(--canvas);
  box-shadow: 4px 4px 0 var(--lilac);
}

.btn--ink:active:not(:disabled) {
  box-shadow: 1px 1px 0 var(--lilac);
}

.btn--kakao {
  background: #fee500;
  color: #191919;
  text-decoration: none;
}

.btn--qty {
  min-height: 64px;
  background: var(--lime);
  font-size: 1.15rem;
}

.btn--plain {
  min-height: 48px;
  font-size: 0.95rem;
}

.btn--big {
  min-height: 64px;
  font-size: 1.2rem;
}

/* ---- 판매 카드 ---- */

.hello {
  margin: 0 0 12px;
  font-size: 1rem;
}

.stage {
  position: relative;
  padding: 22px 18px 20px;
  border: 2px solid var(--ink);
  border-radius: 22px;
  background: var(--canvas);
  box-shadow: 6px 6px 0 var(--ink);
}

.stage--live {
  background: var(--lilac);
}

.stage--soldout {
  background: var(--surface);
}

.stage__idle {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 26px 4px;
  text-align: center;
}

.stage__title {
  margin: 4px 0 0;
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1.35;
}

.pulse {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--pink);
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}

.stage__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--canvas);
  font-size: 0.8rem;
  font-weight: 900;
}

.badge--live {
  color: var(--pink);
}

.remaining {
  padding: 6px 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--canvas);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.remaining--hot {
  background: var(--pink);
  color: var(--canvas);
}

.product__name {
  margin: 18px 0 6px;
  font-size: clamp(1.6rem, 7.4vw, 2.1rem);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.02em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.product__price {
  margin: 0 0 20px;
  font-size: 1.6rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.buy {
  display: grid;
  gap: 12px;
}

.qty-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.other {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
}

.field--inline input {
  min-height: 56px;
}

.soldout {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 10px 0 4px;
}

.soldout__stamp {
  margin: 0;
  padding: 6px 26px;
  border: 4px solid var(--danger);
  border-radius: 12px;
  color: var(--danger);
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  transform: rotate(-6deg);
}

.my-round {
  margin: 16px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  font-weight: 800;
  text-align: center;
}

/* ---- 주문 목록 ---- */

.section-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
}

.orders,
.checkout {
  margin-top: 26px;
  padding: 20px 18px;
  border: 2px solid var(--ink);
  border-radius: 22px;
  background: var(--canvas);
}

.checkout {
  background: var(--lilac-soft);
  box-shadow: 6px 6px 0 var(--ink);
  display: grid;
  gap: 16px;
}

.orders__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.order-list {
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.order-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
  font-variant-numeric: tabular-nums;
}

.order-list--removable li {
  grid-template-columns: 1fr auto auto 5.4em;
  align-items: center;
}

.order__action {
  display: flex;
  justify-content: flex-end;
}

.remove {
  min-width: 100%;
  min-height: 40px;
  padding: 0 8px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--canvas);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.remove--armed {
  border-color: var(--danger);
  background: var(--danger);
  color: var(--canvas);
}

.remove:disabled {
  opacity: 0.4;
}

.remove:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 2px;
}

.order-list .order__name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.order-list .order__qty {
  color: var(--muted);
}

.order-list .order__amount {
  font-weight: 800;
}

.order-list .is-canceled {
  color: var(--muted);
  text-decoration: line-through;
}

.order-list .order__tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
}

.totals {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
}

.totals div {
  display: flex;
  justify-content: space-between;
  font-variant-numeric: tabular-nums;
}

.totals dt,
.totals dd {
  margin: 0;
}

.totals__grand {
  padding-top: 10px;
  border-top: 2px solid var(--ink);
  font-size: 1.15rem;
  font-weight: 900;
}

.fineprint {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

/* ---- 주문서 복사 ---- */

.steps {
  margin: 0;
  padding-left: 20px;
  line-height: 1.8;
}

.checkout-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--canvas);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.5;
}

.account {
  padding: 14px 16px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--canvas);
}

.account__label {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.account__text {
  margin: 4px 0 8px;
  font-size: 1.05rem;
  font-weight: 800;
  overflow-wrap: anywhere;
  user-select: all;
  -webkit-user-select: all;
}

.account__amount {
  margin: 0;
}

.account__amount strong {
  font-size: 1.15rem;
}

.copy-result {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--lime);
  font-weight: 800;
}

.copy-result--fail {
  background: var(--canvas);
  border: 2px solid var(--danger);
  color: var(--danger);
}

/* ---- 알림 ---- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 10;
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 14px 18px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: var(--ink);
  color: var(--canvas);
  box-shadow: 4px 4px 0 var(--lilac);
  font-weight: 800;
  text-align: center;
  transform: translateX(-50%);
}

.toast--ok {
  background: var(--green);
}

.toast--fail {
  background: var(--danger);
}

@media (prefers-reduced-motion: reduce) {
  .pulse {
    animation: none;
  }
  .btn {
    transition: none;
  }
}
