/* 엄마는 요리왕 — warm rose kitchen, phone-first */

:root {
  --paper: #f7e8e1;
  --paper-2: #efd4c8;
  --card: #fff7f3;
  --ink: #2a1612;
  --ink-soft: #7a4d45;
  --muted: #9a6d64;
  --line: #edd0c6;
  --rose: #c45c4a;
  --rose-deep: #9a3d32;
  --rose-soft: #f4d2cb;
  --shadow: 0 10px 28px rgba(80, 28, 22, 0.10);
  --shadow-sm: 0 3px 10px rgba(80, 28, 22, 0.08);
  --tap: 52px;
  --serif: "Noto Serif KR", "Apple SD Gothic Neo", serif;
  --sans: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1100px 480px at 8% -12%, #fff4ee 0%, transparent 50%),
    radial-gradient(800px 360px at 110% 0%, #f0cfc4 0%, transparent 46%),
    var(--paper);
  line-height: 1.5;
}

button, input, textarea { font-family: inherit; }
button {
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
  touch-action: manipulation;
}
input, textarea {
  width: 100%;
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 16px;
  color: var(--ink);
}
a { color: inherit; text-decoration: none; }

#app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(18px + var(--safe-top)) 18px calc(28px + var(--safe-bot));
}

.eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--rose);
  margin-bottom: 4px;
}
h1 {
  font-family: var(--serif);
  font-size: 28px;
  margin: 0 0 6px;
}
.lead { margin: 0 0 16px; color: var(--ink-soft); font-size: 15px; }

.search-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(var(--paper) 70%, transparent);
  padding: 6px 0 12px;
}
.search-bar input { min-height: var(--tap); }

.grid { display: grid; gap: 12px; }
.card {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  background: var(--card);
  border-radius: 22px;
  padding: 10px;
  box-shadow: var(--shadow-sm);
  align-items: center;
}
.card img {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 16px;
  background: var(--paper-2);
}
.card h3 {
  font-family: var(--serif);
  font-size: 18px;
  margin: 0 0 4px;
}
.card p { margin: 0; color: var(--muted); font-size: 13px; }
.empty {
  text-align: center;
  padding: 42px 12px;
  color: var(--ink-soft);
}
.empty .big { font-size: 40px; margin-bottom: 8px; }
.empty h2 { font-family: var(--serif); margin: 0 0 8px; }

.fab {
  position: fixed;
  right: max(18px, calc(50% - 242px));
  bottom: calc(18px + var(--safe-bot));
  min-height: 56px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--rose);
  color: #fff8f5;
  font-weight: 800;
  font-size: 16px;
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.icon-btn {
  min-width: var(--tap);
  min-height: var(--tap);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  font-size: 22px;
  display: grid;
  place-items: center;
}
.topbar .grow { flex: 1; min-width: 0; }
.topbar h1 {
  font-size: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo {
  width: 100%;
  border-radius: 22px;
  box-shadow: var(--shadow);
  background: var(--card);
  display: block;
}
.memo {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
}

.add-btn, .cta {
  width: 100%;
  min-height: var(--tap);
  border-radius: 18px;
  background: var(--ink);
  color: #fff8f5;
  font-size: 17px;
  font-weight: 700;
  margin-top: 14px;
}
.add-btn.ghost, .danger {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
}
.danger { color: var(--rose-deep); border-color: var(--rose-soft); }

.preview {
  width: 100%;
  min-height: 180px;
  border-radius: 22px;
  background: var(--paper-2);
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--ink-soft);
  font-weight: 600;
}
.preview img { width: 100%; display: block; }
.field { margin-top: 12px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + var(--safe-bot));
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff8f5;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  z-index: 20;
}

.ing-list, .step-list { list-style: none; padding: 0; margin: 0; }
.ing-list li, .step-list li {
  background: var(--card);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}
.step-list li { display: grid; grid-template-columns: 28px 1fr; gap: 8px; }
.step-list .n {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--rose-soft); color: var(--rose-deep);
  display: grid; place-items: center; font-weight: 800; font-size: 13px;
}
.section-title {
  font-family: var(--serif);
  font-size: 18px;
  margin: 22px 0 10px;
}
.orig { margin-top: 18px; }
.orig summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.orig img { width: 100%; border-radius: 16px; margin-top: 8px; }
.card .thumb {
  width: 92px;
  height: 92px;
  border-radius: 20px;
  font-size: 42px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #fff 0%, #f4d2cb 100%);
  box-shadow: inset 0 0 0 1px rgba(80, 28, 22, 0.08);
}
.busy { text-align: center; color: var(--ink-soft); padding: 20px 8px; font-weight: 600; }

textarea { width:100%; border:2px solid var(--line); background:#fff; border-radius:16px; padding:14px 16px; font-size:16px; color:var(--ink); min-height:160px; line-height:1.5; }

.upload-panel {
  background: var(--card);
  border-radius: 22px;
  padding: 16px 16px 8px;
  box-shadow: var(--shadow-sm);
}
.upload-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.upload-panel h2 {
  font-family: var(--serif);
  font-size: 18px;
  margin: 0;
}
.upload-count {
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.upload-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--rose-soft);
  overflow: hidden;
  margin-bottom: 8px;
}
.upload-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--rose);
  border-radius: inherit;
  transition: width 0.28s ease;
}
.upload-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.upload-row .name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.upload-row .st {
  flex-shrink: 0;
  color: var(--muted);
  font-weight: 700;
}
.upload-row .st.up { color: var(--rose); }
.upload-row .st.ok { color: var(--rose); }
.upload-row .st.fail { color: var(--rose-deep); }

.add-btn[disabled],
.add-btn.is-disabled {
  opacity: 0.42;
  pointer-events: none;
}

.pending-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-weight: 600;
}
.pending-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 4px rgba(196, 92, 74, 0.14);
  animation: pending-pulse 1.2s ease-in-out infinite;
}
@keyframes pending-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.82); }
  50% { opacity: 1; transform: scale(1.12); }
}

.card.is-pending {
  position: relative;
  overflow: hidden;
}
.card.is-pending::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 247, 243, 0.62) 50%, transparent 80%);
  transform: translateX(-120%);
  animation: pending-shimmer 1.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pending-shimmer {
  100% { transform: translateX(120%); }
}
