/* ============================================================
   OWN STREET — styles
   Lovable 디자인(own-street-design)의 값을 그대로 옮긴 스타일
   Street-brand neo-brutalist: near-black ink, warm off-white paper,
   one vivid signal-orange accent. Thick borders, hard offset shadows.
   ============================================================ */

:root {
  --background: #F6F3ED;
  --foreground: #13161B;
  --card: #FCFAF6;
  --secondary: #EBE7E0;
  --muted-foreground: #4F5661;
  --accent: #F85003;
  --accent-foreground: #FDFCF8;
  --destructive: #DB0003;

  --font-display: "Anton", "Pretendard", system-ui, sans-serif;
  --font-sans: "Pretendard", "Archivo", system-ui, sans-serif;
  color-scheme: light;
}
@supports (color: oklch(0 0 0)) {
  :root {
    --background: oklch(0.965 0.008 85);
    --foreground: oklch(0.2 0.01 260);
    --card: oklch(0.985 0.005 85);
    --secondary: oklch(0.93 0.01 85);
    --muted-foreground: oklch(0.45 0.02 260);
    --accent: oklch(0.66 0.215 38);
    --accent-foreground: oklch(0.99 0.005 85);
    --destructive: oklch(0.55 0.24 27);
  }
}

*, *::before, *::after { box-sizing: border-box; border-color: var(--foreground); }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: break-word;
}
p, h1, h2, ul { margin: 0; }
button, input { font: inherit; color: inherit; }
img, svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.font-display { font-family: var(--font-display); letter-spacing: 0.01em; font-weight: 400; }
.muted { color: var(--muted-foreground); }
.small { font-size: 14px; }
.strong { font-weight: 600; }

/* ---------- Sections ---------- */
.section { border-bottom: 2px solid var(--foreground); padding: 56px 16px; }
@media (min-width: 640px) { .section { padding: 80px 32px; } }

.section-label { display: flex; align-items: baseline; gap: 12px; }
.section-num { font-size: 14px; line-height: 20px; color: var(--accent); }
.section-title { font-size: 24px; line-height: 32px; text-transform: uppercase; letter-spacing: 0.05em; }
@media (min-width: 640px) { .section-title { font-size: 30px; line-height: 36px; } }
.section-desc { margin-top: 12px; max-width: 448px; font-size: 14px; line-height: 1.625; color: var(--muted-foreground); }

/* ---------- 입력 공통 (own-input: 채팅 입력창 + 확인 카드 안 체크박스에서 공용) ---------- */
.own-input {
  display: block; width: 100%; margin-top: 6px;
  border: 2px solid var(--foreground);
  border-radius: 0;
  background: var(--card);
  color: var(--foreground);
  padding: 12px 14.4px;
  font-size: 16px;
  outline: none;
  -webkit-appearance: none; appearance: none;
}
.own-input:focus { box-shadow: 3px 3px 0 0 var(--accent); border-color: var(--foreground); }
.own-input::placeholder { color: var(--muted-foreground); }
.err { display: block; margin-top: 4px; font-size: 14px; color: var(--destructive); }

.consent { display: grid; gap: 6px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; font-weight: 600; line-height: 1.4; position: relative; }
.check input { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: 0; opacity: 0; }
.check .box {
  flex: none; width: 24px; height: 24px;
  border: 2px solid var(--foreground);
  background: var(--card);
  display: grid; place-items: center;
}
.check input:checked + .box { background: var(--accent); }
.check input:checked + .box::after {
  content: ""; width: 7px; height: 12px;
  border: solid var(--accent-foreground); border-width: 0 3px 3px 0;
  transform: translateY(-1px) rotate(45deg);
}
.check input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.consent-info { margin-left: 34px; font-size: 13px; line-height: 1.6; color: var(--muted-foreground); }
.link {
  margin-top: 2px; padding: 0; border: 0; background: none; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--foreground);
  text-decoration: underline; text-underline-offset: 3px;
}

.btn-request {
  margin-top: 8px; width: 100%;
  border: 2px solid var(--foreground);
  background: var(--accent);
  color: var(--accent-foreground);
  padding: 16px 24px;
  box-shadow: 4px 4px 0 0 var(--foreground);
  font-size: 18px; line-height: 28px; text-transform: uppercase; letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform .06s ease, box-shadow .06s ease;
}
.btn-request:active:not(:disabled) { transform: translate(4px, 4px); box-shadow: none; }
.btn-request:disabled { opacity: .6; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .btn, .btn-request, .acc-sign { transition: none !important; } }

/* ---------- Accordion ---------- */
.accordion {
  margin-top: 32px; max-width: 672px;
  border-top: 2px solid var(--foreground);
  border-bottom: 2px solid var(--foreground);
}
.accordion details + details { border-top: 2px solid var(--foreground); }
summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 4px; cursor: pointer; list-style: none;
}
summary::-webkit-details-marker { display: none; }
.acc-title { font-size: 18px; line-height: 28px; text-transform: uppercase; letter-spacing: 0.05em; }
.acc-sign { font-size: 20px; line-height: 1; transition: transform .15s ease; }
details[open] .acc-sign { transform: rotate(45deg); }
.acc-body { padding: 0 4px 24px; }

.size-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.size-chips span { border: 2px solid var(--foreground); padding: 8px 16px; font-family: var(--font-display); font-size: 18px; line-height: 28px; letter-spacing: 0.01em; }
.table-scroll { margin-top: 20px; overflow-x: auto; }
.size-table { width: 100%; border-collapse: collapse; border: 2px solid var(--foreground); font-size: 14px; line-height: 20px; font-variant-numeric: tabular-nums; }
.size-table caption { caption-side: top; text-align: left; font-size: 14px; font-weight: 600; padding-bottom: 8px; }
.size-table th, .size-table td { padding: 8px 12px; text-align: left; white-space: nowrap; }
.size-table th + th, .size-table td, .size-table tbody th + td { border-left: 2px solid var(--foreground); }
.size-table thead tr { border-bottom: 2px solid var(--foreground); background: var(--secondary); }
.size-table thead th { font-weight: 700; }
.size-table tbody tr + tr { border-top: 2px solid var(--foreground); }
.size-table tbody th { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.01em; }
@media (max-width: 479px) { .size-table th, .size-table td { padding: 8px 7px; } }
.acc-note { margin-top: 12px; font-size: 12px; line-height: 1.6; color: var(--muted-foreground); }

.bullets { list-style: none; padding: 0; display: grid; gap: 8px; font-size: 14px; line-height: 1.625; }
.bullets li::before { content: "• "; }

/* ---------- Footer ---------- */
.footer { padding: 48px 16px; }
@media (min-width: 640px) { .footer { padding: 48px 32px; } }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; line-height: 20px; text-transform: uppercase; letter-spacing: 0.05em; }
.footer-links a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; min-height: 32px; }
.footer-links a:hover { color: var(--accent); }
.footer-links button { padding: 0; border: 0; background: none; cursor: pointer; font: inherit; letter-spacing: inherit; text-transform: inherit; min-height: 32px; }
.footer-links button:hover { color: var(--accent); }
.footer-copy {
  margin-top: 24px; border-top: 2px solid var(--foreground); padding-top: 16px;
  font-size: 12px; line-height: 16px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-foreground);
}

/* ---------- Modals ---------- */
.modal {
  width: calc(100% - 32px); max-width: 384px;
  max-height: calc(100dvh - 32px); overflow: auto;
  border: 2px solid var(--foreground);
  border-radius: 0;
  background: var(--background);
  color: var(--foreground);
  padding: 32px;
  box-shadow: 4px 4px 0 0 var(--foreground);
}
.modal-accent { box-shadow: 4px 4px 0 0 var(--accent); }
.modal-doc { max-width: 480px; }
.modal::backdrop { background: rgba(19, 22, 27, .4); }

.modal-kicker { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.modal-kicker .dot { width: 12px; height: 12px; background: var(--accent); }
.modal-kicker .font-display { font-size: 12px; line-height: 16px; text-transform: uppercase; letter-spacing: 0.1em; }
.modal-kicker-error { color: var(--destructive); }
.modal-kicker-error .dot { background: var(--destructive); }

.modal-title { margin-top: 16px; font-size: 30px; line-height: 1.25; }
.modal-doc .modal-title { margin-top: 0; }
.modal-text { margin-top: 12px; font-size: 16px; line-height: 1.6; }
.modal-sub { margin-top: 16px; font-size: 14px; color: var(--muted-foreground); }
.modal .bullets { margin-top: 12px; }
.receipt { font-size: 36px; line-height: 40px; letter-spacing: 0.05em; user-select: all; }

.modal-actions { margin-top: 24px; display: grid; gap: 10px; }
.btn-modal {
  width: 100%;
  border: 2px solid var(--foreground);
  padding: 12px 24px;
  font-size: 14px; line-height: 20px; text-transform: uppercase; letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform .06s ease;
}
.btn-modal:active { transform: translate(4px, 4px); }
.btn-modal-ink { background: var(--foreground); color: var(--background); }
.btn-modal-line { background: var(--background); color: var(--foreground); }
.pay-head { width: 100%; display: flex; align-items: baseline; justify-content: space-between; }
.pay-head .modal-sub { margin-top: 0; }
.pay-amount { font-size: 26px; line-height: 32px; letter-spacing: 0.02em; color: var(--accent); }
.pay-guide { width: 100%; text-align: left; font-size: 14px; line-height: 1.6; }
.pay-guide strong { font-weight: 700; }
.btn-kakaopay {
  width: 100%;
  display: block;
  border: 2px solid var(--foreground);
  background: #FEE500;
  color: #191600;
  padding: 12px 24px;
  box-shadow: 4px 4px 0 0 var(--foreground);
  font-size: 16px; font-weight: 700; line-height: 22px;
  text-decoration: none;
  transition: transform .06s ease, box-shadow .06s ease;
}
.btn-kakaopay:active { transform: translate(4px, 4px); box-shadow: none; }
.pay-qr { margin-top: 6px; width: 148px; height: 148px; border: 2px solid var(--foreground); background: #fff; padding: 4px; }
.pay-qr-note { font-size: 12px; color: var(--muted-foreground); }
.copy-msg { margin-top: 10px; font-size: 13px; color: var(--muted-foreground); }
.copy-msg:empty { display: none; }

/* ============================================================
   대화형 주문 (채팅) — 상단 바 + 스크롤 대화 영역 + 하단 고정 입력창
   오늘은 로직 이식이 중심. 세세한 화면 다듬기는 디자이너가 뒤이어 한다.
   ============================================================ */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* 얇은 상단 바: 로고 한 줄 높이 + 위/아래 여백 최소화. 테두리 1줄만으로 경계를 긋고
   그림자·여백을 줄여 대화 영역이 화면 대부분을 쓰게 한다. (10-16 디자이너 조정)
   topbar-wrap(로고 줄 + 진행 막대)을 통째로 sticky 로 고정한다. */
.topbar-wrap {
  position: sticky; top: 0; z-index: 10;
  background: var(--background);
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 16px;
  border-bottom: 2px solid var(--foreground);
}
.topbar-brand { font-size: 16px; line-height: 22px; letter-spacing: 0.02em; white-space: nowrap; }
.topbar-tag {
  font-size: 11px; line-height: 16px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted-foreground); white-space: nowrap;
}
@media (min-width: 640px) { .topbar { padding: 10px 32px; } }

/* 진행 표시: 숫자(3/8) 대신 막대 채움 비율만 보여준다.
   건너뛰기·되돌리기·수정이 있어도 "틀린 숫자"를 말하지 않기 위해, 정확한 단계 수가 아니라
   지금까지 지난 정도를 넓은 눈금으로만 암시한다. (--progress: 0~1, app.js 가 인라인으로 설정) */
.topbar-progress {
  height: 3px;
  background: var(--secondary);
  border-bottom: 2px solid var(--foreground);
  overflow: hidden;
}
.topbar-progress::after {
  content: "";
  display: block; height: 100%; width: calc(var(--progress, 0) * 100%);
  background: var(--accent);
  transition: width .25s ease;
}
@media (prefers-reduced-motion: reduce) { .topbar-progress::after { transition: none; } }

.user-chip {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
  border: 2px solid var(--foreground);
  background: var(--accent);
  padding: 4px 10px;
  box-shadow: 2px 2px 0 0 var(--foreground);
}
.chip-avatar {
  flex: none; width: 20px; height: 20px;
  display: grid; place-items: center; overflow: hidden;
  background: var(--accent-foreground); color: var(--accent);
  font-size: 11px;
}
.chip-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chip-name {
  font-size: 13px; line-height: 18px; font-weight: 600; color: var(--foreground);
  min-width: 0; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip-logout {
  margin-left: 2px; padding: 2px 0; border: 0; background: none; cursor: pointer;
  font-size: 11px; line-height: 16px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--accent-foreground);
  text-decoration: underline; text-underline-offset: 3px;
}

.chat-section { padding: 24px 16px 56px; border-bottom: 2px solid var(--foreground); }
@media (min-width: 640px) { .chat-section { padding: 32px 32px 64px; } }

.chat { max-width: 560px; margin: 0 auto; }
.chat-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.msg {
  display: flex; flex-direction: column; align-items: flex-start;
  /* #chatInput 은 position: sticky 로 화면 아래에 떠 있어 실제 높이만큼 말풍선을 가린다.
     scrollIntoView(block:'end') 가 입력창 뒤까지 스크롤하도록 여유 공간을 둔다
     (사이즈 칩 2줄 + 건너뛰기 버튼처럼 입력 영역이 가장 커지는 경우를 기준으로 넉넉히 잡음). */
  scroll-margin-bottom: 140px;
}
.msg.me { align-items: flex-end; }
.msg.bot + .msg.me, .msg.me + .msg.bot { margin-top: 6px; }
.msg-who {
  margin-bottom: 6px;
  font-size: 12px; line-height: 16px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent);
}

.bubble {
  max-width: 88%;
  border: 2px solid var(--foreground);
  padding: 10px 14px;
  font-size: 16px; line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.msg.bot .bubble { background: var(--card); color: var(--foreground); }
.msg.me .bubble { background: var(--foreground); color: var(--background); }
.msg.warn .bubble { border-left-width: 8px; border-left-color: var(--destructive); }
.msg.status .bubble { color: var(--muted-foreground); border-style: dashed; }

.msg.wide { align-items: stretch; }
.card {
  border: 2px solid var(--foreground);
  background: var(--card);
  padding: 16px;
  box-shadow: 4px 4px 0 0 var(--foreground);
}
.card.is-old { box-shadow: none; opacity: .55; }

/* 주문 확인 카드 */
.order-list { margin: 0; display: grid; }
.order-row {
  display: grid; grid-template-columns: 76px 1fr auto; gap: 4px 10px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--secondary);
}
/* 한글 라벨은 Anton(영문 전용 디스플레이 폰트) 대신 본문 글꼴을 굵게 써서 선명하게 보이게 한다
   (영문 전용 제목 글꼴로 한글을 쓰면 폴백되면서 가늘어 보이는 문제, .btn-label-ko 와 같은 이유) */
.order-row dt.order-label-ko {
  font-family: var(--font-sans); font-weight: 700;
  font-size: 12px; line-height: 20px; letter-spacing: 0.04em; color: var(--muted-foreground);
}
.order-val { margin: 0; font-size: 15px; line-height: 1.5; font-weight: 600; overflow-wrap: anywhere; }
.order-val.is-url { font-weight: 400; font-size: 14px; }
/* 글자 크기(14px)·밑줄 모양은 그대로 두고, 상하 패딩만 늘려 탭 영역을 48px 쪽에 가깝게 넓힌다
   (COMPONENTS.md "링크형 버튼도 상하 여백으로 탭 영역을 넓힌다" 규칙, 10-22 developer).
   오른쪽 padding 은 좁게 둬서 .order-row 의 76px/1fr/auto 3열 폭 배분을 바꾸지 않는다. */
.order-edit { margin: 0; padding: 10px 2px; min-height: 48px; font-size: 14px; display: inline-flex; align-items: center; }
.order-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 14px; }
.order-total-name { font-size: 14px; font-weight: 600; }
.order-total-price { font-size: 26px; line-height: 32px; letter-spacing: 0.02em; color: var(--accent); white-space: nowrap; }
.order-note { margin-top: 2px; font-size: 13px; color: var(--muted-foreground); }
.order-card .consent { margin-top: 16px; border-top: 2px solid var(--foreground); padding-top: 14px; }
.order-card .btn-request { margin-top: 16px; }
.card button:disabled { cursor: default; }

/* 완료 · 결제 카드 */
.done-card { box-shadow: 4px 4px 0 0 var(--accent); }
.done-title { margin-top: 12px; font-size: 22px; line-height: 1.3; font-weight: 700; }
.done-card .modal-sub { margin-top: 12px; }
.done-text { margin-top: 10px; font-size: 15px; }
.done-story-label { margin-top: 14px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); }
.done-story { margin-top: 2px; font-size: 14px; font-style: italic; color: var(--muted-foreground); overflow-wrap: anywhere; }
.pay-card { display: grid; gap: 10px; justify-items: center; text-align: center; }
.pay-card .pay-head { width: 100%; }

/* 뒷면 프린트 목업: 손님 이미지를 직접 끌어와 보여주지 않는다(받는 것은 이미지 파일 주소가 아니라
   "채팅 링크"). 어디에, 얼마나 크게 프린트되는지 자리만 짚어주는 정적 목업이다. */
.mockup-card { display: grid; gap: 10px; justify-items: center; text-align: center; }
.mockup-img { width: 120px; height: 130px; }
.mockup-note { font-size: 13px; color: var(--muted-foreground); }

/* 입력 영역 */
.chat-input {
  margin-top: 16px; min-height: 52px;
  position: sticky; bottom: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: var(--background);
}
.composer { display: flex; gap: 8px; }
.composer .own-input { margin-top: 0; flex: 1 1 auto; min-width: 0; min-height: 48px; font-size: 16px; }
.send {
  flex: none;
  min-height: 48px; min-width: 48px;
  border: 2px solid var(--foreground);
  background: var(--foreground); color: var(--background);
  padding: 0 16px;
  font-size: 14px; letter-spacing: 0.05em;
  cursor: pointer;
}
.send:active { transform: translate(2px, 2px); }
.composer + .choices { margin-top: 10px; }

.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px;
  border: 2px solid var(--foreground);
  background: var(--background); color: var(--foreground);
  padding: 10px 18px;
  box-shadow: 3px 3px 0 0 var(--foreground);
  font-size: 16px; font-weight: 700; line-height: 22px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .06s ease, box-shadow .06s ease;
  -webkit-tap-highlight-color: transparent;
}
.choice:active { transform: translate(3px, 3px); box-shadow: none; }
.choice.is-primary { background: var(--accent); color: var(--accent-foreground); }
.choice.is-size { min-width: 58px; justify-content: center; font-size: 20px; font-weight: 400; letter-spacing: 0.01em; }
.choice.is-ghost {
  border-color: transparent; box-shadow: none; background: none; padding-left: 4px; padding-right: 4px;
  font-size: 15px; text-decoration: underline; text-underline-offset: 3px;
}
.chat-reset { margin-top: 14px; font-size: 13px; color: var(--muted-foreground); }
@media (prefers-reduced-motion: reduce) { .choice, .send { transition: none; } }

/* 한글 버튼 글자: 굵은 본문 글꼴 사용 (영문 전용 제목 글꼴은 한글이 가늘게 보임) */
.btn-label-ko { font-family: var(--font-sans); font-size: 16px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.btn-request-ko { font-family: var(--font-sans); font-weight: 800; letter-spacing: 0.02em; }
.choice.is-google { background: #fff; box-shadow: 4px 4px 0 0 var(--foreground); padding: 12px 22px; }
