/* Kucanto 요리 진행 화면 (시안 4~10번). 색·폰트는 home.css 의 값을 그대로 쓴다. */

/* ---------- 화면 전환 ---------- */
/* 홈 위로 오른쪽에서 밀려 들어온다. 음성 화면(.voice, z-index 10)은 이 위에 뜬다. */

.screen {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.42s var(--ease), visibility 0s linear 0.42s;
}
.screen.open {
  transform: none;
  visibility: visible;
  transition: transform 0.42s var(--ease), visibility 0s;
}

.screen-top {
  flex: none;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  height: 56px;
  padding: calc(4px + env(safe-area-inset-top)) 8px 0;
  box-sizing: content-box;
}
.screen-name {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
}
.back {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
}
.back:hover { background: rgba(60, 60, 60, 0.06); }

.screen-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: 8px 20px 24px;
}
.screen-body::-webkit-scrollbar { display: none; }

.screen-cta {
  flex: none;
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, rgba(246, 238, 233, 0));
}
.cta {
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(225, 6, 0, 0.35);
  transition: transform 0.2s var(--ease), opacity 0.2s;
}
.cta:active { transform: scale(0.985); }
.cta:disabled { opacity: 0.5; box-shadow: none; }

/* ---------- 4. 레시피 전체 흐름 ---------- */

.ov-title {
  margin: 8px 0 6px;
  font-size: 24px;
  line-height: 1.38;
  font-weight: 700;
  letter-spacing: -0.03em;
  word-break: keep-all;
}
.ov-sub {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.5;
}
.ov-src {
  margin: 8px 0 14px;
  font-size: 13px;
}
.ov-src a {
  color: var(--ink-2, #555);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ov-src a:hover { color: var(--accent, #d00); }

.ov-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}
.ov-meta li {
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 600;
}

.ov-ings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ov-ings li {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
}
.ov-ings li small { margin-left: 6px; color: var(--ink-3); font-size: 12px; font-weight: 400; }

/* 세로 타임라인: 번호 원들을 가는 선으로 잇는다 */
.flow {
  list-style: none;
  margin: 0;
  padding: 0;
}
.flow li {
  position: relative;
  display: grid;
  grid-template-columns: 32px 1fr;
  column-gap: 14px;
  padding-bottom: 20px;
  opacity: 0;
  transform: translateY(8px);
  animation: flow-in 0.5s var(--ease) forwards;
  animation-delay: calc(var(--i) * 70ms + 120ms);
}
.flow li::before {
  content: "";
  position: absolute;
  left: 15.5px;
  top: 32px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.flow li:last-child { padding-bottom: 4px; }
.flow li:last-child::before { display: none; }

.flow-num {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 700;
}
.flow-text {
  padding-top: 5px;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  word-break: keep-all;
}
.flow-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.flow-tag {
  padding: 3px 9px;
  border-radius: 999px;
  background: #e4e1e1;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
}
.flow-tag.cam { background: #eef3ff; color: #3b5bd9; }
.flow-tag.safe { background: #fff0f0; color: #c24141; }

@keyframes flow-in {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .screen, .screen.open { transition: none; }
  .flow li { animation: none; opacity: 1; transform: none; }
}

/* ---------- 공통: 아래 버튼 두 개, 위 숫자 ---------- */

/* 타이머: 단계 화면 진행 바 아래에 남은 시간을 보여 준다 ("3분 타이머 해줘"). */
.cook-timer {
  flex: none;
  margin: 10px 20px 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  text-align: center;
}
.cook-timer.done {
  border-color: var(--accent);
  color: var(--accent);
}
.cook-timer[hidden] { display: none; }

.count {
  justify-self: end;
  padding-right: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
}
.screen-cta.two { display: grid; grid-template-columns: 3fr 7fr; gap: 10px; }
.ghost-btn {
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.2s var(--ease), opacity 0.2s;
}
.ghost-btn:active { transform: scale(0.985); }
.ghost-btn:disabled, .cta:disabled { opacity: 0.45; }

.say { min-height: 3em; }

/* ---------- 5. 재료 확인 ---------- */

.ing-list { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.ing {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.ing-dot {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid #c4c0c0;
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 700;
  transition: background 0.3s, border-color 0.3s;
}
.ing-name { font-size: 16px; font-weight: 600; }
.ing-note { font-size: 12.5px; color: var(--ink-3); }

.ing.is-now {
  border-color: #e0807a;
  box-shadow: 0 8px 22px rgba(225, 6, 0, 0.22);
}
.ing.is-now .ing-dot { border-color: var(--accent); }
.ing.is-now .ing-dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.ing.is-done .ing-dot { background: var(--accent); border-color: var(--accent); }
.ing.is-done .ing-dot::after { content: "✓"; }
.ing.is-missing { background: #e8e5e5; }
.ing.is-missing .ing-name { color: var(--ink-3); text-decoration: line-through; }
.ing.is-missing .ing-dot { background: #c4c0c0; border-color: #c4c0c0; }
.ing.is-missing .ing-dot::after { content: "–"; }
.ing.is-missing .ing-note { color: var(--accent-deep); font-weight: 600; text-decoration: none; }

/* ---------- 6. 조리 단계 카드 ---------- */

.progress { flex: none; display: flex; gap: 5px; padding: 4px 20px 0; }
.progress i {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: #d6d3d3;
  transition: background 0.4s var(--ease);
}
.progress i.on { background: var(--accent); }

.cook-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 18px 20px 8px;
  overflow: hidden;
}
.step-card {
  position: absolute;
  inset: 18px 20px 8px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(60, 60, 60, 0.1);
  overflow: hidden;
  animation: card-in 0.5s var(--ease) both;
}
.step-card.leave { animation: card-out 0.35s var(--ease) both; }

.step-art {
  flex: none;
  aspect-ratio: 5 / 4;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.step-art iframe { display: block; width: 100%; height: 100%; border: 0; background: transparent; }

.step-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 22px 24px 26px; overflow-y: auto; }
.step-text {
  margin: 0;
  font-size: 22px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: -0.03em;
  word-break: keep-all;
}
.step-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

/* 그림이 없는 단계: 번호를 크게 */
.step-card.no-art .step-body { align-items: flex-start; justify-content: flex-start; padding-top: 34px; }

@keyframes card-in { from { opacity: 0; transform: translateX(36px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes card-out { to { opacity: 0; transform: translateX(-36px) scale(0.98); } }

/* ---------- 9. 완성 ---------- */

.done-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 28px;
  text-align: center;
}
.done-title { margin: 10px 0 8px; font-size: 30px; line-height: 1.3; font-weight: 700; letter-spacing: -0.035em; word-break: keep-all; }
.done-sub { margin: 0; font-size: 15px; color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  .step-card, .step-card.leave { animation: none; }
}

.done-stats { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 6px; font-size: 15px; color: var(--ink-2); }

/* 영양 성분: 박스 없이 가는 선과 글자 크기 차이로만 나눈다 */
.nutri { margin: 28px 0 0; text-align: left; }
.nutri .sec-title small { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-left: 6px; }
.nutri-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-top: 1px solid var(--line); }
.nutri-grid div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.nutri-grid dt { font-size: 12px; color: var(--ink-3); }
.nutri-grid dd { margin: 2px 0 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.nutri-note { margin: 12px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); word-break: keep-all; }

/* ---------- 클레이 ----------
   모델 도감 클레이판과 같은 방식: 큰 둥근 모서리, 왼쪽 위 빛, 색 있는 그림자.
   버튼은 볼록하게(주황은 그라데이션), 입력·진행 막대는 오목하게(well). */

.cta, .mic-fab, .ghost-btn, .chip, .back {
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.cta, .mic-fab {
  background: linear-gradient(135deg, #f0403a 0%, #e10600 100%);
  color: var(--accent-ink);
  box-shadow: 5px 7px 15px rgba(225, 6, 0, 0.42), var(--clay-orange);
}
.cta { border-radius: 99px; }
.cta:disabled { box-shadow: 3px 4px 8px rgba(70, 70, 70, 0.2), var(--clay-orange); filter: saturate(0.5); }

.ghost-btn, .chip {
  background: #ffffff;
  border: 0;
  color: var(--ink);
  box-shadow: var(--clay-sm);
}
.ghost-btn { border-radius: 99px; }
.chip { border-radius: 99px; padding: 14px 20px; }
.back { background: #ffffff; box-shadow: var(--clay-sm); }
.back:hover { background: #fff; }

.cta:active, .mic-fab:active, .ghost-btn:active, .chip:active, .back:active {
  transform: translateY(2px) scale(0.985);
  box-shadow: var(--clay-well);
}
.cta:active, .mic-fab:active { box-shadow: 2px 3px 6px rgba(225, 6, 0, 0.35), inset 5px 6px 12px rgba(110, 0, 0, 0.35), inset -4px -4px 8px rgba(255, 255, 255, 0.3); }

/* 담는 면 */
.ask { border: 0; border-radius: 99px; background: #ffffff; box-shadow: var(--clay-sm); }
.ask:focus-within { box-shadow: var(--clay-well); }
.item, .ing, .step-card { border: 0; background: #ffffff; box-shadow: var(--clay-sm); }
.item { border-radius: 24px; }
.item:hover { box-shadow: var(--clay); }
.step-card { border-radius: 32px; box-shadow: var(--clay); }
.step-art { border-bottom: 0; background: transparent; }
.ing { border-radius: 22px; }
.ing.is-now { box-shadow: var(--clay), 0 0 0 2px rgba(225, 6, 0, 0.55); }
.ing.is-missing { background: #e8e5e5; box-shadow: var(--clay-well); }

/* 오목한 칩·막대 */
.ov-meta li, .flow-tag, .tag { box-shadow: var(--clay-well); }
.ov-ings li { border: 0; background: #ffffff; box-shadow: var(--clay-sm); }
.progress i { height: 7px; background: #d6d3d3; box-shadow: var(--clay-well); }
.progress i.on { background: linear-gradient(135deg, #f0403a, #e10600); box-shadow: 1px 2px 4px rgba(225, 6, 0, 0.35); }
.flow-num { background: linear-gradient(135deg, #f0403a, #e10600); box-shadow: 2px 3px 6px rgba(225, 6, 0, 0.35), var(--clay-orange); }
.flow li::before { background: #d6d3d3; width: 2px; }
.tabbar { box-shadow: 0 -6px 16px rgba(70, 70, 70, 0.08); border-top: 0; }

/* ---------- 박스 없이 ----------
   영역은 여백과 가는 선으로 나눈다. 박스는 버튼·입력창에만 남긴다. */

.list { gap: 0; }
.item {
  padding: 14px 2px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  border-bottom: 1px solid var(--line);
}
.item:hover { box-shadow: none; }
.list li:last-child .item { border-bottom: 0; }

.ing-list { gap: 0; margin-top: 18px; }
.ing, .ing.is-now, .ing.is-missing {
  padding: 15px 2px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  border-bottom: 1px solid var(--line);
}
.ing.is-now .ing-name { color: var(--accent-deep); }

.ov-ings { gap: 6px 0; }
.ov-ings li { padding: 0; background: transparent; box-shadow: none; font-size: 15px; }
.ov-ings li::after { content: "·"; margin: 0 9px; color: var(--ink-3); }
.ov-ings li:last-child::after { display: none; }
.ov-meta li, .flow-tag, .tag { box-shadow: none; }

.step-card { background: transparent; box-shadow: none; border-radius: 0; }
.step-art { border-radius: 28px; background: #ffffff; box-shadow: var(--clay-well); }
.step-body { padding: 26px 4px 8px; }

/* ---------- 모서리 줄이기 ---------- */
.ask, .chip, .cta, .ghost-btn { border-radius: 14px; }
.mic-fab { border-radius: 11px; }
.back, .icon-btn, .voice-close { border-radius: 10px; }
.thumb { border-radius: 12px; }
.step-art { border-radius: 16px; }
.ov-meta li, .flow-tag, .tag { border-radius: 8px; }
.flow-num { border-radius: 10px; }
.ing-dot { border-radius: 8px; }
.progress i { border-radius: 3px; }
.voice-mic { border-radius: 16px; }
@media (min-width: 560px) { .app { border-radius: 24px; } }

/* 보조색 연노랑은 채우는 곳에만: 태그·종류 아이콘 배경. 그 위 글씨는 진한 갈색 */
.ov-meta li, .tag { background: var(--accent-soft); color: #2a2a2a; }

.step-art { position: relative; }
.art-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 6px; }
.art-dots i { width: 14px; height: 4px; border-radius: 2px; background: var(--line); cursor: pointer; transition: width 0.3s var(--ease), background 0.3s; }
.art-dots i.on { width: 24px; background: var(--accent); }

/* ---------- 재료 카메라: 전체 화면 ---------- */
.cam-screen { background: #111; z-index: 8; color: #fff; }
.cam-screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-marks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cam-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0) 28%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0.55)); pointer-events: none; }
.cam-close { position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 14px; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: rgba(0, 0, 0, 0.45); color: #fff; }
.cam-panel { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; display: grid; justify-items: end; gap: 6px; }
/* 칩 5개 높이를 넘으면 스크롤. 스크롤바는 숨기고, 아래에 더 있다는 걸 +N 으로 알린다 */
.cam-list { display: grid; justify-items: end; align-content: start; gap: 6px; max-height: 226px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding-bottom: 1px; }
.cam-list::-webkit-scrollbar { display: none; }
.cam-chip { flex: none; }
/* 카메라가 열려 있는 동안 쿠마는 오른쪽 아래로 (오른쪽 위 목록을 가리지 않게) */
body.cam-open .kuma-orb { top: auto; bottom: calc(40px + env(safe-area-inset-bottom)); right: 14px; z-index: 9; }
.cam-chip { padding: 9px 14px; border-radius: 10px; background: rgba(20, 20, 20, 0.62); color: #fff; font-size: 14px; font-weight: 700; backdrop-filter: blur(4px); animation: chip-in 0.35s var(--ease) both; }
.cam-more { min-height: 1em; font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, 0.85); }
.cam-status { position: absolute; left: 16px; right: 16px; bottom: calc(124px + env(safe-area-inset-bottom)); margin: 0; text-align: center; font-size: 15px; font-weight: 600; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }
.cam-status.busy::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1s ease-in-out infinite; vertical-align: 1px; }
.cam-chip.found { background: var(--accent, #e10600); }
.cam-chip.found::before { content: "✓ "; }
.cam-shot { position: absolute; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); width: 74px; height: 74px; margin-left: -37px; padding: 0; border: 4px solid #fff; border-radius: 50%; background: transparent; cursor: pointer; display: grid; place-items: center; }
.cam-shot span { display: block; width: 56px; height: 56px; border-radius: 50%; background: #fff; transition: transform 0.12s var(--ease); }
.cam-shot:active:not(:disabled) span { transform: scale(0.9); }
.cam-shot:disabled { opacity: 0.45; cursor: default; }
.cam-err { position: absolute; left: 24px; right: 24px; top: 45%; margin: 0; text-align: center; font-size: 15px; font-weight: 600; }
@keyframes chip-in { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { opacity: 0.3; } }
.ing-list { margin-top: 6px; }
/* 용도별 묶음 제목: 박스 없이 글자와 가는 선만 */
.ing-head { list-style: none; margin: 14px 0 2px; padding: 0 0 6px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--ink-2); letter-spacing: 0.02em; }
.ing-head:first-child { margin-top: 4px; }
.say:empty { display: none; }
.ing.is-locked { cursor: default; }
.ing:not(.is-locked):not(.is-missing) { cursor: pointer; }

/* 전체 선택 */
.ing-all { display: flex; align-items: center; gap: 10px; margin: 6px 0 0 auto; padding: 8px 2px 8px 10px; border: 0; background: transparent; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.ing-all .ing-dot { width: 22px; height: 22px; border-radius: 7px; }
.ing-all.is-done .ing-dot { background: var(--accent); border-color: var(--accent); }
.ing-all.is-done .ing-dot::after { content: "✓"; }
.ing-all[hidden] { display: none; }

/* 필수 / 대체 가능 표시 */
.ing { grid-template-columns: 28px 1fr auto; }
.ing-main { display: grid; gap: 2px; min-width: 0; }
.ing-note:empty { display: none; }
.ing-kind { padding: 4px 9px; border-radius: 8px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.ing-kind.must { background: #fde8e6; color: #b00500; }
.ing-kind.flex { background: #e2f4e8; color: #137a3f; }
.ing.is-missing .ing-kind { opacity: 0.55; }

/* 필수 / 대체 가능 / 제외 가능: 박스 없이 글자색만 */
.ing-kind { padding: 0; border-radius: 0; background: none; font-size: 13px; font-weight: 700; }
.ing-kind.must { background: none; color: #c20a04; }
.ing-kind.flex { background: none; color: #137a3f; }
.ing-kind.omit { background: none; color: #3b5bd9; }

/* 이 단계에 쓰는 재료와 분량 */
.step-qty { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 18px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); list-style: none; }
.step-qty li { display: flex; gap: 6px; align-items: baseline; font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.step-qty b { font-weight: 700; color: var(--accent-deep); }

/* 아래 버튼: 이전 · 다시 듣기 · 카메라 확인은 둥근 아이콘, 다음은 넓은 빨간 버튼 */
.cook-bar { display: flex; align-items: center; gap: 10px; }
.icon-btn { position: relative; flex: none; display: grid; place-items: center; width: 54px; height: 54px; padding: 0; border: 0; border-radius: 50%; background: #ffffff; color: var(--ink); box-shadow: var(--clay-sm); cursor: pointer; transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease); }
.icon-btn:active:not(:disabled) { transform: translateY(2px) scale(0.96); box-shadow: var(--clay-well); }
.icon-btn:disabled { opacity: 0.4; cursor: default; }
.cook-bar .cta { flex: 1; min-width: 0; display: grid; place-items: center; }
/* 이 단계에 카메라로 확인할 거리가 있으면 카메라 버튼에 빨간 점 */
.icon-btn.hint::after { content: ""; position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px #fff; }
.ghost-btn:disabled { opacity: 0.4; }

/* 단계 카메라 확인 화면 */
.chk-ask { position: absolute; top: calc(18px + env(safe-area-inset-top)); left: 66px; right: 16px; margin: 0; font-size: 15px; font-weight: 700; line-height: 1.4; word-break: keep-all; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }
.chk-result.ok { color: #fff; }
.chk-result.no { color: #ffd9d6; }

/* 이전 단계로 돌아갈 때는 왼쪽에서 들어온다 */
.step-card.turn-back { animation-name: card-in-back; }
.step-card.leave.turn-back { animation-name: card-out-back; }
@keyframes card-in-back { from { opacity: 0; transform: translateX(-36px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes card-out-back { to { opacity: 0; transform: translateX(36px) scale(0.98); } }

.thumb-ico { background: transparent; box-shadow: none; }
.thumb-ico img { object-fit: contain; padding: 6px; }

.ing-block { margin: 14px 0 6px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.ing-block-msg { margin: 0; font-weight: 700; color: #c20a04; }
.ing-block-hint { margin: 0; font-size: 13.5px; color: var(--ink-3); }
.ing-block-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ing-block-row .ghost-btn { flex: 0 0 auto; padding: 0 14px; }

.step-timer { align-self: flex-start; margin-top: 12px; padding: 10px 16px; border: 0; border-radius: 10px; background: var(--surface); box-shadow: var(--clay-sm); font: 700 14px/1 inherit; color: var(--ink); cursor: pointer; }
.step-timer.on { background: var(--accent); color: var(--accent-ink); }

.cook-talk { display: flex; align-items: center; gap: 12px; padding: 4px 22px 12px; min-height: 48px; }
.talk-mic { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: var(--clay-sm); cursor: pointer; }
.talk-text { font-size: 14px; color: var(--ink-3); min-width: 0; overflow-wrap: anywhere; }
.cook-talk.listening .talk-mic { background: var(--accent); color: var(--accent-ink); animation: talk-pulse 1.2s ease-in-out infinite; }
.cook-talk.listening .talk-text { color: var(--accent-deep); font-weight: 600; }
@keyframes talk-pulse { 50% { transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .cook-talk.listening .talk-mic { animation: none; } }

/* 쿠마와 대화 중 표시 (오른쪽 위). 말소리에 맞춰 canvas 가 출렁인다. */
.kuma-orb { position: absolute; top: calc(6px + env(safe-area-inset-top)); right: 6px; z-index: 8; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.kuma-orb[hidden] { display: none; }
.kuma-orb canvas { display: block; width: 48px; height: 48px; }
body.talking .screen-top { grid-template-columns: 44px 1fr 96px; }
body.talking .screen-top .count { justify-self: start; text-align: left; margin-left: 4px; }
body.talking .screen-top .back-spacer { display: block; }

.kuma-orb.muted { opacity: 0.45; filter: grayscale(1); }
/* LLM 생각 중 표시 */
body.llm-thinking .kuma-orb {
  animation: kuma-think 1s ease-in-out infinite;
  filter: brightness(1.15) saturate(1.2);
}
@keyframes kuma-think {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* 음성 인식이 막혔을 때만 뜨는 안내. 누르면 다시 시도한다. */
.voice-note {
  position: absolute;
  bottom: calc(88px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 9px 13px;
  border: 0;
  border-radius: 12px;
  background: rgba(20, 20, 22, 0.92);
  color: var(--night-ink);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  word-break: keep-all;
  cursor: pointer;
}
.voice-note[hidden] { display: none; }

/* ---------- 테스트용 음성 카드 (웹 화면 전용) ---------- */
/* 앱 틀(390px) 바깥 오른쪽 여백에 떠 있어서 화면 버튼을 가리지 않는다.
   폰 화면(좁은 화면)에서는 숨긴다. */
.voice-test { display: none; }

@media (min-width: 760px) {
  .voice-test {
    position: fixed;
    right: 16px;
    bottom: 24px;
    z-index: 9999;
    display: block;
    width: min(300px, calc((100vw - 390px) / 2 - 40px));
    padding: 12px 14px 13px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(40, 40, 40, 0.18);
  }
  .voice-test.folded { width: auto; }
}

.voice-test-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-3);
  cursor: move;
  user-select: none;
  touch-action: none;
}
.voice-test.dragging { box-shadow: 0 16px 40px rgba(40, 40, 40, 0.28); }
.voice-test-grip { margin-right: 5px; letter-spacing: -1px; color: var(--ink-3); }
.voice-test.folded .voice-test-head { margin-bottom: 0; }
.voice-test-fold {
  padding: 2px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  color: var(--ink-3);
  font: 600 12px/1.2 inherit;
  cursor: pointer;
}
.voice-test-label { display: block; margin-bottom: 5px; font-size: 11.5px; color: var(--ink-3); }
.voice-test-row { display: grid; gap: 6px; }
.voice-test-row input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
  font: 500 13px/1.2 inherit;
  color: var(--ink);
}
.voice-test-play {
  padding: 9px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: none;
  font: 700 13px/1 inherit;
  cursor: pointer;
}
.voice-test-play:disabled { opacity: 0.5; }
.voice-test-note {
  margin: 8px 0 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-3);
  word-break: keep-all;
}

/* 개발 모드에서 좁은 창이면 네 카드를 두 줄로 작게 띄운다 (?dev=true) */
.dev-layers .voice-test {
  display: block;
  position: fixed;
  right: 16px;
  bottom: 24px;
  z-index: 9999;
  /* 카드 세 장은 JS 가 좁은 화면 기준이 아닌 폭을 인라인으로 넣어 둔다. 여기서 덮어쓴다. */
  width: min(260px, calc(50vw - 24px)) !important;
  padding: 8px 10px 9px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(40, 40, 40, 0.18);
  font-size: 12px;
}
.dev-layers .voice-test-head { margin-bottom: 6px; }
.dev-layers .vt-body { max-height: 26vh; }

/* hidden 속성은 항상 이긴다 (넓은 화면 규칙이 display:block 이라서) */
.voice-test[hidden] { display: none !important; }

/* 감시 카드: 앱이 듣는 것 · 내가 듣는 것 · 앱이 말하는 것 */
.voice-test-mon .voice-test-head { cursor: default; }
.voice-test-mon { max-height: calc(50vh - 70px); overflow: hidden; }
.vt-body { display: flex; flex-direction: column; gap: 6px; max-height: calc(50vh - 110px); }
/* 앱이 듣는 것 레이어: 네 줄 정도만 보이게 */
#vtAppHeard .vt-body { max-height: calc(11.5px * 1.35 * 4 + 5px * 4 + 6px); overflow: hidden; }
#vtAppHeard .vt-log { max-height: calc(11.5px * 1.35 * 4 + 5px * 4); overflow-y: auto; }
.vt-log {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.vt-row {
  display: grid;
  gap: 1px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--ink);
  word-break: keep-all;
}
.vt-row:last-child { border-bottom: 0; padding-bottom: 0; }
.vt-meta { font-size: 10.5px; color: var(--ink-3); }
.vt-text { font-weight: 600; }
.vt-row.vt-echo .vt-text { color: var(--ink-3); font-weight: 500; }
.vt-row.vt-ok .vt-meta { color: var(--accent); }
/* 생각(추론)은 길게 흘러오므로 줄바꿈을 그대로 살린다. */
.vt-row.vt-think .vt-text { font-weight: 500; white-space: pre-wrap; word-break: break-word; }
/* 생각 카드는 다른 카드와 겹치지 않게 높이를 묶어 두고 안에서 스크롤한다. */
#vtAppThink .vt-body { max-height: 30vh; }
#vtAppThink .vt-log { max-height: 14vh; overflow-y: auto; }
/* 앱이 말하는 것: 최대 300px로 고정 */
#vtAppSaid .vt-body { max-height: 300px; overflow: hidden; }
#vtAppSaid .vt-log { max-height: 300px; overflow-y: auto; }

/* 무엇을 보고 답했는지: 들은 말 · 보낸 데이터 · 모델 답 */
#vtAppThink .vt-trace { max-height: 20vh; overflow-y: auto; }
.vt-sec { margin-bottom: 7px; }
.vt-sec-label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-3);
}
.vt-pre {
  margin: 3px 0 0;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf8f8;
  font: 500 10.5px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 12vh;
  overflow: auto;
}
.vt-empty { margin: 0; font-size: 11.5px; line-height: 1.4; color: var(--ink-3); word-break: keep-all; }
.vt-live { margin: 0; font-size: 11.5px; line-height: 1.4; color: var(--accent); word-break: keep-all; }
.vt-tts-toggle { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); cursor: pointer; user-select: none; }
.vt-tts-toggle input { width: 14px; height: 14px; accent-color: var(--accent); }

/* ---------- 대화창: 박스 없이 선만 ---------- */
.cook-talk[hidden] { display: none; }
.chat { display: grid; gap: 10px; padding: 0 22px 10px; }
.chat-say { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.45; word-break: keep-all; }
.chat-say:empty, body:not(.text-on) .chat-say { display: none; }
.chat-hints { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-hint { padding: 7px 13px; border: 1px solid var(--line); border-radius: 99px; background: transparent; box-shadow: none; color: var(--ink-2); font: 600 13px/1 inherit; cursor: pointer; }
.chat-hint:active { transform: scale(0.96); }
.chat-form { display: flex; align-items: center; gap: 8px; padding: 2px 0 4px; border-bottom: 1.5px solid var(--ink); }
.chat-form:focus-within { border-bottom-color: var(--accent); }
.chat-form input { flex: 1; min-width: 0; padding: 9px 2px; border: 0; outline: 0; background: transparent; box-shadow: none; font: 500 15px/1.2 inherit; color: var(--ink); }
.chat-form input::placeholder { color: var(--ink-3); }
/* 조리 화면 입력줄: 흰 바탕으로 밝게 띄워 눈에 잘 들어오게 (쿠마 대화 창의 입력줄은 그대로) */
#chatForm { padding: 4px 6px; border: 0; border-radius: 99px; background: #ffffff; box-shadow: var(--clay-sm); transition: box-shadow 0.18s var(--ease); }
#chatForm:focus-within { box-shadow: 0 0 0 2px var(--accent), var(--clay-sm); }
#chatForm input { padding: 10px 4px; font-size: 15.5px; color: var(--ink); }
#chatForm input::placeholder { color: var(--ink-2); opacity: 0.8; }
.chat-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; box-shadow: none; color: var(--ink-2); font: 700 12px/1 inherit; cursor: pointer; }
.chat-icon[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

/* 글자 끄기: 그림이 있는 단계는 문장·분량을 숨기고 그림만 크게. 그림이 없으면 문장은 그대로 둔다 */
body:not(.text-on) .step-card:not(.no-art) .step-body > :not(.step-timer):not(.step-tags) { display: none; }
body:not(.text-on) .step-card:not(.no-art) .step-art { flex: 1; aspect-ratio: auto; border-bottom: 0; }
body:not(.text-on) .step-card:not(.no-art) .step-body { flex: none; padding: 8px 24px 14px; }
body.text-on .step-card:not(.no-art) .step-art { aspect-ratio: 4 / 3; }

/* 손질 방법: 단계 문장 아래에 접어 두고, 누르면 펼친다 */
.step-prep { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.step-prep summary { cursor: pointer; font-size: 14.5px; font-weight: 700; color: var(--accent-deep); list-style: none; }
.step-prep summary::-webkit-details-marker { display: none; }
.step-prep summary::after { content: " ▾"; }
.step-prep[open] summary::after { content: " ▴"; }
.step-prep ol { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.prep-tip, .prep-warn { margin: 8px 0 0; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.prep-warn { color: var(--accent-deep); font-weight: 600; }

/* 찾은 대체 재료 확인 버튼: 글자만 있는 작은 버튼 */
.ing-vote { font-size: 12.5px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.ing-vote button { font: inherit; color: var(--accent-ink); background: none; border: 0; border-bottom: 1px solid currentColor; padding: 4px 0; min-height: 28px; cursor: pointer; }
.ing-vote button:disabled { opacity: 0.5; }

/* 동작 그림이 없는 단계의 대체 그림 */
.step-art-plain { display: grid; place-items: center; color: var(--ink-3); opacity: 0.55; }

/* ---------- 2D 평면 ----------
   클레이(볼록·그림자)를 걷어 내고 단색 + 가는 선으로. 단계 버튼·대화·설정 모두 같은 규칙.
   그림자 변수를 비우면 위의 var(--clay*) 를 쓰는 곳이 한꺼번에 평평해진다. */
:root {
  --clay: 0 0 0 0 transparent;
  --clay-sm: 0 0 0 0 transparent;
  --clay-well: 0 0 0 0 transparent;
  --clay-orange: 0 0 0 0 transparent;
}
.cta, .mic-fab, .flow-num, .progress i.on { background: var(--accent); box-shadow: none; }
.cta:disabled { box-shadow: none; filter: none; background: #c9c5c5; color: #fff; }
.ghost-btn, .chip, .back, .icon-btn, .ask { background: #fff; box-shadow: none; border: 1px solid var(--line); }
.back:hover { background: #fff; }
.ask:focus-within { box-shadow: none; border-color: var(--accent); }
.progress i { background: var(--line); box-shadow: none; }
.step-art { background: #fff; box-shadow: none; border: 1px solid var(--line); }
.ing.is-now { box-shadow: none; }
.ing.is-missing { box-shadow: none; }
.thumb { box-shadow: none; }
.tabbar { box-shadow: none; border-top: 1px solid var(--line); }
.cta:active, .mic-fab:active { transform: scale(0.985); box-shadow: none; filter: brightness(0.92); }
.ghost-btn:active, .chip:active, .back:active, .icon-btn:active:not(:disabled) { transform: scale(0.97); box-shadow: none; background: #f1eeee; }
.icon-btn.hint::after { box-shadow: 0 0 0 2px #fff; }

/* 단계 카메라 확인: 테두리 색이 상태를 말한다 (대기 흰색 · 확인 중 노랑 · 맞음 초록 · 아님 빨강) */
#s-chk::after { content: ""; position: absolute; inset: 0; border: 6px solid rgba(255, 255, 255, 0.35); pointer-events: none; transition: border-color 0.25s; z-index: 2; }
#s-chk:has(.chk-result.busy)::after { border-color: #ffc83d; }
#s-chk:has(.chk-result.ok)::after { border-color: #2ecc71; }
#s-chk:has(.chk-result.no)::after { border-color: #ff5a52; }

/* 설정의 슬라이더·체크박스도 앱 색으로 */
input[type="range"], input[type="checkbox"] { accent-color: var(--accent); }

/* ---------- 조리 화면: 글을 크게, 박스 없이 ----------
   그림은 낮게, 글 영역은 넓게. 채팅·아래 버튼은 배경 없이 검은 선과 아이콘만, 화살표만 색으로. */
body.text-on .step-card:not(.no-art) .step-art { aspect-ratio: 16 / 7; }
.step-card:not(.no-art) .step-art { aspect-ratio: 16 / 7; }
.step-card.no-art .step-body, .step-body { justify-content: flex-start; }

.chat-hints { gap: 14px; }
.chat-hint, .chat-hints .chip { padding: 2px 0; border: 0; border-bottom: 1px solid var(--ink-3); border-radius: 0; background: none; box-shadow: none; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.chat-hint:active { transform: none; color: var(--accent); }

#chatForm { background: transparent; box-shadow: none; border: 1px solid var(--ink); border-radius: 12px; }
#chatForm:focus-within { box-shadow: none; border-color: var(--accent); }
.chat-icon { border: 0; border-radius: 8px; }
.chat-icon[type="submit"] { color: var(--accent); }

.cook-bar .icon-btn { background: transparent; border: 0; box-shadow: none; border-radius: 12px; color: var(--ink); }
.cook-bar .icon-btn:active:not(:disabled) { background: none; transform: scale(0.92); }
.cook-bar .cta, #s-cook .cook-bar .cta { background: transparent; color: var(--accent); box-shadow: none; border: 0; filter: none; border-top: 1px solid var(--ink); border-radius: 0; }
.cook-bar .cta:active { filter: none; transform: scale(0.96); }
.cook-bar .cta svg { width: 34px; height: 34px; stroke-width: 2.6; }
.cook-bar { border-top: 1px solid var(--ink); padding-top: 4px; }
.cook-bar .cta { border-top: 0; }
/* 그림은 낮게 두되 잘리지 않게: 높이에 맞춰 5:4 로 줄이고 가운데에 둔다 */
.step-card:not(.no-art) .step-art, body.text-on .step-card:not(.no-art) .step-art { aspect-ratio: 2 / 1; }
.step-art iframe { width: auto; height: 100%; aspect-ratio: 5 / 4; margin: 0 auto; }
body:not(.text-on) .step-card:not(.no-art) .step-art iframe { width: 100%; aspect-ratio: auto; }
#s-cook .cook-bar .cta { border-top: 0; }

/* 분량 팝업: 숟가락·컵 환산을 물었을 때만. 박스 대신 위 선과 큰 글자 */
.amount-pop { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; padding: 22px 24px calc(22px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 2px solid var(--ink); animation: pop-up 0.25s var(--ease) both; }
.amount-pop ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 19px; font-weight: 700; line-height: 1.45; word-break: keep-all; }
.amount-pop-x { margin-top: 16px; padding: 4px 0; border: 0; border-bottom: 1px solid var(--ink); background: none; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
@keyframes pop-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 아래 버튼 4개를 같은 크기·같은 간격으로. 다음 화살표는 크기 대신 색으로만 강조 */
.cook-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.cook-bar .icon-btn, .cook-bar .cta { width: 100%; height: 54px; border-radius: 12px; }
.cook-bar .cta svg { width: 26px; height: 26px; stroke-width: 2.4; }

/* ---------- 번호 배지 걷기 (색은 그대로 둔다) ---------- */
.flow-num { width: 32px; height: auto; border-radius: 0; background: none; box-shadow: none; color: var(--ink); font-size: 17px; font-weight: 800; place-items: start; padding-top: 3px; font-variant-numeric: tabular-nums; }
.flow li::before { top: 30px; left: 6px; }
/* 쿠마 아이콘: 평소엔 흐리게, 말하거나 들을 때만 또렷하게 (마이크가 켜진 걸 알리는 역할은 그대로) */
.kuma-orb { transition: opacity 0.3s; }
.kuma-orb[data-state="idle"] { opacity: 0.35; }
.kuma-orb[data-state="listen"] { opacity: 0.6; }
.kuma-orb[data-state="speak"] { opacity: 1; }

/* ---------- 채팅·검색 입력줄: 완전한 알약 모양, 배경 없이 선만 ---------- */
#chatForm, .ask { border-radius: 99px; background: transparent; box-shadow: none; border: 1px solid var(--ink); }
#chatForm:focus-within, .ask:focus-within { border-color: var(--accent); box-shadow: none; }
#chatForm { padding: 4px 6px 4px 6px; }
.chat-icon { border-radius: 50%; }
/* 마이크: 입력줄과 다른 색 선·아이콘 (빨강), 배경 없음 */
.mic-fab { background: transparent; box-shadow: none; border: 1px solid var(--accent); color: var(--accent); border-radius: 50%; }
.mic-fab:active { background: transparent; filter: none; box-shadow: none; transform: scale(0.94); }
.mic-fab svg { stroke: currentColor; }

/* 홈 검색창: 요리 중 채팅창과 같은 크기 (높이 약 44px) */
.ask { padding: 4px 6px 4px 16px; gap: 6px; }
.ask input { padding: 8px 0; }
.mic-fab { width: 34px; height: 34px; }
.mic-fab svg { width: 18px; height: 18px; }

/* ---------- 모서리 규칙 하나로 ----------
   어중간한 둥근 사각형(8~20px)을 없앤다.
   누르는 것(버튼·입력·선택) = 완전한 알약 또는 원 / 보여 주는 것(사진·그림·판) = 모서리 없음. */
.cta, .ghost-btn, .chip, .chat-hint, .ask, #chatForm, .st-btn { border-radius: 999px; }
.back, .icon-btn, .cam-close, .voice-close, .voice-mic, .mic-fab, .cook-bar .icon-btn, .cook-bar .cta { border-radius: 50%; }
.cook-bar .cta { border-radius: 999px; }
.banner-slide, .cat-ico, .thumb, .step-art, .flow-tag, .tag, .step-card, .app { border-radius: 0; }
.ing-dot, .ing-all .ing-dot { border-radius: 50%; }
.cam-chip { border-radius: 999px; }
.chat-hint, .chat-hints .chip { border-radius: 0; }
