/* ══════════════════════════════════════════════════════════
 * flow.css — 주문 프로세스(디자인→편집→배송→결제→추적) UI 추가 스타일
 * 기본 레이아웃/버블/폼은 site.css, 여기는 새 컴포넌트만.
 * ══════════════════════════════════════════════════════════ */

/* 폰트: 나눔 계열만 */
body { font-family: "Nanum Gothic", "NanumGothic", "Malgun Gothic", system-ui, sans-serif; }
.card-preview .tbox { font-family: "NanumSquare", "Nanum Gothic", sans-serif; }

/* ── 사이드바 보조 ── */
.sidebar { overflow-x: hidden; }
.order-item { width: 100%; overflow: hidden; }
.guest-lookup { font: inherit; font-size: 0.8rem; color: var(--text-dim); background: none; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 8px 12px; margin: 0 14px 10px; cursor: pointer; width: calc(100% - 28px); }
.guest-lookup:hover { color: var(--text); border-color: var(--text-dim); }
.order-sub { display: block; font-size: 0.7rem; color: var(--text-faint); margin-top: 2px; }
.order-empty { padding: 14px 12px; font-size: 0.82rem; color: var(--text-faint); }
.sidebar-foot { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.admin-entry { font-size: 0.74rem; color: var(--text-dim); text-decoration: none; }
.admin-entry:hover { color: var(--text); text-decoration: underline; }
.ai-badge { font-size: 0.68rem; color: var(--text-faint); word-break: break-all; }

/* ── 상태 알약: 메인색 검정 기준 무채색 — 진행 중일수록 진하게, 완료는 검정 ── */
.status-pill[data-status="talking"]::before   { background: #18181b; }
.status-pill[data-status="editing"]::before   { background: #3f3f46; }
.status-pill[data-status="confirm"]::before   { background: #3f3f46; }
.status-pill[data-status="address"]::before   { background: #52525b; }
.status-pill[data-status="checkout"]::before  { background: #52525b; }
.status-pill[data-status="paid"]::before      { background: #71717a; }
.status-pill[data-status="making"]::before    { background: #71717a; }
.status-pill[data-status="shipping"]::before  { background: #a1a1aa; }
.status-pill[data-status="delivered"]::before { background: #18181b; }
.status-pill[data-status="delivered"]         { color: #18181b; font-weight: 700; }
.result-card { border-color: var(--line-strong); background: var(--bg-subtle); }

[hidden] { display: none !important; }

/* ── 헤더: 사용자 칩 ── */
.user-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--text); }
.user-avatar { font-size: 0.9rem; }
.user-name { font-weight: 700; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn { font: inherit; font-size: 0.75rem; color: var(--text-dim); background: none; border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.logout-btn:hover { background: var(--bg-subtle); color: var(--text); }

/* ── 헤더: 프로세스 단계 표시줄 ── */
.phase-bar { display: flex; gap: 4px; padding: 0 16px 10px; max-width: var(--max-w); margin: 0 auto; width: 100%; overflow-x: auto; scrollbar-width: none; }
.phase-bar:empty { display: none; }
.phase { flex: 1 0 auto; font-size: 0.7rem; color: var(--text-faint); padding: 4px 10px; border-radius: 999px; background: #f4f4f5; white-space: nowrap; text-align: center; position: relative; }
.phase.done { color: var(--text); background: #e4e4e7; }
.phase.done::before { content: "✓ "; }
.phase.active { color: #fff; background: var(--accent); font-weight: 700; }

/* ── 시스템 노트 ── */
.note { align-self: center; font-size: 0.74rem; color: var(--text-dim); background: #f4f4f5; border-radius: 999px; padding: 4px 12px; margin: 2px 0; }

/* ── 액션 버튼 줄 ── */
.actions { align-self: flex-start; margin-left: 40px; display: flex; flex-wrap: wrap; gap: 8px; animation: choices-in 0.25s ease both; }
.action-btn { font: inherit; font-size: 0.88rem; font-weight: 700; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; padding: 9px 16px; cursor: pointer; transition: background .15s, color .15s, transform .1s; }
.action-btn:hover { background: var(--bg-subtle); }
.action-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.action-btn.primary:hover { background: var(--accent-hover); }
.action-btn:active { transform: scale(0.97); }
.action-btn:disabled { opacity: .5; cursor: default; }
.typing-label { margin-left: 10px; font-size: 0.78rem; color: var(--text-dim); }

/* ── 디자인 미리보기 카드 ── */
.design-card { align-self: stretch; margin-left: 40px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; animation: choices-in 0.25s ease both; }
.design-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 0.8rem; }
.design-no { font-weight: 800; }
.design-meta { color: var(--text-faint); font-size: 0.72rem; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-btn { font: inherit; font-size: 0.72rem; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 3px 10px; cursor: pointer; }
.mini-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.choice-desc { font-size: 0.72rem; font-weight: 400; color: var(--text-faint); margin-left: 2px; }
.choice-btn.disabled, .choice-btn:disabled { opacity: .45; cursor: not-allowed; background: var(--bg-subtle); color: var(--text-dim); border-style: dashed; }
.choice-btn.disabled:hover { background: var(--bg-subtle); color: var(--text-dim); border-color: var(--line-strong); }
.choice-btn:hover .choice-desc { color: rgba(255,255,255,.75); }
.card-sides { display: flex; flex-direction: column; }
.card-sides.double { flex-direction: row; gap: 10px; padding: 10px; background: var(--bg-subtle); }
.card-sides.double .card-side { flex: 1; min-width: 0; }
.side-label { font-size: 0.7rem; color: var(--text-dim); margin-bottom: 4px; }
.card-sides.double .card-preview { border: 1px solid var(--line); border-radius: 6px; }
@media (max-width: 640px) { .card-sides.double { flex-direction: column; } }
.card-preview { position: relative; width: 100%; container-type: inline-size; overflow: hidden; background: #eee; }
.card-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.card-preview .tbox { position: absolute; line-height: 1.15; white-space: pre-wrap; overflow: hidden; letter-spacing: -0.01em; }
.design-info { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.design-summary { font-size: 0.85rem; color: var(--text); }
.design-texts { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.76rem; color: var(--text-dim); }
.design-texts b { color: var(--text); font-weight: 700; margin-right: 4px; }
.design-texts .dim, .dim { color: var(--text-faint); }
.small { font-size: 0.74rem; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.design-prompt summary { font-size: 0.74rem; color: var(--text-dim); cursor: pointer; }
.design-prompt code { display: block; margin-top: 6px; font-size: 0.72rem; color: var(--text-dim); background: var(--bg-subtle); padding: 8px 10px; border-radius: 8px; white-space: pre-wrap; word-break: break-word; }

/* ── 정보 카드 (주문번호/결제내역/배송추적) ── */
.info-card { gap: 8px; }
.info-row { display: flex; align-items: baseline; gap: 12px; font-size: 0.84rem; }
.info-row .k { flex: 0 0 80px; color: var(--text-dim); font-size: 0.78rem; }
.info-row .v { flex: 1; word-break: break-all; }
.info-row.total { border-top: 1px dashed var(--line-strong); padding-top: 8px; margin-top: 4px; font-weight: 800; }
.info-row.total .v { font-size: 1rem; }
.price-box { background: var(--bg-subtle); border-radius: var(--radius-sm); padding: 12px; }

/* ── 배송 추적 타임라인 ── */
.track-steps { list-style: none; display: flex; justify-content: space-between; margin: 10px 0 4px; position: relative; }
.track-steps::before { content: ""; position: absolute; left: 8%; right: 8%; top: 7px; height: 2px; background: var(--line-strong); z-index: 0; }
.track-steps li { position: relative; z-index: 1; flex: 1; text-align: center; font-size: 0.72rem; color: var(--text-faint); }
.track-steps .dot { display: block; width: 14px; height: 14px; margin: 0 auto 6px; border-radius: 50%; background: #fff; border: 2px solid var(--line-strong); }
.track-steps li.done { color: var(--text-dim); }
.track-steps li.done .dot { background: #52525b; border-color: #52525b; }
.track-steps li.active { color: var(--text); font-weight: 800; }
.track-steps li.active .dot { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px rgba(0,0,0,.08); }

/* ── 로그인 모달: 개발용 이메일 로그인 ── */
.login-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; font-size: 0.72rem; color: var(--text-faint); }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.dev-login { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.dev-login .form-input { width: 100%; }
.dev-login .form-submit { width: 100%; }
.auth-links { display: flex; justify-content: center; gap: 8px; align-items: center; }
.link-btn { font: inherit; font-size: 0.78rem; color: var(--text-dim); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 2px; }
.link-btn:hover { color: var(--text); }
.google-host { display: flex; justify-content: center; min-height: 44px; }
.login-error { font-size: 0.78rem; color: var(--text); font-weight: 700; background: #e4e4e7; border-left: 3px solid #18181b; border-radius: 8px; padding: 7px 10px; }
.login-hint { font-size: 0.72rem; color: var(--text-faint); text-align: center; }
.login-hint code { font-family: ui-monospace, Consolas, monospace; background: var(--bg-subtle); padding: 1px 5px; border-radius: 4px; color: var(--text-dim); }

/* 폼 입력 오류 표시 (site.css 와 동일 규칙 보강) */
.form-input.error { border-color: #18181b !important; box-shadow: 0 0 0 3px rgba(0,0,0,.12) !important; background: #f4f4f5; }

/* 결제수단(카드 단일) — 한 줄 유지 + 안내는 아래 줄 */
.seg-btn { white-space: nowrap; }
.pay-note { display: block; width: 100%; margin-top: 6px; }

/* ── 주소 검색(카카오 우편번호 임베드) ── */
.zip-row { display: flex; gap: 8px; flex: 1; }
.zip-row .form-input { flex: 1; }
.addr-search-btn { font: inherit; font-size: 0.82rem; font-weight: 700; color: #fff; background: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius-sm); padding: 0 14px; cursor: pointer; white-space: nowrap; }
.addr-search-btn:hover { background: var(--accent-hover); }
.addr-embed { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.addr-embed-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; font-size: 0.8rem; font-weight: 700; border-bottom: 1px solid var(--line); background: var(--bg-subtle); }
.addr-embed-body { height: 420px; }
.addr-embed-body iframe { border: 0 !important; }

@media (max-width: 640px) {
  .design-card, .actions, .form-card { margin-left: 0; }
  .info-row .k { flex-basis: 64px; }
  .user-name { display: none; }
}
