/* 배비 DeliveryAI — 공통 스타일 */
:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #242836;
  --accent: #ff6b4a;
  --accent2: #ffb347;
  --baeby: #6ee7b7;
  --text: #f0f2f8;
  --muted: #9aa3b8;
  --radius: 16px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: radial-gradient(ellipse at top, #1e2235 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--baeby); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 32px;
  min-height: 100vh;
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 16px;
}

.logo {
  font-weight: 800;
  font-size: 1.1rem;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links { display: flex; gap: 12px; font-size: 0.85rem; }

.baeby-zone {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  text-align: center;
}

.speech-bubble {
  background: var(--surface2);
  border-radius: 20px;
  padding: 14px 18px;
  margin: 12px auto 0;
  max-width: 320px;
  font-size: 0.95rem;
  position: relative;
  min-height: 48px;
  transition: opacity 0.3s;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border: 10px solid transparent;
  border-top-color: var(--surface2);
}

.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 14px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
  color: var(--text);
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #ff8f70);
  color: #fff;
}

.btn-secondary {
  background: var(--surface2);
  border: 1px solid #3a4055;
}

.btn-accent {
  background: linear-gradient(135deg, #34d399, var(--baeby));
  color: #0f1117;
}

.btn-block { width: 100%; margin-top: 8px; }

.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 12px 0;
}

.tag {
  background: var(--surface2);
  border: 1px solid #3a4055;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.tag:hover, .tag.active {
  background: rgba(255, 107, 74, 0.15);
  border-color: var(--accent);
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.panel h2 { font-size: 1rem; margin-bottom: 12px; }

.hidden { display: none !important; }

.input-row { margin-bottom: 12px; }

.input-row label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.input-row input,
.input-row select,
.input-row textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #3a4055;
  background: var(--surface2);
  color: var(--text);
  font-size: 0.95rem;
}

.input-row textarea { min-height: 80px; resize: vertical; }

.result-card {
  border: 1px solid #3a4055;
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
}

.result-card .menu-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent2);
}

.result-card .reasons {
  margin: 10px 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.result-card .price {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 8px 0;
}

.shop-list { margin-top: 12px; }

.shop-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: var(--surface2);
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.shop-item .label {
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
}

.order-text-box {
  background: #12141c;
  border: 1px dashed #3a4055;
  border-radius: 10px;
  padding: 12px;
  font-size: 0.9rem;
  margin: 10px 0;
  word-break: keep-all;
}

.footer-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 24px;
}

.roulette-display {
  font-size: 1.2rem;
  font-weight: 700;
  min-height: 36px;
  color: var(--accent2);
  margin: 8px 0;
}

.voice-status {
  font-size: 0.8rem;
  color: var(--baeby);
  min-height: 20px;
  margin-top: 8px;
}

.form-grid { display: grid; gap: 12px; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.ops-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.ops-table th, .ops-table td {
  border-bottom: 1px solid #3a4055;
  padding: 8px 6px;
  text-align: left;
}
.ops-table th { color: var(--muted); }

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  background: var(--surface2);
}

.status-DRAFT { color: var(--accent2); }
.status-READY_TO_ORDER { color: var(--baeby); }
.status-COPIED { color: #8fd4ff; }
.status-PAYMENT_PENDING { color: var(--accent2); }
.status-ORDER_REQUESTED { color: var(--baeby); }
.status-PENDING_CONFIRMATION { color: var(--accent2); }
.status-ACCEPTED { color: var(--baeby); }
.status-REJECTED { color: #f87171; }
.status-OPEN { color: var(--accent2); }
.status-SENT { color: #8fd4ff; }
.status-CLOSED { color: var(--muted); }
.status-READY { color: var(--baeby); }
.status-APPROVED { color: var(--baeby); }
.status-PENDING { color: var(--accent2); }

.badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  vertical-align: middle;
  margin-left: 6px;
}

.badge-partner { background: rgba(52, 211, 153, 0.2); color: var(--baeby); }
.badge-partner-sm { background: rgba(52, 211, 153, 0.15); color: var(--baeby); font-size: 0.6rem; padding: 1px 6px; }
.badge-llm { background: rgba(255, 179, 71, 0.2); color: var(--accent2); }

.shop-partner { border-left: 3px solid var(--baeby); }

.copy-btn { margin-top: 8px; }

/* ── BaebyFlow v0.5 스테이지 ── */
.btn-icon {
  background: var(--surface2);
  border: 1px solid #3a4055;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 1rem;
}

.side-menu {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-menu hr { border: none; border-top: 1px solid #3a4055; margin: 6px 0; }

.side-link {
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
  display: block;
}

.side-link:hover { background: var(--surface2); }
.side-link.muted { color: var(--muted); font-size: 0.8rem; }

.stage-panel {
  min-height: 80px;
  animation: stageIn 0.35s ease;
}

@keyframes stageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.stage-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stage-choices.max-3 .btn { margin-top: 0; }

.stage-loading {
  text-align: center;
  color: var(--muted);
  padding: 24px;
}

.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--baeby);
  border-radius: 50%;
  animation: dotPulse 1s infinite;
  margin-right: 8px;
}

.hero-result {
  background: linear-gradient(145deg, var(--surface2), var(--surface));
  border: 1px solid #3a4055;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  text-align: center;
}

.hero-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.hero-menu {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent2);
  margin-bottom: 8px;
}

.hero-price { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; }

.hero-reasons {
  list-style: none;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.hero-reasons li { margin: 4px 0; }

.hero-shop { font-size: 0.8rem; color: var(--baeby); }

.roulette-wheel {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  padding: 32px;
  color: var(--accent2);
  background: var(--surface);
  border-radius: var(--radius);
  border: 2px dashed var(--accent);
  animation: rouletteGlow 0.5s ease infinite alternate;
}

@keyframes rouletteGlow {
  from { box-shadow: 0 0 8px rgba(255, 107, 74, 0.2); }
  to { box-shadow: 0 0 20px rgba(255, 107, 74, 0.45); }
}

.voice-hint, .voice-live {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.voice-live { color: var(--baeby); min-height: 24px; }

.order-draft-card, .done-card {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.order-lines { margin: 10px 0 0 18px; color: var(--muted); }

.check-list { margin-bottom: 12px; }

.phase-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 12px 0;
  line-height: 1.5;
}

.expose-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.expose-links .btn { margin-top: 0; font-size: 0.8rem; padding: 10px 8px; }

.expose-panel {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.expose-photo {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 10px;
  background: #12141c;
}

.expose-caption, .expose-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 8px;
}

.payment-summary {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.payment-summary p { margin-bottom: 8px; }

.done-card {
  text-align: center;
  color: var(--baeby);
  font-weight: 600;
}

/* v0.7 app cards */
.app-card-v7 {
  background: linear-gradient(145deg, var(--surface2), var(--surface));
  border: 1px solid #3a4055;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  text-align: left;
}

.app-card-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 12px;
  font-weight: 600;
}

.app-card-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.app-card-row span { color: var(--muted); flex-shrink: 0; }
.app-card-row strong { text-align: right; font-weight: 600; }

.app-card-list {
  list-style: none;
  text-align: right;
  margin: 0;
  padding: 0;
}

.app-card-list li { margin: 2px 0; }

.app-card-price strong { color: var(--accent2); }

.app-card-hint, .app-card-meta, .app-card-summary {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 8px;
}

.app-card-summary strong { color: var(--text); }

.order-copy-text {
  font-size: 0.95rem;
  line-height: 1.5;
  padding: 12px;
  background: #12141c;
  border-radius: 12px;
  border: 1px dashed #3a4055;
}

.prep-list { display: flex; flex-direction: column; gap: 8px; }

.prep-list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 8px;
  width: 100%;
  text-align: left;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #3a4055;
  background: #12141c;
  color: var(--text);
  cursor: pointer;
}

.prep-list-title { grid-column: 1; font-weight: 600; }
.prep-list-meta { grid-column: 1; font-size: 0.78rem; color: var(--muted); }
.prep-list-row .status-badge { grid-column: 2; grid-row: 1 / span 2; align-self: center; }

.ops-history {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.ops-history li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #2a2e3d;
}

.panel-hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: -4px 0 12px;
}

.ops-queue-item {
  background: #12141c;
  border: 1px solid #3a4055;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.ops-queue-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ops-queue-meta, .ops-queue-row {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 4px 0;
}

.ops-queue-row span { color: var(--text); font-weight: 600; margin-right: 6px; }

.ops-queue-text { margin-top: 10px; font-size: 0.88rem; }

.ops-queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ops-queue-actions .btn { flex: 1; min-width: 100px; }

.ops-history-label {
  list-style: none;
  font-size: 0.7rem;
  color: var(--muted);
  margin: 8px 0 4px;
}

.partner-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}

@media (max-width: 400px) {
  .action-grid { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .baeby-zone { overflow: hidden; }
  .stage-panel { clear: both; }
  .hero-menu { font-size: 1.35rem; }
  .expose-links { grid-template-columns: 1fr; }
}

@media (max-width: 375px) {
  .app-shell { max-width: 100%; }
  .stage-choices { gap: 8px; }
  .hero-result { padding: 16px 12px; }
}
